Changeset 285870 in webkit
- Timestamp:
- Nov 16, 2021, 9:39:10 AM (5 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r285859 r285870 1 2021-11-16 Brady Eidson <beidson@apple.com> 2 3 Enable webpushd tests in the iOS simulator. 4 https://bugs.webkit.org/show_bug.cgi?id=233149 5 6 Reviewed by Alex Christensen. 7 8 * TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm: 9 (TestWebKitAPI::testWebPushDaemonPList): Add a key to allow an OSLaunchdJob executable to break out of the simulator runtime root. 10 1 11 2021-11-16 Tyler Wilcock <tyler_w@apple.com> 2 12 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WebPushDaemon.mm
r285799 r285870 33 33 #import <WebKit/_WKExperimentalFeature.h> 34 34 35 // FIXME: These tests are still currently disabled on iOS while tooling issues with `run-api-tests` are resolved. 36 #if PLATFORM(MAC) 35 #if PLATFORM(MAC) || PLATFORM(IOS) 37 36 38 37 static bool alertReceived = false; … … 66 65 static RetainPtr<xpc_object_t> testWebPushDaemonPList(NSURL *storageLocation) 67 66 { 67 auto currentDirectory = currentExecutableDirectory(); 68 68 69 auto plist = adoptNS(xpc_dictionary_create(nullptr, nullptr, 0)); 69 70 xpc_dictionary_set_string(plist.get(), "_ManagedBy", "TestWebKitAPI"); 70 71 xpc_dictionary_set_string(plist.get(), "Label", "org.webkit.webpushtestdaemon"); 71 72 xpc_dictionary_set_bool(plist.get(), "LaunchOnlyOnce", true); 73 xpc_dictionary_set_bool(plist.get(), "RootedSimulatorPath", true); 72 74 xpc_dictionary_set_string(plist.get(), "StandardErrorPath", [storageLocation URLByAppendingPathComponent:@"daemon_stderr"].path.fileSystemRepresentation); 73 75 74 76 { 75 77 auto environmentVariables = adoptNS(xpc_dictionary_create(nullptr, nullptr, 0)); 76 xpc_dictionary_set_string(environmentVariables.get(), "DYLD_FRAMEWORK_PATH", current ExecutableDirectory().get().fileSystemRepresentation);78 xpc_dictionary_set_string(environmentVariables.get(), "DYLD_FRAMEWORK_PATH", currentDirectory.get().fileSystemRepresentation); 77 79 xpc_dictionary_set_value(plist.get(), "EnvironmentVariables", environmentVariables.get()); 78 80 } … … 88 90 xpc_array_set_string(programArguments.get(), XPC_ARRAY_APPEND, executableLocation.get().fileSystemRepresentation); 89 91 #else 90 // FIXME: These tests are still currently disabled on iOS while tooling issues with `run-api-tests` are resolved. 91 // Once enabled, this patch must point to the webpushd executable at a path that exists within 92 // the simulator runtime root. 93 xpc_array_set_string(programArguments.get(), XPC_ARRAY_APPEND, "/usr/local/bin/webkit-testing/webpushd"); 92 xpc_array_set_string(programArguments.get(), XPC_ARRAY_APPEND, [currentDirectory URLByAppendingPathComponent:@"webpushd"].path.fileSystemRepresentation); 94 93 #endif 95 94 xpc_array_set_string(programArguments.get(), XPC_ARRAY_APPEND, "--machServiceName"); … … 145 144 killFirstInstanceOfDaemon(@"webpushd"); 146 145 147 EXPECT_TRUE([[NSFileManager defaultManager] fileExistsAtPath:tempDir.path]); 146 if (![[NSFileManager defaultManager] fileExistsAtPath:tempDir.path]) 147 return; 148 148 149 NSError *error = nil; 149 150 [[NSFileManager defaultManager] removeItemAtURL:tempDir error:&error]; 151 152 if (error) 153 NSLog(@"Error removing tempDir URL: %@", error); 154 150 155 EXPECT_NULL(error); 151 156 } … … 264 269 } // namespace TestWebKitAPI 265 270 266 #endif // PLATFORM(MAC) 271 #endif // PLATFORM(MAC) || PLATFORM(IOS)
Note:
See TracChangeset
for help on using the changeset viewer.