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

This commit is contained in:
Benjamin Smedberg 2013-11-12 14:31:57 -05:00
parent 858d3e1472
commit c67d5824cb

View File

@ -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); });
});
}