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

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

Issue 2169893002: Convert text-served* and remove-while* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 1 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/text-served-as-text.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/text-served-as-text.html b/third_party/WebKit/LayoutTests/http/tests/media/text-served-as-text.html
index d60dde53192195f5f729643d1b03ec0288728a7a..963171633786c28306621cea04fce0b65cc10a36 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/text-served-as-text.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/text-served-as-text.html
@@ -1,39 +1,18 @@
<!DOCTYPE html>
-<html>
- <head>
- <title>text file served as 'text/plain'</title>
- <!-- 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(false, "loaded text file served as text");
- endTest();
- }
+<title>Tests that a text 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(true, "failed trying to load text file served as text");
- endTest();
- }
+ var watcher = new EventWatcher(t, video, ["loadstart", "loadedmetadata", "error"]);
+ watcher.wait_for(["loadstart", "error"]).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 = "resources/test.txt";
- 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 = "resources/test.txt";
+ 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