diff options
Diffstat (limited to 'toolkit/components/places/tests/chrome/browser_disableglobalhistory.xul')
-rw-r--r-- | toolkit/components/places/tests/chrome/browser_disableglobalhistory.xul | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/toolkit/components/places/tests/chrome/browser_disableglobalhistory.xul b/toolkit/components/places/tests/chrome/browser_disableglobalhistory.xul new file mode 100644 index 000000000..d7bbfda67 --- /dev/null +++ b/toolkit/components/places/tests/chrome/browser_disableglobalhistory.xul @@ -0,0 +1,44 @@ +<?xml version="1.0"?> +<?xml-stylesheet href="chrome://global/skin" type="text/css"?> + +<window title="Test disableglobalhistory attribute on remote browsers" + xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" + onload="run_test();"> + <script type="application/javascript" + src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> + <script type="application/javascript" + src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script> + + <browser id="inprocess_disabled" src="about:blank" type="content" disableglobalhistory="true" /> + <browser id="inprocess_enabled" src="about:blank" type="content" /> + + <browser id="remote_disabled" src="about:blank" type="content" disableglobalhistory="true" /> + <browser id="remote_enabled" src="about:blank" type="content" /> + + <script type="text/javascript;version=1.7"> + const {interfaces: Ci, classes: Cc, results: Cr, utils: Cu} = Components; + + Cu.import("resource://testing-common/ContentTask.jsm"); + ContentTask.setTestScope(window.opener.wrappedJSObject); + + function expectUseGlobalHistory(id, expected) { + let browser = document.getElementById(id); + return ContentTask.spawn(browser, {id, expected}, function*({id, expected}) { + Assert.equal(docShell.useGlobalHistory, expected, + "Got the right useGlobalHistory state in the docShell of " + id); + }); + } + + function run_test() { + spawn_task(function*() { + yield expectUseGlobalHistory("inprocess_disabled", false); + yield expectUseGlobalHistory("inprocess_enabled", true); + + yield expectUseGlobalHistory("remote_disabled", false); + yield expectUseGlobalHistory("remote_enabled", true); + window.opener.done(); + }); + }; + + </script> +</window>
\ No newline at end of file |