Skip to content

Commit

Permalink
Bug 1615031 [wpt PR 21762] - Eliminate last uses of assert_throws., a…
Browse files Browse the repository at this point in the history
…=testonly

Automatic update from web-platform-tests
Eliminate last uses of assert_throws.

The one remaining use inside promise_rejects will go away soon when
promise_rejects goes away.

--

wpt-commits: e4727526d79aa4add8c0f23b64b5fd46df391cc7
wpt-pr: 21762

UltraBlame original commit: 33dc465d4e31611319ae20580c46b8c7e15382da
  • Loading branch information
marco-c committed Feb 18, 2020
1 parent da140e8 commit e06872e
Show file tree
Hide file tree
Showing 29 changed files with 274 additions and 358 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,9 @@
=
false
;
assert_throws
assert_throws_js
(
new
EvalError
(
)
_
=
>
Expand Down Expand Up @@ -207,12 +204,9 @@
=
>
{
assert_throws
assert_throws_js
(
new
EvalError
(
)
_
=
>
Expand Down Expand Up @@ -325,12 +319,9 @@
"
)
;
assert_throws
assert_throws_js
(
new
TypeError
(
)
_
=
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,14 +197,11 @@
.
internals
;
assert_throws
assert_throws_js
(
new
TypeError
(
)
(
)
=
>
{
Expand All @@ -222,12 +219,11 @@
}
)
;
assert_throws
assert_throws_dom
(
new
'
SyntaxError
(
)
'
(
)
=
Expand All @@ -246,7 +242,7 @@
}
)
;
assert_throws
assert_throws_dom
(
'
InvalidCharacterError
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,12 +326,11 @@
=
>
{
assert_throws
assert_throws_dom
(
new
'
SyntaxError
(
)
'
(
)
=
Expand All @@ -350,12 +349,11 @@
}
)
;
assert_throws
assert_throws_dom
(
new
'
SyntaxError
(
)
'
(
)
=
Expand All @@ -375,12 +373,11 @@
}
)
;
assert_throws
assert_throws_dom
(
new
'
SyntaxError
(
)
'
(
)
=
Expand All @@ -401,12 +398,11 @@
}
)
;
assert_throws
assert_throws_dom
(
new
'
SyntaxError
(
)
'
(
)
=
Expand All @@ -428,12 +424,11 @@
}
)
;
assert_throws
assert_throws_dom
(
new
'
SyntaxError
(
)
'
(
)
=
Expand All @@ -457,12 +452,11 @@
}
)
;
assert_throws
assert_throws_dom
(
new
'
SyntaxError
(
)
'
(
)
=
Expand All @@ -485,12 +479,11 @@
}
)
;
assert_throws
assert_throws_dom
(
new
'
SyntaxError
(
)
'
(
)
=
Expand Down
139 changes: 118 additions & 21 deletions testing/web-platform/tests/docs/writing-tests/testharness-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1275,7 +1275,10 @@ next
test
starts
.
promise_rejects
promise_rejects_dom
promise_rejects_js
and
promise_rejects_exactly
can
be
used
Expand All @@ -1288,26 +1291,46 @@ to
reject
:
js
promise_rejects
promise_rejects_dom
(
test_object
code
promise
description
)
promise_rejects_js
(
test_object
constructor
promise
description
)
promise_rejects_exactly
(
test_object
value
promise
description
)
The
code
argument
is
constructor
and
value
arguments
are
equivalent
to
the
same
argument
to
the
assert_throws
function
assert_throws_dom
assert_throws_js
and
assert_throws_exactly
functions
.
Here
'
Expand Down Expand Up @@ -6256,7 +6279,7 @@ readonly
#
#
#
assert_throws
assert_throws_dom
(
code
func
Expand Down Expand Up @@ -6323,7 +6346,7 @@ TIMEOUT_ERR
"
)
*
object
number
-
asserts
that
Expand All @@ -6332,23 +6355,97 @@ thrown
exception
must
be
any
other
kind
of
exception
a
DOMException
with
the
fiven
code
value
(
e
.
g
.
DOMException
.
TIMEOUT_ERR
)
.
func
-
a
property
called
"
name
"
function
that
matches
code
should
throw
#
#
#
assert_throws_js
(
constructor
func
description
)
constructor
-
the
expected
exception
.
name
This
is
the
constructor
object
that
the
exception
should
have
as
its
.
constructor
.
For
example
TypeError
or
someOtherWindow
.
RangeError
.
func
-
a
function
that
should
throw
#
#
#
assert_throws_exactly
(
value
func
description
)
valie
-
the
exact
value
that
func
is
expected
to
throw
if
called
.
func
-
Expand Down
2 changes: 1 addition & 1 deletion testing/web-platform/tests/html/dom/new-harness.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ ReflectionHarness
.
assertThrows
=
assert_throws
assert_throws_dom
;
Loading

0 comments on commit e06872e

Please sign in to comment.