Bug 1161611, e10s, fix and reenable browser_bug417483, r=felipe
authorNeil Deakin <neil@mozilla.com>
Mon, 11 May 2015 08:02:38 -0400
changeset 243358 1c15a3d5906b7fa05000ff4e5698513b8699383c
parent 243357 9ff00018ff1bba9acd9c9d7d38de9a5e0895b180
child 243359 41ca098906eb231f1d99bc60c82b8b7dddda43a9
push id28738
push usercbook@mozilla.com
push dateTue, 12 May 2015 14:11:31 +0000
treeherdermozilla-central@bedce1b405a3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfelipe
bugs1161611, 417483
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1161611, e10s, fix and reenable browser_bug417483, r=felipe
browser/base/content/test/general/browser.ini
browser/base/content/test/general/browser_bug417483.js
--- a/browser/base/content/test/general/browser.ini
+++ b/browser/base/content/test/general/browser.ini
@@ -153,17 +153,16 @@ skip-if = true # browser_bug321000.js is
 [browser_bug386835.js]
 [browser_bug405137.js]
 [browser_bug406216.js]
 [browser_bug409481.js]
 [browser_bug409624.js]
 [browser_bug413915.js]
 [browser_bug416661.js]
 [browser_bug417483.js]
-skip-if = e10s # Bug 1093155 - tries to use context menu from browser-chrome and gets in a mess when in e10s mode
 [browser_bug419612.js]
 [browser_bug422590.js]
 [browser_bug423833.js]
 skip-if = true # bug 428712
 [browser_bug424101.js]
 [browser_bug427559.js]
 [browser_bug431826.js]
 [browser_bug432599.js]
--- a/browser/base/content/test/general/browser_bug417483.js
+++ b/browser/base/content/test/general/browser_bug417483.js
@@ -1,26 +1,30 @@
-function test() {
-  waitForExplicitFinish();
-  
-  var htmlContent = "data:text/html, <iframe src='data:text/html,text text'></iframe>";
-  gBrowser.addEventListener("pageshow", onPageShow, false);
+add_task(function* () {
+  let loadedPromise = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser, true);
+  const htmlContent = "data:text/html, <iframe src='data:text/html,text text'></iframe>";
   gBrowser.loadURI(htmlContent);
-}
+  yield loadedPromise;
 
-function onPageShow() {
-    gBrowser.removeEventListener("pageshow", onPageShow, false);
-    var frame = content.frames[0];
-    var sel = frame.getSelection();
-    var range = frame.document.createRange();
-    var tn = frame.document.body.childNodes[0];
-    range.setStart(tn , 4);
-    range.setEnd(tn , 5);
+  yield ContentTask.spawn(gBrowser.selectedBrowser, { }, function* (arg) {
+    let frame = content.frames[0];
+    let sel = frame.getSelection();
+    let range = frame.document.createRange();
+    let tn = frame.document.body.childNodes[0];
+    range.setStart(tn, 4);
+    range.setEnd(tn, 5);
     sel.addRange(range);
     frame.focus();
-    
-    document.popupNode = frame.document.body;
-    var contentAreaContextMenu = document.getElementById("contentAreaContextMenu");
-    var contextMenu = new nsContextMenu(contentAreaContextMenu);
+  });
+
+  let contentAreaContextMenu = document.getElementById("contentAreaContextMenu");
 
-    ok(document.getElementById("frame-sep").hidden, "'frame-sep' should be hidden if the selection contains only spaces");
-    finish();
-}
+  let popupShownPromise = BrowserTestUtils.waitForEvent(contentAreaContextMenu, "popupshown");
+  yield BrowserTestUtils.synthesizeMouse("frame", 5, 5,
+        { type: "contextmenu", button: 2}, gBrowser.selectedBrowser);
+  yield popupShownPromise;  
+
+  ok(document.getElementById("frame-sep").hidden, "'frame-sep' should be hidden if the selection contains only spaces");
+
+  let popupHiddenPromise = BrowserTestUtils.waitForEvent(contentAreaContextMenu, "popuphidden");
+  contentAreaContextMenu.hidePopup();
+  yield popupHiddenPromise;  
+});