mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1143740 - Re-enable browser_491168.js r=smacleod
This commit is contained in:
parent
c7a904e294
commit
c7b3e2c95b
@ -135,9 +135,6 @@ skip-if = true
|
||||
[browser_485563.js]
|
||||
[browser_490040.js]
|
||||
[browser_491168.js]
|
||||
# Disabled for too many intermittent failures.
|
||||
# Can be re-enabled once bug 930202 lands.
|
||||
skip-if = true
|
||||
[browser_491577.js]
|
||||
[browser_495495.js]
|
||||
[browser_500328.js]
|
||||
|
@ -1,41 +1,42 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
function test() {
|
||||
/** Test for Bug 491168 **/
|
||||
|
||||
waitForExplicitFinish();
|
||||
"use strict";
|
||||
|
||||
const REFERRER1 = "http://example.org/?" + Date.now();
|
||||
const REFERRER2 = "http://example.org/?" + Math.random();
|
||||
|
||||
let tab = gBrowser.addTab();
|
||||
gBrowser.selectedTab = tab;
|
||||
|
||||
add_task(function* () {
|
||||
// Add a new tab.
|
||||
let tab = gBrowser.selectedTab = gBrowser.addTab("about:blank");
|
||||
let browser = tab.linkedBrowser;
|
||||
promiseBrowserLoaded(browser).then(() => {
|
||||
yield promiseBrowserLoaded(browser);
|
||||
|
||||
// Load a new URI with a specific referrer.
|
||||
let referrerURI = Services.io.newURI(REFERRER1, null, null);
|
||||
browser.loadURI("http://example.org", referrerURI, null);
|
||||
yield promiseBrowserLoaded(browser);
|
||||
|
||||
TabState.flush(browser);
|
||||
let tabState = JSON.parse(ss.getTabState(tab));
|
||||
is(tabState.entries[0].referrer, REFERRER1,
|
||||
"Referrer retrieved via getTabState matches referrer set via loadURI.");
|
||||
|
||||
tabState.entries[0].referrer = REFERRER2;
|
||||
yield promiseTabState(tab, tabState);
|
||||
|
||||
promiseTabState(tab, tabState).then(() => {
|
||||
is(window.content.document.referrer, REFERRER2, "document.referrer matches referrer set via setTabState.");
|
||||
is((yield promiseDocumentReferrer()), REFERRER2,
|
||||
"document.referrer matches referrer set via setTabState.");
|
||||
gBrowser.removeCurrentTab();
|
||||
|
||||
gBrowser.removeTab(tab);
|
||||
// Restore the closed tab.
|
||||
tab = ss.undoCloseTab(window, 0);
|
||||
yield promiseTabRestored(tab);
|
||||
|
||||
let newTab = ss.undoCloseTab(window, 0);
|
||||
promiseTabRestored(newTab).then(() => {
|
||||
is(window.content.document.referrer, REFERRER2, "document.referrer is still correct after closing and reopening the tab.");
|
||||
gBrowser.removeTab(newTab);
|
||||
|
||||
finish();
|
||||
});
|
||||
});
|
||||
is((yield promiseDocumentReferrer()), REFERRER2,
|
||||
"document.referrer is still correct after closing and reopening the tab.");
|
||||
gBrowser.removeCurrentTab();
|
||||
});
|
||||
|
||||
let referrerURI = Services.io.newURI(REFERRER1, null, null);
|
||||
browser.loadURI("http://example.org", referrerURI, null);
|
||||
function promiseDocumentReferrer() {
|
||||
return ContentTask.spawn(gBrowser.selectedBrowser, null, function* () {
|
||||
return content.document.referrer;
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user