Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-script-cors-bad-integrity.html |
| diff --git a/third_party/WebKit/LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-script-cors-bad-integrity.html b/third_party/WebKit/LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-script-cors-bad-integrity.html |
| index 98f79398265850ae646fc5fb6f0766ff05d47bbf..1cf0dfbe409cba1e4681ae022577e4fbf64769b0 100644 |
| --- a/third_party/WebKit/LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-script-cors-bad-integrity.html |
| +++ b/third_party/WebKit/LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-script-cors-bad-integrity.html |
| @@ -7,15 +7,33 @@ |
| <script src="/resources/testharnessreport.js"></script> |
| <script> |
| var result = ''; |
| - var scriptLoaded = function() { |
| - assert_unreached('Script loaded.'); |
| - done(); |
| + var test1 = async_test('1st Clause, Step 23 of prepare a script'); |
|
sof
2017/02/24 07:29:22
Could you make clear that these spec references ar
hiroshige
2017/02/24 18:16:57
Done.
|
| + var test2 = async_test('2st Clause, Step 23 of prepare a script'); |
|
sof
2017/02/24 07:29:22
2nd
hiroshige
2017/02/24 18:16:57
Done.
|
| + var test3 = async_test('3st Clause, Step 23 of prepare a script'); |
|
sof
2017/02/24 07:29:22
3rd
hiroshige
2017/02/24 18:16:57
Done.
|
| + var test4 = async_test('4st Clause, Step 23 of prepare a script'); |
|
sof
2017/02/24 07:29:22
fourth/4th
hiroshige
2017/02/24 18:16:57
Done.
|
| + var scriptLoaded = function(t) { |
| + t.step(function() { |
| + assert_unreached('Script loaded.'); |
| + t.done(); |
| + }); |
| }; |
| - var scriptError = function() { |
| - assert_equals(result, '', 'Script did not run.'); |
| - done(); |
| + var scriptError = function(t) { |
| + t.step(function() { |
| + assert_equals(result, '', 'Script did not run.'); |
| + t.done(); |
| + }); |
| }; |
| + var script3 = document.createElement('script'); |
| + script3.setAttribute('integrity', 'sha256-deadbeef'); |
| + script3.setAttribute('crossorigin', ''); |
| + script3.onload = scriptLoaded.bind(undefined, test3); |
| + script3.onerror = scriptError.bind(undefined, test3); |
| + script3.src = 'http://localhost:8000/security/resources/cors-script.php?value=ran&test=3'; |
| + script3.async = false; |
| + document.head.appendChild(script3); |
| </script> |
| - <script crossorigin integrity="sha256-deadbeef" src="http://localhost:8000/security/resources/cors-script.php?value=ran" onload="scriptLoaded();" onerror="scriptError();"></script> |
| + <script crossorigin integrity="sha256-deadbeef" src="http://localhost:8000/security/resources/cors-script.php?value=ran&test=1" onload="scriptLoaded(test1);" onerror="scriptError(test1);" defer></script> |
| + <script crossorigin integrity="sha256-deadbeef" src="http://localhost:8000/security/resources/cors-script.php?value=ran&test=2" onload="scriptLoaded(test2);" onerror="scriptError(test2);"></script> |
| + <script crossorigin integrity="sha256-deadbeef" src="http://localhost:8000/security/resources/cors-script.php?value=ran&test=4" onload="scriptLoaded(test4);" onerror="scriptError(test4);" async></script> |
| </body> |
| </html> |