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

Unified Diff: third_party/WebKit/LayoutTests/fast/images/image-error-event-not-firing.html

Issue 2227423002: Use testharness.js instead of js-test.js in fast/images. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698