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

Side by Side 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: Created 5 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <head>
3 <style>.id1 { background-color: red }</style>
4 <link rel="stylesheet"
5 integrity="ni:///sha256;deadbeef"
6 href="http://localhost:8000/security/resources/cors-style.php?cors=fal se"></link>
7 </head>
8 <body>
9 <script src="/js-test-resources/js-test.js"></script>
10 <script>
11 window.jsTestIsAsync = true;
12 description("The test passes if the style loads and modifies the div to be yellow but that there is also a console error that the integrity cannot be en forced on a non-CORS enabled resource.");
13
14 window.onload = function () {
15 var ele = document.getElementById('id1');
16 window.divBackground = window.getComputedStyle(ele, null).getPropert yValue('background-color');
17 shouldBeEqualToString("divBackground", "rgb(255, 255, 0)");
18 finishJSTest();
19 };
20 </script>
21 <div id="id1" class="id1"></div>
22 </body>
23 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698