B2G/gecko/browser/base/content/test/browser_pluginnotification.js
// Tests a page with an unknown plugin in it.
Tests a page with an unknown plugin in it.
Tests a page with an unknown plugin in it .
function test1() {
  var notificationBox = gBrowser.getNotificationBox(gTestBrowser);
  ok(notificationBox.getNotificationWithValue("missing-plugins"), "Test 1, Should have displayed the missing plugin notification");
  ok(!notificationBox.getNotificationWithValue("blocked-plugins"), "Test 1, Should not have displayed the blocked plugin notification");
  ok(gTestBrowser.missingPlugins, "Test 1, Should be a missing plugin list");
  ok("application/x-unknown" in gTestBrowser.missingPlugins, "Test 1, Should know about application/x-unknown");
  ok(!("application/x-test" in gTestBrowser.missingPlugins), "Test 1, Should not know about application/x-test");
  var pluginNode = gTestBrowser.contentDocument.getElementById("unknown");
  ok(pluginNode, "Test 1, Found plugin in page");
  var objLoadingContent = pluginNode.QueryInterface(Ci.nsIObjectLoadingContent);
  is(objLoadingContent.pluginFallbackType, Ci.nsIObjectLoadingContent.PLUGIN_UNSUPPORTED, "Test 1, plugin fallback type should be PLUGIN_UNSUPPORTED");
  var plugin = getTestPlugin();
  ok(plugin, "Should have a test plugin");
  plugin.disabled = false;
  plugin.blocklisted = false;
  prepareTest(test2, gTestRoot + "plugin_test.html");
}
function test1 ( ) { var notificationBox = gBrowser . getNotificationBox ( gTestBrowser ) ; ok ( notificationBox . getNotificationWithValue ( "missing-plugins" ) , "Test 1, Should have displayed the missing plugin notification" ) ; ok ( ! notificationBox . getNotificationWithValue ( "blocked-plugins" ) , "Test 1, Should not have displayed the blocked plugin notification" ) ; ok ( gTestBrowser . missingPlugins , "Test 1, Should be a missing plugin list" ) ; ok ( "application/x-unknown" in gTestBrowser . missingPlugins , "Test 1, Should know about application/x-unknown" ) ; ok ( ! ( "application/x-test" in gTestBrowser . missingPlugins ) , "Test 1, Should not know about application/x-test" ) ; var pluginNode = gTestBrowser . contentDocument . getElementById ( "unknown" ) ; ok ( pluginNode , "Test 1, Found plugin in page" ) ; var objLoadingContent = pluginNode . QueryInterface ( Ci . nsIObjectLoadingContent ) ; is ( objLoadingContent . pluginFallbackType , Ci . nsIObjectLoadingContent . PLUGIN_UNSUPPORTED , "Test 1, plugin fallback type should be PLUGIN_UNSUPPORTED" ) ; var plugin = getTestPlugin ( ) ; ok ( plugin , "Should have a test plugin" ) ; plugin . disabled = false ; plugin . blocklisted = false ; prepareTest ( test2 , gTestRoot + "plugin_test.html" ) ; }
Tests a page with an unknown plugin in it.
Tests a page with an unknown plugin in it .