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

Side by Side Diff: LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-blocked-mimetypes.html

Issue 1126343003: Ignore unknown options to subresource integrity (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removed option parsing + nits from mkwst Created 5 years, 7 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 <title>SRI with bad MIME types are blocked</title>
4 <script src="/resources/testharness.js"></script>
5 <script src="/resources/testharnessreport.js"></script>
6 </head>
7 <body>
8 <script>
9 var test = async_test("Test that scripts with bad MIME types don't l oad.");
10 var result = false;
11 var tests = [
12 {
13 'src': 'resources/setResultWithMIME.php?mime=application/jav ascript&value=true',
14 'integrity': 'sha256-_CPhHgLf4bYjXZA6KVnegM7ECdy7A3f35ntfHeY y9zI=?ct=applicationjavascript'
15 },
16 {
17 'src': 'resources/setResultWithMIME.php?mime=application/jav ascript&value=true',
18 'integrity': 'sha256-_CPhHgLf4bYjXZA6KVnegM7ECdy7A3f35ntfHeY y9zI=?ct=app/javascript'
19 }
20 ];
21 function scriptLoad() {
22 test.step(function() {
23 assert_unreached();
24 });
25 }
26 function scriptError() {
27 test.step(function() {
28 assert_false(result);
29 nextTest();
30 });
31 }
32 function nextTest() {
33 var next = tests.shift();
34 if (!next) {
35 test.done();
36 return;
37 }
38 result = false;
39 var script = document.createElement('script');
40 script.onload = scriptLoad;
41 script.onerror = scriptError;
42 script.src = next.src;
43 script.integrity = next.integrity;
44 document.body.appendChild(script);
45 }
46 window.onload = function() {
47 nextTest();
48 };
49 </script>
50 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698