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.

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

mercurial