mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 808035 - Test. r=smaug
This commit is contained in:
parent
7c3b77f697
commit
57b5dd072c
@ -32,6 +32,7 @@ MOCHITEST_BROWSER_FILES = \
|
||||
browser_bug670318.js \
|
||||
file_bug670318.html \
|
||||
browser_bug673467.js \
|
||||
browser_bug808035.js \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
33
docshell/test/browser/browser_bug808035.js
Normal file
33
docshell/test/browser/browser_bug808035.js
Normal file
@ -0,0 +1,33 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
// Test for bug 808035.
|
||||
// When we open a new tab, the initial URI is the transient <about:blank> and
|
||||
// then requested URI would be loaded. When the URI's shceme is "javascript:",
|
||||
// we can *replace* the transient <about:blank> with an actual requet
|
||||
// through <javascript:location.replace("http://example.org/")>.
|
||||
//
|
||||
// There's no session history entry corresponding to the transient
|
||||
// <about:blank>. But we should make sure there exists a session history entry
|
||||
// for <http://example.org>.
|
||||
|
||||
function test() {
|
||||
const NEW_URI = "http://test1.example.org/";
|
||||
const REQUESTED_URI = "javascript:void(location.replace('" + NEW_URI +
|
||||
"'))";
|
||||
|
||||
waitForExplicitFinish();
|
||||
|
||||
let tab = gBrowser.addTab(REQUESTED_URI);
|
||||
let browser = tab.linkedBrowser;
|
||||
|
||||
browser.addEventListener('load', function(aEvent) {
|
||||
browser.removeEventListener('load', arguments.callee, true);
|
||||
|
||||
is(browser.contentWindow.location.href, NEW_URI, "The URI is OK.");
|
||||
is(browser.contentWindow.history.length, 1, "There exists a SH entry.");
|
||||
|
||||
gBrowser.removeTab(tab);
|
||||
finish();
|
||||
}, true);
|
||||
}
|
Loading…
Reference in New Issue
Block a user