Bug 1160788 - Attempt to fix random orange: don't spawn multiple ContentTasks when checking the visible state of the click-to-play overlay. r=jimm, a=test-only
authorTrevor Rowbotham <smokey101stair@gmail.com>
Tue, 21 Jul 2015 14:38:00 +0200
changeset 281671 bc5459e3d6965b7958ded660abe6fe19d3cfc354
parent 281670 48e511360f3e338f3cff0ee7509307e7b6a4930e
child 281672 b6be50a73a6e40234cefba3f0739034c37c07eba
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-beta@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm, test-only
bugs1160788
milestone41.0a2
Bug 1160788 - Attempt to fix random orange: don't spawn multiple ContentTasks when checking the visible state of the click-to-play overlay. r=jimm, a=test-only
browser/base/content/test/plugins/browser.ini
browser/base/content/test/plugins/browser_CTP_hide_overlay.js
--- a/browser/base/content/test/plugins/browser.ini
+++ b/browser/base/content/test/plugins/browser.ini
@@ -50,17 +50,16 @@ support-files =
 [browser_clearplugindata.js]
 [browser_CTP_context_menu.js]
 skip-if = toolkit == "gtk2" || toolkit == "gtk3"   # fails intermittently on Linux (bug 909342)
 [browser_CTP_crashreporting.js]
 skip-if = !crashreporter
 [browser_CTP_data_urls.js]
 [browser_CTP_drag_drop.js]
 [browser_CTP_hide_overlay.js]
-skip-if = true # Bug 1160788
 [browser_CTP_iframe.js]
 skip-if = os == 'linux' || os == 'mac' # Bug 984821
 [browser_CTP_multi_allow.js]
 [browser_CTP_nonplugins.js]
 [browser_CTP_notificationBar.js]
 [browser_CTP_outsideScrollArea.js]
 [browser_CTP_remove_navigate.js]
 [browser_CTP_resize.js]
--- a/browser/base/content/test/plugins/browser_CTP_hide_overlay.js
+++ b/browser/base/content/test/plugins/browser_CTP_hide_overlay.js
@@ -24,31 +24,27 @@ add_task(function* () {
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Test Plug-in");
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Second Test Plug-in");
 
   yield promiseTabLoadEvent(gBrowser.selectedTab, gTestRoot + "plugin_test.html");
 
   // Work around for delayed PluginBindingAttached
   yield promiseUpdatePluginBindings(gBrowser.selectedBrowser);
 
-  // Tests that the overlay can be hidded for disabled plugins using the close icon.
-  yield ContentTask.spawn(gBrowser.selectedBrowser, {}, function* () {
+  // Tests that the overlay can be hidden for plugins using the close icon.
+  let overlayIsVisible = yield ContentTask.spawn(gBrowser.selectedBrowser, {}, function* () {
     let doc = content.document;
     let plugin = doc.getElementById("test");
     let overlay = doc.getAnonymousElementByAttribute(plugin, "anonid", "main");
     let closeIcon = doc.getAnonymousElementByAttribute(plugin, "anonid", "closeIcon")
     let bounds = closeIcon.getBoundingClientRect();
     let left = (bounds.left + bounds.right) / 2;
     let top = (bounds.top + bounds.bottom) / 2;
     let utils = content.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
                        .getInterface(Components.interfaces.nsIDOMWindowUtils);
     utils.sendMouseEvent("mousedown", left, top, 0, 1, 0, false, 0, 0);
     utils.sendMouseEvent("mouseup", left, top, 0, 1, 0, false, 0, 0);
+
+    return overlay.classList.contains("visible");
   });
 
-  let overlayIsVisible = yield ContentTask.spawn(gBrowser.selectedBrowser, {}, function* () {
-    let doc = content.document;
-    let plugin = doc.getElementById("test");
-    let overlay = doc.getAnonymousElementByAttribute(plugin, "anonid", "main");
-    return plugin && overlay.classList.contains("visible");
-  });
   ok(!overlayIsVisible, "overlay should be hidden.");
 });