forked from mirrors/gecko-dev
Bug 1802173: Worklet.AddModule should return AbortError if fails to fetch the script. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D162867
This commit is contained in:
parent
c6b7ac16e0
commit
2c1867b493
2 changed files with 5 additions and 12 deletions
|
|
@ -261,7 +261,11 @@ class WorkletFetchHandler final : public PromiseNativeHandler,
|
||||||
virtual void RejectedCallback(JSContext* aCx, JS::Handle<JS::Value> aValue,
|
virtual void RejectedCallback(JSContext* aCx, JS::Handle<JS::Value> aValue,
|
||||||
ErrorResult& aRv) override {
|
ErrorResult& aRv) override {
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
RejectPromises(NS_ERROR_DOM_NETWORK_ERR);
|
|
||||||
|
// https://html.spec.whatwg.org/multipage/worklets.html#dom-worklet-addmodule
|
||||||
|
// Step 6.4.1. If script is null, then:
|
||||||
|
// Step 1.1.2. Reject promise with an "AbortError" DOMException.
|
||||||
|
RejectPromises(NS_ERROR_DOM_ABORT_ERR);
|
||||||
}
|
}
|
||||||
|
|
||||||
const nsCString& URL() const { return mURL; }
|
const nsCString& URL() const { return mURL; }
|
||||||
|
|
|
||||||
|
|
@ -10,15 +10,6 @@
|
||||||
[Importing an invalid URL should reject the given promise with a SyntaxError.]
|
[Importing an invalid URL should reject the given promise with a SyntaxError.]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Importing a file:// URL should reject the given promise.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Importing about:blank should reject the given promise.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Importing a cross origin resource without the Access-Control-Allow-Origin header should reject the given promise]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Importing a script that has a syntax error should reject the given promise.]
|
[Importing a script that has a syntax error should reject the given promise.]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
@ -28,5 +19,3 @@
|
||||||
[Importing a script that imports an invalid identifier should reject the given promise.]
|
[Importing a script that imports an invalid identifier should reject the given promise.]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Importing a cross-origin-redirected resource without the Access-Control-Allow-Origin header should reject the given promise]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue