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

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

Issue 2065433002: Convert media-source*, no-autoplay* and remove-from* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comment 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/media-source-append-multiple-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/media-source-append-multiple.html
diff --git a/third_party/WebKit/LayoutTests/media/media-source-append-multiple.html b/third_party/WebKit/LayoutTests/media/media-source-append-multiple.html
index 0b7a2ff65e65d776692a862367bb65db44fc93ed..d2cef335933f97bd3ea8d6672aca3bb7982ec7e1 100644
--- a/third_party/WebKit/LayoutTests/media/media-source-append-multiple.html
+++ b/third_party/WebKit/LayoutTests/media/media-source-append-multiple.html
@@ -1,53 +1,27 @@
<!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>
- var audio, sourceA, sourceB;
+<title>Test that a media element doesn't reload on removing the current source element and inserting a new source element.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
+<audio></audio>
+<script>
+async_test(function(t) {
+ var audio = document.querySelector("audio");
- function canplaythrough(e)
- {
- testExpected("audio.currentSrc == sourceA.src", true);
- endTest();
- }
+ audio.oncanplaythrough = t.step_func_done(function() {
+ assert_equals(audio.currentSrc, sourceA.src);
+ });
- function loadedMetadataA()
- {
- consoleWrite("loadedMetadataA");
- audio.removeChild(sourceA);
- audio.appendChild(sourceB);
- waitForEventAndFail("loadedmetadata");
- }
+ audio.onloadedmetadata = t.step_func(function() {
+ audio.removeChild(sourceA);
+ audio.appendChild(sourceB);
+ audio.onloadedmetadata = t.unreached_func();
+ });
- function onWindowLoad(e)
- {
- audio = document.getElementById('a');
- waitForEvent("loadstart");
- waitForEvent("progress");
- waitForEvent("emptied");
- waitForEvent("suspend");
- waitForEvent("loadeddata");
- waitForEvent("canplay");
- waitForEventOnce('canplaythrough', canplaythrough);
-
- sourceA = document.createElement("source");
- var audioFile = findMediaFile("audio", "content/test");
- sourceA.setAttribute("src", audioFile);
- sourceB = document.createElement("source");
- audioFile = findMediaFile("audio", "content/silence");
- sourceB.setAttribute("src", audioFile);
-
- waitForEventOnce("loadedmetadata", loadedMetadataA);
- audio.appendChild(sourceA);
- }
-
- window.addEventListener('load', onWindowLoad, false);
- </script>
- </head>
- <body>
- <audio id="a"></audio>
- </body>
-</html>
+ var sourceA = document.createElement("source");
+ sourceA.src = findMediaFile("audio", "content/test");
+ var sourceB = document.createElement("source");
+ sourceB.src = findMediaFile("audio", "content/silence");
+ audio.appendChild(sourceA);
+});
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/media-source-append-multiple-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698