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, a=test-only
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Thu, 06 Oct 2016 16:11:02 +0100
changeset 356073 8964f57e6bd5dfd1097d21b326e9903721aeb0b7
parent 356072 cb53dde697469a072c60476dbcde7727811e61a9
child 356074 ae9a8e3d614c25a3ea513574ae1842773529c069
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmikedeboer, test-only
bugs1277750, 734076
milestone51.0a2
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, a=test-only 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
browser/base/content/test/general/browser.ini
browser/base/content/test/general/browser_bug734076.js
--- a/browser/base/content/test/general/browser.ini
+++ b/browser/base/content/test/general/browser.ini
@@ -252,17 +252,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");