Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(279)

Unified Diff: LayoutTests/http/tests/security/contentTypeOptions/nosniff-dynamic-script-blocked.html

Issue 185593011: Apply 'x-content-type-options' check to dynamically inserted script. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Test. Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/http/tests/security/contentTypeOptions/nosniff-dynamic-script-blocked-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/security/contentTypeOptions/nosniff-dynamic-script-blocked.html
diff --git a/LayoutTests/http/tests/security/contentTypeOptions/nosniff-script-without-content-type-blocked.html b/LayoutTests/http/tests/security/contentTypeOptions/nosniff-dynamic-script-blocked.html
similarity index 64%
copy from LayoutTests/http/tests/security/contentTypeOptions/nosniff-script-without-content-type-blocked.html
copy to LayoutTests/http/tests/security/contentTypeOptions/nosniff-dynamic-script-blocked.html
index 99b385a7c39bc1c3f35687da30125f4e40d1bc50..6d0c62d8e7c1e4cf8369e76e93c00a08b7fa755b 100644
--- a/LayoutTests/http/tests/security/contentTypeOptions/nosniff-script-without-content-type-blocked.html
+++ b/LayoutTests/http/tests/security/contentTypeOptions/nosniff-dynamic-script-blocked.html
@@ -5,14 +5,19 @@
<body>
<script src="/js-test-resources/js-test.js"></script>
<script>
- description('Check that script sent with an \'X-Content-Type-Options: nosniff\' header is correctly blocked if no \'Content-Type\' header is present.');
+ description('Check that script sent with an \'X-Content-Type-Options: nosniff\' header is correctly blocked if the MIME type isn\'t scripty.');
window.jsTestIsAsync = true;
+
window.scriptsSuccessfullyLoaded = 0;
+
+ var s = document.createElement('script');
+ s.src = './resources/script-with-header.pl?mime=application/json';
+ document.querySelector('head').appendChild(s);
+
window.onload = function () {
shouldBe('window.scriptsSuccessfullyLoaded', '0');
finishJSTest();
};
</script>
- <script src="./resources/script-with-header.pl"></script>
</body>
</html>
« no previous file with comments | « no previous file | LayoutTests/http/tests/security/contentTypeOptions/nosniff-dynamic-script-blocked-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698