Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/images/image-error-event-not-firing.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/images/image-error-event-not-firing.html b/third_party/WebKit/LayoutTests/fast/images/image-error-event-not-firing.html |
| index 0bfcdeca24cb0eb111c7b0f7a4829981ff308c4e..8063b9fb956f861bbfec48c51505b7080c1d7b16 100644 |
| --- a/third_party/WebKit/LayoutTests/fast/images/image-error-event-not-firing.html |
| +++ b/third_party/WebKit/LayoutTests/fast/images/image-error-event-not-firing.html |
| @@ -1,35 +1,13 @@ |
| <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| -<html> |
| -<head> |
| +<title>This tests onerror event is fired if we change image src to a url blocked by content-security-policy.</title> |
| <meta http-equiv="Content-Security-Policy" content="img-src 'self'"> |
| -<script src="../../resources/js-test.js"></script> |
| +<script src="../../resources/testharness.js"></script> |
| +<script src="../../resources/testharnessreport.js"></script> |
| +<img src="./color-jpeg-with-color-profile-expected.png"></img> |
|
Srirama
2016/08/10 10:50:21
Remove all these images from platform folders as d
sivag
2016/08/10 11:21:54
Done.
|
| <script> |
| -description( |
| - "This tests onerror event is fired if we change image src to a url blocked by content-security-policy." |
| -) |
| - |
| -jsTestIsAsync = true; |
| - |
| -function load() |
| -{ |
| - var image = document.getElementById('test'); |
| - image.onerror = function() { |
| - testPassed("error event fired."); |
| - finishJSTest(); |
| - }; |
| - image.src = 'http://www.myfakesiteabc.com/image.png'; |
| - |
| - setTimeout(function() { |
| - testFailed("error event is not fired.") |
| - finishJSTest(); |
| - }, 200); |
| -} |
| +async_test(function(t) { |
| + var img = document.querySelector("img"); |
|
Srirama
2016/08/10 10:50:21
remove the extra indentation.
sivag
2016/08/10 11:21:54
Done.
|
| + img.onerror = t.step_func_done(); |
| + img.src = 'http://www.myfakesiteabc.com/image.png'; |
|
Srirama
2016/08/10 10:50:21
nit: use double quotes here or use single quotes i
sivag
2016/08/10 11:21:54
Done.
|
| +}); |
| </script> |
| - |
| -</head> |
| -<body onload='load()'> |
| - |
| -<img src="./color-jpeg-with-color-profile-expected.png" id="test"></img> |
| - |
| -</body> |
| -</html> |