Title: [285961] trunk/Tools
Revision
285961
Author
[email protected]
Date
2021-11-17 15:43:39 -0800 (Wed, 17 Nov 2021)

Log Message

Enable adattributiond testing on iOS simulator
https://bugs.webkit.org/show_bug.cgi?id=233285

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

* TestWebKitAPI/Tests/WebKitCocoa/EventAttribution.mm:
(TestWebKitAPI::testDaemonPList):
(TestWebKitAPI::cleanUpDaemon):
(TestWebKitAPI::TEST):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (285960 => 285961)


--- trunk/Tools/ChangeLog	2021-11-17 23:35:44 UTC (rev 285960)
+++ trunk/Tools/ChangeLog	2021-11-17 23:43:39 UTC (rev 285961)
@@ -1,3 +1,15 @@
+2021-11-17  Alex Christensen  <[email protected]>
+
+        Enable adattributiond testing on iOS simulator
+        https://bugs.webkit.org/show_bug.cgi?id=233285
+
+        Reviewed by Brady Eidson.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/EventAttribution.mm:
+        (TestWebKitAPI::testDaemonPList):
+        (TestWebKitAPI::cleanUpDaemon):
+        (TestWebKitAPI::TEST):
+
 2021-11-17  Ryan Haddad  <[email protected]>
 
         ASSERT NOT REACHED under WebKit::Daemon::ConnectionToMachService seen with TestWebKitAPI.WebPushD.BasicCommunication and PermissionManagement

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/EventAttribution.mm (285960 => 285961)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/EventAttribution.mm	2021-11-17 23:35:44 UTC (rev 285960)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/EventAttribution.mm	2021-11-17 23:43:39 UTC (rev 285961)
@@ -407,8 +407,7 @@
     EXPECT_EQ(webViewToKeepNetworkProcessAlive.get().configuration.websiteDataStore._networkProcessIdentifier, originalNetworkProcessPid);
 }
 
-// FIXME: Get this working in the iOS simulator.
-#if PLATFORM(MAC)
+#if PLATFORM(MAC) || PLATFORM(IOS)
 
 static RetainPtr<NSURL> testPCMDaemonLocation()
 {
@@ -422,6 +421,7 @@
     auto plist = adoptNS(xpc_dictionary_create(nullptr, nullptr, 0));
     xpc_dictionary_set_string(plist.get(), "_ManagedBy", "TestWebKitAPI");
     xpc_dictionary_set_string(plist.get(), "Label", "org.webkit.pcmtestdaemon");
+    xpc_dictionary_set_bool(plist.get(), "RootedSimulatorPath", true);
     xpc_dictionary_set_bool(plist.get(), "LaunchOnlyOnce", true);
     xpc_dictionary_set_string(plist.get(), "StandardErrorPath", [storageLocation URLByAppendingPathComponent:@"daemon_stderr"].path.fileSystemRepresentation);
 
@@ -479,7 +479,7 @@
         [fileManager removeItemAtURL:tempDir error:&error];
     EXPECT_NULL(error);
 
-    system("killall adattributiond -9 2> /dev/null");
+    killFirstInstanceOfDaemon(@"adattributiond");
 
     auto plist = testDaemonPList(tempDir);
 #if HAVE(OS_LAUNCHD_JOB)
@@ -496,7 +496,7 @@
 
 static void cleanUpDaemon(NSURL *tempDir)
 {
-    system("killall adattributiond -9");
+    killFirstInstanceOfDaemon(@"adattributiond");
 
     EXPECT_TRUE([[NSFileManager defaultManager] fileExistsAtPath:tempDir.path]);
     NSError *error = nil;
@@ -530,6 +530,7 @@
     cleanUpDaemon(tempDir);
 }
 
+#if PLATFORM(MAC)
 static void setInjectedBundleClient(WKWebView *webView, Vector<String>& consoleMessages)
 {
     WKPageInjectedBundleClientV0 injectedBundleClient = {
@@ -586,9 +587,10 @@
         Util::spinRunLoop();
     EXPECT_WK_STREQ(consoleMessages[1], "[Private Click Measurement] Turned Debug Mode off.");
 }
-
 #endif // PLATFORM(MAC)
 
+#endif // PLATFORM(MAC) || PLATFORM(IOS)
+
 #if HAVE(UI_EVENT_ATTRIBUTION)
 
 TEST(PrivateClickMeasurement, BasicWithIOSSPI)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to