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

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

Issue 2102433003: Convert video-source* 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/video-source-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/media/video-source.html
diff --git a/third_party/WebKit/LayoutTests/media/video-source.html b/third_party/WebKit/LayoutTests/media/video-source.html
index 93413461dbeb0524e2f560fe1fde01f5a75836a9..1f4b6b5c58cbf53a5b95908d7e5d6e0a4735bd98 100644
--- a/third_party/WebKit/LayoutTests/media/video-source.html
+++ b/third_party/WebKit/LayoutTests/media/video-source.html
@@ -1,35 +1,26 @@
-<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 test()
- {
- var panel = document.getElementById("panel");
- var mediaFile = findMediaFile("video", "content/test");
-
- panel.innerHTML = "<video controls><source src='" + mediaFile + "'></video>";
-
- video = mediaElement = document.getElementsByTagName('video')[0];
- waitForEvent("loadstart", function () {
- testExpected("stripExtension(relativeURL(video.currentSrc))", stripExtension(mediaFile));
-
- source = document.querySelector('source');
- testExpected("stripExtension(source.getAttribute('src'))", stripExtension(mediaFile));
- testExpected("stripExtension(relativeURL(source.src))", stripExtension(mediaFile));
-
- endTest();
- });
- }
- </script>
- </head>
-
- <body onload="setTimeout(test, 100)">
-
- <div id=panel></div>
-
- </body>
-</html>
+<!DOCTYPE html>
+<title>Test "source" element.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
+<video>
+ <source></source>
+</video>
+<script>
+async_test(function(t) {
+ var video = document.querySelector("video");
+ var source = document.querySelector("source");
+ var mediaFile = findMediaFile("video", "content/test");
+ source.src = mediaFile;
+
+ video.onloadstart = t.step_func_done(function() {
+ var url = video.currentSrc;
+ assert_equals(url.substr(url.lastIndexOf("/media/") + 7), mediaFile);
+
+ assert_equals(source.getAttribute("src"), mediaFile);
+
+ url = source.src;
+ assert_equals(url.substr(url.lastIndexOf("/media/") + 7), mediaFile);
+ });
+});
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/video-source-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698