browser_bug495058.js
Go to the documentation of this file.
1 function test() {
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  win.addEventListener("load", function () {
30  win.removeEventListener("load", arguments.callee, false);
31 
32  var _delayedStartup = win.delayedStartup;
33  win.delayedStartup = function delayedStartup() {
34  _delayedStartup.apply(win, arguments);
35  win.delayedStartup = _delayedStartup;
36 
37  is(win.gBrowser.currentURI.spec, uri, uri + ": uri loaded in detached tab");
38  is(win.document.activeElement, win.gBrowser.selectedBrowser, uri + ": browser is focused");
39  is(win.gURLBar.value, "", uri + ": urlbar is empty");
40  ok(win.gURLBar.emptyText, uri + ": emptytext is present");
41  ok(win.gURLBar.hasAttribute("isempty"), uri + ": emptytext is displayed");
42 
43  win.close();
44  if (uris.length)
45  next();
46  else
47  executeSoon(finish);
48  };
49  }, false);
50  }
51 }
function test()
var uris
var tab
waitForExplicitFinish()
return!aWindow arguments!aWindow arguments[0]
var uri
Definition: FeedWriter.js:1135
function delayedStartup(isLoadingBlank, mustLoadSidebar)
Definition: browser.js:1182
var browser
Definition: openLocation.js:42
function next()