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

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

Issue 2098213002: Convert video-src-[plus-source, remove, set, source].html tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address nits 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-plus-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-src-plus-source.html
diff --git a/third_party/WebKit/LayoutTests/media/video-src-plus-source.html b/third_party/WebKit/LayoutTests/media/video-src-plus-source.html
index 7dfcd63909d8f5a10416e98d6937efc5fb66ed7c..5b75d85b4deee87651be4ebcff1dc84aaf4722a7 100644
--- a/third_party/WebKit/LayoutTests/media/video-src-plus-source.html
+++ b/third_party/WebKit/LayoutTests/media/video-src-plus-source.html
@@ -1,35 +1,30 @@
-<html>
-<body>
- <!-- 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>
+<!DOCTYPE html>
+<title>Test that a "source" element is not used when a bogus "src" attribute is present.</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");
- <script>
- mediaElement.addEventListener('loadedmetadata', function() {
- failTest("'loadedmetadata' event fired" );
- }, true);
+ video.onloadedmetadata = t.unreached_func();
+ video.onloadstart = t.step_func(function () {
+ var url = video.currentSrc;
+ assert_equals(url.substr(url.lastIndexOf("/media/")+7), mediaFile);
+ });
- waitForEvent('loadstart', function () {
- findMediaElement();
- testExpected("relativeURL(video.currentSrc)", "content/bogus.mpeg");
- consoleWrite("");
- });
+ video.onerror = t.step_func(function () {
+ var url = video.currentSrc;
+ assert_equals(url.substr(url.lastIndexOf("/media/")+7), mediaFile);
+ assert_equals(video.error.code, MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED);
+ setTimeout(t.step_func_done(), 200) ;
+ });
- waitForEvent('error', function () {
- findMediaElement();
- testExpected("relativeURL(video.currentSrc)", "content/bogus.mpeg");
- testExpected("mediaElement.error.code", MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED);
- setTimeout(endTest, 200) ;
- consoleWrite("");
- });
- </script>
-
- <video src=content/bogus.mpeg controls>
- <source src=content/test.mp4>
- </video>
-
-<p>Test that a &lt;source&gt; element is not used when a bogus 'src' attribute is present
-</p>
-
-</body>
-</html>
+ document.querySelector("source").src = findMediaFile("video", "content/test");
+ var mediaFile = "content/bogus.mpeg";
+ video.src = mediaFile;
+});
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/video-src-plus-source-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698