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

Side by Side Diff: third_party/WebKit/LayoutTests/media/media-play-promise-expected.txt

Issue 1576283003: Have HTMLMediaElement::play() return a Promise. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update layout tests Created 4 years, 9 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 unified diff | Download patch
OLDNEW
(Empty)
1 CONSOLE WARNING: Failed to execute 'play' on 'HTMLMediaElement': API can only be initiated by a user gesture.
2 Test the play() behaviour with regards to the returned promise for media element s.
3
4
5 playBeforeCanPlay()
6 RUN(mediaElement = document.createElement('audio'))
7 RUN(mediaElement.src = 'content/test.wav')
8 EXPECTED (mediaElement.readyState == '0') OK
9 play()
10 EVENT(loadedmetadata)
11 EVENT(loadeddata)
12 EVENT(canplay)
13 EVENT(playing)
14 arguments.length: 1
15 Promise resolved with undefined
16
17 playWhenCanPlay()
18 RUN(mediaElement = document.createElement('audio'))
19 RUN(mediaElement.src = 'content/test.wav')
20 EVENT(canplay)
21 EXPECTED (mediaElement.readyState >= '3') OK
22 EXPECTED (mediaElement.paused == 'true') OK
23 play()
24 EVENT(playing)
25 arguments.length: 1
26 Promise resolved with undefined
27
28 playAfterPlaybackStarted()
29 RUN(mediaElement = document.createElement('audio'))
30 RUN(mediaElement.src = 'content/test.wav')
31 EVENT(canplaythrough)
32 RUN(mediaElement.play())
33 EVENT(playing)
34 EXPECTED (mediaElement.readyState == '4') OK
35 EXPECTED (mediaElement.paused == 'false') OK
36 play()
37 arguments.length: 1
38 Promise resolved with undefined
39
40 playRequiresUserGestureAndHasIt()
41 RUN(mediaElement = document.createElement('audio'))
42 RUN(mediaElement.src = 'content/test.wav')
43 play()
44 EVENT(playing)
45 arguments.length: 1
46 Promise resolved with undefined
47
48 playRequiresUserGestureAndDoesNotHaveIt()
49 RUN(mediaElement = document.createElement('audio'))
50 RUN(mediaElement.src = 'content/test.wav')
51 play()
52 arguments.length: 1
53 Promise failed with NotAllowedError: play() can only be initiated by a user gest ure.
54
55 playNotSupportedContent()
56 RUN(mediaElement = document.createElement('audio'))
57 RUN(mediaElement.src = 'data:,.wav')
58 play()
59 EVENT(error)
60 EXPECTED (mediaElement.error == '[object MediaError]') OK
61 EXPECTED (mediaElement.error.code == '4') OK
62 arguments.length: 1
63 Promise failed with NotSupportedError: Failed to load because no supported sourc e was found.
64
65 playDecodeError()
66 RUN(mediaElement = document.createElement('audio'))
67 RUN(mediaElement.src = 'content/test.wav')
68 EVENT(loadedmetadata)
69 play()
70 EVENT(error)
71 EXPECTED (mediaElement.error == '[object MediaError]') OK
72 EXPECTED (mediaElement.error.code == '3') OK
73 EVENT(playing)
74 arguments.length: 1
75 Promise resolved with undefined
76
77 playNetworkError()
78 RUN(mediaElement = document.createElement('audio'))
79 RUN(mediaElement.src = 'content/test.wav')
80 EVENT(loadedmetadata)
81 play()
82 EVENT(error)
83 EXPECTED (mediaElement.error == '[object MediaError]') OK
84 EXPECTED (mediaElement.error.code == '2') OK
85 EVENT(playing)
86 arguments.length: 1
87 Promise resolved with undefined
88
89 playWithErrorAlreadySet()
90 RUN(mediaElement = document.createElement('audio'))
91 RUN(mediaElement.src = 'data:,.wav')
92 EVENT(error)
93 EXPECTED (mediaElement.error == '[object MediaError]') OK
94 EXPECTED (mediaElement.error.code == '4') OK
95 play()
96 arguments.length: 1
97 Promise failed with NotSupportedError: The element has no supported sources.
98
99 playSrcChangedAfterError()
100 RUN(mediaElement = document.createElement('audio'))
101 RUN(mediaElement.src = 'data:,.wav')
102 EVENT(error)
103 EXPECTED (mediaElement.error == '[object MediaError]') OK
104 EXPECTED (mediaElement.error.code == '4') OK
105 RUN(mediaElement.src = 'content/test.wav')
106 EVENT(loadedmetadata)
107 play()
108 EVENT(playing)
109 arguments.length: 1
110 Promise resolved with undefined
111
112 playRaceWithSrcChangeError()
113 RUN(mediaElement = document.createElement('audio'))
114 RUN(mediaElement.src = 'data:,.wav')
115 EVENT(error)
116 EXPECTED (mediaElement.error == '[object MediaError]') OK
117 EXPECTED (mediaElement.error.code == '4') OK
118 RUN(mediaElement.src = 'content/test.wav')
119 EXPECTED (mediaElement.error == 'null') OK
120 EXPECTED (mediaElement.readyState == '0') OK
121 play()
122 arguments.length: 1
123 Promise failed with NotSupportedError: Failed to load because no supported sourc e was found.
philipj_slow 2016/02/25 14:06:48 This ought to change to a resolved promise, or the
mlamouri (slow - plz ping) 2016/02/25 14:40:05 That's correct. I have no idea why I ended up not
124
125 playAndPauseWhenCanPlay()
126 RUN(mediaElement = document.createElement('audio'))
127 RUN(mediaElement.src = 'content/test.wav')
128 EVENT(canplaythrough)
129 EXPECTED (mediaElement.readyState == '4') OK
130 play()
131 EXPECTED (mediaElement.paused == 'false') OK
132 EXPECTED (mediaElement.paused == 'true') OK
133 EVENT(playing)
134 arguments.length: 1
135 Promise resolved with undefined
136
137 playAndPauseBeforeCanPlay()
138 RUN(mediaElement = document.createElement('audio'))
139 EXPECTED (mediaElement.readyState == '0') OK
140 play()
141 EXPECTED (mediaElement.paused == 'false') OK
142 EXPECTED (mediaElement.paused == 'true') OK
143 arguments.length: 1
144 Promise failed with AbortError: The play() request was interrupted by a call to pause().
145
146 loadRejectsPendingPromises()
147 RUN(mediaElement = document.createElement('audio'))
148 play()
149 RUN(mediaElement.load())
150 arguments.length: 1
151 Promise failed with AbortError: The play() request was interrupted by a new load request.
152
153 newSrcRejectPendingPromises()
154 RUN(mediaElement = document.createElement('audio'))
155 play()
156 RUN(mediaElement.src = 'content/test.wav')
157 arguments.length: 1
158 Promise failed with AbortError: The play() request was interrupted by a new load request.
159
160 testEventAndPromiseOrdering
161 RUN(mediaElement = document.createElement('audio'))
162 RUN(mediaElement.src = 'data:,')
163 EVENT(error)
164 RUN(mediaElement.volume = 0.1)
165 play()
166 RUN(mediaElement.volume = 0.2)
167 arguments.length: 1
168 Promise failed with NotSupportedError: The element has no supported sources.
169 END OF TEST
170
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698