Title: [287384] trunk
Revision
287384
Author
[email protected]
Date
2021-12-22 23:00:15 -0800 (Wed, 22 Dec 2021)

Log Message

Re-enable WebPushD.HandleInjectedPush API test
https://bugs.webkit.org/show_bug.cgi?id=234627

Patch by Alex Christensen <[email protected]> on 2021-12-22
Reviewed by Brady Eidson.

Source/WebKit:

I needed to make an entitlement check return true when using the non-internal SDK,
which can't sign private entitlements into a binary.  I also needed to make the fake
TestWebKitAPI code signing identifier match the identifier that arm64 Macs actually get,
or else m_testingPushMessages would not contain the right key in Daemon::getPendingPushMessages
on arm64 Macs.

* webpushd/PushClientConnection.mm:
(WebPushD::ClientConnection::hostAppCodeSigningIdentifier):
(WebPushD::ClientConnection::hostHasEntitlement):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm:

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (287383 => 287384)


--- trunk/Source/WebKit/ChangeLog	2021-12-23 04:04:25 UTC (rev 287383)
+++ trunk/Source/WebKit/ChangeLog	2021-12-23 07:00:15 UTC (rev 287384)
@@ -1,3 +1,20 @@
+2021-12-22  Alex Christensen  <[email protected]>
+
+        Re-enable WebPushD.HandleInjectedPush API test
+        https://bugs.webkit.org/show_bug.cgi?id=234627
+
+        Reviewed by Brady Eidson.
+
+        I needed to make an entitlement check return true when using the non-internal SDK,
+        which can't sign private entitlements into a binary.  I also needed to make the fake
+        TestWebKitAPI code signing identifier match the identifier that arm64 Macs actually get,
+        or else m_testingPushMessages would not contain the right key in Daemon::getPendingPushMessages
+        on arm64 Macs.
+
+        * webpushd/PushClientConnection.mm:
+        (WebPushD::ClientConnection::hostAppCodeSigningIdentifier):
+        (WebPushD::ClientConnection::hostHasEntitlement):
+
 2021-12-22  Michael Saboff  <[email protected]>
 
         Fix WebKit Build issues when using system content path

Modified: trunk/Source/WebKit/webpushd/PushClientConnection.mm (287383 => 287384)


--- trunk/Source/WebKit/webpushd/PushClientConnection.mm	2021-12-23 04:04:25 UTC (rev 287383)
+++ trunk/Source/WebKit/webpushd/PushClientConnection.mm	2021-12-23 07:00:15 UTC (rev 287384)
@@ -80,8 +80,8 @@
 {
     if (!m_hostAppCodeSigningIdentifier) {
 #if PLATFORM(MAC) && !USE(APPLE_INTERNAL_SDK)
-        // This isn't great, but currently the only user of webpushd in open source builds is TestWebKitAPI and codeSigningIdentifier returns the null String.
-        m_hostAppCodeSigningIdentifier = "TestWebKitAPI";
+        // This isn't great, but currently the only user of webpushd in open source builds is TestWebKitAPI and codeSigningIdentifier returns the null String on x86_64 Macs.
+        m_hostAppCodeSigningIdentifier = "com.apple.WebKit.TestWebKitAPI";
 #else
         if (!m_hostAppAuditToken)
             m_hostAppCodeSigningIdentifier = String();
@@ -110,7 +110,11 @@
 {
     if (!m_hostAppAuditToken)
         return false;
+#if !PLATFORM(MAC) || USE(APPLE_INTERNAL_SDK)
     return WTF::hasEntitlement(*m_hostAppAuditToken, entitlement);
+#else
+    return true;
+#endif
 }
 
 void ClientConnection::setDebugModeIsEnabled(bool enabled)

Modified: trunk/Tools/ChangeLog (287383 => 287384)


--- trunk/Tools/ChangeLog	2021-12-23 04:04:25 UTC (rev 287383)
+++ trunk/Tools/ChangeLog	2021-12-23 07:00:15 UTC (rev 287384)
@@ -1,5 +1,14 @@
 2021-12-22  Alex Christensen  <[email protected]>
 
+        Re-enable WebPushD.HandleInjectedPush API test
+        https://bugs.webkit.org/show_bug.cgi?id=234627
+
+        Reviewed by Brady Eidson.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm:
+
+2021-12-22  Alex Christensen  <[email protected]>
+
         Disable WKInspectorExtensionDelegate.ShowAndHideTabCallbacks API test
         webkit.org/b/231847
 

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm (287383 => 287384)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm	2021-12-23 04:04:25 UTC (rev 287383)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm	2021-12-23 07:00:15 UTC (rev 287384)
@@ -418,12 +418,7 @@
     TestWebKitAPI::Util::run(&clearedStore);
 }
 
-// FIXME: Re-enable this test on Mac once webkit.org/232857 is resolved.
-#if PLATFORM(MAC) && !USE(APPLE_INTERNAL_SDK)
-TEST(WebPushD, DISABLED_HandleInjectedPush)
-#else
 TEST(WebPushD, HandleInjectedPush)
-#endif
 {
     [WKWebsiteDataStore _allowWebsiteDataRecordsForAllOrigins];
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to