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

--HG--
extra : rebase_source : f381a33b62bc910f3becf69b4971b56e57c33e5f
This commit is contained in:
Gijs Kruitbosch 2016-10-06 16:11:02 +01:00
Родитель 0e58530148
Коммит 6b4a71b6fc
2 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -258,7 +258,6 @@ skip-if = os == "mac" # Bug 1102331 - does focus things on the content window wh
[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]

Просмотреть файл

@ -38,6 +38,8 @@ add_task(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);
@ -94,6 +96,8 @@ add_task(function* ()
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();