|
1 /* Any copyright is dedicated to the Public Domain. |
|
2 http://creativecommons.org/publicdomain/zero/1.0/ */ |
|
3 |
|
4 function test() { |
|
5 waitForExplicitFinish(); |
|
6 |
|
7 newWindowWithTabView(function(win) { |
|
8 let numTabsToUpdate = 2; |
|
9 |
|
10 showTabView(function() { |
|
11 let contentWindow = win.TabView.getContentWindow(); |
|
12 let groupItem = contentWindow.GroupItems.groupItems[0]; |
|
13 |
|
14 groupItem.getChildren().forEach(function(tabItem) { |
|
15 tabItem.addSubscriber("updated", function onUpdated() { |
|
16 tabItem.removeSubscriber("updated", onUpdated); |
|
17 |
|
18 if (--numTabsToUpdate == 0) |
|
19 finish(); |
|
20 }); |
|
21 contentWindow.TabItems.update(tabItem.tab); |
|
22 }); |
|
23 }, win); |
|
24 }, function(win) { |
|
25 BrowserOffline.toggleOfflineStatus(); |
|
26 ok(Services.io.offline, "It is now offline"); |
|
27 |
|
28 let originalTab = win.gBrowser.tabs[0]; |
|
29 originalTab.linkedBrowser.loadURI("http://www.example.com/foo"); |
|
30 win.gBrowser.addTab("http://www.example.com/bar"); |
|
31 |
|
32 registerCleanupFunction(function () { |
|
33 if (Services.io.offline) |
|
34 BrowserOffline.toggleOfflineStatus(); |
|
35 win.close(); |
|
36 }); |
|
37 }); |
|
38 } |
|
39 |