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

Unified Diff: LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-style-no-cors.html

Issue 954233003: Enable SRI only for same origin and CORS content. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase on ToT Created 5 years, 9 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
Index: LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-style-no-cors.html
diff --git a/LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-style-no-cors.html b/LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-style-no-cors.html
new file mode 100644
index 0000000000000000000000000000000000000000..33bb6036b50611deefa1697e79e058c6e66fb414
--- /dev/null
+++ b/LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-style-no-cors.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<head>
+ <style>.id1 { background-color: red }</style>
+ <link rel="stylesheet"
+ integrity="ni:///sha256;deadbeef"
Mike West 2015/03/06 03:17:09 Ditto the script comments.
jww 2015/03/06 08:24:21 See reply to your scripts comments.
+ href="http://localhost:8000/security/resources/cors-style.php?credentials=true&cors=false"></link>
+</head>
+<body>
+ <script src="/js-test-resources/js-test.js"></script>
+ <script>
+ window.jsTestIsAsync = true;
+ description("The test passes if the style fails to load and there is also a console error saying that the specified integrity attribute cannot be enforced because the resource is not CORS enabled.");
+
+ window.onload = function () {
+ var ele = document.getElementById('id1');
+ window.divBackground = window.getComputedStyle(ele, null).getPropertyValue('background-color');
+ shouldBeEqualToString("divBackground", "rgb(255, 0, 0)");
+ finishJSTest();
+ };
+ </script>
+ <div id="id1" class="id1"></div>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698