Index: third_party/WebKit/LayoutTests/media/media-play-promise.html |
diff --git a/third_party/WebKit/LayoutTests/media/media-play-promise.html b/third_party/WebKit/LayoutTests/media/media-play-promise.html |
index 77b4ac76d873b04ea315ffba91cc0df810ef6f1d..1ba5d608391223acb551f9c5a4cb44afff77c25f 100644 |
--- a/third_party/WebKit/LayoutTests/media/media-play-promise.html |
+++ b/third_party/WebKit/LayoutTests/media/media-play-promise.html |
@@ -105,6 +105,8 @@ |
}); |
}, |
+ // Test that play() on an element that is already playing returns a |
+ // promise that resolves successfuly. |
fs
2016/06/06 09:13:24
Nit: successfully (also below)
mlamouri (slow - plz ping)
2016/06/06 16:00:55
Changed other places in the file.
|
function playAfterPlaybackStarted() |
{ |
consoleWrite("playAfterPlaybackStarted()"); |
@@ -391,7 +393,32 @@ |
run("mediaElement.volume = 0.2"); |
}); |
- } |
+ }, |
+ |
+ // Test that calling pause() then play() on an element that is already |
+ // playing returns a promise that resolves successfuly. |
+ function pausePlayAfterPlaybackStarted() |
+ { |
+ consoleWrite("pausePlayAfterPlaybackStarted()"); |
+ internals.settings.setMediaPlaybackRequiresUserGesture(false); |
+ |
+ run("mediaElement = document.createElement('audio')"); |
+ mediaElement.preload = "auto"; |
+ var mediaFile = findMediaFile("audio", "content/test"); |
+ run("mediaElement.src = '" + mediaFile + "'"); |
+ |
+ waitForEvent('playing', function() { |
+ testExpected("mediaElement.readyState", HTMLMediaElement.HAVE_ENOUGH_DATA); |
+ testExpected("mediaElement.paused", false); |
+ |
+ run("mediaElement.pause()"); |
+ play(); |
+ }); |
+ |
+ waitForEvent('canplaythrough', function() { |
+ run("mediaElement.play()"); |
+ }); |
+ }, |
]; |
function start() |