Skip to content

Commit

Permalink
Bug 1461604 [wpt PR 11003] - Worker: Throw an ErrorEvent on a failure…
Browse files Browse the repository at this point in the history
… of module loading, a=testonly

Automatic update from web-platform-testsWorker: Throw an ErrorEvent on a failure of module loading

This behavior is defined in the HTML spec:

  Step 13: "If the algorithm asynchronously completes with null, queue a task to
  fire an event named error at worker, and return."
  https://html.spec.whatwg.org/multipage/workers.html#worker-processing-model

An ErrorEvent is created on a worker thread, and passed to the main thread to
dispatch it on a worker object in a document context.

Bug: 843031
Change-Id: I1fd82cba1e02b1658bb2b556742f7a206ee754a7
Reviewed-on: https://chromium-review.googlesource.com/1058998
Commit-Queue: Hiroki Nakagawa <nhirokichromium.org>
Reviewed-by: Kouhei Ueno <kouheichromium.org>
Cr-Commit-Position: refs/heads/master{#558903}

--

wpt-commits: 92a3d3d14638e8aff86eec3a2b1a6599249ea994
wpt-pr: 11003

UltraBlame original commit: 4143290a87a68d7268365fe429e48cf6aba9e52d
  • Loading branch information
marco-c committed Oct 3, 2019
1 parent 06441ad commit e8450a7
Show file tree
Hide file tree
Showing 4 changed files with 336 additions and 2 deletions.
62 changes: 60 additions & 2 deletions testing/web-platform/meta/MANIFEST.json
Original file line number Diff line number Diff line change
Expand Up @@ -1826721,6 +1826721,34 @@ static
-
import
-
non
-
existent
-
script
-
worker
.
js
"
:
[
[
{
}
]
]
"
workers
/
modules
/
resources
/
static
-
import
-
worker
.
js
Expand Down Expand Up @@ -4192926,7 +4192954,7 @@ html
:
[
"
95973c682b79618cc894417a4f89a758e7e8c7b1
b9f5a7a0384ac3f34c48f32a378b758880f59b06
"
"
testharness
Expand Down Expand Up @@ -4193010,7 +4193038,7 @@ js
:
[
"
372686abd1b2d2d09228a44f6420c646319e0bd1
0d2cfe16d71bb17577c6cf6cde5973c18c2c70fe
"
"
support
Expand Down Expand Up @@ -4193235,6 +4193263,36 @@ static
-
import
-
non
-
existent
-
script
-
worker
.
js
"
:
[
"
e8e1f0aedcc780aac742af01387dd151b10104bc
"
"
support
"
]
"
workers
/
modules
/
resources
/
static
-
import
-
worker
.
js
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,256 @@
'
)
;
promise_test
(
(
)
=
>
{
const
scriptURL
=
'
resources
/
non
-
existent
-
worker
.
js
'
;
const
worker
=
new
Worker
(
scriptURL
{
type
:
'
module
'
}
)
;
return
new
Promise
(
resolve
=
>
worker
.
onerror
=
resolve
)
;
}
'
Worker
construction
for
non
-
existent
script
should
throw
an
exception
.
'
)
;
promise_test
(
(
)
=
>
{
const
scriptURL
=
'
resources
/
static
-
import
-
non
-
existent
-
script
-
worker
.
js
'
;
const
worker
=
new
Worker
(
scriptURL
{
type
:
'
module
'
}
)
;
return
new
Promise
(
resolve
=
>
worker
.
onerror
=
resolve
)
;
}
'
Static
import
for
non
-
existent
script
should
throw
an
exception
.
'
)
;
promise_test
(
(
)
=
>
{
const
script_url
=
'
.
/
non
-
existent
-
worker
.
js
'
;
const
worker
=
new
Worker
(
'
resources
/
dynamic
-
import
-
given
-
url
-
worker
.
js
'
{
type
:
'
module
'
}
)
;
worker
.
postMessage
(
script_url
)
;
return
new
Promise
(
resolve
=
>
worker
.
onmessage
=
resolve
)
.
then
(
msg_event
=
>
assert_equals
(
msg_event
.
data
'
ERROR
'
)
)
;
}
'
Dynamic
import
for
non
-
existent
script
should
throw
an
exception
.
'
)
;
<
/
script
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@ e
.
data
)
.
catch
(
error_event
=
>
postMessage
(
'
ERROR
'
)
)
;
}
)
Expand Down
Loading

0 comments on commit e8450a7

Please sign in to comment.