Index: third_party/WebKit/LayoutTests/media/media-play-promise-expected.txt |
diff --git a/third_party/WebKit/LayoutTests/media/media-play-promise-expected.txt b/third_party/WebKit/LayoutTests/media/media-play-promise-expected.txt |
new file mode 100644 |
index 0000000000000000000000000000000000000000..8dfa6058a4bae999c2720593dd787559bd337b7d |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/media/media-play-promise-expected.txt |
@@ -0,0 +1,126 @@ |
+CONSOLE WARNING: Failed to execute 'play' on 'HTMLMediaElement': API can only be initiated by a user gesture. |
+Test the play() behaviour with regards to the returned promise for media elements. |
+ |
+ |
+playLoading() |
+RUN(mediaElement = document.createElement('audio')) |
+RUN(mediaElement.src = 'content/test.wav') |
+EVENT(playing) |
+Promise Resolved |
+ |
+playLoaded() |
+RUN(mediaElement = document.createElement('audio')) |
+RUN(mediaElement.src = 'content/test.wav') |
+EVENT(canplaythrough) |
+EXPECTED (4 == '4') OK |
+EXPECTED (true == 'true') OK |
+EVENT(playing) |
+Promise Resolved |
+ |
+playRequiresUserGestureAndHasIt() |
+RUN(mediaElement = document.createElement('audio')) |
+RUN(mediaElement.src = 'content/test.wav') |
+EVENT(playing) |
+Promise Resolved |
+ |
+playRequiresUserGestureAndDoesNotHaveIt() |
+RUN(mediaElement = document.createElement('audio')) |
+RUN(mediaElement.src = 'content/test.wav') |
+Promise Failed with NotAllowedError |
+ |
+playNotSupportedContent() |
+RUN(mediaElement = document.createElement('audio')) |
+RUN(mediaElement.src = 'content/garbage.wav') |
+EVENT(error) |
+EXPECTED (mediaElement.error == '[object MediaError]') OK |
+EXPECTED (mediaElement.error.code == '4') OK |
+Promise Failed with NotSupportedError |
+ |
+playDecodeError() |
+RUN(mediaElement = document.createElement('audio')) |
+RUN(mediaElement.src = 'content/test.wav') |
+EVENT(loadedmetadata) |
+EVENT(error) |
+EXPECTED (mediaElement.error == '[object MediaError]') OK |
+EXPECTED (mediaElement.error.code == '3') OK |
+EVENT(playing) |
+Promise Resolved |
+ |
+playNetworkError() |
+RUN(mediaElement = document.createElement('audio')) |
+RUN(mediaElement.src = 'content/test.wav') |
+EVENT(loadedmetadata) |
+EVENT(error) |
+EXPECTED (mediaElement.error == '[object MediaError]') OK |
+EXPECTED (mediaElement.error.code == '2') OK |
+EVENT(playing) |
+Promise Resolved |
+ |
+playWithErrorAlreadySet() |
+RUN(mediaElement = document.createElement('audio')) |
+RUN(mediaElement.src = 'content/garbage.wav') |
+RUN(mediaElement.load()) |
+EVENT(error) |
+EXPECTED (mediaElement.error == '[object MediaError]') OK |
+EXPECTED (mediaElement.error.code == '4') OK |
+Promise Failed with NotSupportedError |
+ |
+playSrcChangedAfterError() |
+RUN(mediaElement = document.createElement('audio')) |
+RUN(mediaElement.src = 'content/garbage.wav') |
+RUN(mediaElement.load()) |
+EVENT(error) |
+EXPECTED (mediaElement.error == '[object MediaError]') OK |
+EXPECTED (mediaElement.error.code == '4') OK |
+RUN(mediaElement.src = 'content/test.wav') |
+EVENT(loadedmetadata) |
+EVENT(playing) |
+Promise Resolved |
+ |
+playRaceWithSrcChangeError() |
+RUN(mediaElement = document.createElement('audio')) |
+RUN(mediaElement.src = 'content/garbage.wav') |
+RUN(mediaElement.load()) |
+EVENT(error) |
+EXPECTED (mediaElement.error == '[object MediaError]') OK |
+EXPECTED (mediaElement.error.code == '4') OK |
+RUN(mediaElement.src = 'content/test.wav') |
+Promise Failed with NotSupportedError |
+ |
+playFollowedByPauseWhenLoaded() |
+RUN(mediaElement = document.createElement('audio')) |
+RUN(mediaElement.src = 'content/test.wav') |
+RUN(mediaElement.load()) |
+EVENT(canplaythrough) |
+EXPECTED (mediaElement.readyState == '4') OK |
+EXPECTED (mediaElement.paused == 'false') OK |
+EXPECTED (mediaElement.paused == 'true') OK |
+EVENT(playing) |
+Promise Resolved |
+ |
+playFollowedByPauseWhenLoaded() |
+RUN(mediaElement = document.createElement('audio')) |
+RUN(mediaElement.src = 'content/test.wav') |
+EXPECTED (mediaElement.readyState == '0') OK |
+EXPECTED (mediaElement.paused == 'false') OK |
+EXPECTED (mediaElement.paused == 'true') OK |
+Promise Failed with AbortError |
+ |
+loadRejectPendingPromises() |
+RUN(mediaElement = document.createElement('audio')) |
+RUN(mediaElement.load()) |
+Promise Failed with AbortError |
+ |
+newSrcRejectPendingPromises() |
+RUN(mediaElement = document.createElement('audio')) |
+RUN(mediaElement.src = 'content/test.wav') |
+Promise Failed with AbortError |
+ |
+testEventAndPromiseOrdering |
+RUN(mediaElement = document.createElement('audio')) |
+RUN(mediaElement.src = 'content/test.wav') |
+EVENT(playing) |
+Should be after the play() promise is resolved |
+Promise Resolved |
+END OF TEST |
+ |