|
1 /* Any copyright is dedicated to the Public Domain. |
|
2 * http://creativecommons.org/publicdomain/zero/1.0/ */ |
|
3 |
|
4 function test() { |
|
5 waitForExplicitFinish(); |
|
6 BrowserOpenTab(); |
|
7 |
|
8 let tab = gBrowser.selectedTab; |
|
9 let browser = tab.linkedBrowser; |
|
10 |
|
11 registerCleanupFunction(function () { gBrowser.removeTab(tab); }); |
|
12 |
|
13 whenBrowserLoaded(browser, function () { |
|
14 browser.loadURI("http://example.com/"); |
|
15 |
|
16 whenBrowserLoaded(browser, function () { |
|
17 ok(!gBrowser.canGoBack, "about:newtab wasn't added to the session history"); |
|
18 finish(); |
|
19 }); |
|
20 }); |
|
21 } |
|
22 |
|
23 function whenBrowserLoaded(aBrowser, aCallback) { |
|
24 if (aBrowser.contentDocument.readyState == "complete") { |
|
25 executeSoon(aCallback); |
|
26 return; |
|
27 } |
|
28 |
|
29 aBrowser.addEventListener("load", function onLoad() { |
|
30 aBrowser.removeEventListener("load", onLoad, true); |
|
31 executeSoon(aCallback); |
|
32 }, true); |
|
33 } |