Skip to content

Commit 1a0a2cb

Browse files
committed
Bug 1937663 [wpt PR 49719] - Fix a bug in test_driver.bless(), a=testonly
Automatic update from web-platform-tests Fix a bug in test_driver.bless() (#49719) This code was previously doing this: let wait_click = new Promise(resolve => { button.addEventListener("click", resolve)); }; return test_driver.click(button) .then(wait_click) .then(... but the argument to `.then(wait_click)` isn't a function, it's the promise to return. Therefore .then() creates an already-resolved promise containing `wait_click` as its resolved value. Which the next `.then()` block ignores. So this wasn't actually waiting for the click to occur. This triggered a number of test bugs (caused by erroneous assumptions accidentally baked into the tests. I fixed a few, and filed a few bugs for the rest (after failing to figure out how to fix them). Note that the WPT version of testdriver.js is rolled into Chromium, so that change is being made here: web-platform-tests/wpt#49691 Bug: 384009734,384050894 Change-Id: Ibdb8a97d23998ad89c5a48c23a7e780dc605283b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6094526 Reviewed-by: Jonathan Lee <jonathanjleegoogle.com> Auto-Submit: Mason Freed <masonfchromium.org> Commit-Queue: Mason Freed <masonfchromium.org> Commit-Queue: Jonathan Lee <jonathanjleegoogle.com> Cr-Commit-Position: refs/heads/main{#1397010} Co-authored-by: Mason Freed <masonfchromium.org> -- wpt-commits: ce746b469d6c2fe11cf9db769eb2b3426bad6466 wpt-pr: 49719 UltraBlame original commit: 337b58e389432dc74cdafad2aeb85b1e0ea5fc3c
1 parent 8152897 commit 1a0a2cb

File tree

3 files changed

+159
-100
lines changed

3 files changed

+159
-100
lines changed

testing/web-platform/tests/fullscreen/rendering/backdrop-object.html

+65-42
Original file line numberDiff line numberDiff line change
@@ -139,20 +139,6 @@
139139
+
140140
xml
141141
"
142-
data
143-
=
144-
"
145-
/
146-
images
147-
/
148-
100px
149-
-
150-
green
151-
-
152-
rect
153-
.
154-
svg
155-
"
156142
>
157143
<
158144
/
@@ -173,50 +159,105 @@
173159
"
174160
)
175161
;
176-
Promise
162+
test_driver
177163
.
178-
all
164+
bless
165+
(
166+
'
167+
fullscreen
168+
'
169+
)
170+
.
171+
then
172+
(
173+
(
174+
)
175+
=
176+
>
177+
{
178+
object
179+
.
180+
data
181+
=
182+
"
183+
/
184+
images
185+
/
186+
100px
187+
-
188+
green
189+
-
190+
rect
191+
.
192+
svg
193+
"
194+
;
195+
}
196+
)
197+
.
198+
then
179199
(
180-
[
200+
(
201+
)
202+
=
203+
>
181204
new
182205
Promise
183206
(
184207
(
185208
resolve
186-
reject
187209
)
188210
=
189211
>
190-
document
212+
object
191213
.
192214
addEventListener
193215
(
194216
"
195-
fullscreenchange
217+
load
196218
"
197219
resolve
198220
)
199221
)
222+
)
223+
.
224+
then
225+
(
226+
(
227+
)
228+
=
229+
>
230+
object
231+
.
232+
requestFullscreen
233+
(
234+
)
235+
)
236+
.
237+
then
238+
(
239+
(
240+
)
241+
=
242+
>
200243
new
201244
Promise
202245
(
203246
(
204247
resolve
205-
reject
206248
)
207249
=
208250
>
209-
object
251+
document
210252
.
211253
addEventListener
212254
(
213255
"
214-
load
256+
fullscreenchange
215257
"
216258
resolve
217259
)
218260
)
219-
]
220261
)
221262
.
222263
then
@@ -241,24 +282,6 @@
241282
)
242283
)
243284
;
244-
test_driver
245-
.
246-
bless
247-
(
248-
'
249-
fullscreen
250-
'
251-
(
252-
)
253-
=
254-
>
255-
object
256-
.
257-
requestFullscreen
258-
(
259-
)
260-
)
261-
;
262285
<
263286
/
264287
script

testing/web-platform/tests/html/semantics/forms/the-input-element/show-picker-user-gesture.html

+88-57
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,6 @@
104104
body
105105
>
106106
<
107-
/
108-
body
109-
>
110-
<
111107
script
112108
type
113109
=
@@ -126,20 +122,42 @@
126122
js
127123
"
128124
;
129-
for
130-
(
125+
/
126+
/
127+
File
128+
pickers
129+
can
130+
'
131+
t
132+
be
133+
closed
134+
.
131135
const
132-
inputType
133-
of
136+
types
137+
=
134138
inputTypes
135-
)
136-
{
137-
test
139+
.
140+
filter
138141
(
139142
(
143+
t
140144
)
141145
=
142146
>
147+
t
148+
!
149+
=
150+
'
151+
file
152+
'
153+
)
154+
;
155+
function
156+
createElement
157+
(
158+
t
159+
type
160+
)
143161
{
144162
const
145163
input
@@ -160,6 +178,60 @@
160178
"
161179
type
162180
"
181+
type
182+
)
183+
;
184+
document
185+
.
186+
body
187+
.
188+
appendChild
189+
(
190+
input
191+
)
192+
;
193+
t
194+
.
195+
add_cleanup
196+
(
197+
(
198+
)
199+
=
200+
>
201+
input
202+
.
203+
remove
204+
(
205+
)
206+
)
207+
;
208+
return
209+
input
210+
;
211+
}
212+
for
213+
(
214+
const
215+
inputType
216+
of
217+
types
218+
)
219+
{
220+
promise_test
221+
(
222+
async
223+
(
224+
t
225+
)
226+
=
227+
>
228+
{
229+
const
230+
input
231+
=
232+
createElement
233+
(
234+
t
163235
inputType
164236
)
165237
;
@@ -200,41 +272,21 @@
200272
gesture
201273
)
202274
;
203-
}
204-
for
205-
(
206-
const
207-
inputType
208-
of
209-
inputTypes
210-
)
211-
{
212275
promise_test
213276
(
214277
async
278+
(
215279
t
280+
)
216281
=
217282
>
218283
{
219284
const
220285
input
221286
=
222-
document
223-
.
224287
createElement
225288
(
226-
"
227-
input
228-
"
229-
)
230-
;
231-
input
232-
.
233-
setAttribute
234-
(
235-
"
236-
type
237-
"
289+
t
238290
inputType
239291
)
240292
;
@@ -283,42 +335,21 @@
283335
active
284336
)
285337
;
286-
}
287-
for
288-
(
289-
const
290-
inputType
291-
of
292-
inputTypes
293-
)
294-
{
295338
promise_test
296339
(
297340
async
298341
(
342+
t
299343
)
300344
=
301345
>
302346
{
303347
const
304348
input
305349
=
306-
document
307-
.
308350
createElement
309351
(
310-
'
311-
input
312-
'
313-
)
314-
;
315-
input
316-
.
317-
setAttribute
318-
(
319-
'
320-
type
321-
'
352+
t
322353
inputType
323354
)
324355
;

testing/web-platform/tests/resources/testdriver.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -666,14 +666,19 @@ button
666666
.
667667
then
668668
(
669+
(
670+
)
671+
=
672+
>
669673
wait_click
670674
)
671675
.
672676
then
673677
(
674-
function
675678
(
676679
)
680+
=
681+
>
677682
{
678683
button
679684
.

0 commit comments

Comments
 (0)