ServiceWorkerGlobalScope::skipWaiting() should resolve its promise
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Nov 2017 21:41:59 +0000 (21:41 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Nov 2017 21:41:59 +0000 (21:41 +0000)
https://bugs.webkit.org/show_bug.cgi?id=180204

Reviewed by Brady Eidson.

LayoutTests/imported/w3c:

Rebaseline test which uses skipWaiting().

* web-platform-tests/service-workers/service-worker/claim-with-redirect.https-expected.txt:

Source/WebCore:

ServiceWorkerGlobalScope::skipWaiting() should resolve its promise, even if it is not
implemented yet. For now, always reject the promise.

* workers/service/ServiceWorkerGlobalScope.cpp:
(WebCore::ServiceWorkerGlobalScope::skipWaiting):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225346 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/claim-with-redirect.https-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/workers/service/ServiceWorkerGlobalScope.cpp

index c7b5961..ec76bb6 100644 (file)
@@ -1,5 +1,16 @@
 2017-11-30  Chris Dumez  <cdumez@apple.com>
 
+        ServiceWorkerGlobalScope::skipWaiting() should resolve its promise
+        https://bugs.webkit.org/show_bug.cgi?id=180204
+
+        Reviewed by Brady Eidson.
+
+        Rebaseline test which uses skipWaiting().
+
+        * web-platform-tests/service-workers/service-worker/claim-with-redirect.https-expected.txt:
+
+2017-11-30  Chris Dumez  <cdumez@apple.com>
+
         Populate self.registration.installing/waiting/active inside service workers
         https://bugs.webkit.org/show_bug.cgi?id=180168
 
index 1008013..284e429 100644 (file)
@@ -1,4 +1,4 @@
-CONSOLE MESSAGE: Unhandled Promise Rejection: TypeError: Cannot update a null/nonexistent service worker registration
+CONSOLE MESSAGE: line 27: Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating 'r.update')
   
 
 FAIL Claim works after redirection to another origin assert_equals: expected (string) "updated" but got (undefined) undefined
index 1788583..3e9927d 100644 (file)
@@ -1,5 +1,18 @@
 2017-11-30  Chris Dumez  <cdumez@apple.com>
 
+        ServiceWorkerGlobalScope::skipWaiting() should resolve its promise
+        https://bugs.webkit.org/show_bug.cgi?id=180204
+
+        Reviewed by Brady Eidson.
+
+        ServiceWorkerGlobalScope::skipWaiting() should resolve its promise, even if it is not
+        implemented yet. For now, always reject the promise.
+
+        * workers/service/ServiceWorkerGlobalScope.cpp:
+        (WebCore::ServiceWorkerGlobalScope::skipWaiting):
+
+2017-11-30  Chris Dumez  <cdumez@apple.com>
+
         Mark a few heap-allocated service worker types as WTF_MAKE_FAST_ALLOCATED
         https://bugs.webkit.org/show_bug.cgi?id=180212
 
index 33c7f2e..d6a3f17 100644 (file)
@@ -46,8 +46,10 @@ ServiceWorkerGlobalScope::ServiceWorkerGlobalScope(const ServiceWorkerContextDat
 
 ServiceWorkerGlobalScope::~ServiceWorkerGlobalScope() = default;
 
-void ServiceWorkerGlobalScope::skipWaiting(Ref<DeferredPromise>&&)
+void ServiceWorkerGlobalScope::skipWaiting(Ref<DeferredPromise>&& promise)
 {
+    // FIXME: Implement this.
+    promise->reject(Exception { NotSupportedError, ASCIILiteral("self.skipWaiting() is not yet supported") });
 }
 
 EventTargetInterface ServiceWorkerGlobalScope::eventTargetInterface() const