browser/components/sessionstore/test/browser_687710.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* Any copyright is dedicated to the Public Domain.
     2    http://creativecommons.org/publicdomain/zero/1.0/ */
     4 // Test that sessionrestore handles cycles in the shentry graph properly.
     5 //
     6 // These cycles shouldn't be there in the first place, but they cause hangs
     7 // when they mysteriously appear (bug 687710).  Docshell code assumes this
     8 // graph is a tree and tires to walk to the root.  But if there's a cycle,
     9 // there is no root, and we loop forever.
    11 let stateBackup = ss.getBrowserState();
    13 let state = {windows:[{tabs:[{entries:[
    14   {
    15     docIdentifier: 1,
    16     url: "http://example.com",
    17     children: [
    18       {
    19         docIdentifier: 2,
    20         url: "http://example.com"
    21       }
    22     ]
    23   },
    24   {
    25     docIdentifier: 2,
    26     url: "http://example.com",
    27     children: [
    28       {
    29         docIdentifier: 1,
    30         url: "http://example.com"
    31       }
    32     ]
    33   }
    34 ]}]}]}
    36 function test() {
    37   registerCleanupFunction(function () {
    38     ss.setBrowserState(stateBackup);
    39   });
    41   /* This test fails by hanging. */
    42   ss.setBrowserState(JSON.stringify(state));
    43   ok(true, "Didn't hang!");
    44 }

mercurial