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

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: 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-src.html
diff --git a/third_party/WebKit/LayoutTests/media/video-src.html b/third_party/WebKit/LayoutTests/media/video-src.html
index d5704de9cd83727acd824f815543a329baee6b88..ab62a6fdf6e1834802876dbf0d58c6cc2c54a7da 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>Video element with src="" should invoke media element's load algorithm and should fire "error" event. Network state should be NETWORK_NO_SOURCE and the error code should be MEDIA_ERR_SRC_NOT_SUPPORTED.</title>
fs 2016/06/25 17:12:03 Hmm?
Srirama 2016/06/26 05:41:55 Sorry, copy paste mistake :)
+<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>

Powered by Google App Engine
This is Rietveld 408576698