Skip to content

Commit

Permalink
Bug 1572270 [wpt PR 18329] - [payment-request] Fix uncaught rejection…
Browse files Browse the repository at this point in the history
…s in payment-is-showing test, a=testonly

Automatic update from web-platform-tests
Catch all promise rejections so the test harness doesn't fail due to uncaught rejection

--

wpt-commits: 5c3c67adc2cfce655b6ec0e65b3e4b785590e821
wpt-pr: 18329

UltraBlame original commit: bf3b03c7cc3447c07b6b6fffce3485de7f926ffa
  • Loading branch information
marco-c committed Oct 4, 2019
1 parent b604558 commit d5badf6
Showing 1 changed file with 298 additions and 16 deletions.
314 changes: 298 additions & 16 deletions testing/web-platform/tests/payment-request/payment-is-showing.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -1079,6 +1079,7 @@
.
const
[
windowShowPromise
iframeShowPromise
]
=
Expand Down Expand Up @@ -1106,14 +1107,13 @@
=
>
{
return
[
windowRequest
.
show
(
)
;
return
[
iframeRequest
.
show
Expand Down Expand Up @@ -1156,6 +1156,28 @@
(
)
;
await
promise_rejects
(
t
"
AbortError
"
windowShowPromise
"
The
window
payment
request
should
be
aborted
by
test
.
"
)
;
iframe
.
remove
Expand Down Expand Up @@ -1340,19 +1362,6 @@
)
;
await
popupRequest
.
abort
(
)
;
popupWindow
.
close
(
)
;
await
promise_rejects
(
t
Expand All @@ -1375,6 +1384,39 @@
"
)
;
await
popupRequest
.
abort
(
)
;
await
promise_rejects
(
t
"
AbortError
"
popupShowPromise
"
Expected
popupShowPromise
to
be
aborted
by
test
.
"
)
;
popupWindow
.
close
(
)
;
}
"
Using
Expand Down Expand Up @@ -1660,6 +1702,27 @@
(
)
;
await
promise_rejects
(
t
"
AbortError
"
windowShowPromise
"
Expect
window
promise
to
be
aborted
by
test
.
"
)
;
popupWindow
.
close
Expand Down Expand Up @@ -1911,6 +1974,26 @@
(
)
;
await
promise_rejects
(
t
"
AbortError
"
popupShowPromise
"
Expected
popupShowPromise
to
be
aborted
by
test
.
"
)
;
popupWindow
.
close
Expand Down Expand Up @@ -2223,6 +2306,26 @@
(
)
;
await
promise_rejects
(
t
"
AbortError
"
iframeShowPromise
"
Expected
iframeShowPromise
to
be
aborted
by
test
.
"
)
;
popupWindow
.
close
Expand Down Expand Up @@ -2433,21 +2536,200 @@
)
;
const
[
showPromise
]
=
await
test_driver
.
bless
(
"
start
a
new
payment
request
"
(
)
=
>
{
return
[
request
.
show
(
)
]
;
}
)
;
/
/
If
a
payment
sheet
fails
to
show
it
should
reject
immediately
.
If
it
/
/
hasn
'
t
rejected
in
1
second
then
the
test
has
passed
.
t
.
step_timeout
(
async
(
)
=
>
{
/
/
We
'
re
done
.
Clean
up
.
await
request
.
abort
(
)
;
t
.
done
(
)
;
}
)
;
/
/
If
the
navigation
in
iframe
failed
to
close
the
original
payment
sheet
/
/
there
|
showPromise
|
should
reject
immediately
and
this
indicates
a
/
/
failure
of
this
test
.
await
showPromise
.
then
(
(
)
=
>
{
assert_true
(
false
"
Second
payment
sheet
should
be
pending
but
is
resolved
.
"
)
;
}
)
.
catch
(
e
=
>
{
assert_true
(
false
"
Second
payment
sheet
should
be
pending
but
is
rejected
.
"
+
e
.
message
)
;
}
)
;
}
"
Navigating
Expand Down

0 comments on commit d5badf6

Please sign in to comment.