Bug 1202623 - Try to fix the intermittent orange by listening earlier for the notification. r=Felipe
MozReview-Commit-ID: 6aT7WrvHFCf
--- 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;