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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/media/video-served-as-text.html

Issue 2177793003: Convert video-seek* and video-served* http tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
Index: third_party/WebKit/LayoutTests/http/tests/media/video-served-as-text.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-served-as-text.html b/third_party/WebKit/LayoutTests/http/tests/media/video-served-as-text.html
index 3c2e55337cd05b9abf50132a7c1882b4019d3991..9fc3e165f713516eb666e2f81703d42366c9dc60 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-served-as-text.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-served-as-text.html
@@ -1,40 +1,18 @@
<!DOCTYPE html>
-<html>
- <head>
- <title>media file served as 'text/plain'</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(evt)
- {
- logResult(true, "loaded media file served as text");
- endTest();
- }
+<title>Tests that a media file is served as "text/plain".</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(evt)
- {
- logResult(false, "failed trying to load media file served as text");
- endTest();
- }
+ var watcher = new EventWatcher(t, video, ["loadstart", "loadedmetadata", "error"]);
+ watcher.wait_for(["loadstart", "loadedmetadata"]).then(t.step_func_done());
+ assert_equals(video.error, null);
- function start()
- {
- findMediaElement();
-
- waitForEvent('loadedmetadata', loadedmetadata);
- waitForEvent("error", error);
- waitForEvent("loadstart");
- testExpected("video.error", null);
-
- var movie = findMediaFile("video", "resources/test");
- video.src = "http://127.0.0.1:8000/media/video-throttled-load.cgi?name=" + movie + "&throttle=99999&type=text/plain";
- }
- </script>
- </head>
-
- <body onload="start()">
- <video controls></video>
- </body>
-</html>
+ var movie = findMediaFile("video", "resources/test");
+ video.src = "http://127.0.0.1:8000/media/video-throttled-load.cgi?name=" + movie + "&throttle=99999&type=text/plain";
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698