browser/components/tabview/test/browser_tabview_bug659594.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/components/tabview/test/browser_tabview_bug659594.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,39 @@
     1.4 +/* Any copyright is dedicated to the Public Domain.
     1.5 +   http://creativecommons.org/publicdomain/zero/1.0/ */
     1.6 +
     1.7 +function test() {
     1.8 +  waitForExplicitFinish();
     1.9 +
    1.10 +  newWindowWithTabView(function(win) {
    1.11 +    let numTabsToUpdate = 2;
    1.12 +
    1.13 +    showTabView(function() {
    1.14 +      let contentWindow = win.TabView.getContentWindow();
    1.15 +      let groupItem = contentWindow.GroupItems.groupItems[0];
    1.16 +
    1.17 +      groupItem.getChildren().forEach(function(tabItem) {
    1.18 +        tabItem.addSubscriber("updated", function onUpdated() {
    1.19 +          tabItem.removeSubscriber("updated", onUpdated);
    1.20 +
    1.21 +          if (--numTabsToUpdate == 0)
    1.22 +            finish();
    1.23 +        });
    1.24 +        contentWindow.TabItems.update(tabItem.tab);
    1.25 +      });
    1.26 +    }, win);
    1.27 +  }, function(win) {
    1.28 +    BrowserOffline.toggleOfflineStatus();
    1.29 +    ok(Services.io.offline, "It is now offline");
    1.30 +
    1.31 +    let originalTab = win.gBrowser.tabs[0];
    1.32 +    originalTab.linkedBrowser.loadURI("http://www.example.com/foo");
    1.33 +    win.gBrowser.addTab("http://www.example.com/bar");
    1.34 +
    1.35 +    registerCleanupFunction(function () {
    1.36 +      if (Services.io.offline)
    1.37 +        BrowserOffline.toggleOfflineStatus();
    1.38 +      win.close();
    1.39 +    });
    1.40 +  });
    1.41 +}
    1.42 +

mercurial