bug 821892 - update "Page Info" -> Permissions for plugin permission differentiation r=jaws a=lsblakk
authorDavid Keeler <dkeeler@mozilla.com>
Sun, 10 Feb 2013 18:27:02 -0800
changeset 123978 a12a304c16af
parent 123977 e841c66bde34
child 123979 8c557b7c03a4
push id3361
push userdkeeler@mozilla.com
push dateWed, 13 Feb 2013 21:07:30 +0000
treeherdermozilla-aurora@a12a304c16af [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws, lsblakk
bugs821892
milestone20.0a2
bug 821892 - update "Page Info" -> Permissions for plugin permission differentiation r=jaws a=lsblakk
browser/base/content/pageinfo/pageInfo.xul
browser/base/content/pageinfo/permissions.js
browser/base/content/test/Makefile.in
browser/base/content/test/browser_pageInfo_plugins.js
--- a/browser/base/content/pageinfo/pageInfo.xul
+++ b/browser/base/content/pageinfo/pageInfo.xul
@@ -56,17 +56,17 @@
     <command id="cmd_pluginsDef"    oncommand="onCheckboxClick('plugins');"/>
     <command id="cmd_imageToggle"   oncommand="onRadioClick('image');"/>
     <command id="cmd_popupToggle"   oncommand="onRadioClick('popup');"/>
     <command id="cmd_cookieToggle"  oncommand="onRadioClick('cookie');"/>
     <command id="cmd_installToggle" oncommand="onRadioClick('install');"/>
     <command id="cmd_fullscreenToggle" oncommand="onRadioClick('fullscreen');"/>
     <command id="cmd_geoToggle"     oncommand="onRadioClick('geo');"/>
     <command id="cmd_indexedDBToggle" oncommand="onRadioClick('indexedDB');"/>
-    <command id="cmd_pluginsToggle" oncommand="onRadioClick('plugins');"/>
+    <command id="cmd_pluginsToggle" oncommand="onPluginRadioClick(event);"/>
   </commandset>
 
   <keyset id="pageInfoKeySet">
     <key key="&closeWindow.key;" modifiers="accel" command="cmd_close"/>
     <key keycode="VK_ESCAPE"                       command="cmd_close"/>
 #ifdef XP_MACOSX
     <key key="."                 modifiers="meta"  command="cmd_close"/>
 #else
@@ -371,22 +371,23 @@
             </vbox>
             <button id="indexedDBClear" label="&permClearStorage;" hidden="true"
                     accesskey="&permClearStorage.accesskey;" onclick="onIndexedDBClear();"/>
           </hbox>
         </vbox>
         <vbox class="permission" id="permPluginsRow">
           <label class="permissionLabel" id="permPluginsLabel"
                  value="&permPlugins;" control="pluginsRadioGroup"/>
-          <hbox id="permPluginsBox" role="group" aria-labelledby="permPluginsLabel">
-            <checkbox id="pluginsDef" command="cmd_pluginsDef" label="&permAskAlways;"/>
+          <hbox id="permPluginTemplate" role="group" aria-labelledby="permPluginsLabel" align="baseline">
+            <label class="permPluginTemplateLabel"/>
             <spacer flex="1"/>
-            <radiogroup id="pluginsRadioGroup" orient="horizontal">
-              <radio id="plugins#1" command="cmd_pluginsToggle" label="&permAllow;"/>
-              <radio id="plugins#2" command="cmd_pluginsToggle" label="&permBlock;"/>
+            <radiogroup class="permPluginTemplateRadioGroup" orient="horizontal" command="cmd_pluginsToggle">
+              <radio class="permPluginTemplateRadioAsk" label="&permAskAlways;"/>
+              <radio class="permPluginTemplateRadioAllow" label="&permAllow;"/>
+              <radio class="permPluginTemplateRadioBlock" label="&permBlock;"/>
             </radiogroup>
           </hbox>
         </vbox>
         <vbox class="permission" id="permFullscreenRow">
           <label class="permissionLabel" id="permFullscreenLabel"
                  value="&permFullscreen;" control="fullscreenRadioGroup"/>
           <hbox id="permFullscreenBox" role="group" aria-labelledby="permFullscreenLabel">
             <checkbox id="fullscreenDef" command="cmd_fullscreenDef" label="&permUseDefault;"/>
--- a/browser/base/content/pageinfo/permissions.js
+++ b/browser/base/content/pageinfo/permissions.js
@@ -50,33 +50,35 @@ var gPermObj = {
     return BLOCK;
   },
   indexedDB: function getIndexedDBDefaultPermissions()
   {
     return UNKNOWN;
   },
   plugins: function getPluginsDefaultPermissions()
   {
-    if (gPrefs.getBoolPref("plugins.click_to_play"))
-      return BLOCK;
-    return ALLOW;
+    return UNKNOWN;
   },
   fullscreen: function getFullscreenDefaultPermissions()
   {
     return UNKNOWN;  
   }
 };
 
 var permissionObserver = {
   observe: function (aSubject, aTopic, aData)
   {
     if (aTopic == "perm-changed") {
       var permission = aSubject.QueryInterface(Components.interfaces.nsIPermission);
-      if (permission.host == gPermURI.host && permission.type in gPermObj)
-        initRow(permission.type);
+      if (permission.host == gPermURI.host) {
+        if (permission.type in gPermObj)
+          initRow(permission.type);
+        else if (permission.type.startsWith("plugin"))
+          setPluginsRadioState();
+      }
     }
   }
 };
 
 function onLoadPermission()
 {
   gPrefs = Components.classes[PREFERENCES_CONTRACTID]
                      .getService(Components.interfaces.nsIPrefBranch);
@@ -108,18 +110,20 @@ function onUnloadPermission()
 
   var dbManager = Components.classes["@mozilla.org/dom/indexeddb/manager;1"]
                             .getService(nsIIndexedDatabaseManager);
   dbManager.cancelGetUsageForURI(gPermURI, onIndexedDBUsageCallback);
 }
 
 function initRow(aPartId)
 {
-  if (aPartId == "plugins" && !gPrefs.getBoolPref("plugins.click_to_play"))
-    document.getElementById("permPluginsRow").hidden = true;
+  if (aPartId == "plugins") {
+    initPluginsRow();
+    return;
+  }
 
   var permissionManager = Components.classes[PERMISSION_CONTRACTID]
                                     .getService(nsIPermissionManager);
 
   var checkbox = document.getElementById(aPartId + "Def");
   var command  = document.getElementById("cmd_" + aPartId + "Toggle");
   // Geolocation permission consumers use testExactPermission, not testPermission. 
   var perm = aPartId == "geo" ? permissionManager.testExactPermission(gPermURI, aPartId) :
@@ -154,16 +158,20 @@ function onCheckboxClick(aPartId)
     setRadioState(aPartId, perm);
   }
   else {
     onRadioClick(aPartId);
     command.removeAttribute("disabled");
   }
 }
 
+function onPluginRadioClick(aEvent) {
+  onRadioClick(aEvent.originalTarget.getAttribute("id").split('#')[0]);
+}
+
 function onRadioClick(aPartId)
 {
   var permissionManager = Components.classes[PERMISSION_CONTRACTID]
                                     .getService(nsIPermissionManager);
 
   var radioGroup = document.getElementById(aPartId + "RadioGroup");
   var id = radioGroup.selectedItem.id;
   var permission = id.split('#')[1];
@@ -225,8 +233,103 @@ function onIndexedDBUsageCallback(uri, u
 
     status.value =
       gBundle.getFormattedString("indexedDBUsage",
                                  DownloadUtils.convertByteUnits(usage));
     status.removeAttribute("hidden");
     button.removeAttribute("hidden");
   }
 }
+
+// XXX copied this from browser-plugins.js - is there a way to share?
+function makeNicePluginName(aName) {
+  if (aName == "Shockwave Flash")
+    return "Adobe Flash";
+
+  // Clean up the plugin name by stripping off any trailing version numbers
+  // or "plugin". EG, "Foo Bar Plugin 1.23_02" --> "Foo Bar"
+  // Do this by first stripping the numbers, etc. off the end, and then
+  // removing "Plugin" (and then trimming to get rid of any whitespace).
+  // (Otherwise, something like "Java(TM) Plug-in 1.7.0_07" gets mangled)
+  let newName = aName.replace(/[\s\d\.\-\_\(\)]+$/, "").replace(/\bplug-?in\b/i, "").trim();
+  return newName;
+}
+
+function fillInPluginPermissionTemplate(aPluginName, aPermissionString) {
+  let permPluginTemplate = document.getElementById("permPluginTemplate");
+  permPluginTemplate.setAttribute("permString", aPermissionString);
+  let attrs = [
+    [ ".permPluginTemplateLabel", "value", aPluginName ],
+    [ ".permPluginTemplateRadioGroup", "id", aPermissionString + "RadioGroup" ],
+    [ ".permPluginTemplateRadioAsk", "id", aPermissionString + "#0" ],
+    [ ".permPluginTemplateRadioAllow", "id", aPermissionString + "#1" ],
+    [ ".permPluginTemplateRadioBlock", "id", aPermissionString + "#2" ]
+  ];
+
+  for (let attr of attrs) {
+    document.querySelector(attr[0]).setAttribute(attr[1], attr[2]);
+  }
+
+  return permPluginTemplate.cloneNode(true);
+}
+
+function clearPluginPermissionTemplate() {
+  let permPluginTemplate = document.getElementById("permPluginTemplate");
+  permPluginTemplate.hidden = true;
+  permPluginTemplate.removeAttribute("permString");
+  document.querySelector(".permPluginTemplateLabel").removeAttribute("value");
+  document.querySelector(".permPluginTemplateRadioGroup").removeAttribute("id");
+  document.querySelector(".permPluginTemplateRadioAsk").removeAttribute("id");
+  document.querySelector(".permPluginTemplateRadioAllow").removeAttribute("id");
+  document.querySelector(".permPluginTemplateRadioBlock").removeAttribute("id");
+}
+
+function initPluginsRow() {
+  let pluginHost = Components.classes["@mozilla.org/plugin/host;1"].getService(Components.interfaces.nsIPluginHost);
+  let tags = pluginHost.getPluginTags().filter(function(aTag) {
+    let mimeTypes = aTag.getMimeTypes();
+    if (mimeTypes.length < 1)
+      return false;
+    let mimeType = mimeTypes[0].type;
+    return (!aTag.disabled && pluginHost.isPluginClickToPlayForType(mimeType));
+  });
+
+  tags.sort(function(tagA, tagB) {
+    let nameA = makeNicePluginName(tagA.name);
+    let nameB = makeNicePluginName(tagB.name);
+    return nameA < nameB ? -1 : (nameA == nameB ? 0 : 1);
+  });
+
+  let permissionEntries = [];
+  for (let plugin of tags) {
+    let mimeType = plugin.getMimeTypes()[0].type;
+    let permString = pluginHost.getPermissionStringForType(mimeType);
+    let pluginName = makeNicePluginName(plugin.name)
+    let permEntry = fillInPluginPermissionTemplate(pluginName, permString);
+    permissionEntries.push(permEntry);
+  }
+
+  let permPluginsRow = document.getElementById("permPluginsRow");
+  clearPluginPermissionTemplate();
+  if (permissionEntries.length < 1) {
+    permPluginsRow.hidden = true;
+    return;
+  }
+
+  for (let permissionEntry of permissionEntries) {
+    permPluginsRow.appendChild(permissionEntry);
+  }
+
+  setPluginsRadioState();
+}
+
+function setPluginsRadioState() {
+  var permissionManager = Components.classes[PERMISSION_CONTRACTID]
+                                    .getService(nsIPermissionManager);
+  let box = document.getElementById("permPluginsRow");
+  for (let permissionEntry of box.childNodes) {
+    if (permissionEntry.hasAttribute("permString")) {
+      let permString = permissionEntry.getAttribute("permString");
+      let permission = permissionManager.testPermission(gPermURI, permString);
+      setRadioState(permString, permission);
+    }
+  }
+}
--- a/browser/base/content/test/Makefile.in
+++ b/browser/base/content/test/Makefile.in
@@ -291,16 +291,17 @@ endif
                  blockPluginVulnerableUpdatable.xml \
                  blockPluginVulnerableNoUpdate.xml \
                  blockNoPlugins.xml \
                  browser_utilityOverlay.js \
                  browser_bug676619.js \
                  download_page.html \
                  browser_URLBarSetURI.js \
                  browser_bookmark_titles.js \
+                 browser_pageInfo_plugins.js \
                  $(NULL)
 
 ifneq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 _BROWSER_FILES += \
 		browser_bug462289.js \
 		$(NULL)
 else
 _BROWSER_FILES += \
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/browser_pageInfo_plugins.js
@@ -0,0 +1,217 @@
+let gHttpTestRoot = getRootDirectory(gTestPath).replace("chrome://mochitests/content/", "http://127.0.0.1:8888/");
+let gPageInfo = null;
+let gNextTest = null;
+let gTestBrowser = null;
+let gPluginHost = Components.classes["@mozilla.org/plugin/host;1"]
+                    .getService(Components.interfaces.nsIPluginHost);
+let gPermissionManager = Components.classes["@mozilla.org/permissionmanager;1"]
+                           .getService(Components.interfaces.nsIPermissionManager);
+let gTestPermissionString = gPluginHost.getPermissionStringForType("application/x-test");
+let gSecondTestPermissionString = gPluginHost.getPermissionStringForType("application/x-second-test");
+
+function doOnPageLoad(url, continuation) {
+  gNextTest = continuation;
+  gTestBrowser.addEventListener("load", pageLoad, true);
+  gTestBrowser.contentWindow.location = url;
+}
+
+function pageLoad() {
+  gTestBrowser.removeEventListener("load", pageLoad);
+  // The plugin events are async dispatched and can come after the load event
+  // This just allows the events to fire before we then go on to test the states
+  executeSoon(gNextTest);
+}
+
+function doOnOpenPageInfo(continuation) {
+  Services.obs.addObserver(pageInfoObserve, "page-info-dialog-loaded", false);
+  gNextTest = continuation;
+  // An explanation: it looks like the test harness complains about leaked
+  // windows if we don't keep a reference to every window we've opened.
+  // So, don't reuse pointers to opened Page Info windows - simply append
+  // to this list.
+  gPageInfo = BrowserPageInfo(null, "permTab");
+}
+
+function pageInfoObserve(win, topic, data) {
+  Services.obs.removeObserver(pageInfoObserve, "page-info-dialog-loaded");
+  executeSoon(gNextTest);
+}
+
+function finishTest() {
+  gPermissionManager.remove("127.0.0.1:8888", gTestPermissionString);
+  gPermissionManager.remove("127.0.0.1:8888", gSecondTestPermissionString);
+  Services.prefs.clearUserPref("plugins.click_to_play");
+  gBrowser.removeCurrentTab();
+  finish();
+}
+
+function test() {
+  waitForExplicitFinish();
+  Services.prefs.setBoolPref("plugins.click_to_play", true);
+  gBrowser.selectedTab = gBrowser.addTab();
+  gTestBrowser = gBrowser.selectedBrowser;
+  doOnPageLoad(gHttpTestRoot + "plugin_two_types.html", testPart1a);
+}
+
+// By default, everything should be click-to-play. So: no plugins should be
+// activated, and the radio buttons in Page Info should be "Always Ask"
+function testPart1a() {
+  let notification = PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser);
+  ok(notification, "part 1a: should have a click-to-play notification");
+  let test = gTestBrowser.contentDocument.getElementById("test");
+  let objLoadingContent = test.QueryInterface(Ci.nsIObjectLoadingContent);
+  ok(!objLoadingContent.activated, "part 1a: Test plugin should not be activated");
+  let secondtest = gTestBrowser.contentDocument.getElementById("secondtestA");
+  let objLoadingContent = secondtest.QueryInterface(Ci.nsIObjectLoadingContent);
+  ok(!objLoadingContent.activated, "part 1a: Second Test plugin should not be activated");
+
+  doOnOpenPageInfo(testPart1b);
+}
+
+function testPart1b() {
+  let testRadioGroup = gPageInfo.document.getElementById(gTestPermissionString + "RadioGroup");
+  let testRadioAsk = gPageInfo.document.getElementById(gTestPermissionString + "#0");
+  is(testRadioGroup.selectedItem, testRadioAsk, "part 1b: Test radio group should be set to 'Always Ask'");
+  let testRadioAllow = gPageInfo.document.getElementById(gTestPermissionString + "#1");
+  testRadioGroup.selectedItem = testRadioAllow;
+  testRadioAllow.doCommand();
+
+  let secondtestRadioGroup = gPageInfo.document.getElementById(gSecondTestPermissionString + "RadioGroup");
+  let secondtestRadioAsk = gPageInfo.document.getElementById(gSecondTestPermissionString + "#0");
+  is(secondtestRadioGroup.selectedItem, secondtestRadioAsk, "part 1b: Second Test radio group should be set to 'Always Ask'");
+
+  doOnPageLoad(gHttpTestRoot + "plugin_two_types.html", testPart2);
+}
+
+// Now, the Test plugin should be allowed.
+function testPart2() {
+  let notification = PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser);
+  ok(notification, "part 2: should have a click-to-play notification");
+  let test = gTestBrowser.contentDocument.getElementById("test");
+  let objLoadingContent = test.QueryInterface(Ci.nsIObjectLoadingContent);
+  ok(objLoadingContent.activated, "part 2: Test plugin should be activated");
+  let secondtest = gTestBrowser.contentDocument.getElementById("secondtestA");
+  let objLoadingContent = secondtest.QueryInterface(Ci.nsIObjectLoadingContent);
+  ok(!objLoadingContent.activated, "part 2: Second Test plugin should not be activated");
+
+  let testRadioGroup = gPageInfo.document.getElementById(gTestPermissionString + "RadioGroup");
+  let testRadioAllow = gPageInfo.document.getElementById(gTestPermissionString + "#1");
+  is(testRadioGroup.selectedItem, testRadioAllow, "part 2: Test radio group should be set to 'Allow'");
+  let testRadioBlock = gPageInfo.document.getElementById(gTestPermissionString + "#2");
+  testRadioGroup.selectedItem = testRadioBlock;
+  testRadioBlock.doCommand();
+
+  let secondtestRadioGroup = gPageInfo.document.getElementById(gSecondTestPermissionString + "RadioGroup");
+  let secondtestRadioAsk = gPageInfo.document.getElementById(gSecondTestPermissionString + "#0");
+  is(secondtestRadioGroup.selectedItem, secondtestRadioAsk, "part 2: Second Test radio group should be set to 'Always Ask'");
+  let secondtestRadioBlock = gPageInfo.document.getElementById(gSecondTestPermissionString + "#2");
+  secondtestRadioGroup.selectedItem = secondtestRadioBlock;
+  secondtestRadioBlock.doCommand();
+
+  doOnPageLoad(gHttpTestRoot + "plugin_two_types.html", testPart3);
+}
+
+// Now, all the things should be blocked
+function testPart3() {
+  let notification = PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser);
+  ok(!notification, "part 3: should not have a click-to-play notification");
+
+  let test = gTestBrowser.contentDocument.getElementById("test");
+  let objLoadingContent = test.QueryInterface(Ci.nsIObjectLoadingContent);
+  ok(!objLoadingContent.activated, "part 3: Test plugin should not be activated");
+  let overlay = gTestBrowser.contentDocument.getAnonymousElementByAttribute(test, "class", "mainBox");
+  ok(overlay.style.visibility == "hidden", "part 3: Test plugin should not have visible overlay");
+  let secondtest = gTestBrowser.contentDocument.getElementById("secondtestA");
+  let objLoadingContent = secondtest.QueryInterface(Ci.nsIObjectLoadingContent);
+  ok(!objLoadingContent.activated, "part 3: Second Test plugin should not be activated");
+  let overlay = gTestBrowser.contentDocument.getAnonymousElementByAttribute(secondtest, "class", "mainBox");
+  ok(overlay.style.visibility == "hidden", "part 3: Second Test plugin should not have visible overlay");
+
+  // reset permissions
+  gPermissionManager.remove("127.0.0.1:8888", gTestPermissionString);
+  gPermissionManager.remove("127.0.0.1:8888", gSecondTestPermissionString);
+  // check that changing the permissions affects the radio state in the
+  // open Page Info window
+  let testRadioGroup = gPageInfo.document.getElementById(gTestPermissionString + "RadioGroup");
+  let testRadioAsk = gPageInfo.document.getElementById(gTestPermissionString + "#0");
+  is(testRadioGroup.selectedItem, testRadioAsk, "part 3: Test radio group should be set to 'Ask'");
+  let secondtestRadioGroup = gPageInfo.document.getElementById(gSecondTestPermissionString + "RadioGroup");
+  let secondtestRadioAsk = gPageInfo.document.getElementById(gSecondTestPermissionString + "#0");
+  is(secondtestRadioGroup.selectedItem, secondtestRadioAsk, "part 3: Second Test radio group should be set to 'Always Ask'");
+
+  doOnPageLoad(gHttpTestRoot + "plugin_two_types.html", testPart4a);
+}
+
+// Now test that the popup notification influences Page Info
+function testPart4a() {
+  let notification = PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser);
+  ok(notification, "part 4a: should have a notification");
+  // simulate "always allow"
+  notification.secondaryActions[0].callback();
+
+  // check (again) that changing the permissions affects the radio state in the
+  // open Page Info window
+  let testRadioGroup = gPageInfo.document.getElementById(gTestPermissionString + "RadioGroup");
+  let testRadioAllow = gPageInfo.document.getElementById(gTestPermissionString + "#1");
+  is(testRadioGroup.selectedItem, testRadioAllow, "part 4a: Test radio group should be set to 'Allow'");
+  let secondtestRadioGroup = gPageInfo.document.getElementById(gSecondTestPermissionString + "RadioGroup");
+  let secondtestRadioAllow = gPageInfo.document.getElementById(gSecondTestPermissionString + "#1");
+  is(secondtestRadioGroup.selectedItem, secondtestRadioAllow, "part 4a: Second Test radio group should be set to 'Always Allow'");
+
+  // now close Page Info and see that it opens with the right settings
+  gPageInfo.close();
+  doOnOpenPageInfo(testPart4b);
+}
+
+// check that "always allow" resulted in the radio buttons getting set to allow
+function testPart4b() {
+  let testRadioGroup = gPageInfo.document.getElementById(gTestPermissionString + "RadioGroup");
+  let testRadioAllow = gPageInfo.document.getElementById(gTestPermissionString + "#1");
+  is(testRadioGroup.selectedItem, testRadioAllow, "part 4b: Test radio group should be set to 'Allow'");
+
+  let secondtestRadioGroup = gPageInfo.document.getElementById(gSecondTestPermissionString + "RadioGroup");
+  let secondtestRadioAllow = gPageInfo.document.getElementById(gSecondTestPermissionString + "#1");
+  is(secondtestRadioGroup.selectedItem, secondtestRadioAllow, "part 4b: Second Test radio group should be set to 'Allow'");
+
+  Services.prefs.setBoolPref("plugins.click_to_play", false);
+  gPageInfo.close();
+  doOnPageLoad(gHttpTestRoot + "plugin_two_types.html", testPart5a);
+}
+
+// check that if there are no click-to-play plugins, the plugin row is hidden
+function testPart5a() {
+  let notification = PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser);
+  ok(!notification, "part 5a: should not have a click-to-play notification");
+
+  doOnOpenPageInfo(testPart5b);
+}
+
+function testPart5b() {
+  ok(gPageInfo.document.getElementById("permPluginsRow").hidden, "part 5b: plugin permission row should be hidden");
+
+  gPageInfo.close();
+  setAndUpdateBlocklist(gHttpTestRoot + "blockPluginVulnerableUpdatable.xml",
+  function() {
+    doOnPageLoad(gHttpTestRoot + "plugin_test.html", testPart6a);
+  });
+}
+
+// check that if plugins.click_to_play is false, but there is a
+// click-to-play blocklisted plugin, we show the plugin row
+function testPart6a() {
+  let notification = PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser);
+  ok(notification, "part 6a: should have a click-to-play notification");
+
+  doOnOpenPageInfo(testPart6b);
+}
+
+function testPart6b() {
+  ok(!gPageInfo.document.getElementById("permPluginsRow").hidden, "part 6b: plugin permission row should not be hidden");
+
+  setAndUpdateBlocklist(gHttpTestRoot + "blockNoPlugins.xml",
+  function() {
+    resetBlocklist();
+    gPageInfo.close();
+    finishTest();
+  });
+}