Bug 1397655 - Update tests within dom/ to comply with new toplevel data: URI navigation policy. r=smaug

This commit is contained in:
Christoph Kerschbaumer 2017-09-10 13:24:07 +02:00
parent 84764f515b
commit 9048e3f216
18 changed files with 40 additions and 13 deletions

View File

@ -12,6 +12,12 @@ support-files =
file_bug1011748_OK.sjs
file_bug1303838.html
file_bug1303838_target.html
file_bug1303838_target_foo.html
file_bug1303838_target_bar.html
file_bug1303838_target_baz.html
file_bug1303838_target_ifoo.html
file_bug1303838_target_ibar.html
file_bug1303838_target_ibaz.html
file_bug1303838_with_iframe.html
file_messagemanager_unload.html
file_pluginAudio.html

View File

@ -8,15 +8,15 @@ Tests for tab switching on link clicks.
<title>Tests for tab switching on link clicks.</title>
</head>
<body>
<a id="link-1" target="testTab" href="data:text/html;charset=utf-8,foo">Link 1</a><br>
<a id="link-2" target="testTab" href="data:text/html;charset=utf-8,bar">Link 2</a><br>
<a id="link-3" target="testTab" href="data:text/html;charset=utf-8,baz">Link 3</a><br>
<a id="link-1" target="testTab" href="file_bug1303838_target_foo.html">Link 1</a><br>
<a id="link-2" target="testTab" href="file_bug1303838_target_bar.html">Link 2</a><br>
<a id="link-3" target="testTab" href="file_bug1303838_target_baz.html">Link 3</a><br>
<a id="link-4" target="testTab" href="file_bug1303838_target.html">Link 4</a><br>
<a id="anchor-link-1" target="testTab" href="file_bug1303838_target.html#foo">Anchor Link 1</a><br>
<a id="anchor-link-2" target="testTab" href="file_bug1303838_target.html#bar">Anchor Link 2</a><br>
<a id="anchor-link-3" target="testTab" href="file_bug1303838_target.html#baz">Anchor Link 3</a><br>
<a id="frame-link-1" target="testFrame" href="data:text/html;charset=utf-8,ifoo">Frame Link 1</a><br>
<a id="frame-link-2" target="testFrame" href="data:text/html;charset=utf-8,ibar">Frame Link 2</a><br>
<a id="frame-link-3" target="testFrame" href="data:text/html;charset=utf-8,ibaz">Frame Link 3</a><br>
<a id="frame-link-1" target="testFrame" href="file_bug1303838_target_ifoo.html">Frame Link 1</a><br>
<a id="frame-link-2" target="testFrame" href="file_bug1303838_target_ibar.html">Frame Link 2</a><br>
<a id="frame-link-3" target="testFrame" href="file_bug1303838_target_ibaz.html">Frame Link 3</a><br>
</body>
</html>

View File

@ -0,0 +1 @@
<html><body>bar</body></html>

View File

@ -0,0 +1 @@
<html><body>baz</body></html>

View File

@ -0,0 +1 @@
<html><body>foo</body></html>

View File

@ -0,0 +1 @@
<html><body>ibar</body></html>

View File

@ -0,0 +1 @@
<html><body>ibaz</body></html>

View File

@ -0,0 +1 @@
<html><body>ifoo</body></html>

View File

@ -15,8 +15,10 @@
SimpleTest.waitForExplicitFinish();
SpecialPowers.setBoolPref("security.data_uri.unique_opaque_origin", true);
SpecialPowers.setBoolPref("security.data_uri.block_toplevel_data_uri_navigations", false);
SimpleTest.registerCleanupFunction(() => {
SpecialPowers.clearUserPref("security.data_uri.unique_opaque_origin");
SpecialPowers.clearUserPref("security.data_uri.block_toplevel_data_uri_navigations");
});
function imgListener(img) {

View File

@ -175,7 +175,11 @@ var testFrameNotLoadedInDataURI = function() {
SimpleTest.waitForExplicitFinish();
// load the test harness
document.getElementById("harness").src = "file_x-frame-options_main.html";
SpecialPowers.pushPrefEnv({
"set": [["security.data_uri.block_toplevel_data_uri_navigations", false],]
}, function() {
document.getElementById("harness").src = "file_x-frame-options_main.html";
});
</script>
</pre>

View File

@ -0,0 +1 @@
<!DOCTYPE HTML><html><body></body></html>

View File

@ -18,6 +18,7 @@ support-files =
[test_blobURL_expiring.html]
[test_file_from_blob.html]
[test_ipc_messagemanager_blob.html]
support-files = file_ipc_messagemanager_blob.html
[test_nonascii_blob_url.html]
[test_file_negative_date.html]
[test_fileapi.html]

View File

@ -14,8 +14,7 @@
SimpleTest.waitForExplicitFinish();
const childFrameURL =
"data:text/html,<!DOCTYPE HTML><html><body></body></html>";
const childFrameURL = "file_ipc_messagemanager_blob.html";
function childFrameScript() {
"use strict";

View File

@ -37,7 +37,8 @@ addLoadEvent(function () {
["full-screen-api.unprefix.enabled", true],
["full-screen-api.allow-trusted-requests-only", false],
// Use legacy data: URI behavior to run test.
["security.data_uri.unique_opaque_origin", false]
["security.data_uri.unique_opaque_origin", false],
["security.data_uri.block_toplevel_data_uri_navigations", false],
]
}, next);
});

View File

@ -0,0 +1 @@
<!DOCTYPE HTML><html><body></body></html>

View File

@ -12,6 +12,7 @@ skip-if = e10s
# This test is only supposed to run in the main process
skip-if = e10s || toolkit == 'android'
[test_cpow_cookies.html]
support-files = file_cpow_cookies.html
[test_child_docshell.html]
skip-if = toolkit == 'cocoa' # disabled due to hangs, see changeset 6852e7c47edf
[test_CrashService_crash.html]

View File

@ -14,8 +14,7 @@
SimpleTest.waitForExplicitFinish();
const childFrameURL =
"data:text/html,<!DOCTYPE HTML><html><body></body></html>";
const childFrameURL = "file_cpow_cookies.html";
function childFrameScript() {
"use strict";

View File

@ -13,7 +13,7 @@ Tests for plugin stream error conditions.
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css" />
</head>
<body onload="runNextTest()">
<body onload="startTests()">
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=517078">
Mozilla Bug 517078</a> - Plugin Stream Error Tests
<p id="display"></p>
@ -161,6 +161,12 @@ function continueTest() {
index++;
}
function startTests() {
SpecialPowers.pushPrefEnv({"set": [
["security.data_uri.block_toplevel_data_uri_navigations", false],
]}, runNextTest);
}
</script>
</div>
</body>