From f036e933f7243fe927d7093e25ee142327a38e40 Mon Sep 17 00:00:00 2001 From: Benjamin Smedberg Date: Tue, 12 Nov 2013 14:31:57 -0500 Subject: [PATCH] Bug 932854 followup - Clear the plugin infobar after test_bug391728.html so that it doesn't affect later tests. a=ryanvm for pushing on a CLOSED TREE --- content/base/test/chrome/test_bug391728.html | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/content/base/test/chrome/test_bug391728.html b/content/base/test/chrome/test_bug391728.html index 2842129a26e5..01fcbf32a313 100644 --- a/content/base/test/chrome/test_bug391728.html +++ b/content/base/test/chrome/test_bug391728.html @@ -97,10 +97,27 @@ function start_test(plugin) { load_frame(test_normal, "file_bug391728"); } +function clearInfobar() { + var Ci = SpecialPowers.Ci; + var Cc = SpecialPowers.Cc; + ok(Ci != null, "Access Ci"); + ok(Cc != null, "Access Cc"); + + var browser = window.top.QueryInterface(Ci.nsIInterfaceRequestor) + .getInterface(Ci.nsIWebNavigation) + .QueryInterface(Ci.nsIDocShell) + .chromeEventHandler; + var chromeWin = browser.ownerDocument.defaultView; + var notificationBox = chromeWin.gBrowser.getNotificationBox(browser); + var notification = notificationBox.getNotificationWithValue("plugin-hidden"); + notificationBox.removeNotification(notification, true); +} + function finish_test(plugin) { Services.prefs.clearUserPref("extensions.blocklist.suppressUI"); resetBlocklist(); plugin.enabledState = Components.interfaces.nsIPluginTag.STATE_ENABLED; + clearInfobar(); SimpleTest.finish(); } @@ -189,7 +206,7 @@ function test_unknown(plugin) { test_style("none"); setAndUpdateBlocklist(gHttpTestRoot + "blockNoPlugins.xml", function() { ok(!plugin.blocklisted, "Plugin shouldn't remain blocklisted"); - finish_test(plugin); + SimpleTest.executeSoon(function() { finish_test(plugin); }); }); }