Wed, 31 Dec 2014 06:09:35 +0100
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 | newWindowWithTabView(function(win) { |
michael@0 | 8 | let numTabsToUpdate = 2; |
michael@0 | 9 | |
michael@0 | 10 | showTabView(function() { |
michael@0 | 11 | let contentWindow = win.TabView.getContentWindow(); |
michael@0 | 12 | let groupItem = contentWindow.GroupItems.groupItems[0]; |
michael@0 | 13 | |
michael@0 | 14 | groupItem.getChildren().forEach(function(tabItem) { |
michael@0 | 15 | tabItem.addSubscriber("updated", function onUpdated() { |
michael@0 | 16 | tabItem.removeSubscriber("updated", onUpdated); |
michael@0 | 17 | |
michael@0 | 18 | if (--numTabsToUpdate == 0) |
michael@0 | 19 | finish(); |
michael@0 | 20 | }); |
michael@0 | 21 | contentWindow.TabItems.update(tabItem.tab); |
michael@0 | 22 | }); |
michael@0 | 23 | }, win); |
michael@0 | 24 | }, function(win) { |
michael@0 | 25 | BrowserOffline.toggleOfflineStatus(); |
michael@0 | 26 | ok(Services.io.offline, "It is now offline"); |
michael@0 | 27 | |
michael@0 | 28 | let originalTab = win.gBrowser.tabs[0]; |
michael@0 | 29 | originalTab.linkedBrowser.loadURI("http://www.example.com/foo"); |
michael@0 | 30 | win.gBrowser.addTab("http://www.example.com/bar"); |
michael@0 | 31 | |
michael@0 | 32 | registerCleanupFunction(function () { |
michael@0 | 33 | if (Services.io.offline) |
michael@0 | 34 | BrowserOffline.toggleOfflineStatus(); |
michael@0 | 35 | win.close(); |
michael@0 | 36 | }); |
michael@0 | 37 | }); |
michael@0 | 38 | } |
michael@0 | 39 |