Bug 1523562 [wpt PR 15061] - Worker: Fix wpt/workers/semantics/run-a-worker/003.html...
commit9190fc83bd7f28b30ab604eff0e81bfb63ad28d6
authorHiroki Nakagawa <nhiroki@chromium.org>
Fri, 1 Feb 2019 11:39:38 +0000 (1 11:39 +0000)
committerJames Graham <james@hoppipolla.co.uk>
Tue, 5 Feb 2019 17:54:32 +0000 (5 17:54 +0000)
tree3cb744d513974ed16ec7c2ea54e751f06503565f
parent90a9bc54838c325128d27b47380e1eb0d19357c6
Bug 1523562 [wpt PR 15061] - Worker: Fix wpt/workers/semantics/run-a-worker/003.html for shared workers, a=testonly

Automatic update from web-platform-tests
Worker: Fix wpt/workers/semantics/run-a-worker/003.html for shared workers

Before this CL, the test expects that a 404 failure on shared worker script
fetch doesn't fire an error event. However, this doesn't obey the HTML spec
(see below), and actually Chrome and Firefox fail the test [1]. Note that
Edge and Safari haven't been implemented shared workers.

This CL changes the test to expect that the failure fires an error event.

<HTML spec from [2]>
12. Obtain script by switching on the value of options's type member:
  - "classic": Fetch a classic worker script given url, outside settings,
    destination, and inside settings.
  (...snip...)
  If the algorithm asynchronously completes with null, then:
    - Queue a task to fire an event named error at worker.
    - Run the environment discarding steps for inside settings.
    - Return.
</HTML spec>

<Fetch spec from [3]>
To fetch a classic worker script given a url, a fetch client settings
object, a destination, and a script settings object, run these steps.
The algorithm will asynchronously complete with either null (on failure) or
a new classic script (on success).
  (...snip...)
  4. If response's type is "error", or response's status is not an ok
     status, asynchronously complete this algorithm with null, and abort
     these steps.
</Fetch spec>

[1] https://wpt.fyi/results/workers/semantics/run-a-worker/003.html?run_id=5697959937179648&run_id=5733815918002176&run_id=5135009983758336&run_id=5639735062036480
[2] https://html.spec.whatwg.org/multipage/workers.html#run-a-worker
[3] https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-classic-worker-script

Bug: 655458, 924041
Change-Id: Ia4dc694e5bff5daed9a80a963e6316293c86c8bc
Reviewed-on: https://chromium-review.googlesource.com/c/1436276
Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Reviewed-by: Hiroshige Hayashizaki <hiroshige@chromium.org>
Cr-Commit-Position: refs/heads/master@{#626059}

--

wpt-commits: 67d4f2347351f94e5b5faf411e59471189fedd3b
wpt-pr: 15061
testing/web-platform/tests/workers/semantics/run-a-worker/003.html