summaryrefslogtreecommitdiffstats
path: root/docshell/test/navigation/test_triggeringprincipal_window_open.html
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-05-06 14:31:20 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-05-06 14:31:20 +0200
commit4b7a2c677a8bda717cbc21f8e06ee43c0d9f0005 (patch)
treeea479247696202858d088702ecd85b4163c4750a /docshell/test/navigation/test_triggeringprincipal_window_open.html
parent7d5f95a8e57de5255ad2767342c1f2392b6f261f (diff)
downloadUXP-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 'docshell/test/navigation/test_triggeringprincipal_window_open.html')
-rw-r--r--docshell/test/navigation/test_triggeringprincipal_window_open.html28
1 files changed, 3 insertions, 25 deletions
diff --git a/docshell/test/navigation/test_triggeringprincipal_window_open.html b/docshell/test/navigation/test_triggeringprincipal_window_open.html
index d5d7f210b..dbee21777 100644
--- a/docshell/test/navigation/test_triggeringprincipal_window_open.html
+++ b/docshell/test/navigation/test_triggeringprincipal_window_open.html
@@ -13,8 +13,7 @@
/* We call window.open() using different URIs and make sure the triggeringPrincipal
* loadingPrincipal are correct.
* Test1: window.open(http:)
- * Test2: window.open(data:)
- * Test3: window.open(javascript:)
+ * Test2: window.open(javascript:)
*/
const TRIGGERING_PRINCIPAL_URI =
@@ -22,7 +21,7 @@ const TRIGGERING_PRINCIPAL_URI =
SimpleTest.waitForExplicitFinish();
-const NUM_TESTS = 3;
+const NUM_TESTS = 2;
var test_counter = 0;
function checkFinish() {
@@ -54,28 +53,7 @@ httpWin.onload = function() {
}
// ----------------------------------------------------------------------------
-// Test 2: window.open(data:)
-var dataWin = window.open("data:text/html,<html><body>data</body></html>", "_blank", "width=10,height=10");
-dataWin.onload = function() {
- var dataChannel = SpecialPowers.wrap(dataWin.document).docShell.currentDocumentChannel;
- var dataTriggeringPrincipal = dataChannel.loadInfo.triggeringPrincipal.URI.asciiSpec;
- var dataLoadingPrincipal = dataChannel.loadInfo.loadingPrincipal;
-
- is(dataTriggeringPrincipal, TRIGGERING_PRINCIPAL_URI,
- "TriggeringPrincipal for window.open(data:) should be the principal of the document");
-
- is(dataWin.document.referrer, "",
- "Referrer for window.open(data:) should be empty");
-
- is(dataLoadingPrincipal, null,
- "LoadingPrincipal for window.open(data:) should be null");
-
- dataWin.close();
- checkFinish();
-}
-
-// ----------------------------------------------------------------------------
-// Test 3: window.open(javascript:)
+// Test 2: window.open(javascript:)
var jsWin = window.open("javascript:'<html><body>js</body></html>';", "_blank", "width=10,height=10");
jsWin.onload = function() {
var jsChannel = SpecialPowers.wrap(jsWin.document).docShell.currentDocumentChannel;