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

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

Issue 349973006: HTMLMediaElement::webMediaPlayer() should never be null if m_readyState >= HAVE_METADATA (multiple … (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed review comments Created 6 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: LayoutTests/media/media-source-append-multiple.html
diff --git a/LayoutTests/media/media-source-append-multiple.html b/LayoutTests/media/media-source-append-multiple.html
new file mode 100644
index 0000000000000000000000000000000000000000..934756ecfe7ddc1602fb3ed9d584727651bbaa43
--- /dev/null
+++ b/LayoutTests/media/media-source-append-multiple.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <script src=media-file.js></script>
+ <script src=video-test.js></script>
+ <script>
+ var audio, sourceA, sourceB;
+
+ function canplaythrough(e)
+ {
+ testExpected("audio.currentSrc == sourceA.src", true);
+ endTest();
+ }
+
+ function loadedMetadataA()
+ {
+ consoleWrite("loadedMetadataA");
+ audio.removeChild(sourceA);
+ audio.appendChild(sourceB);
+ waitForEventAndFail("loadedmetadata");
+ }
+
+ 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>

Powered by Google App Engine
This is Rietveld 408576698