diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-05-06 14:31:20 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-05-06 14:31:20 +0200 |
commit | 4b7a2c677a8bda717cbc21f8e06ee43c0d9f0005 (patch) | |
tree | ea479247696202858d088702ecd85b4163c4750a /dom/browser-element/mochitest | |
parent | 7d5f95a8e57de5255ad2767342c1f2392b6f261f (diff) | |
download | UXP-4b7a2c677a8bda717cbc21f8e06ee43c0d9f0005.tar UXP-4b7a2c677a8bda717cbc21f8e06ee43c0d9f0005.tar.gz UXP-4b7a2c677a8bda717cbc21f8e06ee43c0d9f0005.tar.lz UXP-4b7a2c677a8bda717cbc21f8e06ee43c0d9f0005.tar.xz UXP-4b7a2c677a8bda717cbc21f8e06ee43c0d9f0005.zip |
moebius#231: Consider blocking top level window data: URIs (tests)
https://github.com/MoonchildProductions/moebius/pull/231
Diffstat (limited to 'dom/browser-element/mochitest')
16 files changed, 19 insertions, 0 deletions
diff --git a/dom/browser-element/mochitest/browserElementTestHelpers.js b/dom/browser-element/mochitest/browserElementTestHelpers.js index 004b25333..8df1476ac 100644 --- a/dom/browser-element/mochitest/browserElementTestHelpers.js +++ b/dom/browser-element/mochitest/browserElementTestHelpers.js @@ -84,6 +84,10 @@ const browserElementTestHelpers = { this.unlockTestReady.bind(this)); }, + allowTopLevelDataURINavigation: function() { + this._setPref("security.data_uri.block_toplevel_data_uri_navigations", false); + }, + _observers: [], // This function is a wrapper which lets you register an observer to one of diff --git a/dom/browser-element/mochitest/browserElement_BrowserWindowResize.js b/dom/browser-element/mochitest/browserElement_BrowserWindowResize.js index 420b4bc34..65a777861 100644 --- a/dom/browser-element/mochitest/browserElement_BrowserWindowResize.js +++ b/dom/browser-element/mochitest/browserElement_BrowserWindowResize.js @@ -7,6 +7,7 @@ SimpleTest.waitForExplicitFinish(); browserElementTestHelpers.setEnabledPref(true); browserElementTestHelpers.addPermission(); +browserElementTestHelpers.allowTopLevelDataURINavigation(); function runTest() { var srcResizeTo = "data:text/html, \ diff --git a/dom/browser-element/mochitest/browserElement_Close.js b/dom/browser-element/mochitest/browserElement_Close.js index 57bdf384d..103805404 100644 --- a/dom/browser-element/mochitest/browserElement_Close.js +++ b/dom/browser-element/mochitest/browserElement_Close.js @@ -7,6 +7,7 @@ SimpleTest.waitForExplicitFinish(); browserElementTestHelpers.setEnabledPref(true); browserElementTestHelpers.addPermission(); +browserElementTestHelpers.allowTopLevelDataURINavigation(); function runTest() { var iframe = document.createElement('iframe'); diff --git a/dom/browser-element/mochitest/browserElement_ContextmenuEvents.js b/dom/browser-element/mochitest/browserElement_ContextmenuEvents.js index 66aa8e015..a8c361ebd 100644 --- a/dom/browser-element/mochitest/browserElement_ContextmenuEvents.js +++ b/dom/browser-element/mochitest/browserElement_ContextmenuEvents.js @@ -4,6 +4,7 @@ SimpleTest.waitForExplicitFinish(); browserElementTestHelpers.setEnabledPref(true); browserElementTestHelpers.setClipboardPlainTextOnlyPref(false); browserElementTestHelpers.addPermission(); +browserElementTestHelpers.allowTopLevelDataURINavigation(); var audioUrl = 'http://mochi.test:8888/tests/dom/browser-element/mochitest/audio.ogg'; var videoUrl = 'http://mochi.test:8888/tests/dom/browser-element/mochitest/short-video.ogv'; diff --git a/dom/browser-element/mochitest/browserElement_CopyPaste.js b/dom/browser-element/mochitest/browserElement_CopyPaste.js index b23feef59..97a37be8b 100644 --- a/dom/browser-element/mochitest/browserElement_CopyPaste.js +++ b/dom/browser-element/mochitest/browserElement_CopyPaste.js @@ -9,6 +9,7 @@ SimpleTest.requestFlakyTimeout("untriaged"); browserElementTestHelpers.setEnabledPref(true); browserElementTestHelpers.setupAccessibleCaretPref(); browserElementTestHelpers.addPermission(); +browserElementTestHelpers.allowTopLevelDataURINavigation(); const { Services } = SpecialPowers.Cu.import('resource://gre/modules/Services.jsm'); var gTextarea = null; diff --git a/dom/browser-element/mochitest/browserElement_DataURI.js b/dom/browser-element/mochitest/browserElement_DataURI.js index f57f4566a..d31678f89 100644 --- a/dom/browser-element/mochitest/browserElement_DataURI.js +++ b/dom/browser-element/mochitest/browserElement_DataURI.js @@ -7,6 +7,7 @@ SimpleTest.waitForExplicitFinish(); browserElementTestHelpers.setEnabledPref(true); browserElementTestHelpers.addPermission(); +browserElementTestHelpers.allowTopLevelDataURINavigation(); function runTest() { var iframe1 = document.createElement('iframe'); diff --git a/dom/browser-element/mochitest/browserElement_Iconchange.js b/dom/browser-element/mochitest/browserElement_Iconchange.js index 367a2de15..283331d3c 100644 --- a/dom/browser-element/mochitest/browserElement_Iconchange.js +++ b/dom/browser-element/mochitest/browserElement_Iconchange.js @@ -7,6 +7,7 @@ SimpleTest.waitForExplicitFinish(); browserElementTestHelpers.setEnabledPref(true); browserElementTestHelpers.addPermission(); +browserElementTestHelpers.allowTopLevelDataURINavigation(); function createHtml(link) { return 'data:text/html,<html><head>' + link + '<body></body></html>'; diff --git a/dom/browser-element/mochitest/browserElement_Manifestchange.js b/dom/browser-element/mochitest/browserElement_Manifestchange.js index 22cf8fe7c..5b3733d14 100644 --- a/dom/browser-element/mochitest/browserElement_Manifestchange.js +++ b/dom/browser-element/mochitest/browserElement_Manifestchange.js @@ -7,6 +7,7 @@ SimpleTest.waitForExplicitFinish(); browserElementTestHelpers.setEnabledPref(true); browserElementTestHelpers.addPermission(); +browserElementTestHelpers.allowTopLevelDataURINavigation(); function createHtml(manifest) { return 'data:text/html,<html xmlns:xml="http://www.w3.org/XML/1998/namespace"><head>' + manifest + '<body></body></html>'; diff --git a/dom/browser-element/mochitest/browserElement_Metachange.js b/dom/browser-element/mochitest/browserElement_Metachange.js index 7789a3e18..53c8d2397 100644 --- a/dom/browser-element/mochitest/browserElement_Metachange.js +++ b/dom/browser-element/mochitest/browserElement_Metachange.js @@ -7,6 +7,7 @@ SimpleTest.waitForExplicitFinish(); browserElementTestHelpers.setEnabledPref(true); browserElementTestHelpers.addPermission(); +browserElementTestHelpers.allowTopLevelDataURINavigation(); function createHtml(meta) { return 'data:text/html,<html xmlns:xml="http://www.w3.org/XML/1998/namespace"><head>' + meta + '<body></body></html>'; diff --git a/dom/browser-element/mochitest/browserElement_Opensearch.js b/dom/browser-element/mochitest/browserElement_Opensearch.js index 8df44d2a9..5762e6f0e 100644 --- a/dom/browser-element/mochitest/browserElement_Opensearch.js +++ b/dom/browser-element/mochitest/browserElement_Opensearch.js @@ -7,6 +7,7 @@ SimpleTest.waitForExplicitFinish(); browserElementTestHelpers.setEnabledPref(true); browserElementTestHelpers.addPermission(); +browserElementTestHelpers.allowTopLevelDataURINavigation(); function createHtml(link) { return 'data:text/html,<html><head>' + link + '<body></body></html>'; diff --git a/dom/browser-element/mochitest/browserElement_PromptCheck.js b/dom/browser-element/mochitest/browserElement_PromptCheck.js index d6edde09f..952f4468e 100644 --- a/dom/browser-element/mochitest/browserElement_PromptCheck.js +++ b/dom/browser-element/mochitest/browserElement_PromptCheck.js @@ -13,6 +13,7 @@ SimpleTest.waitForExplicitFinish(); browserElementTestHelpers.setEnabledPref(true); browserElementTestHelpers.addPermission(); +browserElementTestHelpers.allowTopLevelDataURINavigation(); function runTest() { diff --git a/dom/browser-element/mochitest/browserElement_PromptConfirm.js b/dom/browser-element/mochitest/browserElement_PromptConfirm.js index c01836a25..b920a6d26 100644 --- a/dom/browser-element/mochitest/browserElement_PromptConfirm.js +++ b/dom/browser-element/mochitest/browserElement_PromptConfirm.js @@ -11,6 +11,7 @@ SimpleTest.waitForExplicitFinish(); browserElementTestHelpers.setEnabledPref(true); browserElementTestHelpers.addPermission(); +browserElementTestHelpers.allowTopLevelDataURINavigation(); function runTest() { var iframe = document.createElement('iframe'); diff --git a/dom/browser-element/mochitest/browserElement_RemoveBrowserElement.js b/dom/browser-element/mochitest/browserElement_RemoveBrowserElement.js index 583d58734..3ab206388 100644 --- a/dom/browser-element/mochitest/browserElement_RemoveBrowserElement.js +++ b/dom/browser-element/mochitest/browserElement_RemoveBrowserElement.js @@ -9,6 +9,7 @@ SimpleTest.waitForExplicitFinish(); browserElementTestHelpers.setEnabledPref(true); browserElementTestHelpers.addPermission(); +browserElementTestHelpers.allowTopLevelDataURINavigation(); function runTest() { var iframe = document.createElement('iframe'); diff --git a/dom/browser-element/mochitest/browserElement_ScrollEvent.js b/dom/browser-element/mochitest/browserElement_ScrollEvent.js index 06dc91b86..5230c524a 100644 --- a/dom/browser-element/mochitest/browserElement_ScrollEvent.js +++ b/dom/browser-element/mochitest/browserElement_ScrollEvent.js @@ -7,6 +7,7 @@ SimpleTest.waitForExplicitFinish(); browserElementTestHelpers.setEnabledPref(true); browserElementTestHelpers.addPermission(); +browserElementTestHelpers.allowTopLevelDataURINavigation(); function runTest() { var iframe = document.createElement('iframe'); diff --git a/dom/browser-element/mochitest/browserElement_Titlechange.js b/dom/browser-element/mochitest/browserElement_Titlechange.js index 78c939ad8..145e9baa8 100644 --- a/dom/browser-element/mochitest/browserElement_Titlechange.js +++ b/dom/browser-element/mochitest/browserElement_Titlechange.js @@ -7,6 +7,7 @@ SimpleTest.waitForExplicitFinish(); browserElementTestHelpers.setEnabledPref(true); browserElementTestHelpers.addPermission(); +browserElementTestHelpers.allowTopLevelDataURINavigation(); function runTest() { var iframe1 = document.createElement('iframe'); diff --git a/dom/browser-element/mochitest/browserElement_TopBarrier.js b/dom/browser-element/mochitest/browserElement_TopBarrier.js index 3bd68854c..186622b33 100644 --- a/dom/browser-element/mochitest/browserElement_TopBarrier.js +++ b/dom/browser-element/mochitest/browserElement_TopBarrier.js @@ -7,6 +7,7 @@ SimpleTest.waitForExplicitFinish(); browserElementTestHelpers.setEnabledPref(true); browserElementTestHelpers.addPermission(); +browserElementTestHelpers.allowTopLevelDataURINavigation(); var iframe; function runTest() { |