Bug 1202623 - Try to fix the intermittent orange by listening earlier for the notification. r=Felipe
authorBlake Kaplan <mrbkap@gmail.com>
Mon, 31 Oct 2016 16:33:09 -0700
changeset 347643 4e8e4c0bfd0b61a668911d1261b51b5083bd529e
parent 347642 ef6bdef5db2c56f9b511393d273fecdbcd18ba97
child 347644 4b30232f430a14d43420fbeff8eeb076f353ed34
push id10298
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:33:03 +0000
treeherdermozilla-aurora@7e29173b1641 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersFelipe
bugs1202623
milestone52.0a1
Bug 1202623 - Try to fix the intermittent orange by listening earlier for the notification. r=Felipe MozReview-Commit-ID: 6aT7WrvHFCf
browser/base/content/test/plugins/browser_private_clicktoplay.js
--- a/browser/base/content/test/plugins/browser_private_clicktoplay.js
+++ b/browser/base/content/test/plugins/browser_private_clicktoplay.js
@@ -99,22 +99,20 @@ add_task(function* test2a() {
   yield ContentTask.spawn(gTestBrowser, null, function* () {
     let plugin = content.document.getElementById("test");
     let objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
     let condition = () => objLoadingContent.activated;
     yield ContentTaskUtils.waitForCondition(condition, "Test 2a, Waited too long for plugin to activate");
   });
 });
 
-add_task(function* test2b() {
+add_task(function* test2c() {
+  let topicObserved = TestUtils.topicObserved("PopupNotifications-updateNotShowing");
   yield createPrivateWindow(gHttpTestRoot + "plugin_test.html");
-});
-
-add_task(function* test2c() {
-  yield TestUtils.topicObserved("PopupNotifications-updateNotShowing");
+  yield topicObserved;
 
   let popupNotification = gPrivateWindow.PopupNotifications.getNotification("click-to-play-plugins", gPrivateBrowser);
   ok(popupNotification, "Test 2c, Should have a click-to-play notification");
 
   yield ContentTask.spawn(gPrivateBrowser, null, function() {
     let plugin = content.document.getElementById("test");
     let objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
     ok(objLoadingContent.activated, "Test 2c, Plugin should be activated");
@@ -156,22 +154,21 @@ add_task(function* test3a() {
   yield ContentTask.spawn(gTestBrowser, null, function* () {
     let plugin = content.document.getElementById("test");
     let objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
     let condition = () => objLoadingContent.activated;
     yield ContentTaskUtils.waitForCondition(condition, "Test 3a, Waited too long for plugin to activate");
   });
 });
 
-add_task(function* test3b() {
+add_task(function* test3c() {
+  let topicObserved = TestUtils.topicObserved("PopupNotifications-updateNotShowing");
   yield createPrivateWindow(gHttpTestRoot + "plugin_test.html");
-});
+  yield topicObserved;
 
-add_task(function* test3c() {
-  yield TestUtils.topicObserved("PopupNotifications-updateNotShowing");
   let popupNotification = gPrivateWindow.PopupNotifications.getNotification("click-to-play-plugins", gPrivateBrowser);
   ok(popupNotification, "Test 3c, Should have a click-to-play notification");
 
   // Check the button status
   let promiseShown = BrowserTestUtils.waitForEvent(gPrivateWindow.PopupNotifications.panel,
                                                    "Shown");
   popupNotification.reshow();
   yield promiseShown;