Chromium Code Reviews| 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..20fff5c08021cb093cb31e8232b049298056656d |
| --- /dev/null |
| +++ b/LayoutTests/media/media-source-append-multiple.html |
| @@ -0,0 +1,53 @@ |
| +<!DOCTYPE html> |
| +<html> |
| + <head> |
| + <script src=media-file.js></script> |
| + <script src=video-test.js></script> |
| + <script> |
| + var audio, sourceA, sourceB; |
| + |
| + function canplaythrough(e) |
| + { |
| + consoleWrite("EVENT(canplaythrough)"); |
| + testExpected("audio.currentSrc", sourceA.src); |
| + endTest(); |
| + } |
| + |
| + function loadedMetadataA() |
| + { |
| + consoleWrite("loadedMetadataA"); |
| + audio.removeChild(sourceA); |
| + audio.appendChild(sourceB); |
| + waitForEventAndFail("loadedmetadata", null); |
|
acolwell GONE FROM CHROMIUM
2014/06/23 20:30:49
nit: You shouldn't need the null. waitForEventAndF
Srirama
2014/06/24 07:04:47
Done.
|
| + } |
| + |
| + function onWindowLoad(e) |
| + { |
| + audio = document.getElementById('a'); |
| + waitForEvent("loadstart"); |
| + waitForEvent("progress"); |
| + waitForEvent("emptied"); |
| + waitForEvent("suspend"); |
| + waitForEvent("loadedmetadata"); |
| + waitForEvent("loadeddata"); |
| + waitForEvent("canplay"); |
| + audio.addEventListener('canplaythrough', canplaythrough); |
|
acolwell GONE FROM CHROMIUM
2014/06/23 20:30:49
nit: Use waitForEventOnce() here as well and remov
Srirama
2014/06/24 07:04:47
Done.
|
| + |
| + 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> |