Title: [287347] trunk
Revision
287347
Author
[email protected]
Date
2021-12-21 22:28:01 -0800 (Tue, 21 Dec 2021)

Log Message

Fix some API tests after r287341
https://bugs.webkit.org/show_bug.cgi?id=232857

Source/WebKit:

I found the cause of the strange failures and verified my "fix" on an Intel Mac and an Apple Silicon Mac.

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

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm:
(TestWebKitAPI::TEST):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (287346 => 287347)


--- trunk/Source/WebKit/ChangeLog	2021-12-22 05:17:13 UTC (rev 287346)
+++ trunk/Source/WebKit/ChangeLog	2021-12-22 06:28:01 UTC (rev 287347)
@@ -1,3 +1,13 @@
+2021-12-21  Alex Christensen  <[email protected]>
+
+        Fix some API tests after r287341
+        https://bugs.webkit.org/show_bug.cgi?id=232857
+
+        I found the cause of the strange failures and verified my "fix" on an Intel Mac and an Apple Silicon Mac.
+
+        * webpushd/PushClientConnection.mm:
+        (WebPushD::ClientConnection::hostAppCodeSigningIdentifier):
+
 2021-12-21  Sihui Liu  <[email protected]>
 
         Use fileURLWithPath instead of URLWithString in WebsiteDataStore::excludeDirectoryFromBackup

Modified: trunk/Source/WebKit/webpushd/PushClientConnection.mm (287346 => 287347)


--- trunk/Source/WebKit/webpushd/PushClientConnection.mm	2021-12-22 05:17:13 UTC (rev 287346)
+++ trunk/Source/WebKit/webpushd/PushClientConnection.mm	2021-12-22 06:28:01 UTC (rev 287347)
@@ -79,10 +79,15 @@
 const String& ClientConnection::hostAppCodeSigningIdentifier()
 {
     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";
+#else
         if (!m_hostAppAuditToken)
             m_hostAppCodeSigningIdentifier = String();
         else
             m_hostAppCodeSigningIdentifier = WebKit::codeSigningIdentifier(*m_hostAppAuditToken);
+#endif
     }
 
     return *m_hostAppCodeSigningIdentifier;

Modified: trunk/Tools/ChangeLog (287346 => 287347)


--- trunk/Tools/ChangeLog	2021-12-22 05:17:13 UTC (rev 287346)
+++ trunk/Tools/ChangeLog	2021-12-22 06:28:01 UTC (rev 287347)
@@ -1,3 +1,11 @@
+2021-12-21  Alex Christensen  <[email protected]>
+
+        Fix some API tests after r287341
+        https://bugs.webkit.org/show_bug.cgi?id=232857
+
+        * TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm:
+        (TestWebKitAPI::TEST):
+
 2021-12-21  Simon Fraser  <[email protected]>
 
         Fuzzy pixel data need to be computed in terms of CSS pixels

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm (287346 => 287347)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm	2021-12-22 05:17:13 UTC (rev 287346)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm	2021-12-22 06:28:01 UTC (rev 287347)
@@ -236,13 +236,6 @@
 
         bool stringMatches = [nsMessage hasPrefix:@"[com.apple.WebKit.TestWebKitAPI"] || [nsMessage hasPrefix:@"[TestWebKitAPI"];
         stringMatches = stringMatches && [nsMessage hasSuffix:@" Turned Debug Mode on"];
-        
-#if PLATFORM(MAC) && !USE(APPLE_INTERNAL_SDK) && CPU(x86_64)
-        // ClientConnection::hostAppCodeSigningIdentifier returns an empty string,
-        // so the string is more like "[(0x7f8f4bd083f0) (1 )] Turned Debug Mode on".
-        // This is of no consequence, so just make the test pass.
-        stringMatches = true;
-#endif
 
         EXPECT_TRUE(stringMatches);
         if (!stringMatches)
@@ -334,14 +327,7 @@
     static bool originOperationDone = false;
     static RetainPtr<WKSecurityOrigin> origin;
     [dataStore _getOriginsWithPushAndNotificationPermissions:^(NSSet<WKSecurityOrigin *> *origins) {
-#if PLATFORM(MAC) && !USE(APPLE_INTERNAL_SDK) && CPU(x86_64)
-        // ClientConnection::hostAppCodeSigningIdentifier returns an empty string,
-        // so Daemon::canRegisterForNotifications returns false.
-        // This is of no consequence, so just make the test pass.
-        EXPECT_EQ([origins count], 0u);
-#else
         EXPECT_EQ([origins count], 1u);
-#endif
         origin = [origins anyObject];
         originOperationDone = true;
     }];
@@ -348,10 +334,8 @@
 
     TestWebKitAPI::Util::run(&originOperationDone);
 
-#if !PLATFORM(MAC) || USE(APPLE_INTERNAL_SDK) || !CPU(x86_64)
     EXPECT_WK_STREQ(origin.get().protocol, "testing");
     EXPECT_WK_STREQ(origin.get().host, "main");
-#endif
 
     // If we failed to retrieve an expected origin, we will have failed the above checks
     if (!origin) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to