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

mercurial