1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/base/content/test/general/browser_bug495058.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,43 @@ 1.4 +function test() { 1.5 + waitForExplicitFinish(); 1.6 + next(); 1.7 +} 1.8 + 1.9 +var uris = [ 1.10 + "about:blank", 1.11 + "about:sessionrestore", 1.12 + "about:privatebrowsing", 1.13 +]; 1.14 + 1.15 +function next() { 1.16 + var tab = gBrowser.addTab(); 1.17 + var uri = uris.shift(); 1.18 + 1.19 + if (uri == "about:blank") { 1.20 + detach(); 1.21 + } else { 1.22 + let browser = tab.linkedBrowser; 1.23 + browser.addEventListener("load", function () { 1.24 + browser.removeEventListener("load", arguments.callee, true); 1.25 + detach(); 1.26 + }, true); 1.27 + browser.loadURI(uri); 1.28 + } 1.29 + 1.30 + function detach() { 1.31 + var win = gBrowser.replaceTabWithWindow(tab); 1.32 + 1.33 + whenDelayedStartupFinished(win, function () { 1.34 + is(win.gBrowser.currentURI.spec, uri, uri + ": uri loaded in detached tab"); 1.35 + is(win.document.activeElement, win.gBrowser.selectedBrowser, uri + ": browser is focused"); 1.36 + is(win.gURLBar.value, "", uri + ": urlbar is empty"); 1.37 + ok(win.gURLBar.placeholder, uri + ": placeholder text is present"); 1.38 + 1.39 + win.close(); 1.40 + if (uris.length) 1.41 + next(); 1.42 + else 1.43 + executeSoon(finish); 1.44 + }); 1.45 + } 1.46 +}