Chromium Code Reviews| Index: third_party/WebKit/Source/modules/serviceworkers/ExtendableEvent.cpp |
| diff --git a/third_party/WebKit/Source/modules/serviceworkers/ExtendableEvent.cpp b/third_party/WebKit/Source/modules/serviceworkers/ExtendableEvent.cpp |
| index b3aa4da5d83590e6461c62480be5fd65ebe31d13..c7faaf94a0e6a33fd99c5eebd5747eeb2cbe4047 100644 |
| --- a/third_party/WebKit/Source/modules/serviceworkers/ExtendableEvent.cpp |
| +++ b/third_party/WebKit/Source/modules/serviceworkers/ExtendableEvent.cpp |
| @@ -52,8 +52,19 @@ ExtendableEvent::~ExtendableEvent() {} |
| void ExtendableEvent::waitUntil(ScriptState* script_state, |
| ScriptPromise script_promise, |
| ExceptionState& exception_state) { |
| - if (observer_) |
| - observer_->WaitUntil(script_state, script_promise, exception_state); |
| + // WPT test: |
| + // external/wpt/service-workers/service-worker/ |
| + // extendable-event-async-waituntil.https.html |
| + // 'Test calling waitUntil on a script constructed ExtendableEvent throws |
| + // exception' |
|
falken
2017/05/25 07:23:23
Ah sorry I meant to just link in the codereview.
leonhsl(Using Gerrit)
2017/05/25 10:11:36
Oops, got it, removed this comment and updated CL
|
| + if (!observer_) { |
| + exception_state.ThrowDOMException( |
| + kInvalidStateError, |
| + "Can not call waitUntil on a script constructed ExtendableEvent."); |
| + return; |
| + } |
| + |
| + observer_->WaitUntil(script_state, script_promise, exception_state); |
| } |
| ExtendableEvent::ExtendableEvent(const AtomicString& type, |