Backed out changeset 0a3fa6d853a6 (bug 915824) for effectively re-enabling tests that were disabled on B2G.

CLOSED TREE

--HG--
rename : content/base/test/csp/file_csp_report.sjs => content/base/test/file_bug548193.sjs
rename : content/base/test/csp/file_policyuri_async_fetch.html => content/base/test/file_bug558431.html
rename : content/base/test/csp/file_policyuri_async_fetch.html^headers^ => content/base/test/file_bug558431.html^headers^
rename : content/base/test/csp/file_redirect_content.sjs => content/base/test/file_bug650386_content.sjs
rename : content/base/test/csp/file_redirect_report.sjs => content/base/test/file_bug650386_report.sjs
rename : content/base/test/csp/file_subframe_run_js_if_allowed.html => content/base/test/file_bug702439.html
rename : content/base/test/csp/file_multi_policy_injection_bypass.html => content/base/test/file_bug717511.html
rename : content/base/test/csp/file_multi_policy_injection_bypass.html^headers^ => content/base/test/file_bug717511.html^headers^
rename : content/base/test/csp/file_multi_policy_injection_bypass_2.html => content/base/test/file_bug717511_2.html
rename : content/base/test/csp/file_multi_policy_injection_bypass_2.html^headers^ => content/base/test/file_bug717511_2.html^headers^
rename : content/base/test/csp/test_csp_report.html => content/base/test/test_bug548193.html
rename : content/base/test/csp/test_policyuri_async_fetch.html => content/base/test/test_bug558431.html
rename : content/base/test/csp/test_301_redirect.html => content/base/test/test_bug650386_redirect_301.html
rename : content/base/test/csp/test_302_redirect.html => content/base/test/test_bug650386_redirect_302.html
rename : content/base/test/csp/test_303_redirect.html => content/base/test/test_bug650386_redirect_303.html
rename : content/base/test/csp/test_307_redirect.html => content/base/test/test_bug650386_redirect_307.html
rename : content/base/test/csp/test_subframe_run_js_if_allowed.html => content/base/test/test_bug702439.html
rename : content/base/test/csp/file_subframe_run_js_if_allowed.html^headers^ => content/base/test/test_bug702439.html^headers^
rename : content/base/test/csp/test_multi_policy_injection_bypass.html => content/base/test/test_bug717511.html
This commit is contained in:
Ryan VanderMeulen 2014-02-13 12:54:31 -05:00
parent 16624d3391
commit 9ab1f93eca
22 changed files with 48 additions and 68 deletions

View File

@ -1,13 +0,0 @@
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=702439
This document is a child frame of a CSP document and the
test verifies that it is permitted to run javascript: URLs
if the parent has a policy that allows them.
-->
<body onload="document.getElementById('a').click()">
<a id="a" href="javascript:parent.javascript_link_ran = true;
parent.checkResult();">click</a>
</body>
</html>

View File

@ -109,17 +109,6 @@ support-files =
file_self_none_as_hostname_confusion.html
file_self_none_as_hostname_confusion.html^headers^
file_csp_testserver.sjs
file_csp_report.sjs
file_policyuri_async_fetch.html
file_policyuri_async_fetch.html^headers^
file_redirect_content.sjs
file_redirect_report.sjs
file_subframe_run_js_if_allowed.html
file_subframe_run_js_if_allowed.html^headers^
file_multi_policy_injection_bypass.html
file_multi_policy_injection_bypass.html^headers^
file_multi_policy_injection_bypass_2.html
file_multi_policy_injection_bypass_2.html^headers^
file_csp_regexp_parsing.html
file_csp_regexp_parsing.js
file_report_uri_missing_in_report_only_header.html
@ -149,13 +138,5 @@ support-files =
[test_dual_headers_warning.html]
[test_self_none_as_hostname_confusion.html]
[test_bug949549.html]
[test_csp_report.html]
[test_policyuri_async_fetch.html]
[test_301_redirect.html]
[test_302_redirect.html]
[test_303_redirect.html]
[test_307_redirect.html]
[test_subframe_run_js_if_allowed.html]
[test_multi_policy_injection_bypass.html]
[test_csp_regexp_parsing.html]
[test_report_uri_missing_in_report_only_header.html]

View File

@ -1,5 +1,4 @@
// SJS file for CSP violation report test
// https://bugzilla.mozilla.org/show_bug.cgi?id=548193
function handleRequest(request, response)
{
var query = {};

View File

@ -1,5 +1,2 @@
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=558431
-->
<iframe id="inner"
src="/tests/content/base/test/file_CSP.sjs?content=%3Cdiv%20id%3D%22test%22%3Etest%20558431%3C/div%3E"></iframe>

View File

@ -1,7 +1,6 @@
// https://bugzilla.mozilla.org/show_bug.cgi?id=650386
// This SJS file serves file_redirect_content.html
// SJS file for tests for bug650386, serves file_bug650386_content.html
// with a CSP that will trigger a violation and that will report it
// to file_redirect_report.sjs
// to file_bug650386_report.sjs
//
// This handles 301, 302, 303 and 307 redirects. The HTTP status code
// returned/type of redirect to do comes from the query string
@ -23,7 +22,7 @@ function handleRequest(request, response) {
return;
}
var csp = "default-src \'self\';report-uri http://mochi.test:8888/tests/content/base/test/csp/file_redirect_report.sjs?" + redirect;
var csp = "default-src \'self\';report-uri http://mochi.test:8888/tests/content/base/test/file_bug650386_report.sjs?" + redirect;
response.setHeader("X-Content-Security-Policy", csp, false);

View File

@ -1,5 +1,4 @@
// https://bugzilla.mozilla.org/show_bug.cgi?id=650386
// This SJS file serves as CSP violation report target
// SJS file for tests for bug650386, this serves as CSP violation report target
// and issues a redirect, to make sure the browser does not post to the target
// of the redirect, per CSP spec.
// This handles 301, 302, 303 and 307 redirects. The HTTP status code

View File

@ -0,0 +1,11 @@
<html>
<!--
This document is a child frame of a CSP document and the
test verifies that it is permitted to run javascript: URLs
if the parent has a policy that allows them.
-->
<body onload="document.getElementById('a').click()">
<a id="a" href="javascript:parent.javascript_link_ran = true;
parent.checkResult();">click</a>
</body>
</html>

View File

@ -1,7 +1,4 @@
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=717511
-->
<body>
<!-- these should be stopped by CSP after fixing bug 717511. :) -->
<img src="http://example.org/tests/content/base/test/file_CSP.sjs?testid=img_bad&type=img/png"> </img>

View File

@ -1,7 +1,4 @@
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=717511
-->
<body>
<!-- these should be stopped by CSP after fixing bug 717511. :) -->
<img src="http://example.org/tests/content/base/test/file_CSP.sjs?testid=img2_bad&type=img/png"> </img>

View File

@ -94,7 +94,10 @@ support-files =
file_bug503481b_inner.html
file_bug541937.html
file_bug541937.xhtml
file_bug548193.sjs
file_bug557892.html
file_bug558431.html
file_bug558431.html^headers^
file_bug562137.txt
file_bug590812-ref.xhtml
file_bug590812.xml
@ -109,6 +112,8 @@ support-files =
file_bug604660-6.xsl
file_bug622088.sjs
file_bug622088_inner.html
file_bug650386_content.sjs
file_bug650386_report.sjs
file_bug675121.sjs
file_bug687859-16.js
file_bug687859-16.js^headers^
@ -119,11 +124,16 @@ support-files =
file_bug687859-http.js^headers^
file_bug687859-inherit.js
file_bug692434.xml
file_bug702439.html
file_bug707142_baseline.json
file_bug707142_bom.json
file_bug707142_utf-16.json
file_bug708620-2.html
file_bug708620.html
file_bug717511.html
file_bug717511.html^headers^
file_bug717511_2.html
file_bug717511_2.html^headers^
file_bug782342.txt
file_bug787778.sjs
file_bug804395.jar
@ -401,9 +411,11 @@ support-files =
[test_bug544642.html]
[test_bug545644.html]
[test_bug545644.xhtml]
[test_bug548193.html]
[test_bug548463.html]
[test_bug553896.xhtml]
[test_bug557892.html]
[test_bug558431.html]
[test_bug558726.html]
[test_bug559526.html]
[test_bug560780.html]
@ -441,6 +453,10 @@ support-files =
[test_bug631615.html]
[test_bug638112.html]
[test_bug647518.html]
[test_bug650386_redirect_301.html]
[test_bug650386_redirect_302.html]
[test_bug650386_redirect_303.html]
[test_bug650386_redirect_307.html]
[test_bug656283.html]
[test_bug664916.html]
[test_bug666604.html]
@ -462,11 +478,14 @@ support-files =
[test_bug696301-2.html]
[test_bug698381.html]
[test_bug698384.html]
[test_bug702439.html]
[test_bug702439.html^headers^]
[test_bug704063.html]
[test_bug707142.html]
[test_bug708620.html]
[test_bug711047.html]
[test_bug711180.html]
[test_bug717511.html]
[test_bug719533.html]
[test_bug726364.html]
[test_bug737087.html]

View File

@ -1,10 +1,7 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=548193
-->
<head>
<title>Test for Bug 548193</title>
<title>Test for CSP JSON violation report</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
@ -76,13 +73,13 @@ examiner.prototype = {
}
// content file that triggers a violation report
var testFile = "file_csp_report.sjs";
var testFile = "file_bug548193.sjs";
window.checkResults = function(reportObj) {
var cspReport = reportObj["csp-report"];
// correct violating request
is(cspReport["document-uri"],
"http://mochi.test:8888/tests/content/base/test/csp/" + testFile,
"http://mochi.test:8888/tests/content/base/test/" + testFile,
"Incorrect violating request");
// correct blocked-uri
is(cspReport["blocked-uri"],

View File

@ -1,10 +1,7 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=558431
-->
<head>
<title>Test for Bug 558431</title>
<title>Test for CSP async policy-uri</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
@ -27,7 +24,7 @@ f.addEventListener('load', function() {
SimpleTest.finish();
}, false);
// load the test frame
f.src = "file_policyuri_async_fetch.html";
f.src = "file_bug558431.html";
SimpleTest.waitForExplicitFinish();
</script>
</body>

View File

@ -71,7 +71,7 @@ window.done = function(result) {
SimpleTest.waitForExplicitFinish();
// save this for last so that our listeners are registered.
document.getElementById('content_iframe').src = 'file_redirect_content.sjs?301';
document.getElementById('content_iframe').src = 'file_bug650386_content.sjs?301';
</script>
</pre>
</body>

View File

@ -71,7 +71,7 @@ window.done = function(result) {
SimpleTest.waitForExplicitFinish();
// save this for last so that our listeners are registered.
document.getElementById('content_iframe').src = 'file_redirect_content.sjs?302';
document.getElementById('content_iframe').src = 'file_bug650386_content.sjs?302';
</script>
</pre>
</body>

View File

@ -71,7 +71,7 @@ window.done = function(result) {
SimpleTest.waitForExplicitFinish();
// save this for last so that our listeners are registered.
document.getElementById('content_iframe').src = 'file_redirect_content.sjs?303';
document.getElementById('content_iframe').src = 'file_bug650386_content.sjs?303';
</script>
</pre>
</body>

View File

@ -71,7 +71,7 @@ window.done = function(result) {
SimpleTest.waitForExplicitFinish();
// save this for last so that our listeners are registered.
document.getElementById('content_iframe').src = 'file_redirect_content.sjs?307';
document.getElementById('content_iframe').src = 'file_bug650386_content.sjs?307';
</script>
</pre>
</body>

View File

@ -8,7 +8,7 @@ permitted to execute javascript: URLs assuming the policy
allows this.
-->
<head>
<title>Test for Bug 702439</title>
<title>Test for Bug 428847</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
@ -27,6 +27,6 @@ function checkResult()
SimpleTest.waitForExplicitFinish();
</script>
<iframe id="i" src="file_subframe_run_js_if_allowed.html"></iframe>
<iframe id="i" src="file_bug702439.html"></iframe>
</body>
</html>

View File

@ -115,8 +115,8 @@ SimpleTest.waitForExplicitFinish();
// save this for last so that our listeners are registered.
// ... this loads the testbed of good and bad requests.
document.getElementById('cspframe').src = 'file_multi_policy_injection_bypass.html';
document.getElementById('cspframe2').src = 'file_multi_policy_injection_bypass_2.html';
document.getElementById('cspframe').src = 'file_bug717511.html';
document.getElementById('cspframe2').src = 'file_bug717511_2.html';
</script>
</pre>