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

Unified Diff: third_party/WebKit/LayoutTests/media/video-single-valid-source.html

Issue 2103783002: Convert video-seeking*, video-set* and video-single* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/media/video-single-valid-source.html
diff --git a/third_party/WebKit/LayoutTests/media/video-single-valid-source.html b/third_party/WebKit/LayoutTests/media/video-single-valid-source.html
index 44b402536aa72410f372cfe42b19edeadac8b426..40ee975ac52ff34a7b4b92ca7f00a63ede9cc8ea 100644
--- a/third_party/WebKit/LayoutTests/media/video-single-valid-source.html
+++ b/third_party/WebKit/LayoutTests/media/video-single-valid-source.html
@@ -1,49 +1,24 @@
-<!doctype html>
-<html>
- <head>
- <script src=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=video-test.js></script>
-
- <script>
-
- function errorEvent()
- {
- logResult(false, "*** \"" + relativeURL(video.currentSrc) + "\" should not have been processed!" );
- consoleWrite("");
- endTest();
- }
-
- function setup()
- {
- video = document.createElement("video");
- video.setAttribute("controls", "controls");
-
- // The first source should load.
- var source = document.createElement("source");
- source.setAttribute("src", findMediaFile("video", "content/test"));
- source.setAttribute("type", mimeTypeForFile(source.getAttribute("src")));
- video.appendChild(source);
-
- // The second source is bogus and won't load, but it should never be processed.
- source = document.createElement("source");
- source.setAttribute("src", findMediaFile("video", "content/does-not-exist"));
- source.setAttribute("type", mimeTypeForFile(source.getAttribute("src")));
- video.appendChild(source);
-
- document.body.appendChild(video);
-
- waitForEvent('error', errorEvent);
- waitForEvent('loadedmetadata', endTest);
- consoleWrite("");
- }
-
- </script>
- </head>
-<body onload="setup()">
-
- <p>Test that a single valid &lt;source&gt; element loads correctly</p>
-
-</body>
-</html>
+<!DOCTYPE html>
+<title>Test that a single valid "source" element loads correctly.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
+<video></video>
+<script>
+async_test(function(t) {
+ var video = document.querySelector("video");
+
+ // The first source should load.
+ var source = document.createElement("source");
+ source.src = findMediaFile("video", "content/test");;
+ video.appendChild(source);
+
+ // The second source is bogus and won't load, but it should never be processed.
+ source = document.createElement("source");
+ source.src = "content/does-not-exist";
+ source.onerror = t.unreached_func();
+ video.appendChild(source);
+
+ video.onloadedmetadata = t.step_func_done();
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698