browser/components/tabview/test/browser_tabview_bug628061.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 const ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
     6 let state = {
     7   windows: [{
     8     tabs: [{
     9       entries: [{ url: "about:robots" }],
    10       hidden: true,
    11       extData: {"tabview-tab": '{"url":"about:robots","groupID":1,"bounds":{"left":20,"top":20,"width":20,"height":20}}'}
    12     },{
    13       entries: [{ url: "about:robots" }],
    14       hidden: false,
    15       extData: {"tabview-tab": '{"url":"about:robots","groupID":2,"bounds":{"left":20,"top":20,"width":20,"height":20}}'},
    16     }],
    17     selected: 2,
    18     extData: {
    19       "tabview-groups": '{"nextID":3,"activeGroupId":2, "totalNumber":2}',
    20       "tabview-group":
    21         '{"1":{"bounds":{"left":15,"top":5,"width":280,"height":232},"id":1},' +
    22         '"2":{"bounds":{"left":309,"top":5,"width":267,"height":226},"id":2}}'
    23     }
    24   }]
    25 };
    27 function test() {
    28   waitForExplicitFinish();
    29   testOne();
    30 }
    32 function testOne() {
    33   newWindowWithTabView(
    34     function(win) {
    35       testTwo();
    36       win.close();
    37     },
    38     function(win) {
    39       registerCleanupFunction(function() win.close());
    40       is(win.document.getElementById("tabviewGroupsNumber").getAttribute("groups"),
    41          "1", "There is one group");
    42     });
    43 }
    45 function testTwo() {
    46   newWindowWithState(state, function(win) {
    47     registerCleanupFunction(function() win.close());
    49     is(win.document.getElementById("tabviewGroupsNumber").getAttribute("groups"),
    50        "2", "There are two groups");
    51     waitForFocus(finish);
    52   });
    53 }

mercurial