browser/components/tabview/test/browser_tabview_bug707466.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 function test() {
     5   waitForExplicitFinish();
     7   // create two groups and each group has one tab item
     8   let newState = {
     9     windows: [{
    10       tabs: [{
    11         entries: [{ url: "about:robots" }],
    12         hidden: true,
    13         attributes: {},
    14         extData: {
    15           "tabview-tab":
    16             '{"bounds":{"left":21,"top":29,"width":204,"height":153},' +
    17             '"userSize":null,"url":"about:robots","groupID":1,' +
    18             '"imageData":null,"title":null}'
    19         }
    20       },{
    21         entries: [{ url: "about:robots" }],
    22         hidden: false,
    23         attributes: {},
    24         extData: {
    25           "tabview-tab":
    26             '{"bounds":{"left":315,"top":29,"width":111,"height":84},' +
    27             '"userSize":null,"url":"about:robots","groupID":2,' +
    28             '"imageData":null,"title":null}'
    29         },
    30       }],
    31       selected:2,
    32       _closedTabs: [],
    33       extData: {
    34         "tabview-groups": '{"nextID":3,"activeGroupId":2}',
    35         "tabview-group":
    36           '{"1":{"bounds":{"left":15,"top":5,"width":280,"height":232},' +
    37           '"userSize":null,"title":"","id":1},' +
    38           '"2":{"bounds":{"left":309,"top":5,"width":267,"height":226},' +
    39           '"userSize":null,"title":"","id":2}}',
    40         "tabview-ui": '{"pageBounds":{"left":0,"top":0,"width":788,"height":548}}'
    41       }, sizemode:"normal"
    42     }]
    43   };
    45   newWindowWithState(newState, function(win) {
    46     registerCleanupFunction(function () win.close());
    48     whenTabViewIsShown(function() {
    49       let cw = win.TabView.getContentWindow();
    51       is(cw.GroupItems.groupItems.length, 2, "There are still two groups");
    52       is(win.gBrowser.tabs.length, 1, "There is only one tab");
    53       is(cw.UI.getActiveTab(), win.gBrowser.selectedTab._tabViewTabItem, "The last tab is selected");
    55       finish();
    56     }, win);
    57     win.gBrowser.removeTab(win.gBrowser.selectedTab);
    58   });
    59 }

mercurial