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

Unified Diff: LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-style-no-cors-no-xorigin.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: Fixed test failures 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-no-xorigin.html
diff --git a/LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-style-no-cors-no-xorigin.html b/LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-style-no-cors-no-xorigin.html
new file mode 100644
index 0000000000000000000000000000000000000000..b48c1f7bec3a76c5e7bd3925af1d3580063e7920
--- /dev/null
+++ b/LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-style-no-cors-no-xorigin.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<head>
+ <title>SRI on cross origin CORS disabled style, without CORS fetch</title>
+ <style>.id1 { background-color: red }</style>
+ <link rel="stylesheet"
+ integrity="ni:///sha256;fy1lC6jbv7rOG6Flb00n5PYLggqe25IcE6QlZf8KtwI="
+ href="http://localhost:8000/security/resources/cors-style.php?cors=false"></link>
+</head>
+<body>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ window.onload = function () {
+ var ele = document.getElementById('id1');
+ var divBackground = window.getComputedStyle(ele, null).getPropertyValue('background-color');
+ assert_equals(divBackground, "rgb(255, 0, 0)");
+ done();
+ };
+ </script>
+ <div id="id1" class="id1"></div>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698