Bug 1277750, fix intermittent bug734076.js test failure on linux64 e10s by forcing a size onto the <img> element loading an invalid URI, r?mikedeboer
In the failing case, the context menu is basically appearing over <body>
instead of the image. In that case we don't show the 'view image' option
and don't have a URL to use to open the image, which means we try and
do a security check for the load of '', which fails, and we don't get
a new load on which to run the rest of the test.
My guess is this is happening because if the image hasn't loaded yet
by the time we run the code, it takes up no space at all, and a mouse
event at its coordinates only 'hits' the body.
We can avoid that by givin the element width and height.
MozReview-Commit-ID: kU2IoYTqeE
--- a/browser/base/content/test/general/browser.ini
+++ b/browser/base/content/test/general/browser.ini
@@ -253,17 +253,16 @@ skip-if = buildapp == 'mulet'
[browser_bug676619.js]
skip-if = buildapp == 'mulet' || os == "mac" # mac: Intermittent failures, bug 925225
[browser_bug678392.js]
skip-if = os == "mac" # Bug 1102331 - does focus things on the content window which break in e10s mode (still causes orange on Mac 10.10)
[browser_bug710878.js]
[browser_bug719271.js]
[browser_bug724239.js]
[browser_bug734076.js]
-skip-if = (os == 'linux' && e10s) # bug 1277750
[browser_bug735471.js]
[browser_bug749738.js]
[browser_bug763468_perwindowpb.js]
[browser_bug767836_perwindowpb.js]
[browser_bug817947.js]
[browser_bug822367.js]
tags = mcb
[browser_bug832435.js]
--- a/browser/base/content/test/general/browser_bug734076.js
+++ b/browser/base/content/test/general/browser_bug734076.js
@@ -33,16 +33,18 @@ add_task(function* ()
{
name: "view image",
url: "http://mochi.test:8888/",
element: "img",
go: function () {
return ContentTask.spawn(gBrowser.selectedBrowser, { writeDomainURL: writeDomainURL }, function* (arg) {
let doc = content.document;
let img = doc.createElement("img");
+ img.height = 100;
+ img.width = 100;
img.setAttribute("src", arg.writeDomainURL);
doc.body.insertBefore(img, doc.body.firstChild);
return "context-viewimage";
});
},
verify: function () {
return ContentTask.spawn(gBrowser.selectedBrowser, null, function* (arg) {
@@ -89,16 +91,18 @@ add_task(function* ()
info("Run subtest " + test.name);
let commandToRun = yield test.go();
let popupShownPromise = BrowserTestUtils.waitForEvent(contentAreaContextMenu, "popupshown");
yield BrowserTestUtils.synthesizeMouse(test.element, 3, 3,
{ type: "contextmenu", button: 2 }, gBrowser.selectedBrowser);
yield popupShownPromise;
+ info("onImage: " + gContextMenu.onImage);
+ info("target: " + gContextMenu.target.tagName);
let loadedAfterCommandPromise = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
document.getElementById(commandToRun).click();
yield loadedAfterCommandPromise;
yield test.verify();
let popupHiddenPromise = BrowserTestUtils.waitForEvent(contentAreaContextMenu, "popuphidden");