browser/base/content/test/general/browser_bug495058.js

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:c6e6da619eca
1 function test() {
2 waitForExplicitFinish();
3 next();
4 }
5
6 var uris = [
7 "about:blank",
8 "about:sessionrestore",
9 "about:privatebrowsing",
10 ];
11
12 function next() {
13 var tab = gBrowser.addTab();
14 var uri = uris.shift();
15
16 if (uri == "about:blank") {
17 detach();
18 } else {
19 let browser = tab.linkedBrowser;
20 browser.addEventListener("load", function () {
21 browser.removeEventListener("load", arguments.callee, true);
22 detach();
23 }, true);
24 browser.loadURI(uri);
25 }
26
27 function detach() {
28 var win = gBrowser.replaceTabWithWindow(tab);
29
30 whenDelayedStartupFinished(win, function () {
31 is(win.gBrowser.currentURI.spec, uri, uri + ": uri loaded in detached tab");
32 is(win.document.activeElement, win.gBrowser.selectedBrowser, uri + ": browser is focused");
33 is(win.gURLBar.value, "", uri + ": urlbar is empty");
34 ok(win.gURLBar.placeholder, uri + ": placeholder text is present");
35
36 win.close();
37 if (uris.length)
38 next();
39 else
40 executeSoon(finish);
41 });
42 }
43 }

mercurial