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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/media/video-load-metadata-decode-error.html

Issue 2180713002: Convert video-load* http tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test failures Created 4 years, 5 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/media/video-load-metadata-decode-error-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/media/video-load-metadata-decode-error.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-load-metadata-decode-error.html b/third_party/WebKit/LayoutTests/http/tests/media/video-load-metadata-decode-error.html
index ca566a3e0d0a3e1c89cb0d28ce656bd2b880ac08..cd3f020032e9c5d7675ab0995023366813c1edd5 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-load-metadata-decode-error.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-load-metadata-decode-error.html
@@ -1,41 +1,20 @@
-<html>
-<head>
- <title>Loading corrupted video with proper metadata</title>
- <script src=../../../media-resources/media-file.js></script>
- <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
- (Please avoid writing new tests using video-test.js) -->
- <script src=../../../media-resources/video-test.js></script>
- <script>
- function loadedmetadata(e)
- {
- consoleWrite("loaded metadata of media file");
- }
+<!DOCTYPE html>
+<title>This test case simulates a decode error after loading meta data of a video.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="../../media-resources/media-file.js"></script>
+<video></video>
+<script>
+async_test(function(t) {
+ var video = document.querySelector("video");
- function error(e)
- {
- consoleWrite("failed to load media file");
- testExpected("video.networkState", HTMLMediaElement.NETWORK_IDLE);
- endTest();
- }
-
- function start()
- {
- findMediaElement();
-
- waitForEvent('loadedmetadata', loadedmetadata);
- waitForEvent("error", error);
-
- var movie = findMediaFile("video", "resources/test");
- var type = mimeTypeForExtension(movie.split('.').pop());
- video.src = "video-load-metadata-decode-error.cgi?name=" + movie + "&type=" + type;
- video.play();
- }
- </script>
-</head>
-<body onload="start()">
-<video id="video"></video>
-<p>
-This test case simulates a decode error after loading meta data of a video.<br/><br/>
-</p>
-</body>
-</html>
+ var watcher = new EventWatcher(t, video, ["loadedmetadata", "error"]);
+ watcher.wait_for(["loadedmetadata", "error"]).then(t.step_func_done(function() {
+ assert_equals(video.networkState, HTMLMediaElement.NETWORK_IDLE);
+ }));
+ var movie = findMediaFile("video", "resources/test");
+ var type = mimeTypeForExtension(movie.split(".").pop());
+ video.src = "video-load-metadata-decode-error.cgi?name=" + movie + "&type=" + type;
+ video.play();
+});
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/media/video-load-metadata-decode-error-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698