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..fdd6f192ac8dce07b5fe67ca246829f2de981837 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"> |
fs
2016/08/10 17:37:08
Could you make this just "<!DOCTYPE html>" while w
sivag
2016/08/16 09:21:16
Done.
|
-<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> |
fs
2016/08/10 17:13:17
It was arguably a bit fishy to use <random-image-i
sivag
2016/08/16 09:21:16
Done.
I created a 1*1 png test image to test this
|
<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'; |
fs
2016/08/10 17:13:17
This is not great - previously we were relying on
sivag
2016/08/16 09:21:16
Done.
|
- |
- setTimeout(function() { |
- testFailed("error event is not fired.") |
- finishJSTest(); |
- }, 200); |
-} |
+async_test(function(t) { |
+ var img = document.querySelector("img"); |
+ img.onerror = t.step_func_done(); |
+ img.src = "http://www.myfakesiteabc.com/image.png"; |
+}); |
</script> |
- |
-</head> |
-<body onload='load()'> |
- |
-<img src="./color-jpeg-with-color-profile-expected.png" id="test"></img> |
- |
-</body> |
-</html> |