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

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

Issue 2092373002: Convert video-src* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments 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-src-blob.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/media/video-src.html
diff --git a/third_party/WebKit/LayoutTests/media/video-src.html b/third_party/WebKit/LayoutTests/media/video-src.html
index d5704de9cd83727acd824f815543a329baee6b88..35c6b5aefcbd003eb32a050d443a876c7012435a 100644
--- a/third_party/WebKit/LayoutTests/media/video-src.html
+++ b/third_party/WebKit/LayoutTests/media/video-src.html
@@ -1,29 +1,24 @@
-<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>
+<!DOCTYPE html>
+<title>Verify media element's "src" attribute on "loadstart" event.</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");
+ var mediaFile = findMediaFile("video", "content/test");
- function test()
- {
- video = mediaElement = document.getElementsByTagName('video')[0];
- var mediaFile = findMediaFile("video", "content/test");
+ video.onloadstart = t.step_func_done(function () {
+ var url = video.currentSrc;
+ assert_equals(url.substr(url.lastIndexOf("/media/")+7), mediaFile);
- waitForEvent("loadstart", function () {
- testExpected("stripExtension(relativeURL(video.currentSrc))", stripExtension(mediaFile));
- testExpected("stripExtension(relativeURL(video.src))", stripExtension(mediaFile));
- testExpected("stripExtension(video.getAttribute('src'))", stripExtension(mediaFile));
- endTest();
- });
+ url = video.src;
+ assert_equals(url.substr(url.lastIndexOf("/media/")+7), mediaFile);
- video.src = mediaFile;
- }
- </script>
- </head>
+ assert_equals(video.getAttribute("src"), mediaFile);
+ });
- <body onload="setTimeout(test, 100)">
- <video controls></video>
- </body>
-</html>
+ video.src = mediaFile;
+});
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/video-src-blob.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698