michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: function test() { michael@0: waitForExplicitFinish(); michael@0: michael@0: newWindowWithTabView(function(win) { michael@0: let numTabsToUpdate = 2; michael@0: michael@0: showTabView(function() { michael@0: let contentWindow = win.TabView.getContentWindow(); michael@0: let groupItem = contentWindow.GroupItems.groupItems[0]; michael@0: michael@0: groupItem.getChildren().forEach(function(tabItem) { michael@0: tabItem.addSubscriber("updated", function onUpdated() { michael@0: tabItem.removeSubscriber("updated", onUpdated); michael@0: michael@0: if (--numTabsToUpdate == 0) michael@0: finish(); michael@0: }); michael@0: contentWindow.TabItems.update(tabItem.tab); michael@0: }); michael@0: }, win); michael@0: }, function(win) { michael@0: BrowserOffline.toggleOfflineStatus(); michael@0: ok(Services.io.offline, "It is now offline"); michael@0: michael@0: let originalTab = win.gBrowser.tabs[0]; michael@0: originalTab.linkedBrowser.loadURI("http://www.example.com/foo"); michael@0: win.gBrowser.addTab("http://www.example.com/bar"); michael@0: michael@0: registerCleanupFunction(function () { michael@0: if (Services.io.offline) michael@0: BrowserOffline.toggleOfflineStatus(); michael@0: win.close(); michael@0: }); michael@0: }); michael@0: } michael@0: