SharedWorker: Fire an error event when type or credentials mismatch #21795
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This CL adds the step to check if type and credentials values are same
with these of matched SharedWorkerGlobalScope before connecting to it.
This is just added to the spec.
Spec issue: whatwg/html#5235
Pull request: whatwg/html#5258
WPT: #21651
This changes the behavior, and WPT is already added from the public pull
requests to WPT GitHub:
wpt/workers/shared-worker-options-mismatch.html
In this CL, http/tests/workers/shared-worker-shared.html is modified.
Since the way to catch worker's error had changed, this test was no
longer catching the error properly. This test was attempting to create
SharedWorker with non-existing script url so ErrorEvent had been fired.
However, this test couldn't successfully catch ErrorEvent and this is
found out since the console error log added in this CL is printed as
"text diff". Fixing this test is out-of-scope, so this CL avoid this
console error by using an existing script url.
Bug: 1050438
Change-Id: I03232ff19db89560d99d3ddc6a25cdd8f1898222
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2041386
Commit-Queue: Eriko Kurimoto <elkurin@google.com>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Hiroshige Hayashizaki <hiroshige@chromium.org>
Cr-Commit-Position: refs/heads/master@{#741848}