Title: [290159] branches/safari-613.1.17.1-branch
Revision
290159
Author
[email protected]
Date
2022-02-18 13:17:59 -0800 (Fri, 18 Feb 2022)

Log Message

Cherry-pick r290156. rdar://problem/89154452

    ServiceWorkerGlobalScope+PushAPI requires PushAPIEnabled
    https://bugs.webkit.org/show_bug.cgi?id=236846

    Patch by Sam Sneddon <[email protected]> on 2022-02-18
    Reviewed by Chris Dumez.

    Source/WebCore:

    Tests: http/wpt/push-api/onpush-disabled.html
           http/wpt/push-api/onpush-enabled.html

    * Modules/push-api/ServiceWorkerGlobalScope+PushAPI.idl:

    LayoutTests:

    * http/wpt/push-api/onpush-disabled-expected.txt: Added.
    * http/wpt/push-api/onpush-disabled.html: Added.
    * http/wpt/push-api/onpush-disabled.js: Added.
    (test):
    * http/wpt/push-api/onpush-enabled-expected.txt: Added.
    * http/wpt/push-api/onpush-enabled.html: Added.
    * http/wpt/push-api/onpush-enabled.js: Added.
    (test):

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

Modified Paths

Added Paths

Diff

Modified: branches/safari-613.1.17.1-branch/LayoutTests/ChangeLog (290158 => 290159)


--- branches/safari-613.1.17.1-branch/LayoutTests/ChangeLog	2022-02-18 21:13:01 UTC (rev 290158)
+++ branches/safari-613.1.17.1-branch/LayoutTests/ChangeLog	2022-02-18 21:17:59 UTC (rev 290159)
@@ -1,5 +1,51 @@
 2022-02-18  Russell Epstein  <[email protected]>
 
+        Cherry-pick r290156. rdar://problem/89154452
+
+    ServiceWorkerGlobalScope+PushAPI requires PushAPIEnabled
+    https://bugs.webkit.org/show_bug.cgi?id=236846
+    
+    Patch by Sam Sneddon <[email protected]> on 2022-02-18
+    Reviewed by Chris Dumez.
+    
+    Source/WebCore:
+    
+    Tests: http/wpt/push-api/onpush-disabled.html
+           http/wpt/push-api/onpush-enabled.html
+    
+    * Modules/push-api/ServiceWorkerGlobalScope+PushAPI.idl:
+    
+    LayoutTests:
+    
+    * http/wpt/push-api/onpush-disabled-expected.txt: Added.
+    * http/wpt/push-api/onpush-disabled.html: Added.
+    * http/wpt/push-api/onpush-disabled.js: Added.
+    (test):
+    * http/wpt/push-api/onpush-enabled-expected.txt: Added.
+    * http/wpt/push-api/onpush-enabled.html: Added.
+    * http/wpt/push-api/onpush-enabled.js: Added.
+    (test):
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290156 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2022-02-18  Sam Sneddon  <[email protected]>
+
+            ServiceWorkerGlobalScope+PushAPI requires PushAPIEnabled
+            https://bugs.webkit.org/show_bug.cgi?id=236846
+
+            Reviewed by Chris Dumez.
+
+            * http/wpt/push-api/onpush-disabled-expected.txt: Added.
+            * http/wpt/push-api/onpush-disabled.html: Added.
+            * http/wpt/push-api/onpush-disabled.js: Added.
+            (test):
+            * http/wpt/push-api/onpush-enabled-expected.txt: Added.
+            * http/wpt/push-api/onpush-enabled.html: Added.
+            * http/wpt/push-api/onpush-enabled.js: Added.
+            (test):
+
+2022-02-18  Russell Epstein  <[email protected]>
+
         Cherry-pick r290087. rdar://problem/88713302
 
     Source/ThirdParty/ANGLE:

Added: branches/safari-613.1.17.1-branch/LayoutTests/http/wpt/push-api/onpush-disabled-expected.txt (0 => 290159)


--- branches/safari-613.1.17.1-branch/LayoutTests/http/wpt/push-api/onpush-disabled-expected.txt	                        (rev 0)
+++ branches/safari-613.1.17.1-branch/LayoutTests/http/wpt/push-api/onpush-disabled-expected.txt	2022-02-18 21:17:59 UTC (rev 290159)
@@ -0,0 +1,4 @@
+
+PASS onpush should not be exposed on ServiceWorkerGlobalScope
+PASS onpushsubscriptionchange should not be exposed on ServiceWorkerGlobalScope
+

Added: branches/safari-613.1.17.1-branch/LayoutTests/http/wpt/push-api/onpush-disabled.html (0 => 290159)


--- branches/safari-613.1.17.1-branch/LayoutTests/http/wpt/push-api/onpush-disabled.html	                        (rev 0)
+++ branches/safari-613.1.17.1-branch/LayoutTests/http/wpt/push-api/onpush-disabled.html	2022-02-18 21:17:59 UTC (rev 290159)
@@ -0,0 +1,16 @@
+<!-- webkit-test-runner [ PushAPIEnabled=false ] -->
+<!doctype html>
+<meta charset=utf-8>
+
+<script src=""
+<script src=""
+<div id=log></div>
+<script>
+(async function() {
+  const scope = 'does/not/exist';
+  let reg = await navigator.serviceWorker.getRegistration(scope);
+  if (reg) await reg.unregister();
+  reg = await navigator.serviceWorker.register("onpush-disabled.js", {scope});
+  fetch_tests_from_worker(reg.installing);
+})();
+</script>

Added: branches/safari-613.1.17.1-branch/LayoutTests/http/wpt/push-api/onpush-disabled.js (0 => 290159)


--- branches/safari-613.1.17.1-branch/LayoutTests/http/wpt/push-api/onpush-disabled.js	                        (rev 0)
+++ branches/safari-613.1.17.1-branch/LayoutTests/http/wpt/push-api/onpush-disabled.js	2022-02-18 21:17:59 UTC (rev 290159)
@@ -0,0 +1,9 @@
+importScripts("/resources/testharness.js");
+
+test(() => {
+    assert_false("onpush" in self);
+}, "onpush should not be exposed on ServiceWorkerGlobalScope");
+
+test(() => {
+    assert_false("onpushsubscriptionchange" in self);
+}, "onpushsubscriptionchange should not be exposed on ServiceWorkerGlobalScope");

Added: branches/safari-613.1.17.1-branch/LayoutTests/http/wpt/push-api/onpush-enabled-expected.txt (0 => 290159)


--- branches/safari-613.1.17.1-branch/LayoutTests/http/wpt/push-api/onpush-enabled-expected.txt	                        (rev 0)
+++ branches/safari-613.1.17.1-branch/LayoutTests/http/wpt/push-api/onpush-enabled-expected.txt	2022-02-18 21:17:59 UTC (rev 290159)
@@ -0,0 +1,4 @@
+
+PASS onpush should be exposed on ServiceWorkerGlobalScope
+PASS onpushsubscriptionchange should be exposed on ServiceWorkerGlobalScope
+

Added: branches/safari-613.1.17.1-branch/LayoutTests/http/wpt/push-api/onpush-enabled.html (0 => 290159)


--- branches/safari-613.1.17.1-branch/LayoutTests/http/wpt/push-api/onpush-enabled.html	                        (rev 0)
+++ branches/safari-613.1.17.1-branch/LayoutTests/http/wpt/push-api/onpush-enabled.html	2022-02-18 21:17:59 UTC (rev 290159)
@@ -0,0 +1,16 @@
+<!-- webkit-test-runner [ PushAPIEnabled=true ] -->
+<!doctype html>
+<meta charset=utf-8>
+
+<script src=""
+<script src=""
+<div id=log></div>
+<script>
+(async function() {
+  const scope = 'does/not/exist';
+  let reg = await navigator.serviceWorker.getRegistration(scope);
+  if (reg) await reg.unregister();
+  reg = await navigator.serviceWorker.register("onpush-enabled.js", {scope});
+  fetch_tests_from_worker(reg.installing);
+})();
+</script>

Added: branches/safari-613.1.17.1-branch/LayoutTests/http/wpt/push-api/onpush-enabled.js (0 => 290159)


--- branches/safari-613.1.17.1-branch/LayoutTests/http/wpt/push-api/onpush-enabled.js	                        (rev 0)
+++ branches/safari-613.1.17.1-branch/LayoutTests/http/wpt/push-api/onpush-enabled.js	2022-02-18 21:17:59 UTC (rev 290159)
@@ -0,0 +1,9 @@
+importScripts("/resources/testharness.js");
+
+test(() => {
+    assert_true("onpush" in self);
+}, "onpush should be exposed on ServiceWorkerGlobalScope");
+
+test(() => {
+    assert_true("onpushsubscriptionchange" in self);
+}, "onpushsubscriptionchange should be exposed on ServiceWorkerGlobalScope");

Modified: branches/safari-613.1.17.1-branch/Source/WebCore/ChangeLog (290158 => 290159)


--- branches/safari-613.1.17.1-branch/Source/WebCore/ChangeLog	2022-02-18 21:13:01 UTC (rev 290158)
+++ branches/safari-613.1.17.1-branch/Source/WebCore/ChangeLog	2022-02-18 21:17:59 UTC (rev 290159)
@@ -1,5 +1,47 @@
 2022-02-18  Russell Epstein  <[email protected]>
 
+        Cherry-pick r290156. rdar://problem/89154452
+
+    ServiceWorkerGlobalScope+PushAPI requires PushAPIEnabled
+    https://bugs.webkit.org/show_bug.cgi?id=236846
+    
+    Patch by Sam Sneddon <[email protected]> on 2022-02-18
+    Reviewed by Chris Dumez.
+    
+    Source/WebCore:
+    
+    Tests: http/wpt/push-api/onpush-disabled.html
+           http/wpt/push-api/onpush-enabled.html
+    
+    * Modules/push-api/ServiceWorkerGlobalScope+PushAPI.idl:
+    
+    LayoutTests:
+    
+    * http/wpt/push-api/onpush-disabled-expected.txt: Added.
+    * http/wpt/push-api/onpush-disabled.html: Added.
+    * http/wpt/push-api/onpush-disabled.js: Added.
+    (test):
+    * http/wpt/push-api/onpush-enabled-expected.txt: Added.
+    * http/wpt/push-api/onpush-enabled.html: Added.
+    * http/wpt/push-api/onpush-enabled.js: Added.
+    (test):
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290156 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2022-02-18  Sam Sneddon  <[email protected]>
+
+            ServiceWorkerGlobalScope+PushAPI requires PushAPIEnabled
+            https://bugs.webkit.org/show_bug.cgi?id=236846
+
+            Reviewed by Chris Dumez.
+
+            Tests: http/wpt/push-api/onpush-disabled.html
+                   http/wpt/push-api/onpush-enabled.html
+
+            * Modules/push-api/ServiceWorkerGlobalScope+PushAPI.idl:
+
+2022-02-18  Russell Epstein  <[email protected]>
+
         Cherry-pick r290109. rdar://problem/89072235
 
     Crash under ScrollingCoordinatorMac::hasNodeWithAnimatedScrollChanged()

Modified: branches/safari-613.1.17.1-branch/Source/WebCore/Modules/push-api/ServiceWorkerGlobalScope+PushAPI.idl (290158 => 290159)


--- branches/safari-613.1.17.1-branch/Source/WebCore/Modules/push-api/ServiceWorkerGlobalScope+PushAPI.idl	2022-02-18 21:13:01 UTC (rev 290158)
+++ branches/safari-613.1.17.1-branch/Source/WebCore/Modules/push-api/ServiceWorkerGlobalScope+PushAPI.idl	2022-02-18 21:17:59 UTC (rev 290159)
@@ -24,7 +24,8 @@
  */
 
 [
-    EnabledAtRuntime=ServiceWorkerEnabled
+    Conditional=SERVICE_WORKER,
+    EnabledAtRuntime=ServiceWorkerEnabled&PushAPIEnabled
 ] partial interface ServiceWorkerGlobalScope {
     attribute EventHandler onpush;
     attribute EventHandler onpushsubscriptionchange;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to