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..2d51e35be146fbbf68914099754d2fe70214c875 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 |
@@ -2,34 +2,20 @@ |
<html> |
Srirama
2016/08/10 06:59:47
html, head and body are optional elements, so you
sivag
2016/08/10 09:17:48
Done.
|
<head> |
<meta http-equiv="Content-Security-Policy" content="img-src 'self'"> |
-<script src="../../resources/js-test.js"></script> |
+<title>"This tests onerror event is fired if we change image src to a url blocked by content-security-policy."</title> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
<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 = new Image(); |
+ img.onerror = t.step_func_done(function() { |
Srirama
2016/08/10 06:59:47
you can directly use t.step_func_done(), no need t
sivag
2016/08/10 09:17:48
Done.
|
+ assert_true(true, "Test passed"); |
+ }); |
+ img.onload = t.step_func_done(function() { |
Srirama
2016/08/10 06:59:47
this isn't right, as the test will finish here and
sivag
2016/08/10 09:17:48
Done.
|
+ image.src = 'http://www.myfakesiteabc.com/image.png'; |
+ }); |
+ img.src = './color-jpeg-with-color-profile-expected.png'; |
+}); |
</script> |
- |
</head> |
-<body onload='load()'> |
- |
-<img src="./color-jpeg-with-color-profile-expected.png" id="test"></img> |
- |
-</body> |
</html> |