browser/components/tabview/test/browser_tabview_bug651311.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_bug651311.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,34 @@
     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 +  let callCount = 0;
    1.11 +
    1.12 +  newWindow(function (win) {
    1.13 +    registerCleanupFunction(function () win.close());
    1.14 +
    1.15 +    win.TabView._initFrame(function () {
    1.16 +      is(callCount++, 0, "call count is zero");
    1.17 +      ok(win.TabView.getContentWindow().UI, "content window is loaded");
    1.18 +    });
    1.19 +
    1.20 +    win.TabView._initFrame(function () {
    1.21 +      is(callCount++, 1, "call count is one");
    1.22 +      ok(win.TabView.getContentWindow().UI, "content window is loaded");
    1.23 +    });
    1.24 +
    1.25 +    win.TabView._initFrame(function () {
    1.26 +      is(callCount, 2, "call count is two");
    1.27 +      ok(win.TabView.getContentWindow().UI, "content window is loaded");
    1.28 +      finish();
    1.29 +    });
    1.30 +  });
    1.31 +}
    1.32 +
    1.33 +function newWindow(callback) {
    1.34 +  let opts = "chrome,all,dialog=no,height=800,width=800";
    1.35 +  let win = window.openDialog(getBrowserURL(), "_blank", opts, "about:blank");
    1.36 +  whenDelayedStartupFinished(win, () => callback(win));
    1.37 +}

mercurial