mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1155352, e10s, rewrite and reenable browser_middleMouse_noJSPaste.js, r=gijs
This commit is contained in:
parent
1dee995d07
commit
4859f0e9ed
@ -334,7 +334,6 @@ skip-if = os == "linux" # Linux: Intermittent failures, bug 917535
|
||||
[browser_menuButtonFitts.js]
|
||||
skip-if = os != "win" # The Fitts Law menu button is only supported on Windows (bug 969376)
|
||||
[browser_middleMouse_noJSPaste.js]
|
||||
skip-if = e10s # Bug 921952 - Content:Click event issues
|
||||
[browser_minimize.js]
|
||||
skip-if = e10s # Bug 1100664 - test directly access content docShells (TypeError: gBrowser.docShell is null)
|
||||
[browser_mixedcontent_securityflags.js]
|
||||
|
@ -3,51 +3,32 @@
|
||||
|
||||
const middleMousePastePref = "middlemouse.contentLoadURL";
|
||||
const autoScrollPref = "general.autoScroll";
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
Services.prefs.setBoolPref(middleMousePastePref, true);
|
||||
Services.prefs.setBoolPref(autoScrollPref, false);
|
||||
let tab = gBrowser.selectedTab = gBrowser.addTab();
|
||||
add_task(function* () {
|
||||
yield pushPrefs([middleMousePastePref, true], [autoScrollPref, false]);
|
||||
|
||||
registerCleanupFunction(function () {
|
||||
Services.prefs.clearUserPref(middleMousePastePref);
|
||||
Services.prefs.clearUserPref(autoScrollPref);
|
||||
gBrowser.removeTab(tab);
|
||||
});
|
||||
let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser);
|
||||
|
||||
addPageShowListener(function () {
|
||||
let pagePrincipal = gBrowser.contentPrincipal;
|
||||
|
||||
// copy javascript URI to the clipboard
|
||||
let url = "javascript:http://www.example.com/";
|
||||
waitForClipboard(url,
|
||||
function() {
|
||||
Components.classes["@mozilla.org/widget/clipboardhelper;1"]
|
||||
.getService(Components.interfaces.nsIClipboardHelper)
|
||||
.copyString(url, document);
|
||||
},
|
||||
function () {
|
||||
// Middle click on the content area
|
||||
info("Middle clicking");
|
||||
EventUtils.sendMouseEvent({type: "click", button: 1}, gBrowser);
|
||||
},
|
||||
function() {
|
||||
ok(false, "Failed to copy URL to the clipboard");
|
||||
finish();
|
||||
}
|
||||
);
|
||||
|
||||
addPageShowListener(function () {
|
||||
is(gBrowser.currentURI.spec, url.replace(/^javascript:/, ""), "url loaded by middle click doesn't include JS");
|
||||
finish();
|
||||
let url = "javascript:http://www.example.com/";
|
||||
yield new Promise((resolve, reject) => {
|
||||
SimpleTest.waitForClipboard(url, () => {
|
||||
Components.classes["@mozilla.org/widget/clipboardhelper;1"]
|
||||
.getService(Components.interfaces.nsIClipboardHelper)
|
||||
.copyString(url, document);
|
||||
}, resolve, () => {
|
||||
ok(false, "Clipboard copy failed");
|
||||
reject();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function addPageShowListener(func) {
|
||||
gBrowser.selectedBrowser.addEventListener("pageshow", function loadListener() {
|
||||
gBrowser.selectedBrowser.removeEventListener("pageshow", loadListener, false);
|
||||
func();
|
||||
});
|
||||
}
|
||||
let middlePagePromise = BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
||||
|
||||
// Middle click on the content area
|
||||
info("Middle clicking");
|
||||
yield BrowserTestUtils.synthesizeMouse(null, 10, 10, {button: 1}, gBrowser.selectedBrowser);
|
||||
yield middlePagePromise;
|
||||
|
||||
is(gBrowser.currentURI.spec, url.replace(/^javascript:/, ""), "url loaded by middle click doesn't include JS");
|
||||
|
||||
gBrowser.removeTab(tab);
|
||||
});
|
||||
|
@ -2,14 +2,17 @@
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function testURLBarCopy(targetValue) {
|
||||
return new Promise(resolve => {
|
||||
return new Promise((resolve, reject) => {
|
||||
info("Expecting copy of: " + targetValue);
|
||||
waitForClipboard(targetValue, function () {
|
||||
gURLBar.focus();
|
||||
gURLBar.select();
|
||||
|
||||
goDoCommand("cmd_copy");
|
||||
}, resolve);
|
||||
}, resolve, () => {
|
||||
ok(false, "Clipboard copy failed");
|
||||
reject();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user