Bug 1381755: Updating the data: URI inheritance security model renders test browser_CTP_data_urls.js superfluous. r=bsmedberg
authorChristoph Kerschbaumer <ckerschb@christophkerschbaumer.com>
Mon, 24 Jul 2017 20:34:29 +0200
changeset 419466 44bd18fcb2e8481a40f7b8fd8d1915ae5755a744
parent 419465 1dea32a148a9bf79a83dae48a3ef46fb36ce1e99
child 419467 e86441746f45f15a2963ad7112cc50a6709371d4
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs1381755
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1381755: Updating the data: URI inheritance security model renders test browser_CTP_data_urls.js superfluous. r=bsmedberg
browser/base/content/test/plugins/browser.ini
browser/base/content/test/plugins/browser_CTP_data_urls.js
browser/base/content/test/plugins/plugin_data_url.html
testing/runtimes/mochitest-browser-chrome-e10s.runtimes.json
testing/runtimes/mochitest-browser-chrome.runtimes.json
--- a/browser/base/content/test/plugins/browser.ini
+++ b/browser/base/content/test/plugins/browser.ini
@@ -17,17 +17,16 @@ support-files =
   plugin_both2.html
   plugin_bug744745.html
   plugin_bug749455.html
   plugin_bug787619.html
   plugin_bug797677.html
   plugin_bug820497.html
   plugin_clickToPlayAllow.html
   plugin_clickToPlayDeny.html
-  plugin_data_url.html
   plugin_favorfallback.html
   plugin_hidden_to_visible.html
   plugin_iframe.html
   plugin_outsideScrollArea.html
   plugin_overlayed.html
   plugin_positioned.html
   plugin_simple_blank.swf
   plugin_small.html
@@ -53,18 +52,16 @@ tags = blocklist
 [browser_clearplugindata.js]
 tags = blocklist
 [browser_CTP_context_menu.js]
 skip-if = toolkit == "gtk2" || toolkit == "gtk3"   # fails intermittently on Linux (bug 909342)
 tags = blocklist
 [browser_CTP_crashreporting.js]
 skip-if = !crashreporter
 tags = blocklist
-[browser_CTP_data_urls.js]
-tags = blocklist
 [browser_CTP_drag_drop.js]
 tags = blocklist
 [browser_CTP_favorfallback.js]
 [browser_CTP_hide_overlay.js]
 tags = blocklist
 [browser_CTP_iframe.js]
 tags = blocklist
 [browser_CTP_multi_allow.js]
deleted file mode 100644
--- a/browser/base/content/test/plugins/browser_CTP_data_urls.js
+++ /dev/null
@@ -1,255 +0,0 @@
-var rootDir = getRootDirectory(gTestPath);
-const gTestRoot = rootDir.replace("chrome://mochitests/content/", "http://127.0.0.1:8888/");
-var gPluginHost = Components.classes["@mozilla.org/plugin/host;1"].getService(Components.interfaces.nsIPluginHost);
-var gTestBrowser = null;
-
-add_task(async function() {
-  registerCleanupFunction(function() {
-    clearAllPluginPermissions();
-    setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in");
-    setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Second Test Plug-in");
-    Services.prefs.clearUserPref("plugins.click_to_play");
-    Services.prefs.clearUserPref("extensions.blocklist.suppressUI");
-    gBrowser.removeCurrentTab();
-    window.focus();
-    gTestBrowser = null;
-  });
-
-  gBrowser.selectedTab =  BrowserTestUtils.addTab(gBrowser);
-  gTestBrowser = gBrowser.selectedBrowser;
-
-  Services.prefs.setBoolPref("plugins.click_to_play", true);
-  Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true);
-
-  setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Test Plug-in");
-  setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Second Test Plug-in");
-});
-
-// Test that the click-to-play doorhanger still works when navigating to data URLs
-add_task(async function() {
-  await promiseTabLoadEvent(gBrowser.selectedTab, gTestRoot + "plugin_data_url.html");
-
-  // Work around for delayed PluginBindingAttached
-  await promiseUpdatePluginBindings(gTestBrowser);
-
-  let popupNotification = PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser);
-  ok(popupNotification, "Test 1a, Should have a click-to-play notification");
-
-  let pluginInfo = await promiseForPluginInfo("test");
-  ok(!pluginInfo.activated, "Test 1a, plugin should not be activated");
-
-  let loadPromise = promiseTabLoadEvent(gBrowser.selectedTab);
-  await ContentTask.spawn(gTestBrowser, {}, async function() {
-    // navigate forward to a page with 'test' in it
-    content.document.getElementById("data-link-1").click();
-  });
-  await loadPromise;
-
-  // Work around for delayed PluginBindingAttached
-  await promiseUpdatePluginBindings(gTestBrowser);
-
-  popupNotification = PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser);
-  ok(popupNotification, "Test 1b, Should have a click-to-play notification");
-
-  pluginInfo = await promiseForPluginInfo("test");
-  ok(!pluginInfo.activated, "Test 1b, plugin should not be activated");
-
-  let promise = promisePopupNotification("click-to-play-plugins");
-  await ContentTask.spawn(gTestBrowser, {}, async function() {
-    let plugin = content.document.getElementById("test");
-    let bounds = plugin.getBoundingClientRect();
-    let left = (bounds.left + bounds.right) / 2;
-    let top = (bounds.top + bounds.bottom) / 2;
-    let utils = content.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
-                       .getInterface(Components.interfaces.nsIDOMWindowUtils);
-    utils.sendMouseEvent("mousedown", left, top, 0, 1, 0, false, 0, 0);
-    utils.sendMouseEvent("mouseup", left, top, 0, 1, 0, false, 0, 0);
-  });
-  await promise;
-
-  // Simulate clicking the "Allow Always" button.
-  let condition = () => !PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser).dismissed &&
-    PopupNotifications.panel.firstChild;
-  await promiseForCondition(condition);
-  PopupNotifications.panel.firstChild._primaryButton.click();
-
-  // check plugin state
-  pluginInfo = await promiseForPluginInfo("test");
-  ok(pluginInfo.activated, "Test 1b, plugin should be activated");
-});
-
-// Test that the click-to-play notification doesn't break when navigating
-// to data URLs with multiple plugins.
-add_task(async function() {
-  // We click activated above
-  clearAllPluginPermissions();
-
-  await promiseTabLoadEvent(gBrowser.selectedTab, gTestRoot + "plugin_data_url.html");
-
-  // Work around for delayed PluginBindingAttached
-  await promiseUpdatePluginBindings(gTestBrowser);
-
-  let notification = PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser);
-  ok(notification, "Test 2a, Should have a click-to-play notification");
-
-  let pluginInfo = await promiseForPluginInfo("test");
-  ok(!pluginInfo.activated, "Test 2a, plugin should not be activated");
-
-  let loadPromise = promiseTabLoadEvent(gBrowser.selectedTab);
-  await ContentTask.spawn(gTestBrowser, {}, async function() {
-    // navigate forward to a page with 'test1' & 'test2' in it
-    content.document.getElementById("data-link-2").click();
-  });
-  await loadPromise;
-
-  // Work around for delayed PluginBindingAttached
-  await ContentTask.spawn(gTestBrowser, {}, async function() {
-    content.document.getElementById("test1").clientTop;
-    content.document.getElementById("test2").clientTop;
-  });
-
-  pluginInfo = await promiseForPluginInfo("test1");
-  ok(!pluginInfo.activated, "Test 2a, test1 should not be activated");
-  pluginInfo = await promiseForPluginInfo("test2");
-  ok(!pluginInfo.activated, "Test 2a, test2 should not be activated");
-
-  notification = PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser);
-  ok(notification, "Test 2b, Should have a click-to-play notification");
-
-  await promiseForNotificationShown(notification);
-
-  // Simulate choosing "Allow now" for the test plugin
-  is(notification.options.pluginData.size, 2, "Test 2b, Should have two types of plugin in the notification");
-
-  let centerAction = null;
-  for (let action of notification.options.pluginData.values()) {
-    if (action.pluginName == "Test") {
-      centerAction = action;
-      break;
-    }
-  }
-  ok(centerAction, "Test 2b, found center action for the Test plugin");
-
-  let centerItem = null;
-  for (let item of PopupNotifications.panel.firstChild.childNodes) {
-    is(item.value, "block", "Test 2b, all plugins should start out blocked");
-    if (item.action == centerAction) {
-      centerItem = item;
-      break;
-    }
-  }
-  ok(centerItem, "Test 2b, found center item for the Test plugin");
-
-  // "click" the button to activate the Test plugin
-  centerItem.value = "allownow";
-  PopupNotifications.panel.firstChild._primaryButton.click();
-
-  // Work around for delayed PluginBindingAttached
-  await promiseUpdatePluginBindings(gTestBrowser);
-
-  // check plugin state
-  pluginInfo = await promiseForPluginInfo("test1");
-  ok(pluginInfo.activated, "Test 2b, plugin should be activated");
-});
-
-add_task(async function() {
-  // We click activated above
-  clearAllPluginPermissions();
-
-  await promiseTabLoadEvent(gBrowser.selectedTab, gTestRoot + "plugin_data_url.html");
-
-  // Work around for delayed PluginBindingAttached
-  await promiseUpdatePluginBindings(gTestBrowser);
-});
-
-// Test that when navigating to a data url, the plugin permission is inherited
-add_task(async function() {
-  let notification = PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser);
-  ok(notification, "Test 3a, Should have a click-to-play notification");
-
-  // check plugin state
-  let pluginInfo = await promiseForPluginInfo("test");
-  ok(!pluginInfo.activated, "Test 3a, plugin should not be activated");
-
-  let promise = promisePopupNotification("click-to-play-plugins");
-  await ContentTask.spawn(gTestBrowser, {}, async function() {
-    let plugin = content.document.getElementById("test");
-    let bounds = plugin.getBoundingClientRect();
-    let left = (bounds.left + bounds.right) / 2;
-    let top = (bounds.top + bounds.bottom) / 2;
-    let utils = content.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
-                       .getInterface(Components.interfaces.nsIDOMWindowUtils);
-    utils.sendMouseEvent("mousedown", left, top, 0, 1, 0, false, 0, 0);
-    utils.sendMouseEvent("mouseup", left, top, 0, 1, 0, false, 0, 0);
-  });
-  await promise;
-
-  // Simulate clicking the "Allow Always" button.
-  let condition = () => !PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser).dismissed &&
-    PopupNotifications.panel.firstChild;
-  await promiseForCondition(condition);
-  PopupNotifications.panel.firstChild._primaryButton.click();
-
-  // check plugin state
-  pluginInfo = await promiseForPluginInfo("test");
-  ok(pluginInfo.activated, "Test 3a, plugin should be activated");
-
-  let loadPromise = promiseTabLoadEvent(gBrowser.selectedTab);
-  await ContentTask.spawn(gTestBrowser, {}, async function() {
-    // navigate forward to a page with 'test' in it
-    content.document.getElementById("data-link-1").click();
-  });
-  await loadPromise;
-
-  // Work around for delayed PluginBindingAttached
-  await promiseUpdatePluginBindings(gTestBrowser);
-
-  // check plugin state
-  pluginInfo = await promiseForPluginInfo("test");
-  ok(pluginInfo.activated, "Test 3b, plugin should be activated");
-
-  clearAllPluginPermissions();
-});
-
-// Test that the click-to-play doorhanger still works
-// when directly navigating to data URLs.
-// Fails, bug XXX. Plugins plus a data url don't fire a load event.
-/*
-add_task(function* () {
-  yield promiseTabLoadEvent(gBrowser.selectedTab,
-   "data:text/html,Hi!<embed id='test' style='width:200px; height:200px' type='application/x-test'/>");
-
-  // Work around for delayed PluginBindingAttached
-  yield promiseUpdatePluginBindings(gTestBrowser);
-
-  let notification = PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser);
-  ok(notification, "Test 4a, Should have a click-to-play notification");
-
-  // check plugin state
-  let pluginInfo = yield promiseForPluginInfo("test");
-  ok(!pluginInfo.activated, "Test 4a, plugin should not be activated");
-
-  let promise = promisePopupNotification("click-to-play-plugins");
-  yield ContentTask.spawn(gTestBrowser, {}, function* () {
-    let plugin = content.document.getElementById("test");
-    let bounds = plugin.getBoundingClientRect();
-    let left = (bounds.left + bounds.right) / 2;
-    let top = (bounds.top + bounds.bottom) / 2;
-    let utils = content.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
-                       .getInterface(Components.interfaces.nsIDOMWindowUtils);
-    utils.sendMouseEvent("mousedown", left, top, 0, 1, 0, false, 0, 0);
-    utils.sendMouseEvent("mouseup", left, top, 0, 1, 0, false, 0, 0);
-  });
-  yield promise;
-
-  // Simulate clicking the "Allow Always" button.
-  let condition = () => !PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser).dismissed &&
-    PopupNotifications.panel.firstChild;
-  yield promiseForCondition(condition);
-  PopupNotifications.panel.firstChild._primaryButton.click();
-
-  // check plugin state
-  pluginInfo = yield promiseForPluginInfo("test");
-  ok(pluginInfo.activated, "Test 4a, plugin should be activated");
-});
-*/
deleted file mode 100644
--- a/browser/base/content/test/plugins/plugin_data_url.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<html>
-<body>
-  <a id="data-link-1" href='data:text/html,<embed id="test" style="width: 200px; height: 200px" type="application/x-test"/>'>
-    data: with one plugin
-  </a><br />
-  <a id="data-link-2" href='data:text/html,<embed id="test1" style="width: 200px; height: 200px" type="application/x-test"/><embed id="test2" style="width: 200px; height: 200px" type="application/x-second-test"/>'>
-    data: with two plugins
-  </a><br />
-  <object id="test" style="width: 200px; height: 200px" type="application/x-test"></object>
-</body>
-</html>
--- a/testing/runtimes/mochitest-browser-chrome-e10s.runtimes.json
+++ b/testing/runtimes/mochitest-browser-chrome-e10s.runtimes.json
@@ -136,17 +136,16 @@
     "browser/base/content/test/newtab/browser_newtab_block.js": 4959, 
     "browser/base/content/test/newtab/browser_newtab_bug1194895.js": 7308, 
     "browser/base/content/test/newtab/browser_newtab_drag_drop.js": 4697, 
     "browser/base/content/test/newtab/browser_newtab_drag_drop_ext.js": 6606, 
     "browser/base/content/test/newtab/browser_newtab_enhanced.js": 4411, 
     "browser/base/content/test/newtab/browser_newtab_perwindow_private_browsing.js": 2913, 
     "browser/base/content/test/newtab/browser_newtab_unpin.js": 3032, 
     "browser/base/content/test/plugins/browser_CTP_crashreporting.js": 4878, 
-    "browser/base/content/test/plugins/browser_CTP_data_urls.js": 4053, 
     "browser/base/content/test/plugins/browser_CTP_drag_drop.js": 5737, 
     "browser/base/content/test/plugins/browser_CTP_notificationBar.js": 4802, 
     "browser/base/content/test/plugins/browser_CTP_remove_navigate.js": 3322, 
     "browser/base/content/test/plugins/browser_blocking.js": 9383, 
     "browser/base/content/test/plugins/browser_blocklist_content.js": 3661, 
     "browser/base/content/test/plugins/browser_iterate_hidden_plugins.js": 5033, 
     "browser/base/content/test/plugins/browser_pageInfo_plugins.js": 4977, 
     "browser/base/content/test/plugins/browser_pluginCrashCommentAndURL.js": 4166, 
--- a/testing/runtimes/mochitest-browser-chrome.runtimes.json
+++ b/testing/runtimes/mochitest-browser-chrome.runtimes.json
@@ -152,17 +152,16 @@
     "browser/base/content/test/newtab/browser_newtab_bug1194895.js": 7375, 
     "browser/base/content/test/newtab/browser_newtab_drag_drop.js": 4524, 
     "browser/base/content/test/newtab/browser_newtab_drag_drop_ext.js": 10077, 
     "browser/base/content/test/newtab/browser_newtab_enhanced.js": 4317, 
     "browser/base/content/test/newtab/browser_newtab_intro.js": 2152, 
     "browser/base/content/test/newtab/browser_newtab_perwindow_private_browsing.js": 2984, 
     "browser/base/content/test/newtab/browser_newtab_unpin.js": 2896, 
     "browser/base/content/test/plugins/browser_CTP_crashreporting.js": 4623, 
-    "browser/base/content/test/plugins/browser_CTP_data_urls.js": 3580, 
     "browser/base/content/test/plugins/browser_CTP_drag_drop.js": 5004, 
     "browser/base/content/test/plugins/browser_CTP_notificationBar.js": 4726, 
     "browser/base/content/test/plugins/browser_CTP_outsideScrollArea.js": 2057, 
     "browser/base/content/test/plugins/browser_CTP_remove_navigate.js": 2607, 
     "browser/base/content/test/plugins/browser_CTP_zoom.js": 2497, 
     "browser/base/content/test/plugins/browser_blocking.js": 8859, 
     "browser/base/content/test/plugins/browser_bug743421.js": 1953, 
     "browser/base/content/test/plugins/browser_clearplugindata.js": 1970,