WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-165927-20161215163128.patch (text/plain), 228.66 KB, created by
Jonathan Bedard
on 2016-12-15 16:32:21 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Jonathan Bedard
Created:
2016-12-15 16:32:21 PST
Size:
228.66 KB
patch
obsolete
>Index: Tools/ChangeLog >=================================================================== >--- Tools/ChangeLog (revision 209886) >+++ Tools/ChangeLog (working copy) >@@ -1,3 +1,133 @@ >+2016-12-15 Jonathan Bedard <jbedard@apple.com> >+ >+ Removing LayoutTestRelay >+ https://bugs.webkit.org/show_bug.cgi?id=165927 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: Added unixLoggingPipes.h and .mm to DumpRenderTree. >+ * DumpRenderTree/mac/DumpRenderTree.mm: Added call to setupUnixLoggingPipes() and teardownUnixLoggingPipes() for iOS. >+ (dumpRenderTree): >+ * LayoutTestRelay: Removed. >+ * Makefile: >+ * Scripts/build-layouttestrelay: Removed. >+ * Scripts/build-webkit: Removed reference to LayoutTestRelay. >+ * Scripts/webkitpy/common/ipc_pipe.py: Added. >+ (UnixPipeServer): A server-side Unix pipe abstraction used to send data over a AF_UNIX streaming socket. >+ (AbstractPipe): Abstraction for reading from/writing to stdin, stdout and stderr. >+ (AbstractPipe.clean): Clears the stdout and stderr streams to preserve memory. >+ (AbstractPipe._parseMessage): Expected to be overridden by child classes. Adds data to stdout and stderr streams. >+ (AbstractPipe.readLine): Read the next line, read stderr before stdout. >+ (AbstractPipe.stdoutRead): Read a line from stdout, calls _parseMessage. >+ (AbstractPipe.stderrRead): Read a line from stderr, calls _parseMessage. >+ (AbstractPipe.readBufferStdout): Read everything in the stdout buffer. >+ (AbstractPipe.readBufferStderr): Read everything in the stderr buffer. >+ (AbstractPipe.readBlockStdout): Read a block of size from stdout, calls _parseMessage. >+ (AbstractPipe.readBlockStderr): Read a block of size from stderr, calls _parseMessage. >+ (UnixPipe): Inherits from AbstractPipe, uses three Unix pipes as stdin, stdout and stderr. >+ (UnixPipe.__init__): Opens all 3 Unix pipes and begins listening for connections. >+ (UnixPipe.connect): Wait for connections on all 3 Unix pipes, return connection status. >+ (UnixPipe.close): Disconnect all 3 Unix pipes. >+ (UnixPipe.send): Send message through stdin pipe. >+ (UnixPipe._parseMessage): Attempt to read from both stdout and stderr Unix pipes. >+ (UnixPipe.handle_interrupt): Needed during crashes. >+ (ProcessPipe): >+ (ProcessPipe.__init__): >+ (ProcessPipe.pid): >+ (ProcessPipe.isConnected): >+ (ProcessPipe.handle_interrupt): >+ (ProcessPipe.close): >+ (ProcessPipe.send): >+ (ProcessPipe._unixstdBlock): >+ (ProcessPipe._unixerrBlock): >+ (ProcessPipe._win32NonBlockingRead): >+ (ProcessPipe._win32stdBlock): >+ (ProcessPipe._win32errBlock): >+ (ProcessPipe._parseMessage): >+ * Scripts/webkitpy/common/ipc_pipe_testcase.py: Added. >+ (DummyProcessPipe): Process pipe used for testing. >+ (UnixPipeClient): Unix pipe client used to test UnixPipeServer and UnixPipe classes. >+ * Scripts/webkitpy/common/ipc_pipe_unittest.py: Added. >+ (UnixPipeClientTestingThread): Function used for testing client/server architectures. >+ (ipcPipeTest): Unit tests for classes in ipc_pipe.py. >+ (ipcPipeTest.test_abstractpipe_stdout): Test stdout stream in the abstract pipe. >+ (ipcPipeTest.test_abstractpipe_stderr): Test stderr stream in the abstract pipe. >+ (ipcPipeTest.test_abstractpipe_duel_streams): Ensure stdout and stderr do not mingle. >+ (ipcPipeTest.test_abstractpipe_stdoutblock): Test reading a data block from stdout. >+ (ipcPipeTest.test_abstractpipe_stderrblock): Test reading a data block from stderr. >+ (ipcPipeTest.test_unixPipeServer): Test the UnixPipeServer with a UnixPipeClient. >+ (ipcPipeTest.test_unixPipe): Test all three streams of the UnixPipe class. >+ * Scripts/webkitpy/port/base.py: >+ (Port.to.deviceDefined): Function to be overridden by iOS classes. >+ (Port.to.runOnDevice): Function to be overridden by iOS classes. >+ * Scripts/webkitpy/port/base_unittest.py: >+ (test_device): Test that, in the general case, devices are undefined. >+ * Scripts/webkitpy/port/darwin.py: >+ (DarwinPort.extractBundleID): Search an app bundle for a plist and bundle ID. >+ * Scripts/webkitpy/port/darwin_testcase.py: >+ (DarwinTest.test_plist): Test plist access by creating a temporary plist to read. >+ * Scripts/webkitpy/port/driver.py: >+ (Driver.__init__): >+ (Driver.run_test): Clear streams with clean before running a test. >+ (DeviceDriver): Changed from IOSSimulatorDriver. >+ (DeviceDriver.cmd_line): Pass 'run-on-deviceâ, which is recognized by the server_process class. >+ (DeviceDriver._setup_environ_for_driver): Changed from IOSSimulatorDriver. >+ * Scripts/webkitpy/port/ios.py: >+ (IOSBase): Base class for IOSPort and IOSSimulator port. >+ (IOSBase.driver_name): Access current app name. >+ (IOSBase._get_crash_log): Moved from IOSSimulatorPort. >+ (IOSBase._testing_device): Access devices by index. >+ (IOSBase.device_id_for_worker_number): Moved from IOSSimulatorPort. >+ (IOSBase._driver_class): Moved from IOSSimulatorPort. >+ (IOSBase.deviceDefined): True for all IOS classes. >+ (IOSBase._devicePing): Function to test if a device is on. >+ (IOSBase._deviceInstall): Install app to device. >+ (IOSBase._deviceRun): Run app on device. >+ (IOSBase._deviceKill): Shutdown app on device. >+ (IOSBase.runOnDevice): Run command on device. >+ (IOSPort): Class designed for running on device. >+ (IOSSimulatorPort): >+ (IOSSimulatorPort._devicePing): Check if the targeted simulator is booted. >+ (IOSSimulatorPort._deviceInstall): Install app to simulator. >+ (IOSSimulatorPort._deviceRun): Run installed app on targeted simulator. >+ (IOSSimulatorPort._deviceKill): Shutdown app on targeted simulator. >+ (IOSSimulatorPort.relay_path): Removed LayoutTestRelay. >+ (IOSSimulatorPort._check_relay): Removed LayoutTestRelay. >+ (IOSSimulatorPort._get_crash_log): Moved to IOSBase. >+ (IOSSimulatorPort._build_relay): Removed LayoutTestRelay. >+ (IOSSimulatorPort._driver_class): Moved to IOSBase. >+ * Scripts/webkitpy/port/ios_unittest.py: >+ (IOSTest): Tests functionality unique to the IOSPort class. >+ (IOSSimulatorTest): Tests functionality unique to the IOSSimulator class. >+ (iosTest): Moved to either IOSSimulatorTest or IOSBaseTest. >+ * Scripts/webkitpy/port/iosbase_testcase.py: Added. >+ (IOSBaseTest): Tests functionality shared between IOSPort and IOSSimulator. >+ * Scripts/webkitpy/port/server_process.py: Note that some previous functionality of server_process has been moved to ProcessPipe. >+ (ServerProcess.__init__): Use _pipe instead of proc. >+ (ServerProcess.clean): Clean pipe (resets stream buffers. >+ (ServerProcess._reset): Destroy pipe, no pid. >+ (ServerProcess._start): Use UnixPipe for running on-device and ProcessPipe otherwise. >+ (ServerProcess.poll): Use isConnected function of pipes. >+ (ServerProcess.write): Write data to pipe. >+ (ServerProcess._pop_stdout_line_if_ready): Read stdout line from pipe. >+ (ServerProcess._pop_stderr_line_if_ready): Read stderr line from pipe. >+ (ServerProcess.pop_all_buffered_stderr): Read all stderr lines from pipe. >+ (ServerProcess.read_either_stdout_or_stderr_line): Read a line from either stream from the pipe. >+ (ServerProcess.read_stdout): Read from stdout of pipe. >+ (ServerProcess.stop): Clear buffers and shutdown pipe. >+ * Scripts/webkitpy/port/server_process_unittest.py: Use pipes instead of MockProc. >+ (MockFile): Replaced MockFile with DummyProcessPipe. >+ * Scripts/webkitpy/style/checkers/python.py: >+ (Pylinter.run): Fix for known issue with Pylinter and sockets. >+ * TestRunnerShared/unixLoggingPipes.h: Added. >+ * TestRunnerShared/unixLoggingPipes.mm: Added. >+ (WTR::setupUnixLoggingPipes): Sets up UnixPipes for IOSSimulator. >+ (WTR::teardownUnixLoggingPipes): Tears-down up UnixPipes for IOSSimulator. >+ * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj: >+ * WebKitTestRunner/ios/TestControllerIOS.mm: >+ (WTR::TestController::platformInitialize): Added call to setupUnixLoggingPipes() for iOS. >+ (WTR::TestController::platformDestroy): Added call to teardownUnixLoggingPipes() for iOS. >+ > 2016-12-15 Claudio Saavedra <csaavedra@igalia.com> > > [GTK] Ensure gst* docs are not built with update-webkitgtk-libs >Index: Tools/LayoutTestRelay/Configurations/Base.xcconfig >=================================================================== >--- Tools/LayoutTestRelay/Configurations/Base.xcconfig (revision 209886) >+++ Tools/LayoutTestRelay/Configurations/Base.xcconfig (nonexistent) >@@ -1,68 +0,0 @@ >-// Copyright (C) 2014 Apple Inc. All rights reserved. >-// >-// Redistribution and use in source and binary forms, with or without >-// modification, are permitted provided that the following conditions >-// are met: >-// 1. Redistributions of source code must retain the above copyright >-// notice, this list of conditions and the following disclaimer. >-// 2. Redistributions in binary form must reproduce the above copyright >-// notice, this list of conditions and the following disclaimer in the >-// documentation and/or other materials provided with the distribution. >-// >-// THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >-// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >-// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >-// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >- >-#include "../../../../Internal/Configurations/HaveInternalSDK.xcconfig" >- >-USE_INTERNAL_SDK = $(USE_INTERNAL_SDK_$(CONFIGURATION)); >-USE_INTERNAL_SDK_Production = YES; >-USE_INTERNAL_SDK_Debug = $(HAVE_INTERNAL_SDK); >-USE_INTERNAL_SDK_Release = $(HAVE_INTERNAL_SDK); >- >-CLANG_CXX_LANGUAGE_STANDARD = gnu++0x; >-CLANG_ENABLE_OBJC_ARC = YES; >-CLANG_WARN_CXX0X_EXTENSIONS = NO; >-HEADER_SEARCH_PATHS = $(BUILT_PRODUCTS_DIR)/usr/local/include $(WEBCORE_PRIVATE_HEADERS_DIR)/ForwardingHeaders $(SRCROOT)/../../Source/JavaScriptCore/icu $(NEXT_ROOT)/usr/local/include/WebCoreTestSupport; >-GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) ENABLE_DASHBOARD_SUPPORT; >-DEBUG_INFORMATION_FORMAT = dwarf-with-dsym; >-PREBINDING = NO >-GCC_C_LANGUAGE_STANDARD = gnu99 >-GCC_ENABLE_CPP_EXCEPTIONS = NO; >-GCC_ENABLE_CPP_RTTI = NO; >-GCC_PRECOMPILE_PREFIX_HEADER = YES >-GCC_TREAT_WARNINGS_AS_ERRORS = YES >-GCC_VERSION = com.apple.compilers.llvm.clang.1_0; >-GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO >-GCC_WARN_UNUSED_FUNCTION = YES >-GCC_WARN_UNUSED_VARIABLE = YES >-GCC_WARN_64_TO_32_BIT_CONVERSION[arch=x86_64] = NO; >-WARNING_CFLAGS = -Wall -W -Wno-unused-parameter -Wundef >- >-DEBUG_DEFINES_debug = ; >-DEBUG_DEFINES_normal = NDEBUG; >-DEBUG_DEFINES = $(DEBUG_DEFINES_$(CURRENT_VARIANT)); >- >-TARGET_MAC_OS_X_VERSION_MAJOR = $(TARGET_MAC_OS_X_VERSION_MAJOR$(MACOSX_DEPLOYMENT_TARGET:suffix:identifier)); >-TARGET_MAC_OS_X_VERSION_MAJOR_10 = 101000; >-TARGET_MAC_OS_X_VERSION_MAJOR_11 = 101100; >-TARGET_MAC_OS_X_VERSION_MAJOR_12 = 101200; >-TARGET_MAC_OS_X_VERSION_MAJOR_13 = 101300; >- >-SDKROOT = macosx.internal; >- >-SUPPORTED_PLATFORMS = macosx; >- >-TOOLCHAINS = default; >- >-OTHER_CFLAGS = $(ASAN_OTHER_CFLAGS); >-OTHER_CPLUSPLUSFLAGS = $(ASAN_OTHER_CPLUSPLUSFLAGS); >-OTHER_LDFLAGS = $(ASAN_OTHER_LDFLAGS); >Index: Tools/LayoutTestRelay/Configurations/DebugRelease.xcconfig >=================================================================== >--- Tools/LayoutTestRelay/Configurations/DebugRelease.xcconfig (revision 209886) >+++ Tools/LayoutTestRelay/Configurations/DebugRelease.xcconfig (nonexistent) >@@ -1,42 +0,0 @@ >-// Copyright (C) 2014 Apple Inc. All rights reserved. >-// >-// Redistribution and use in source and binary forms, with or without >-// modification, are permitted provided that the following conditions >-// are met: >-// 1. Redistributions of source code must retain the above copyright >-// notice, this list of conditions and the following disclaimer. >-// 2. Redistributions in binary form must reproduce the above copyright >-// notice, this list of conditions and the following disclaimer in the >-// documentation and/or other materials provided with the distribution. >-// >-// THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >-// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >-// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >-// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >- >-#include "Base.xcconfig" >- >-ARCHS = $(ARCHS_STANDARD_64_BIT); >- >-TARGET_MAC_OS_X_VERSION_MAJOR = $(MAC_OS_X_VERSION_MAJOR); >- >-MACOSX_DEPLOYMENT_TARGET = $(MACOSX_DEPLOYMENT_TARGET_$(TARGET_MAC_OS_X_VERSION_MAJOR)) >-MACOSX_DEPLOYMENT_TARGET_101000 = 10.10; >-MACOSX_DEPLOYMENT_TARGET_101100 = 10.11; >-MACOSX_DEPLOYMENT_TARGET_101200 = 10.12; >-MACOSX_DEPLOYMENT_TARGET_101300 = 10.13; >- >-FRAMEWORK_SEARCH_PATHS = $(DEVELOPER_DIR)/Library/PrivateFrameworks; >-LD_RUNPATH_SEARCH_PATHS = $(DEVELOPER_DIR)/Library/PrivateFrameworks; >-OTHER_LDFLAGS = -framework CoreSimulator -framework AppKit; >- >-SDKROOT = $(SDKROOT_macosx_$(USE_INTERNAL_SDK)); >-SDKROOT_macosx_ = macosx; >-SDKROOT_macosx_YES = macosx.internal; >Index: Tools/LayoutTestRelay/LayoutTestRelay/CoreSimulatorSPI.h >=================================================================== >--- Tools/LayoutTestRelay/LayoutTestRelay/CoreSimulatorSPI.h (revision 209886) >+++ Tools/LayoutTestRelay/LayoutTestRelay/CoreSimulatorSPI.h (nonexistent) >@@ -1,58 +0,0 @@ >-/* >- * Copyright (C) 2015, 2016 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >- * THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#if __has_include(<CoreSimulator/CoreSimulator.h>) >- >-/* FIXME: Remove the below #define once we require Xcode 7.3 with iOS 9.3 SDK or newer. */ >-#define __coresim_unavailable_msg(msg) >-#import <CoreSimulator/CoreSimulator.h> >- >-/* FIXME: Always use SimServiceContext once we require Xcode 7.3 with iOS 9.3 SDK or newer. */ >-#define USE_SIM_SERVICE_CONTEXT defined(CORESIM_API_MAX_ALLOWED) >- >-#else >- >-#import <Foundation/Foundation.h> >- >-#define USE_SIM_SERVICE_CONTEXT 1 >- >-#define kSimDeviceLaunchApplicationArguments @"arguments" >-#define kSimDeviceLaunchApplicationEnvironment @"environment" >- >-@interface SimDevice : NSObject >-- (BOOL)installApplication:(NSURL *)installURL withOptions:(NSDictionary *)options error:(NSError * __autoreleasing *)error; >-- (pid_t)launchApplicationWithID:(NSString *)bundleID options:(NSDictionary *)options error:(NSError * __autoreleasing *)error; >-@end >- >-@interface SimDeviceSet : NSObject >-@property (readonly, copy) NSDictionary *devicesByUDID; >-@end >- >-@interface SimServiceContext : NSObject >-+(SimServiceContext *)sharedServiceContextForDeveloperDir:(NSString *)developerDir error:(NSError * __autoreleasing *)error; >--(SimDeviceSet *)defaultDeviceSetWithError:(NSError * __autoreleasing *)error; >-@end >- >-#endif >Index: Tools/LayoutTestRelay/LayoutTestRelay/LTPipeRelay.h >=================================================================== >--- Tools/LayoutTestRelay/LayoutTestRelay/LTPipeRelay.h (revision 209886) >+++ Tools/LayoutTestRelay/LayoutTestRelay/LTPipeRelay.h (nonexistent) >@@ -1,36 +0,0 @@ >-/* >- * Copyright (C) 2014 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >- * THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#ifndef LTPipeRelay_h >-#define LTPipeRelay_h >- >-#import "LTRelay.h" >- >-@interface LTPipeRelay : NSObject <LTRelay> >-@property (weak) id<LTRelayDelegate> relayDelegate; >-- (id)initWithPrefix:(NSString *)prefix; >-@end >- >-#endif >Index: Tools/LayoutTestRelay/LayoutTestRelay/LTPipeRelay.m >=================================================================== >--- Tools/LayoutTestRelay/LayoutTestRelay/LTPipeRelay.m (revision 209886) >+++ Tools/LayoutTestRelay/LayoutTestRelay/LTPipeRelay.m (nonexistent) >@@ -1,158 +0,0 @@ >-/* >- * Copyright (C) 2014 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >- * THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#import "LTPipeRelay.h" >- >-#import <Foundation/Foundation.h> >-#include <sys/stat.h> >-#include <sys/types.h> >- >-@interface LTPipeRelay () >-@property (readonly, strong) NSString *fifoPrefix; >-@property (strong) NSOutputStream *standardInputPipe; >-@property (strong) NSInputStream *standardOutputPipe; >-@property (strong) NSInputStream *standardErrorPipe; >- >-- (void)createFIFOs; >-- (void)destroyFIFOs; >-@end >- >-@implementation LTPipeRelay >- >-- (NSString *)inPipePath >-{ >- return [_fifoPrefix stringByAppendingString:@"_IN"]; >-} >- >-- (NSString *)outPipePath >-{ >- return [_fifoPrefix stringByAppendingString:@"_OUT"]; >-} >- >-- (NSString *)errorPipePath >-{ >- return [_fifoPrefix stringByAppendingString:@"_ERROR"]; >-} >- >-- (NSOutputStream *) outputStream >-{ >- return _standardInputPipe; >-} >- >-- (id)initWithPrefix:(NSString *)prefix >-{ >- if ((self = [super init])) { >- _fifoPrefix = prefix; >- [self destroyFIFOs]; >- } >- return self; >-} >- >-- (void)setup >-{ >- [self destroyFIFOs]; >- [self createFIFOs]; >-} >- >-- (void)tearDown >-{ >- [self destroyFIFOs]; >-} >- >--(void) connect >-{ >- _standardInputPipe = [NSOutputStream outputStreamToFileAtPath:[self inPipePath] append:YES]; >- _standardOutputPipe = [NSInputStream inputStreamWithFileAtPath:[self outPipePath]]; >- _standardErrorPipe = [NSInputStream inputStreamWithFileAtPath:[self errorPipePath]]; >- >- [[self standardInputPipe] setDelegate:self]; >- [[self standardOutputPipe] setDelegate:self]; >- [[self standardErrorPipe] setDelegate:self]; >- >- [[self standardOutputPipe] scheduleInRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode]; >- [[self standardErrorPipe] scheduleInRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode]; >- >- [[self standardInputPipe] open]; >- [[self standardOutputPipe] open]; >- [[self standardErrorPipe] open]; >- >- [[self relayDelegate] didConnect]; >-} >- >-- (void)disconnect >-{ >- [[self standardOutputPipe] close]; >- [[self standardErrorPipe] close]; >- [[self standardInputPipe] close]; >- [[self relayDelegate] didDisconnect]; >-} >- >-- (void)createFIFOs >-{ >- mkfifo([[self inPipePath] UTF8String], 0666); >- mkfifo([[self outPipePath] UTF8String], 0666); >- mkfifo([[self errorPipePath] UTF8String], 0666); >-} >- >-- (void)destroyFIFOs >-{ >- unlink([[self inPipePath] UTF8String]); >- unlink([[self outPipePath] UTF8String]); >- unlink([[self errorPipePath] UTF8String]); >-} >- >-- (void) relayStream:(NSInputStream *)stream >-{ >- uint8_t bytes[1024]; >- NSInteger bytesRead = [stream read:bytes maxLength:1024]; >- NSData *data = [NSData dataWithBytes:bytes length:bytesRead]; >- >- if (stream == [self standardOutputPipe]) >- [[self relayDelegate] didReceiveStdoutData:data]; >- else >- [[self relayDelegate] didReceiveStderrData:data]; >-} >- >-- (void)stream:(NSStream *)aStream handleEvent:(NSStreamEvent)eventCode >-{ >- switch (eventCode) { >- case NSStreamEventNone: >- break; >- case NSStreamEventHasBytesAvailable: >- [self relayStream:(NSInputStream *)aStream]; >- case NSStreamEventHasSpaceAvailable: >- break; >- case NSStreamEventOpenCompleted: >- break; >- case NSStreamEventEndEncountered: >- [[self relayDelegate] didCrashWithMessage:nil]; >- break; >- case NSStreamEventErrorOccurred: >- [[self relayDelegate] didCrashWithMessage:[[aStream streamError] description]]; >- break; >- } >-} >- >-@end >Index: Tools/LayoutTestRelay/LayoutTestRelay/LTRelay.h >=================================================================== >--- Tools/LayoutTestRelay/LayoutTestRelay/LTRelay.h (revision 209886) >+++ Tools/LayoutTestRelay/LayoutTestRelay/LTRelay.h (nonexistent) >@@ -1,48 +0,0 @@ >-/* >- * Copyright (C) 2014 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >- * THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#ifndef LTRelay_h >-#define LTRelay_h >- >-#import <Foundation/Foundation.h> >- >-@protocol LTRelayDelegate <NSObject> >-- (void)didConnect; >-- (void)didDisconnect; >-- (void)didCrashWithMessage:(NSString *)message; >-- (void)didReceiveStdoutData:(NSData *)data; >-- (void)didReceiveStderrData:(NSData *)data; >-@end >- >-@protocol LTRelay <NSObject, NSStreamDelegate> >-- (void)setup; >-- (void)tearDown; >-- (void)connect; >-- (void)disconnect; >-@property (weak) id<LTRelayDelegate> relayDelegate; >-@property (readonly, strong) NSOutputStream *outputStream; >-@end >- >-#endif >Index: Tools/LayoutTestRelay/LayoutTestRelay/LTRelayController.h >=================================================================== >--- Tools/LayoutTestRelay/LayoutTestRelay/LTRelayController.h (revision 209886) >+++ Tools/LayoutTestRelay/LayoutTestRelay/LTRelayController.h (nonexistent) >@@ -1,40 +0,0 @@ >-/* >- * Copyright (C) 2014 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >- * THE POSSIBILITY OF SUCH DAMAGE. >- */ >-#ifndef LTRelayController_h >-#define LTRelayController_h >- >-#import "LTRelay.h" >- >-#import <Foundation/Foundation.h> >- >-@class SimDevice; >- >-@interface LTRelayController : NSObject <LTRelayDelegate> >-- (id)initWithDevice:(SimDevice *)device productDir:(NSString *)productDir appPath:(NSString *)appPath deviceUDID:(NSUUID *)udid dumpToolArguments:(NSArray *)arguments; >-- (void)start; >-- (void)finish; >-@end >- >-#endif >Index: Tools/LayoutTestRelay/LayoutTestRelay/LTRelayController.m >=================================================================== >--- Tools/LayoutTestRelay/LayoutTestRelay/LTRelayController.m (revision 209886) >+++ Tools/LayoutTestRelay/LayoutTestRelay/LTRelayController.m (nonexistent) >@@ -1,272 +0,0 @@ >-/* >- * Copyright (C) 2014 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >- * THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#import "LTRelayController.h" >- >-#import "CoreSimulatorSPI.h" >-#import "LTPipeRelay.h" >-#import <AppKit/AppKit.h> >-#import <crt_externs.h> >- >-@interface LTRelayController () >-@property (readonly, strong) dispatch_source_t standardInputDispatchSource; >-@property (readonly, strong) NSFileHandle *standardOutput; >-@property (readonly, strong) NSFileHandle *standardError; >-@property (readonly, strong) NSString *ipcIdentifier; >-@property (readonly, strong) NSString *appBundleIdentifier; >-@property (readonly, strong) NSString *appPath; >-@property (readonly, strong) NSUUID *deviceUDID; >-@property (readonly, strong) NSArray *dumpToolArguments; >-@property (readonly, strong) NSString *productDir; >-@property (strong) SimDevice *device; >-@property (strong) id<LTRelay> relay; >-@property pid_t pid; >-@property (strong) dispatch_source_t appDispatchSource; >-@end >- >-@implementation LTRelayController >- >-- (id)initWithDevice:(SimDevice *)device productDir:(NSString *)productDir appPath:(NSString *)appPath deviceUDID:(NSUUID *)udid dumpToolArguments:(NSArray *)arguments >-{ >- if ((self = [super init])) { >- _device = device; >- _productDir = productDir; >- _appPath = appPath; >- _appBundleIdentifier = [[NSBundle bundleWithPath:appPath] bundleIdentifier]; >- _deviceUDID = udid; >- _dumpToolArguments = arguments; >- _standardInputDispatchSource = dispatch_source_create(DISPATCH_SOURCE_TYPE_READ, STDIN_FILENO, 0, dispatch_get_main_queue()); >- _standardOutput = [NSFileHandle fileHandleWithStandardOutput]; >- _standardError = [NSFileHandle fileHandleWithStandardError]; >- >- dispatch_source_set_event_handler(_standardInputDispatchSource, ^{ >- uint8_t buffer[1024]; >- ssize_t len = read(STDIN_FILENO, buffer, sizeof(buffer)); >- if (len > 0) { >- @try { >- [[[self relay] outputStream] write:buffer maxLength:len]; >- } @catch (NSException *e) { >- // Broken pipe - the dump tool crashed. Time to die. >- [self didCrashWithMessage:nil]; >- } >- } else { >- // EOF Received on the relay's standard input. >- [self finish]; >- } >- }); >- >- _relay = [[LTPipeRelay alloc] initWithPrefix:[@"/tmp" stringByAppendingPathComponent:self.ipcIdentifier]]; >- [_relay setRelayDelegate:self]; >- } >- return self; >-} >- >-- (NSString *)ipcIdentifier >-{ >- return [NSString stringWithFormat:@"%@-%@", self.appBundleIdentifier, self.deviceUDID.UUIDString]; >-} >- >-- (NSString *)processName >-{ >- return [self.appBundleIdentifier componentsSeparatedByString:@"."].lastObject; >-} >- >-- (void)didReceiveStdoutData:(NSData *)data >-{ >- @try { >- [[self standardOutput] writeData:data]; >- } @catch (NSException *exception) { >- // NSFileHandleOperationException >- // Broken pipe - the test harness stopped listening to us, >- // probably because we timed out or a run was canceled. >- exit(EXIT_FAILURE); >- } >-} >- >-- (void)didReceiveStderrData:(NSData *)data >-{ >- @try { >- [[self standardError] writeData:data]; >- } @catch (NSException *exception) { >- // NSFileHandleOperationException >- // Broken pipe - the test harness stopped listening to us, >- // probably because we timed out or a run was canceled. >- exit(EXIT_FAILURE); >- } >-} >- >-- (void)didDisconnect >-{ >- dispatch_suspend([self standardInputDispatchSource]); >-} >- >-- (void)didConnect >-{ >- dispatch_resume([self standardInputDispatchSource]); >-} >- >-- (void)didCrashWithMessage:(NSString *)message >-{ >- [[self relay] disconnect]; >- NSString *crashMessage = [NSString stringWithFormat:@"\n#CRASHED - %@ (pid %d)\n", [self processName], [self pid]]; >- >- if (message) >- crashMessage = [crashMessage stringByAppendingFormat:@"%@\n", message]; >- >- [[self standardError] writeData:[crashMessage dataUsingEncoding:NSUTF8StringEncoding]]; >- [[self standardError] closeFile]; >- [[self standardOutput] closeFile]; >- exit(EXIT_FAILURE); >-} >- >-- (void)installApp >-{ >- NSDictionary *installOptions = @{ >- (NSString *)kCFBundleIdentifierKey: self.appBundleIdentifier, >- }; >- >- NSError *error = nil; >- BOOL installed = [self.device installApplication:[NSURL fileURLWithPath:self.appPath] withOptions:installOptions error:&error]; >- if (!installed) { >- NSLog(@"Couldn't install %@: %@", self.appPath, error.description); >- exit(EXIT_FAILURE); >- } >-} >- >-- (void)killApp >-{ >- dispatch_source_t dispatch = [self appDispatchSource]; >- >- if (dispatch) >- dispatch_source_cancel(dispatch); >- >- if ([self pid] > 1) { >- kill(self.pid, SIGKILL); >- [self setPid:-1]; >- } >- [self setAppDispatchSource:nil]; >-} >- >-- (NSDictionary *)_environmentVariables >-{ >- static NSDictionary *environmentVariables; >- static dispatch_once_t once; >- >- dispatch_once(&once, ^{ >- NSString *productDirectory = [self productDir]; >- >- NSMutableDictionary *dictionary = [@{ >- @"IPC_IDENTIFIER": self.ipcIdentifier, >- @"DYLD_FRAMEWORK_PATH": productDirectory, >- @"__XPC_DYLD_FRAMEWORK_PATH": productDirectory, >- @"DYLD_LIBRARY_PATH": productDirectory, >- @"__XPC_DYLD_LIBRARY_PATH": productDirectory, >- } mutableCopy]; >- >- for (NSString *keyName in @[@"DYLD_INSERT_LIBRARIES", @"MallocStackLogging", @"LOCAL_RESOURCE_ROOT", @"DUMPRENDERTREE_TEMP"]) { >- const char* value = getenv([keyName UTF8String]); >- if (value && strlen(value)) { >- NSString *nsValue = [NSString stringWithUTF8String:value]; >- [dictionary setObject:nsValue forKey:keyName]; >- [dictionary setObject:nsValue forKey:[@"__XPC_" stringByAppendingString:keyName]]; >- } >- } >- >- for (char** envp = *_NSGetEnviron(); *envp; envp++) { >- const char* env = *envp; >- if (!strncmp("JSC_", env, 4) || !strncmp("__XPC_JSC_", env, 10)) { >- const char* equal = strchr(env, '='); >- if (!equal) { >- NSLog(@"Missing '=' in env var '%s'", env); >- continue; >- } >- >- static const size_t maxKeyLength = 256; >- size_t keyLength = equal - env; >- if (keyLength >= maxKeyLength) { >- NSLog(@"Env var '%s' is too long", env); >- continue; >- } >- >- char key[maxKeyLength]; >- strncpy(key, env, keyLength); >- key[keyLength] = '\0'; >- const char* value = equal + 1; >- >- NSString *nsKey = [NSString stringWithUTF8String:key]; >- NSString *nsValue = [NSString stringWithUTF8String:value]; >- [dictionary setObject:nsValue forKey:nsKey]; >- } >- } >- >- environmentVariables = [dictionary copy]; >- }); >- >- return environmentVariables; >-} >- >-- (void)launchApp >-{ >- NSDictionary *launchOptions = @{ >- kSimDeviceLaunchApplicationEnvironment: [self _environmentVariables], >- kSimDeviceLaunchApplicationArguments: [self dumpToolArguments], >- }; >- >- NSError *error; >- pid_t pid = [self.device launchApplicationWithID:self.appBundleIdentifier options:launchOptions error:&error]; >- >- if (pid < 0) { >- NSLog(@"Couldn't launch %@: %@", self.appBundleIdentifier, error.description); >- exit(EXIT_FAILURE); >- } >- >- [self setPid:pid]; >- >- dispatch_queue_t queue = dispatch_get_main_queue(); >- dispatch_source_t simulatorAppExitDispatchSource = dispatch_source_create(DISPATCH_SOURCE_TYPE_PROC, [self pid], DISPATCH_PROC_EXIT, queue); >- [self setAppDispatchSource:simulatorAppExitDispatchSource]; >- dispatch_source_set_event_handler(simulatorAppExitDispatchSource, ^{ >- dispatch_source_cancel(simulatorAppExitDispatchSource); >- [self didCrashWithMessage:nil]; >- }); >- dispatch_resume(simulatorAppExitDispatchSource); >-} >- >-- (void)start >-{ >- [self installApp]; >- [[self relay] setup]; >- [self launchApp]; >- [[self relay] connect]; >-} >- >-- (void)finish >-{ >- [[self relay] disconnect]; >- [self killApp]; >- exit(EXIT_SUCCESS); >-} >- >-@end >Index: Tools/LayoutTestRelay/LayoutTestRelay/main.m >=================================================================== >--- Tools/LayoutTestRelay/LayoutTestRelay/main.m (revision 209886) >+++ Tools/LayoutTestRelay/LayoutTestRelay/main.m (nonexistent) >@@ -1,133 +0,0 @@ >-/* >- * Copyright (C) 2014, 2016 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >- * THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#import "CoreSimulatorSPI.h" >-#import "LTRelayController.h" >-#import <Foundation/Foundation.h> >- >-static LTRelayController *relayController; >- >-void usage() >-{ >- NSString *helpText = @"LayoutTestRelay: run a dump tool in the simulator. Not for direct consumption.\n" >- "Usage: LayoutTestRelay [-h] [options] -- [dump tool arguments]\n" >- "Required options:\n" >- " -udid <identifier> Simulator device identifier\n" >- " -app <app_path> Path to the built iOS .app bundle directory.\n" >- " -productDir <dir> /path/to/WebKitBuild/{configuration}-{short platform}.\n"; >- >- fprintf(stderr, "%s\n", [helpText UTF8String]); >-} >- >-NSString *getRequiredStringArgument(NSString *parameter) >-{ >- NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; >- NSString *argument = [defaults stringForKey:parameter]; >- >- if (!argument) { >- NSLog(@"-%@ is required.", parameter); >- usage(); >- exit(EXIT_FAILURE); >- } >- return argument; >-} >- >-NSArray *getDumpToolArguments() >-{ >- NSMutableArray *dumpToolArguments = [[NSMutableArray alloc] init]; >- NSArray *processArgs = [[NSProcessInfo processInfo] arguments]; >- BOOL appending = NO; >- for (NSString *arg in processArgs) { >- if ([arg isEqualToString:@"--"]) { >- appending = YES; >- continue; >- } >- if (appending) >- [dumpToolArguments addObject:arg]; >- } >- return dumpToolArguments; >-} >- >-void finish() >-{ >- [relayController finish]; >-} >- >-void receivedSignal(int signal) >-{ >- exit(EXIT_SUCCESS); >-} >- >-int main(int argc, const char * argv[]) >-{ >- @autoreleasepool { >- NSArray *helpArguments = @[@"-h", @"--help"]; >- for (NSString *helpArgument in helpArguments) { >- if ([[[NSProcessInfo processInfo] arguments] indexOfObject:helpArgument] != NSNotFound) { >- usage(); >- exit(EXIT_FAILURE); >- } >- } >- >-#if USE_SIM_SERVICE_CONTEXT >- NSString *developerDirectory = getRequiredStringArgument(@"developerDir"); >-#endif >- NSUUID *udid = [[NSUUID alloc] initWithUUIDString:getRequiredStringArgument(@"udid")]; >- NSString *appPath = getRequiredStringArgument(@"app"); >- NSString *productDirectory = getRequiredStringArgument(@"productDir"); >- NSArray *dumpToolArguments = getDumpToolArguments(); >- >-#if USE_SIM_SERVICE_CONTEXT >- NSError *error; >- SimServiceContext *serviceContext = [SimServiceContext sharedServiceContextForDeveloperDir:developerDirectory error:&error]; >- if (!serviceContext) { >- NSLog(@"Device context couldn't be found: %@", error); >- exit(EXIT_FAILURE); >- } >- SimDeviceSet *deviceSet = [serviceContext defaultDeviceSetWithError:nil]; >- if (!deviceSet) { >- NSLog(@"Default device set couldn't be found: %@", error); >- exit(EXIT_FAILURE); >- } >- SimDevice *device = [deviceSet.devicesByUDID objectForKey:udid]; >-#else >- SimDevice *device = [SimDeviceSet.defaultSet.devicesByUDID objectForKey:udid]; >-#endif >- if (!device) { >- NSLog(@"Device %@ couldn't be found", udid); >- exit(EXIT_FAILURE); >- } >- >- relayController = [[LTRelayController alloc] initWithDevice:device productDir:productDirectory appPath:appPath deviceUDID:udid dumpToolArguments:dumpToolArguments]; >- [relayController start]; >- >- atexit(finish); >- signal(SIGINT, receivedSignal); >- signal(SIGTERM, receivedSignal); >- >- [[NSRunLoop mainRunLoop] run]; >- } >- return 0; >-} >Index: Tools/LayoutTestRelay/LayoutTestRelay.xcodeproj/project.pbxproj >=================================================================== >--- Tools/LayoutTestRelay/LayoutTestRelay.xcodeproj/project.pbxproj (revision 209886) >+++ Tools/LayoutTestRelay/LayoutTestRelay.xcodeproj/project.pbxproj (nonexistent) >@@ -1,202 +0,0 @@ >-// !$*UTF8*$! >-{ >- archiveVersion = 1; >- classes = { >- }; >- objectVersion = 46; >- objects = { >- >-/* Begin PBXBuildFile section */ >- 2E8D3EF819881D43004F6CC2 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 2E8D3EF719881D43004F6CC2 /* main.m */; }; >- 2E8D3F0219881FD0004F6CC2 /* LTPipeRelay.m in Sources */ = {isa = PBXBuildFile; fileRef = 2E8D3F0119881FD0004F6CC2 /* LTPipeRelay.m */; }; >- 2E8D3F0619882406004F6CC2 /* LTRelayController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2E8D3F0519882406004F6CC2 /* LTRelayController.m */; }; >-/* End PBXBuildFile section */ >- >-/* Begin PBXCopyFilesBuildPhase section */ >- 2E8D3EF219881D43004F6CC2 /* CopyFiles */ = { >- isa = PBXCopyFilesBuildPhase; >- buildActionMask = 2147483647; >- dstPath = /usr/share/man/man1/; >- dstSubfolderSpec = 0; >- files = ( >- ); >- runOnlyForDeploymentPostprocessing = 1; >- }; >-/* End PBXCopyFilesBuildPhase section */ >- >-/* Begin PBXFileReference section */ >- 2E8D3EF419881D43004F6CC2 /* LayoutTestRelay */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = LayoutTestRelay; sourceTree = BUILT_PRODUCTS_DIR; }; >- 2E8D3EF719881D43004F6CC2 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; }; >- 2E8D3EFE19881E13004F6CC2 /* DebugRelease.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = DebugRelease.xcconfig; path = Configurations/DebugRelease.xcconfig; sourceTree = "<group>"; }; >- 2E8D3EFF19881E25004F6CC2 /* Base.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Base.xcconfig; path = Configurations/Base.xcconfig; sourceTree = "<group>"; }; >- 2E8D3F0019881F29004F6CC2 /* LTRelay.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LTRelay.h; sourceTree = "<group>"; }; >- 2E8D3F0119881FD0004F6CC2 /* LTPipeRelay.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LTPipeRelay.m; sourceTree = "<group>"; }; >- 2E8D3F0319881FE2004F6CC2 /* LTPipeRelay.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LTPipeRelay.h; sourceTree = "<group>"; }; >- 2E8D3F0419882406004F6CC2 /* LTRelayController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LTRelayController.h; sourceTree = "<group>"; }; >- 2E8D3F0519882406004F6CC2 /* LTRelayController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LTRelayController.m; sourceTree = "<group>"; }; >- CE1FBC151B290E79000136F5 /* CoreSimulatorSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreSimulatorSPI.h; sourceTree = "<group>"; }; >-/* End PBXFileReference section */ >- >-/* Begin PBXFrameworksBuildPhase section */ >- 2E8D3EF119881D43004F6CC2 /* Frameworks */ = { >- isa = PBXFrameworksBuildPhase; >- buildActionMask = 2147483647; >- files = ( >- ); >- runOnlyForDeploymentPostprocessing = 0; >- }; >-/* End PBXFrameworksBuildPhase section */ >- >-/* Begin PBXGroup section */ >- 2E8D3EEB19881D43004F6CC2 = { >- isa = PBXGroup; >- children = ( >- 2E8D3EFF19881E25004F6CC2 /* Base.xcconfig */, >- 2E8D3EFE19881E13004F6CC2 /* DebugRelease.xcconfig */, >- 2E8D3EF619881D43004F6CC2 /* LayoutTestRelay */, >- 2E8D3EF519881D43004F6CC2 /* Products */, >- ); >- sourceTree = "<group>"; >- }; >- 2E8D3EF519881D43004F6CC2 /* Products */ = { >- isa = PBXGroup; >- children = ( >- 2E8D3EF419881D43004F6CC2 /* LayoutTestRelay */, >- ); >- name = Products; >- sourceTree = "<group>"; >- }; >- 2E8D3EF619881D43004F6CC2 /* LayoutTestRelay */ = { >- isa = PBXGroup; >- children = ( >- 2E8D3EF719881D43004F6CC2 /* main.m */, >- CE1FBC151B290E79000136F5 /* CoreSimulatorSPI.h */, >- 2E8D3F0019881F29004F6CC2 /* LTRelay.h */, >- 2E8D3F0119881FD0004F6CC2 /* LTPipeRelay.m */, >- 2E8D3F0319881FE2004F6CC2 /* LTPipeRelay.h */, >- 2E8D3F0419882406004F6CC2 /* LTRelayController.h */, >- 2E8D3F0519882406004F6CC2 /* LTRelayController.m */, >- ); >- path = LayoutTestRelay; >- sourceTree = "<group>"; >- }; >-/* End PBXGroup section */ >- >-/* Begin PBXNativeTarget section */ >- 2E8D3EF319881D43004F6CC2 /* LayoutTestRelay */ = { >- isa = PBXNativeTarget; >- buildConfigurationList = 2E8D3EFB19881D43004F6CC2 /* Build configuration list for PBXNativeTarget "LayoutTestRelay" */; >- buildPhases = ( >- 2E8D3EF019881D43004F6CC2 /* Sources */, >- 2E8D3EF119881D43004F6CC2 /* Frameworks */, >- 2E8D3EF219881D43004F6CC2 /* CopyFiles */, >- ); >- buildRules = ( >- ); >- dependencies = ( >- ); >- name = LayoutTestRelay; >- productName = LayoutTestRelay; >- productReference = 2E8D3EF419881D43004F6CC2 /* LayoutTestRelay */; >- productType = "com.apple.product-type.tool"; >- }; >-/* End PBXNativeTarget section */ >- >-/* Begin PBXProject section */ >- 2E8D3EEC19881D43004F6CC2 /* Project object */ = { >- isa = PBXProject; >- attributes = { >- LastUpgradeCheck = 0600; >- ORGANIZATIONNAME = "Apple, Inc."; >- TargetAttributes = { >- 2E8D3EF319881D43004F6CC2 = { >- CreatedOnToolsVersion = 6.0; >- }; >- }; >- }; >- buildConfigurationList = 2E8D3EEF19881D43004F6CC2 /* Build configuration list for PBXProject "LayoutTestRelay" */; >- compatibilityVersion = "Xcode 3.2"; >- developmentRegion = English; >- hasScannedForEncodings = 0; >- knownRegions = ( >- en, >- ); >- mainGroup = 2E8D3EEB19881D43004F6CC2; >- productRefGroup = 2E8D3EF519881D43004F6CC2 /* Products */; >- projectDirPath = ""; >- projectRoot = ""; >- targets = ( >- 2E8D3EF319881D43004F6CC2 /* LayoutTestRelay */, >- ); >- }; >-/* End PBXProject section */ >- >-/* Begin PBXSourcesBuildPhase section */ >- 2E8D3EF019881D43004F6CC2 /* Sources */ = { >- isa = PBXSourcesBuildPhase; >- buildActionMask = 2147483647; >- files = ( >- 2E8D3F0619882406004F6CC2 /* LTRelayController.m in Sources */, >- 2E8D3EF819881D43004F6CC2 /* main.m in Sources */, >- 2E8D3F0219881FD0004F6CC2 /* LTPipeRelay.m in Sources */, >- ); >- runOnlyForDeploymentPostprocessing = 0; >- }; >-/* End PBXSourcesBuildPhase section */ >- >-/* Begin XCBuildConfiguration section */ >- 2E8D3EF919881D43004F6CC2 /* Debug */ = { >- isa = XCBuildConfiguration; >- baseConfigurationReference = 2E8D3EFE19881E13004F6CC2 /* DebugRelease.xcconfig */; >- buildSettings = { >- }; >- name = Debug; >- }; >- 2E8D3EFA19881D43004F6CC2 /* Release */ = { >- isa = XCBuildConfiguration; >- baseConfigurationReference = 2E8D3EFE19881E13004F6CC2 /* DebugRelease.xcconfig */; >- buildSettings = { >- }; >- name = Release; >- }; >- 2E8D3EFC19881D43004F6CC2 /* Debug */ = { >- isa = XCBuildConfiguration; >- baseConfigurationReference = 2E8D3EFE19881E13004F6CC2 /* DebugRelease.xcconfig */; >- buildSettings = { >- PRODUCT_NAME = "$(TARGET_NAME)"; >- }; >- name = Debug; >- }; >- 2E8D3EFD19881D43004F6CC2 /* Release */ = { >- isa = XCBuildConfiguration; >- baseConfigurationReference = 2E8D3EFE19881E13004F6CC2 /* DebugRelease.xcconfig */; >- buildSettings = { >- PRODUCT_NAME = "$(TARGET_NAME)"; >- }; >- name = Release; >- }; >-/* End XCBuildConfiguration section */ >- >-/* Begin XCConfigurationList section */ >- 2E8D3EEF19881D43004F6CC2 /* Build configuration list for PBXProject "LayoutTestRelay" */ = { >- isa = XCConfigurationList; >- buildConfigurations = ( >- 2E8D3EF919881D43004F6CC2 /* Debug */, >- 2E8D3EFA19881D43004F6CC2 /* Release */, >- ); >- defaultConfigurationIsVisible = 0; >- defaultConfigurationName = Release; >- }; >- 2E8D3EFB19881D43004F6CC2 /* Build configuration list for PBXNativeTarget "LayoutTestRelay" */ = { >- isa = XCConfigurationList; >- buildConfigurations = ( >- 2E8D3EFC19881D43004F6CC2 /* Debug */, >- 2E8D3EFD19881D43004F6CC2 /* Release */, >- ); >- defaultConfigurationIsVisible = 0; >- defaultConfigurationName = Release; >- }; >-/* End XCConfigurationList section */ >- }; >- rootObject = 2E8D3EEC19881D43004F6CC2 /* Project object */; >-} >Index: Tools/LayoutTestRelay/LayoutTestRelay.xcodeproj >=================================================================== >--- Tools/LayoutTestRelay/LayoutTestRelay.xcodeproj (revision 209886) >+++ Tools/LayoutTestRelay/LayoutTestRelay.xcodeproj (nonexistent) > >Property changes on: Tools/LayoutTestRelay/LayoutTestRelay.xcodeproj >___________________________________________________________________ >Deleted: svn:ignore >## -1,2 +0,0 ## >-project.xcworkspace >-xcuserdata >Index: Tools/LayoutTestRelay/Makefile >=================================================================== >--- Tools/LayoutTestRelay/Makefile (revision 209886) >+++ Tools/LayoutTestRelay/Makefile (nonexistent) >@@ -1,6 +0,0 @@ >-SCRIPTS_PATH = ../Scripts >- >-OVERRIDE_ARCHS = default >-OVERRIDE_SDKROOT = default >- >-include ../../Makefile.shared >Index: Tools/Makefile >=================================================================== >--- Tools/Makefile (revision 209886) >+++ Tools/Makefile (working copy) >@@ -7,9 +7,6 @@ ifneq (,$(SDKROOT)) > ifneq (,$(findstring iphone,$(SDKROOT))) > MODULES += MobileMiniBrowser > endif >- ifeq (,$(DO_NOT_BUILD_LAYOUT_TEST_RELAY)) >- MODULES += LayoutTestRelay >- endif > endif > > all: >Index: Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj >=================================================================== >--- Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj (revision 209886) >+++ Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj (working copy) >@@ -79,6 +79,7 @@ > 2CE88FA217124D8C00734FC0 /* JavaScriptThreading.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2CE88FA117124CEE00734FC0 /* JavaScriptThreading.cpp */; }; > 2D403F1B15087209005358D2 /* LayoutTestHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D403EA215087142005358D2 /* LayoutTestHelper.m */; }; > 31117B3D15D9A56A00163BC8 /* MockWebNotificationProvider.mm in Sources */ = {isa = PBXBuildFile; fileRef = 31117B3B15D9A56A00163BC8 /* MockWebNotificationProvider.mm */; }; >+ 31B09CC81E0335F1006F4E4D /* unixLoggingPipes.mm in Sources */ = {isa = PBXBuildFile; fileRef = 31B09CC71E0335EB006F4E4D /* unixLoggingPipes.mm */; }; > 440590711268453800CFD48D /* WebArchiveDumpSupportMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 440590701268453800CFD48D /* WebArchiveDumpSupportMac.mm */; }; > 4437730E125CBC3600AAE02C /* WebArchiveDumpSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 44A997830FCDE86400580F10 /* WebArchiveDumpSupport.cpp */; }; > 4464CABE1C20A08B00E5BB55 /* DumpRenderTreeAppMain.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4464CABD1C20A07000E5BB55 /* DumpRenderTreeAppMain.mm */; }; >@@ -293,6 +294,8 @@ > 2D403F19150871F9005358D2 /* LayoutTestHelper */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = LayoutTestHelper; sourceTree = BUILT_PRODUCTS_DIR; }; > 31117B3A15D9A56A00163BC8 /* MockWebNotificationProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MockWebNotificationProvider.h; path = mac/MockWebNotificationProvider.h; sourceTree = "<group>"; }; > 31117B3B15D9A56A00163BC8 /* MockWebNotificationProvider.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MockWebNotificationProvider.mm; path = mac/MockWebNotificationProvider.mm; sourceTree = "<group>"; }; >+ 31B09CC61E0335EB006F4E4D /* unixLoggingPipes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = unixLoggingPipes.h; path = ../TestRunnerShared/unixLoggingPipes.h; sourceTree = "<group>"; }; >+ 31B09CC71E0335EB006F4E4D /* unixLoggingPipes.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = unixLoggingPipes.mm; path = ../TestRunnerShared/unixLoggingPipes.mm; sourceTree = "<group>"; }; > 32A70AAB03705E1F00C91783 /* DumpRenderTreePrefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DumpRenderTreePrefix.h; sourceTree = "<group>"; }; > 375F09710DAC3CB600C8B4E5 /* WebKitWeightWatcher100.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = WebKitWeightWatcher100.ttf; path = fonts/WebKitWeightWatcher100.ttf; sourceTree = "<group>"; }; > 375F09720DAC3CB600C8B4E5 /* WebKitWeightWatcher200.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = WebKitWeightWatcher200.ttf; path = fonts/WebKitWeightWatcher200.ttf; sourceTree = "<group>"; }; >@@ -473,6 +476,7 @@ > 08FB7794FE84155DC02AAC07 /* DumpRenderTree */ = { > isa = PBXGroup; > children = ( >+ 31B09CC51E0335D0006F4E4D /* TestRunnerShared */, > 0F18E6F11D6B9C640027E547 /* DerivedSources.make */, > 0F18E6E71D6B9BF50027E547 /* UIScriptContext */, > A1158D6A18927CE10088C17B /* ios */, >@@ -700,6 +704,15 @@ > name = LayoutTestHelper; > sourceTree = "<group>"; > }; >+ 31B09CC51E0335D0006F4E4D /* TestRunnerShared */ = { >+ isa = PBXGroup; >+ children = ( >+ 31B09CC61E0335EB006F4E4D /* unixLoggingPipes.h */, >+ 31B09CC71E0335EB006F4E4D /* unixLoggingPipes.mm */, >+ ); >+ name = TestRunnerShared; >+ sourceTree = "<group>"; >+ }; > 417DA9181373674D007C57FB /* WebCoreTestSupport */ = { > isa = PBXGroup; > children = ( >@@ -1158,6 +1171,7 @@ > buildActionMask = 2147483647; > files = ( > 4464CABE1C20A08B00E5BB55 /* DumpRenderTreeAppMain.mm in Sources */, >+ 31B09CC81E0335F1006F4E4D /* unixLoggingPipes.mm in Sources */, > ); > runOnlyForDeploymentPostprocessing = 0; > }; >Index: Tools/DumpRenderTree/mac/DumpRenderTree.mm >=================================================================== >--- Tools/DumpRenderTree/mac/DumpRenderTree.mm (revision 209886) >+++ Tools/DumpRenderTree/mac/DumpRenderTree.mm (working copy) >@@ -103,6 +103,7 @@ > #if PLATFORM(IOS) > #import "DumpRenderTreeBrowserView.h" > #import "UIKitSPI.h" >+#import "unixLoggingPipes.h" > #import <QuartzCore/QuartzCore.h> > #import <WebCore/CoreGraphicsSPI.h> > #import <WebKit/WAKWindow.h> >@@ -1272,17 +1273,7 @@ void writeCrashedMessageOnFatalError(int > void dumpRenderTree(int argc, const char *argv[]) > { > #if PLATFORM(IOS) >- const char* identifier = getenv("IPC_IDENTIFIER"); >- const char *stdinPath = [[NSString stringWithFormat:@"/tmp/%s_IN", identifier] UTF8String]; >- const char *stdoutPath = [[NSString stringWithFormat:@"/tmp/%s_OUT", identifier] UTF8String]; >- const char *stderrPath = [[NSString stringWithFormat:@"/tmp/%s_ERROR", identifier] UTF8String]; >- >- int infd = open(stdinPath, O_RDWR); >- dup2(infd, STDIN_FILENO); >- int outfd = open(stdoutPath, O_RDWR); >- dup2(outfd, STDOUT_FILENO); >- int errfd = open(stderrPath, O_RDWR | O_NONBLOCK); >- dup2(errfd, STDERR_FILENO); >+ WTR::setupUnixLoggingPipes(); > #endif > > signal(SIGILL, &writeCrashedMessageOnFatalError); >@@ -1343,9 +1334,7 @@ void dumpRenderTree(int argc, const char > } > > #if PLATFORM(IOS) >- close(infd); >- close(outfd); >- close(errfd); >+ WTR::teardownUnixLoggingPipes(); > #endif > } > >Index: Tools/LayoutTestRelay/Configurations/Base.xcconfig >=================================================================== >--- Tools/LayoutTestRelay/Configurations/Base.xcconfig (revision 209886) >+++ Tools/LayoutTestRelay/Configurations/Base.xcconfig (nonexistent) >@@ -1,68 +0,0 @@ >-// Copyright (C) 2014 Apple Inc. All rights reserved. >-// >-// Redistribution and use in source and binary forms, with or without >-// modification, are permitted provided that the following conditions >-// are met: >-// 1. Redistributions of source code must retain the above copyright >-// notice, this list of conditions and the following disclaimer. >-// 2. Redistributions in binary form must reproduce the above copyright >-// notice, this list of conditions and the following disclaimer in the >-// documentation and/or other materials provided with the distribution. >-// >-// THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >-// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >-// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >-// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >- >-#include "../../../../Internal/Configurations/HaveInternalSDK.xcconfig" >- >-USE_INTERNAL_SDK = $(USE_INTERNAL_SDK_$(CONFIGURATION)); >-USE_INTERNAL_SDK_Production = YES; >-USE_INTERNAL_SDK_Debug = $(HAVE_INTERNAL_SDK); >-USE_INTERNAL_SDK_Release = $(HAVE_INTERNAL_SDK); >- >-CLANG_CXX_LANGUAGE_STANDARD = gnu++0x; >-CLANG_ENABLE_OBJC_ARC = YES; >-CLANG_WARN_CXX0X_EXTENSIONS = NO; >-HEADER_SEARCH_PATHS = $(BUILT_PRODUCTS_DIR)/usr/local/include $(WEBCORE_PRIVATE_HEADERS_DIR)/ForwardingHeaders $(SRCROOT)/../../Source/JavaScriptCore/icu $(NEXT_ROOT)/usr/local/include/WebCoreTestSupport; >-GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) ENABLE_DASHBOARD_SUPPORT; >-DEBUG_INFORMATION_FORMAT = dwarf-with-dsym; >-PREBINDING = NO >-GCC_C_LANGUAGE_STANDARD = gnu99 >-GCC_ENABLE_CPP_EXCEPTIONS = NO; >-GCC_ENABLE_CPP_RTTI = NO; >-GCC_PRECOMPILE_PREFIX_HEADER = YES >-GCC_TREAT_WARNINGS_AS_ERRORS = YES >-GCC_VERSION = com.apple.compilers.llvm.clang.1_0; >-GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO >-GCC_WARN_UNUSED_FUNCTION = YES >-GCC_WARN_UNUSED_VARIABLE = YES >-GCC_WARN_64_TO_32_BIT_CONVERSION[arch=x86_64] = NO; >-WARNING_CFLAGS = -Wall -W -Wno-unused-parameter -Wundef >- >-DEBUG_DEFINES_debug = ; >-DEBUG_DEFINES_normal = NDEBUG; >-DEBUG_DEFINES = $(DEBUG_DEFINES_$(CURRENT_VARIANT)); >- >-TARGET_MAC_OS_X_VERSION_MAJOR = $(TARGET_MAC_OS_X_VERSION_MAJOR$(MACOSX_DEPLOYMENT_TARGET:suffix:identifier)); >-TARGET_MAC_OS_X_VERSION_MAJOR_10 = 101000; >-TARGET_MAC_OS_X_VERSION_MAJOR_11 = 101100; >-TARGET_MAC_OS_X_VERSION_MAJOR_12 = 101200; >-TARGET_MAC_OS_X_VERSION_MAJOR_13 = 101300; >- >-SDKROOT = macosx.internal; >- >-SUPPORTED_PLATFORMS = macosx; >- >-TOOLCHAINS = default; >- >-OTHER_CFLAGS = $(ASAN_OTHER_CFLAGS); >-OTHER_CPLUSPLUSFLAGS = $(ASAN_OTHER_CPLUSPLUSFLAGS); >-OTHER_LDFLAGS = $(ASAN_OTHER_LDFLAGS); >Index: Tools/LayoutTestRelay/Configurations/DebugRelease.xcconfig >=================================================================== >--- Tools/LayoutTestRelay/Configurations/DebugRelease.xcconfig (revision 209886) >+++ Tools/LayoutTestRelay/Configurations/DebugRelease.xcconfig (nonexistent) >@@ -1,42 +0,0 @@ >-// Copyright (C) 2014 Apple Inc. All rights reserved. >-// >-// Redistribution and use in source and binary forms, with or without >-// modification, are permitted provided that the following conditions >-// are met: >-// 1. Redistributions of source code must retain the above copyright >-// notice, this list of conditions and the following disclaimer. >-// 2. Redistributions in binary form must reproduce the above copyright >-// notice, this list of conditions and the following disclaimer in the >-// documentation and/or other materials provided with the distribution. >-// >-// THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >-// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >-// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >-// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >- >-#include "Base.xcconfig" >- >-ARCHS = $(ARCHS_STANDARD_64_BIT); >- >-TARGET_MAC_OS_X_VERSION_MAJOR = $(MAC_OS_X_VERSION_MAJOR); >- >-MACOSX_DEPLOYMENT_TARGET = $(MACOSX_DEPLOYMENT_TARGET_$(TARGET_MAC_OS_X_VERSION_MAJOR)) >-MACOSX_DEPLOYMENT_TARGET_101000 = 10.10; >-MACOSX_DEPLOYMENT_TARGET_101100 = 10.11; >-MACOSX_DEPLOYMENT_TARGET_101200 = 10.12; >-MACOSX_DEPLOYMENT_TARGET_101300 = 10.13; >- >-FRAMEWORK_SEARCH_PATHS = $(DEVELOPER_DIR)/Library/PrivateFrameworks; >-LD_RUNPATH_SEARCH_PATHS = $(DEVELOPER_DIR)/Library/PrivateFrameworks; >-OTHER_LDFLAGS = -framework CoreSimulator -framework AppKit; >- >-SDKROOT = $(SDKROOT_macosx_$(USE_INTERNAL_SDK)); >-SDKROOT_macosx_ = macosx; >-SDKROOT_macosx_YES = macosx.internal; >Index: Tools/LayoutTestRelay/LayoutTestRelay/CoreSimulatorSPI.h >=================================================================== >--- Tools/LayoutTestRelay/LayoutTestRelay/CoreSimulatorSPI.h (revision 209886) >+++ Tools/LayoutTestRelay/LayoutTestRelay/CoreSimulatorSPI.h (nonexistent) >@@ -1,58 +0,0 @@ >-/* >- * Copyright (C) 2015, 2016 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >- * THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#if __has_include(<CoreSimulator/CoreSimulator.h>) >- >-/* FIXME: Remove the below #define once we require Xcode 7.3 with iOS 9.3 SDK or newer. */ >-#define __coresim_unavailable_msg(msg) >-#import <CoreSimulator/CoreSimulator.h> >- >-/* FIXME: Always use SimServiceContext once we require Xcode 7.3 with iOS 9.3 SDK or newer. */ >-#define USE_SIM_SERVICE_CONTEXT defined(CORESIM_API_MAX_ALLOWED) >- >-#else >- >-#import <Foundation/Foundation.h> >- >-#define USE_SIM_SERVICE_CONTEXT 1 >- >-#define kSimDeviceLaunchApplicationArguments @"arguments" >-#define kSimDeviceLaunchApplicationEnvironment @"environment" >- >-@interface SimDevice : NSObject >-- (BOOL)installApplication:(NSURL *)installURL withOptions:(NSDictionary *)options error:(NSError * __autoreleasing *)error; >-- (pid_t)launchApplicationWithID:(NSString *)bundleID options:(NSDictionary *)options error:(NSError * __autoreleasing *)error; >-@end >- >-@interface SimDeviceSet : NSObject >-@property (readonly, copy) NSDictionary *devicesByUDID; >-@end >- >-@interface SimServiceContext : NSObject >-+(SimServiceContext *)sharedServiceContextForDeveloperDir:(NSString *)developerDir error:(NSError * __autoreleasing *)error; >--(SimDeviceSet *)defaultDeviceSetWithError:(NSError * __autoreleasing *)error; >-@end >- >-#endif >Index: Tools/LayoutTestRelay/LayoutTestRelay/LTPipeRelay.h >=================================================================== >--- Tools/LayoutTestRelay/LayoutTestRelay/LTPipeRelay.h (revision 209886) >+++ Tools/LayoutTestRelay/LayoutTestRelay/LTPipeRelay.h (nonexistent) >@@ -1,36 +0,0 @@ >-/* >- * Copyright (C) 2014 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >- * THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#ifndef LTPipeRelay_h >-#define LTPipeRelay_h >- >-#import "LTRelay.h" >- >-@interface LTPipeRelay : NSObject <LTRelay> >-@property (weak) id<LTRelayDelegate> relayDelegate; >-- (id)initWithPrefix:(NSString *)prefix; >-@end >- >-#endif >Index: Tools/LayoutTestRelay/LayoutTestRelay/LTPipeRelay.m >=================================================================== >--- Tools/LayoutTestRelay/LayoutTestRelay/LTPipeRelay.m (revision 209886) >+++ Tools/LayoutTestRelay/LayoutTestRelay/LTPipeRelay.m (nonexistent) >@@ -1,158 +0,0 @@ >-/* >- * Copyright (C) 2014 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >- * THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#import "LTPipeRelay.h" >- >-#import <Foundation/Foundation.h> >-#include <sys/stat.h> >-#include <sys/types.h> >- >-@interface LTPipeRelay () >-@property (readonly, strong) NSString *fifoPrefix; >-@property (strong) NSOutputStream *standardInputPipe; >-@property (strong) NSInputStream *standardOutputPipe; >-@property (strong) NSInputStream *standardErrorPipe; >- >-- (void)createFIFOs; >-- (void)destroyFIFOs; >-@end >- >-@implementation LTPipeRelay >- >-- (NSString *)inPipePath >-{ >- return [_fifoPrefix stringByAppendingString:@"_IN"]; >-} >- >-- (NSString *)outPipePath >-{ >- return [_fifoPrefix stringByAppendingString:@"_OUT"]; >-} >- >-- (NSString *)errorPipePath >-{ >- return [_fifoPrefix stringByAppendingString:@"_ERROR"]; >-} >- >-- (NSOutputStream *) outputStream >-{ >- return _standardInputPipe; >-} >- >-- (id)initWithPrefix:(NSString *)prefix >-{ >- if ((self = [super init])) { >- _fifoPrefix = prefix; >- [self destroyFIFOs]; >- } >- return self; >-} >- >-- (void)setup >-{ >- [self destroyFIFOs]; >- [self createFIFOs]; >-} >- >-- (void)tearDown >-{ >- [self destroyFIFOs]; >-} >- >--(void) connect >-{ >- _standardInputPipe = [NSOutputStream outputStreamToFileAtPath:[self inPipePath] append:YES]; >- _standardOutputPipe = [NSInputStream inputStreamWithFileAtPath:[self outPipePath]]; >- _standardErrorPipe = [NSInputStream inputStreamWithFileAtPath:[self errorPipePath]]; >- >- [[self standardInputPipe] setDelegate:self]; >- [[self standardOutputPipe] setDelegate:self]; >- [[self standardErrorPipe] setDelegate:self]; >- >- [[self standardOutputPipe] scheduleInRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode]; >- [[self standardErrorPipe] scheduleInRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode]; >- >- [[self standardInputPipe] open]; >- [[self standardOutputPipe] open]; >- [[self standardErrorPipe] open]; >- >- [[self relayDelegate] didConnect]; >-} >- >-- (void)disconnect >-{ >- [[self standardOutputPipe] close]; >- [[self standardErrorPipe] close]; >- [[self standardInputPipe] close]; >- [[self relayDelegate] didDisconnect]; >-} >- >-- (void)createFIFOs >-{ >- mkfifo([[self inPipePath] UTF8String], 0666); >- mkfifo([[self outPipePath] UTF8String], 0666); >- mkfifo([[self errorPipePath] UTF8String], 0666); >-} >- >-- (void)destroyFIFOs >-{ >- unlink([[self inPipePath] UTF8String]); >- unlink([[self outPipePath] UTF8String]); >- unlink([[self errorPipePath] UTF8String]); >-} >- >-- (void) relayStream:(NSInputStream *)stream >-{ >- uint8_t bytes[1024]; >- NSInteger bytesRead = [stream read:bytes maxLength:1024]; >- NSData *data = [NSData dataWithBytes:bytes length:bytesRead]; >- >- if (stream == [self standardOutputPipe]) >- [[self relayDelegate] didReceiveStdoutData:data]; >- else >- [[self relayDelegate] didReceiveStderrData:data]; >-} >- >-- (void)stream:(NSStream *)aStream handleEvent:(NSStreamEvent)eventCode >-{ >- switch (eventCode) { >- case NSStreamEventNone: >- break; >- case NSStreamEventHasBytesAvailable: >- [self relayStream:(NSInputStream *)aStream]; >- case NSStreamEventHasSpaceAvailable: >- break; >- case NSStreamEventOpenCompleted: >- break; >- case NSStreamEventEndEncountered: >- [[self relayDelegate] didCrashWithMessage:nil]; >- break; >- case NSStreamEventErrorOccurred: >- [[self relayDelegate] didCrashWithMessage:[[aStream streamError] description]]; >- break; >- } >-} >- >-@end >Index: Tools/LayoutTestRelay/LayoutTestRelay/LTRelay.h >=================================================================== >--- Tools/LayoutTestRelay/LayoutTestRelay/LTRelay.h (revision 209886) >+++ Tools/LayoutTestRelay/LayoutTestRelay/LTRelay.h (nonexistent) >@@ -1,48 +0,0 @@ >-/* >- * Copyright (C) 2014 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >- * THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#ifndef LTRelay_h >-#define LTRelay_h >- >-#import <Foundation/Foundation.h> >- >-@protocol LTRelayDelegate <NSObject> >-- (void)didConnect; >-- (void)didDisconnect; >-- (void)didCrashWithMessage:(NSString *)message; >-- (void)didReceiveStdoutData:(NSData *)data; >-- (void)didReceiveStderrData:(NSData *)data; >-@end >- >-@protocol LTRelay <NSObject, NSStreamDelegate> >-- (void)setup; >-- (void)tearDown; >-- (void)connect; >-- (void)disconnect; >-@property (weak) id<LTRelayDelegate> relayDelegate; >-@property (readonly, strong) NSOutputStream *outputStream; >-@end >- >-#endif >Index: Tools/LayoutTestRelay/LayoutTestRelay/LTRelayController.h >=================================================================== >--- Tools/LayoutTestRelay/LayoutTestRelay/LTRelayController.h (revision 209886) >+++ Tools/LayoutTestRelay/LayoutTestRelay/LTRelayController.h (nonexistent) >@@ -1,40 +0,0 @@ >-/* >- * Copyright (C) 2014 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >- * THE POSSIBILITY OF SUCH DAMAGE. >- */ >-#ifndef LTRelayController_h >-#define LTRelayController_h >- >-#import "LTRelay.h" >- >-#import <Foundation/Foundation.h> >- >-@class SimDevice; >- >-@interface LTRelayController : NSObject <LTRelayDelegate> >-- (id)initWithDevice:(SimDevice *)device productDir:(NSString *)productDir appPath:(NSString *)appPath deviceUDID:(NSUUID *)udid dumpToolArguments:(NSArray *)arguments; >-- (void)start; >-- (void)finish; >-@end >- >-#endif >Index: Tools/LayoutTestRelay/LayoutTestRelay/LTRelayController.m >=================================================================== >--- Tools/LayoutTestRelay/LayoutTestRelay/LTRelayController.m (revision 209886) >+++ Tools/LayoutTestRelay/LayoutTestRelay/LTRelayController.m (nonexistent) >@@ -1,272 +0,0 @@ >-/* >- * Copyright (C) 2014 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >- * THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#import "LTRelayController.h" >- >-#import "CoreSimulatorSPI.h" >-#import "LTPipeRelay.h" >-#import <AppKit/AppKit.h> >-#import <crt_externs.h> >- >-@interface LTRelayController () >-@property (readonly, strong) dispatch_source_t standardInputDispatchSource; >-@property (readonly, strong) NSFileHandle *standardOutput; >-@property (readonly, strong) NSFileHandle *standardError; >-@property (readonly, strong) NSString *ipcIdentifier; >-@property (readonly, strong) NSString *appBundleIdentifier; >-@property (readonly, strong) NSString *appPath; >-@property (readonly, strong) NSUUID *deviceUDID; >-@property (readonly, strong) NSArray *dumpToolArguments; >-@property (readonly, strong) NSString *productDir; >-@property (strong) SimDevice *device; >-@property (strong) id<LTRelay> relay; >-@property pid_t pid; >-@property (strong) dispatch_source_t appDispatchSource; >-@end >- >-@implementation LTRelayController >- >-- (id)initWithDevice:(SimDevice *)device productDir:(NSString *)productDir appPath:(NSString *)appPath deviceUDID:(NSUUID *)udid dumpToolArguments:(NSArray *)arguments >-{ >- if ((self = [super init])) { >- _device = device; >- _productDir = productDir; >- _appPath = appPath; >- _appBundleIdentifier = [[NSBundle bundleWithPath:appPath] bundleIdentifier]; >- _deviceUDID = udid; >- _dumpToolArguments = arguments; >- _standardInputDispatchSource = dispatch_source_create(DISPATCH_SOURCE_TYPE_READ, STDIN_FILENO, 0, dispatch_get_main_queue()); >- _standardOutput = [NSFileHandle fileHandleWithStandardOutput]; >- _standardError = [NSFileHandle fileHandleWithStandardError]; >- >- dispatch_source_set_event_handler(_standardInputDispatchSource, ^{ >- uint8_t buffer[1024]; >- ssize_t len = read(STDIN_FILENO, buffer, sizeof(buffer)); >- if (len > 0) { >- @try { >- [[[self relay] outputStream] write:buffer maxLength:len]; >- } @catch (NSException *e) { >- // Broken pipe - the dump tool crashed. Time to die. >- [self didCrashWithMessage:nil]; >- } >- } else { >- // EOF Received on the relay's standard input. >- [self finish]; >- } >- }); >- >- _relay = [[LTPipeRelay alloc] initWithPrefix:[@"/tmp" stringByAppendingPathComponent:self.ipcIdentifier]]; >- [_relay setRelayDelegate:self]; >- } >- return self; >-} >- >-- (NSString *)ipcIdentifier >-{ >- return [NSString stringWithFormat:@"%@-%@", self.appBundleIdentifier, self.deviceUDID.UUIDString]; >-} >- >-- (NSString *)processName >-{ >- return [self.appBundleIdentifier componentsSeparatedByString:@"."].lastObject; >-} >- >-- (void)didReceiveStdoutData:(NSData *)data >-{ >- @try { >- [[self standardOutput] writeData:data]; >- } @catch (NSException *exception) { >- // NSFileHandleOperationException >- // Broken pipe - the test harness stopped listening to us, >- // probably because we timed out or a run was canceled. >- exit(EXIT_FAILURE); >- } >-} >- >-- (void)didReceiveStderrData:(NSData *)data >-{ >- @try { >- [[self standardError] writeData:data]; >- } @catch (NSException *exception) { >- // NSFileHandleOperationException >- // Broken pipe - the test harness stopped listening to us, >- // probably because we timed out or a run was canceled. >- exit(EXIT_FAILURE); >- } >-} >- >-- (void)didDisconnect >-{ >- dispatch_suspend([self standardInputDispatchSource]); >-} >- >-- (void)didConnect >-{ >- dispatch_resume([self standardInputDispatchSource]); >-} >- >-- (void)didCrashWithMessage:(NSString *)message >-{ >- [[self relay] disconnect]; >- NSString *crashMessage = [NSString stringWithFormat:@"\n#CRASHED - %@ (pid %d)\n", [self processName], [self pid]]; >- >- if (message) >- crashMessage = [crashMessage stringByAppendingFormat:@"%@\n", message]; >- >- [[self standardError] writeData:[crashMessage dataUsingEncoding:NSUTF8StringEncoding]]; >- [[self standardError] closeFile]; >- [[self standardOutput] closeFile]; >- exit(EXIT_FAILURE); >-} >- >-- (void)installApp >-{ >- NSDictionary *installOptions = @{ >- (NSString *)kCFBundleIdentifierKey: self.appBundleIdentifier, >- }; >- >- NSError *error = nil; >- BOOL installed = [self.device installApplication:[NSURL fileURLWithPath:self.appPath] withOptions:installOptions error:&error]; >- if (!installed) { >- NSLog(@"Couldn't install %@: %@", self.appPath, error.description); >- exit(EXIT_FAILURE); >- } >-} >- >-- (void)killApp >-{ >- dispatch_source_t dispatch = [self appDispatchSource]; >- >- if (dispatch) >- dispatch_source_cancel(dispatch); >- >- if ([self pid] > 1) { >- kill(self.pid, SIGKILL); >- [self setPid:-1]; >- } >- [self setAppDispatchSource:nil]; >-} >- >-- (NSDictionary *)_environmentVariables >-{ >- static NSDictionary *environmentVariables; >- static dispatch_once_t once; >- >- dispatch_once(&once, ^{ >- NSString *productDirectory = [self productDir]; >- >- NSMutableDictionary *dictionary = [@{ >- @"IPC_IDENTIFIER": self.ipcIdentifier, >- @"DYLD_FRAMEWORK_PATH": productDirectory, >- @"__XPC_DYLD_FRAMEWORK_PATH": productDirectory, >- @"DYLD_LIBRARY_PATH": productDirectory, >- @"__XPC_DYLD_LIBRARY_PATH": productDirectory, >- } mutableCopy]; >- >- for (NSString *keyName in @[@"DYLD_INSERT_LIBRARIES", @"MallocStackLogging", @"LOCAL_RESOURCE_ROOT", @"DUMPRENDERTREE_TEMP"]) { >- const char* value = getenv([keyName UTF8String]); >- if (value && strlen(value)) { >- NSString *nsValue = [NSString stringWithUTF8String:value]; >- [dictionary setObject:nsValue forKey:keyName]; >- [dictionary setObject:nsValue forKey:[@"__XPC_" stringByAppendingString:keyName]]; >- } >- } >- >- for (char** envp = *_NSGetEnviron(); *envp; envp++) { >- const char* env = *envp; >- if (!strncmp("JSC_", env, 4) || !strncmp("__XPC_JSC_", env, 10)) { >- const char* equal = strchr(env, '='); >- if (!equal) { >- NSLog(@"Missing '=' in env var '%s'", env); >- continue; >- } >- >- static const size_t maxKeyLength = 256; >- size_t keyLength = equal - env; >- if (keyLength >= maxKeyLength) { >- NSLog(@"Env var '%s' is too long", env); >- continue; >- } >- >- char key[maxKeyLength]; >- strncpy(key, env, keyLength); >- key[keyLength] = '\0'; >- const char* value = equal + 1; >- >- NSString *nsKey = [NSString stringWithUTF8String:key]; >- NSString *nsValue = [NSString stringWithUTF8String:value]; >- [dictionary setObject:nsValue forKey:nsKey]; >- } >- } >- >- environmentVariables = [dictionary copy]; >- }); >- >- return environmentVariables; >-} >- >-- (void)launchApp >-{ >- NSDictionary *launchOptions = @{ >- kSimDeviceLaunchApplicationEnvironment: [self _environmentVariables], >- kSimDeviceLaunchApplicationArguments: [self dumpToolArguments], >- }; >- >- NSError *error; >- pid_t pid = [self.device launchApplicationWithID:self.appBundleIdentifier options:launchOptions error:&error]; >- >- if (pid < 0) { >- NSLog(@"Couldn't launch %@: %@", self.appBundleIdentifier, error.description); >- exit(EXIT_FAILURE); >- } >- >- [self setPid:pid]; >- >- dispatch_queue_t queue = dispatch_get_main_queue(); >- dispatch_source_t simulatorAppExitDispatchSource = dispatch_source_create(DISPATCH_SOURCE_TYPE_PROC, [self pid], DISPATCH_PROC_EXIT, queue); >- [self setAppDispatchSource:simulatorAppExitDispatchSource]; >- dispatch_source_set_event_handler(simulatorAppExitDispatchSource, ^{ >- dispatch_source_cancel(simulatorAppExitDispatchSource); >- [self didCrashWithMessage:nil]; >- }); >- dispatch_resume(simulatorAppExitDispatchSource); >-} >- >-- (void)start >-{ >- [self installApp]; >- [[self relay] setup]; >- [self launchApp]; >- [[self relay] connect]; >-} >- >-- (void)finish >-{ >- [[self relay] disconnect]; >- [self killApp]; >- exit(EXIT_SUCCESS); >-} >- >-@end >Index: Tools/LayoutTestRelay/LayoutTestRelay/main.m >=================================================================== >--- Tools/LayoutTestRelay/LayoutTestRelay/main.m (revision 209886) >+++ Tools/LayoutTestRelay/LayoutTestRelay/main.m (nonexistent) >@@ -1,133 +0,0 @@ >-/* >- * Copyright (C) 2014, 2016 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >- * THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#import "CoreSimulatorSPI.h" >-#import "LTRelayController.h" >-#import <Foundation/Foundation.h> >- >-static LTRelayController *relayController; >- >-void usage() >-{ >- NSString *helpText = @"LayoutTestRelay: run a dump tool in the simulator. Not for direct consumption.\n" >- "Usage: LayoutTestRelay [-h] [options] -- [dump tool arguments]\n" >- "Required options:\n" >- " -udid <identifier> Simulator device identifier\n" >- " -app <app_path> Path to the built iOS .app bundle directory.\n" >- " -productDir <dir> /path/to/WebKitBuild/{configuration}-{short platform}.\n"; >- >- fprintf(stderr, "%s\n", [helpText UTF8String]); >-} >- >-NSString *getRequiredStringArgument(NSString *parameter) >-{ >- NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; >- NSString *argument = [defaults stringForKey:parameter]; >- >- if (!argument) { >- NSLog(@"-%@ is required.", parameter); >- usage(); >- exit(EXIT_FAILURE); >- } >- return argument; >-} >- >-NSArray *getDumpToolArguments() >-{ >- NSMutableArray *dumpToolArguments = [[NSMutableArray alloc] init]; >- NSArray *processArgs = [[NSProcessInfo processInfo] arguments]; >- BOOL appending = NO; >- for (NSString *arg in processArgs) { >- if ([arg isEqualToString:@"--"]) { >- appending = YES; >- continue; >- } >- if (appending) >- [dumpToolArguments addObject:arg]; >- } >- return dumpToolArguments; >-} >- >-void finish() >-{ >- [relayController finish]; >-} >- >-void receivedSignal(int signal) >-{ >- exit(EXIT_SUCCESS); >-} >- >-int main(int argc, const char * argv[]) >-{ >- @autoreleasepool { >- NSArray *helpArguments = @[@"-h", @"--help"]; >- for (NSString *helpArgument in helpArguments) { >- if ([[[NSProcessInfo processInfo] arguments] indexOfObject:helpArgument] != NSNotFound) { >- usage(); >- exit(EXIT_FAILURE); >- } >- } >- >-#if USE_SIM_SERVICE_CONTEXT >- NSString *developerDirectory = getRequiredStringArgument(@"developerDir"); >-#endif >- NSUUID *udid = [[NSUUID alloc] initWithUUIDString:getRequiredStringArgument(@"udid")]; >- NSString *appPath = getRequiredStringArgument(@"app"); >- NSString *productDirectory = getRequiredStringArgument(@"productDir"); >- NSArray *dumpToolArguments = getDumpToolArguments(); >- >-#if USE_SIM_SERVICE_CONTEXT >- NSError *error; >- SimServiceContext *serviceContext = [SimServiceContext sharedServiceContextForDeveloperDir:developerDirectory error:&error]; >- if (!serviceContext) { >- NSLog(@"Device context couldn't be found: %@", error); >- exit(EXIT_FAILURE); >- } >- SimDeviceSet *deviceSet = [serviceContext defaultDeviceSetWithError:nil]; >- if (!deviceSet) { >- NSLog(@"Default device set couldn't be found: %@", error); >- exit(EXIT_FAILURE); >- } >- SimDevice *device = [deviceSet.devicesByUDID objectForKey:udid]; >-#else >- SimDevice *device = [SimDeviceSet.defaultSet.devicesByUDID objectForKey:udid]; >-#endif >- if (!device) { >- NSLog(@"Device %@ couldn't be found", udid); >- exit(EXIT_FAILURE); >- } >- >- relayController = [[LTRelayController alloc] initWithDevice:device productDir:productDirectory appPath:appPath deviceUDID:udid dumpToolArguments:dumpToolArguments]; >- [relayController start]; >- >- atexit(finish); >- signal(SIGINT, receivedSignal); >- signal(SIGTERM, receivedSignal); >- >- [[NSRunLoop mainRunLoop] run]; >- } >- return 0; >-} >Index: Tools/LayoutTestRelay/LayoutTestRelay.xcodeproj/project.pbxproj >=================================================================== >--- Tools/LayoutTestRelay/LayoutTestRelay.xcodeproj/project.pbxproj (revision 209886) >+++ Tools/LayoutTestRelay/LayoutTestRelay.xcodeproj/project.pbxproj (nonexistent) >@@ -1,202 +0,0 @@ >-// !$*UTF8*$! >-{ >- archiveVersion = 1; >- classes = { >- }; >- objectVersion = 46; >- objects = { >- >-/* Begin PBXBuildFile section */ >- 2E8D3EF819881D43004F6CC2 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 2E8D3EF719881D43004F6CC2 /* main.m */; }; >- 2E8D3F0219881FD0004F6CC2 /* LTPipeRelay.m in Sources */ = {isa = PBXBuildFile; fileRef = 2E8D3F0119881FD0004F6CC2 /* LTPipeRelay.m */; }; >- 2E8D3F0619882406004F6CC2 /* LTRelayController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2E8D3F0519882406004F6CC2 /* LTRelayController.m */; }; >-/* End PBXBuildFile section */ >- >-/* Begin PBXCopyFilesBuildPhase section */ >- 2E8D3EF219881D43004F6CC2 /* CopyFiles */ = { >- isa = PBXCopyFilesBuildPhase; >- buildActionMask = 2147483647; >- dstPath = /usr/share/man/man1/; >- dstSubfolderSpec = 0; >- files = ( >- ); >- runOnlyForDeploymentPostprocessing = 1; >- }; >-/* End PBXCopyFilesBuildPhase section */ >- >-/* Begin PBXFileReference section */ >- 2E8D3EF419881D43004F6CC2 /* LayoutTestRelay */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = LayoutTestRelay; sourceTree = BUILT_PRODUCTS_DIR; }; >- 2E8D3EF719881D43004F6CC2 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; }; >- 2E8D3EFE19881E13004F6CC2 /* DebugRelease.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = DebugRelease.xcconfig; path = Configurations/DebugRelease.xcconfig; sourceTree = "<group>"; }; >- 2E8D3EFF19881E25004F6CC2 /* Base.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Base.xcconfig; path = Configurations/Base.xcconfig; sourceTree = "<group>"; }; >- 2E8D3F0019881F29004F6CC2 /* LTRelay.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LTRelay.h; sourceTree = "<group>"; }; >- 2E8D3F0119881FD0004F6CC2 /* LTPipeRelay.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LTPipeRelay.m; sourceTree = "<group>"; }; >- 2E8D3F0319881FE2004F6CC2 /* LTPipeRelay.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LTPipeRelay.h; sourceTree = "<group>"; }; >- 2E8D3F0419882406004F6CC2 /* LTRelayController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LTRelayController.h; sourceTree = "<group>"; }; >- 2E8D3F0519882406004F6CC2 /* LTRelayController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LTRelayController.m; sourceTree = "<group>"; }; >- CE1FBC151B290E79000136F5 /* CoreSimulatorSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreSimulatorSPI.h; sourceTree = "<group>"; }; >-/* End PBXFileReference section */ >- >-/* Begin PBXFrameworksBuildPhase section */ >- 2E8D3EF119881D43004F6CC2 /* Frameworks */ = { >- isa = PBXFrameworksBuildPhase; >- buildActionMask = 2147483647; >- files = ( >- ); >- runOnlyForDeploymentPostprocessing = 0; >- }; >-/* End PBXFrameworksBuildPhase section */ >- >-/* Begin PBXGroup section */ >- 2E8D3EEB19881D43004F6CC2 = { >- isa = PBXGroup; >- children = ( >- 2E8D3EFF19881E25004F6CC2 /* Base.xcconfig */, >- 2E8D3EFE19881E13004F6CC2 /* DebugRelease.xcconfig */, >- 2E8D3EF619881D43004F6CC2 /* LayoutTestRelay */, >- 2E8D3EF519881D43004F6CC2 /* Products */, >- ); >- sourceTree = "<group>"; >- }; >- 2E8D3EF519881D43004F6CC2 /* Products */ = { >- isa = PBXGroup; >- children = ( >- 2E8D3EF419881D43004F6CC2 /* LayoutTestRelay */, >- ); >- name = Products; >- sourceTree = "<group>"; >- }; >- 2E8D3EF619881D43004F6CC2 /* LayoutTestRelay */ = { >- isa = PBXGroup; >- children = ( >- 2E8D3EF719881D43004F6CC2 /* main.m */, >- CE1FBC151B290E79000136F5 /* CoreSimulatorSPI.h */, >- 2E8D3F0019881F29004F6CC2 /* LTRelay.h */, >- 2E8D3F0119881FD0004F6CC2 /* LTPipeRelay.m */, >- 2E8D3F0319881FE2004F6CC2 /* LTPipeRelay.h */, >- 2E8D3F0419882406004F6CC2 /* LTRelayController.h */, >- 2E8D3F0519882406004F6CC2 /* LTRelayController.m */, >- ); >- path = LayoutTestRelay; >- sourceTree = "<group>"; >- }; >-/* End PBXGroup section */ >- >-/* Begin PBXNativeTarget section */ >- 2E8D3EF319881D43004F6CC2 /* LayoutTestRelay */ = { >- isa = PBXNativeTarget; >- buildConfigurationList = 2E8D3EFB19881D43004F6CC2 /* Build configuration list for PBXNativeTarget "LayoutTestRelay" */; >- buildPhases = ( >- 2E8D3EF019881D43004F6CC2 /* Sources */, >- 2E8D3EF119881D43004F6CC2 /* Frameworks */, >- 2E8D3EF219881D43004F6CC2 /* CopyFiles */, >- ); >- buildRules = ( >- ); >- dependencies = ( >- ); >- name = LayoutTestRelay; >- productName = LayoutTestRelay; >- productReference = 2E8D3EF419881D43004F6CC2 /* LayoutTestRelay */; >- productType = "com.apple.product-type.tool"; >- }; >-/* End PBXNativeTarget section */ >- >-/* Begin PBXProject section */ >- 2E8D3EEC19881D43004F6CC2 /* Project object */ = { >- isa = PBXProject; >- attributes = { >- LastUpgradeCheck = 0600; >- ORGANIZATIONNAME = "Apple, Inc."; >- TargetAttributes = { >- 2E8D3EF319881D43004F6CC2 = { >- CreatedOnToolsVersion = 6.0; >- }; >- }; >- }; >- buildConfigurationList = 2E8D3EEF19881D43004F6CC2 /* Build configuration list for PBXProject "LayoutTestRelay" */; >- compatibilityVersion = "Xcode 3.2"; >- developmentRegion = English; >- hasScannedForEncodings = 0; >- knownRegions = ( >- en, >- ); >- mainGroup = 2E8D3EEB19881D43004F6CC2; >- productRefGroup = 2E8D3EF519881D43004F6CC2 /* Products */; >- projectDirPath = ""; >- projectRoot = ""; >- targets = ( >- 2E8D3EF319881D43004F6CC2 /* LayoutTestRelay */, >- ); >- }; >-/* End PBXProject section */ >- >-/* Begin PBXSourcesBuildPhase section */ >- 2E8D3EF019881D43004F6CC2 /* Sources */ = { >- isa = PBXSourcesBuildPhase; >- buildActionMask = 2147483647; >- files = ( >- 2E8D3F0619882406004F6CC2 /* LTRelayController.m in Sources */, >- 2E8D3EF819881D43004F6CC2 /* main.m in Sources */, >- 2E8D3F0219881FD0004F6CC2 /* LTPipeRelay.m in Sources */, >- ); >- runOnlyForDeploymentPostprocessing = 0; >- }; >-/* End PBXSourcesBuildPhase section */ >- >-/* Begin XCBuildConfiguration section */ >- 2E8D3EF919881D43004F6CC2 /* Debug */ = { >- isa = XCBuildConfiguration; >- baseConfigurationReference = 2E8D3EFE19881E13004F6CC2 /* DebugRelease.xcconfig */; >- buildSettings = { >- }; >- name = Debug; >- }; >- 2E8D3EFA19881D43004F6CC2 /* Release */ = { >- isa = XCBuildConfiguration; >- baseConfigurationReference = 2E8D3EFE19881E13004F6CC2 /* DebugRelease.xcconfig */; >- buildSettings = { >- }; >- name = Release; >- }; >- 2E8D3EFC19881D43004F6CC2 /* Debug */ = { >- isa = XCBuildConfiguration; >- baseConfigurationReference = 2E8D3EFE19881E13004F6CC2 /* DebugRelease.xcconfig */; >- buildSettings = { >- PRODUCT_NAME = "$(TARGET_NAME)"; >- }; >- name = Debug; >- }; >- 2E8D3EFD19881D43004F6CC2 /* Release */ = { >- isa = XCBuildConfiguration; >- baseConfigurationReference = 2E8D3EFE19881E13004F6CC2 /* DebugRelease.xcconfig */; >- buildSettings = { >- PRODUCT_NAME = "$(TARGET_NAME)"; >- }; >- name = Release; >- }; >-/* End XCBuildConfiguration section */ >- >-/* Begin XCConfigurationList section */ >- 2E8D3EEF19881D43004F6CC2 /* Build configuration list for PBXProject "LayoutTestRelay" */ = { >- isa = XCConfigurationList; >- buildConfigurations = ( >- 2E8D3EF919881D43004F6CC2 /* Debug */, >- 2E8D3EFA19881D43004F6CC2 /* Release */, >- ); >- defaultConfigurationIsVisible = 0; >- defaultConfigurationName = Release; >- }; >- 2E8D3EFB19881D43004F6CC2 /* Build configuration list for PBXNativeTarget "LayoutTestRelay" */ = { >- isa = XCConfigurationList; >- buildConfigurations = ( >- 2E8D3EFC19881D43004F6CC2 /* Debug */, >- 2E8D3EFD19881D43004F6CC2 /* Release */, >- ); >- defaultConfigurationIsVisible = 0; >- defaultConfigurationName = Release; >- }; >-/* End XCConfigurationList section */ >- }; >- rootObject = 2E8D3EEC19881D43004F6CC2 /* Project object */; >-} >Index: Tools/LayoutTestRelay/LayoutTestRelay.xcodeproj >=================================================================== >--- Tools/LayoutTestRelay/LayoutTestRelay.xcodeproj (revision 209886) >+++ Tools/LayoutTestRelay/LayoutTestRelay.xcodeproj (nonexistent) > >Property changes on: Tools/LayoutTestRelay/LayoutTestRelay.xcodeproj >___________________________________________________________________ >Deleted: svn:ignore >## -1,2 +0,0 ## >-project.xcworkspace >-xcuserdata >Index: Tools/LayoutTestRelay/Makefile >=================================================================== >--- Tools/LayoutTestRelay/Makefile (revision 209886) >+++ Tools/LayoutTestRelay/Makefile (nonexistent) >@@ -1,6 +0,0 @@ >-SCRIPTS_PATH = ../Scripts >- >-OVERRIDE_ARCHS = default >-OVERRIDE_SDKROOT = default >- >-include ../../Makefile.shared >Index: Tools/LayoutTestRelay/Configurations/Base.xcconfig >=================================================================== >--- Tools/LayoutTestRelay/Configurations/Base.xcconfig (revision 209886) >+++ Tools/LayoutTestRelay/Configurations/Base.xcconfig (nonexistent) >@@ -1,68 +0,0 @@ >-// Copyright (C) 2014 Apple Inc. All rights reserved. >-// >-// Redistribution and use in source and binary forms, with or without >-// modification, are permitted provided that the following conditions >-// are met: >-// 1. Redistributions of source code must retain the above copyright >-// notice, this list of conditions and the following disclaimer. >-// 2. Redistributions in binary form must reproduce the above copyright >-// notice, this list of conditions and the following disclaimer in the >-// documentation and/or other materials provided with the distribution. >-// >-// THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >-// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >-// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >-// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >- >-#include "../../../../Internal/Configurations/HaveInternalSDK.xcconfig" >- >-USE_INTERNAL_SDK = $(USE_INTERNAL_SDK_$(CONFIGURATION)); >-USE_INTERNAL_SDK_Production = YES; >-USE_INTERNAL_SDK_Debug = $(HAVE_INTERNAL_SDK); >-USE_INTERNAL_SDK_Release = $(HAVE_INTERNAL_SDK); >- >-CLANG_CXX_LANGUAGE_STANDARD = gnu++0x; >-CLANG_ENABLE_OBJC_ARC = YES; >-CLANG_WARN_CXX0X_EXTENSIONS = NO; >-HEADER_SEARCH_PATHS = $(BUILT_PRODUCTS_DIR)/usr/local/include $(WEBCORE_PRIVATE_HEADERS_DIR)/ForwardingHeaders $(SRCROOT)/../../Source/JavaScriptCore/icu $(NEXT_ROOT)/usr/local/include/WebCoreTestSupport; >-GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) ENABLE_DASHBOARD_SUPPORT; >-DEBUG_INFORMATION_FORMAT = dwarf-with-dsym; >-PREBINDING = NO >-GCC_C_LANGUAGE_STANDARD = gnu99 >-GCC_ENABLE_CPP_EXCEPTIONS = NO; >-GCC_ENABLE_CPP_RTTI = NO; >-GCC_PRECOMPILE_PREFIX_HEADER = YES >-GCC_TREAT_WARNINGS_AS_ERRORS = YES >-GCC_VERSION = com.apple.compilers.llvm.clang.1_0; >-GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO >-GCC_WARN_UNUSED_FUNCTION = YES >-GCC_WARN_UNUSED_VARIABLE = YES >-GCC_WARN_64_TO_32_BIT_CONVERSION[arch=x86_64] = NO; >-WARNING_CFLAGS = -Wall -W -Wno-unused-parameter -Wundef >- >-DEBUG_DEFINES_debug = ; >-DEBUG_DEFINES_normal = NDEBUG; >-DEBUG_DEFINES = $(DEBUG_DEFINES_$(CURRENT_VARIANT)); >- >-TARGET_MAC_OS_X_VERSION_MAJOR = $(TARGET_MAC_OS_X_VERSION_MAJOR$(MACOSX_DEPLOYMENT_TARGET:suffix:identifier)); >-TARGET_MAC_OS_X_VERSION_MAJOR_10 = 101000; >-TARGET_MAC_OS_X_VERSION_MAJOR_11 = 101100; >-TARGET_MAC_OS_X_VERSION_MAJOR_12 = 101200; >-TARGET_MAC_OS_X_VERSION_MAJOR_13 = 101300; >- >-SDKROOT = macosx.internal; >- >-SUPPORTED_PLATFORMS = macosx; >- >-TOOLCHAINS = default; >- >-OTHER_CFLAGS = $(ASAN_OTHER_CFLAGS); >-OTHER_CPLUSPLUSFLAGS = $(ASAN_OTHER_CPLUSPLUSFLAGS); >-OTHER_LDFLAGS = $(ASAN_OTHER_LDFLAGS); >Index: Tools/LayoutTestRelay/Configurations/DebugRelease.xcconfig >=================================================================== >--- Tools/LayoutTestRelay/Configurations/DebugRelease.xcconfig (revision 209886) >+++ Tools/LayoutTestRelay/Configurations/DebugRelease.xcconfig (nonexistent) >@@ -1,42 +0,0 @@ >-// Copyright (C) 2014 Apple Inc. All rights reserved. >-// >-// Redistribution and use in source and binary forms, with or without >-// modification, are permitted provided that the following conditions >-// are met: >-// 1. Redistributions of source code must retain the above copyright >-// notice, this list of conditions and the following disclaimer. >-// 2. Redistributions in binary form must reproduce the above copyright >-// notice, this list of conditions and the following disclaimer in the >-// documentation and/or other materials provided with the distribution. >-// >-// THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >-// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >-// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >-// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >- >-#include "Base.xcconfig" >- >-ARCHS = $(ARCHS_STANDARD_64_BIT); >- >-TARGET_MAC_OS_X_VERSION_MAJOR = $(MAC_OS_X_VERSION_MAJOR); >- >-MACOSX_DEPLOYMENT_TARGET = $(MACOSX_DEPLOYMENT_TARGET_$(TARGET_MAC_OS_X_VERSION_MAJOR)) >-MACOSX_DEPLOYMENT_TARGET_101000 = 10.10; >-MACOSX_DEPLOYMENT_TARGET_101100 = 10.11; >-MACOSX_DEPLOYMENT_TARGET_101200 = 10.12; >-MACOSX_DEPLOYMENT_TARGET_101300 = 10.13; >- >-FRAMEWORK_SEARCH_PATHS = $(DEVELOPER_DIR)/Library/PrivateFrameworks; >-LD_RUNPATH_SEARCH_PATHS = $(DEVELOPER_DIR)/Library/PrivateFrameworks; >-OTHER_LDFLAGS = -framework CoreSimulator -framework AppKit; >- >-SDKROOT = $(SDKROOT_macosx_$(USE_INTERNAL_SDK)); >-SDKROOT_macosx_ = macosx; >-SDKROOT_macosx_YES = macosx.internal; >Index: Tools/LayoutTestRelay/LayoutTestRelay.xcodeproj/project.pbxproj >=================================================================== >--- Tools/LayoutTestRelay/LayoutTestRelay.xcodeproj/project.pbxproj (revision 209886) >+++ Tools/LayoutTestRelay/LayoutTestRelay.xcodeproj/project.pbxproj (nonexistent) >@@ -1,202 +0,0 @@ >-// !$*UTF8*$! >-{ >- archiveVersion = 1; >- classes = { >- }; >- objectVersion = 46; >- objects = { >- >-/* Begin PBXBuildFile section */ >- 2E8D3EF819881D43004F6CC2 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 2E8D3EF719881D43004F6CC2 /* main.m */; }; >- 2E8D3F0219881FD0004F6CC2 /* LTPipeRelay.m in Sources */ = {isa = PBXBuildFile; fileRef = 2E8D3F0119881FD0004F6CC2 /* LTPipeRelay.m */; }; >- 2E8D3F0619882406004F6CC2 /* LTRelayController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2E8D3F0519882406004F6CC2 /* LTRelayController.m */; }; >-/* End PBXBuildFile section */ >- >-/* Begin PBXCopyFilesBuildPhase section */ >- 2E8D3EF219881D43004F6CC2 /* CopyFiles */ = { >- isa = PBXCopyFilesBuildPhase; >- buildActionMask = 2147483647; >- dstPath = /usr/share/man/man1/; >- dstSubfolderSpec = 0; >- files = ( >- ); >- runOnlyForDeploymentPostprocessing = 1; >- }; >-/* End PBXCopyFilesBuildPhase section */ >- >-/* Begin PBXFileReference section */ >- 2E8D3EF419881D43004F6CC2 /* LayoutTestRelay */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = LayoutTestRelay; sourceTree = BUILT_PRODUCTS_DIR; }; >- 2E8D3EF719881D43004F6CC2 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; }; >- 2E8D3EFE19881E13004F6CC2 /* DebugRelease.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = DebugRelease.xcconfig; path = Configurations/DebugRelease.xcconfig; sourceTree = "<group>"; }; >- 2E8D3EFF19881E25004F6CC2 /* Base.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Base.xcconfig; path = Configurations/Base.xcconfig; sourceTree = "<group>"; }; >- 2E8D3F0019881F29004F6CC2 /* LTRelay.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LTRelay.h; sourceTree = "<group>"; }; >- 2E8D3F0119881FD0004F6CC2 /* LTPipeRelay.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LTPipeRelay.m; sourceTree = "<group>"; }; >- 2E8D3F0319881FE2004F6CC2 /* LTPipeRelay.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LTPipeRelay.h; sourceTree = "<group>"; }; >- 2E8D3F0419882406004F6CC2 /* LTRelayController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LTRelayController.h; sourceTree = "<group>"; }; >- 2E8D3F0519882406004F6CC2 /* LTRelayController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LTRelayController.m; sourceTree = "<group>"; }; >- CE1FBC151B290E79000136F5 /* CoreSimulatorSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreSimulatorSPI.h; sourceTree = "<group>"; }; >-/* End PBXFileReference section */ >- >-/* Begin PBXFrameworksBuildPhase section */ >- 2E8D3EF119881D43004F6CC2 /* Frameworks */ = { >- isa = PBXFrameworksBuildPhase; >- buildActionMask = 2147483647; >- files = ( >- ); >- runOnlyForDeploymentPostprocessing = 0; >- }; >-/* End PBXFrameworksBuildPhase section */ >- >-/* Begin PBXGroup section */ >- 2E8D3EEB19881D43004F6CC2 = { >- isa = PBXGroup; >- children = ( >- 2E8D3EFF19881E25004F6CC2 /* Base.xcconfig */, >- 2E8D3EFE19881E13004F6CC2 /* DebugRelease.xcconfig */, >- 2E8D3EF619881D43004F6CC2 /* LayoutTestRelay */, >- 2E8D3EF519881D43004F6CC2 /* Products */, >- ); >- sourceTree = "<group>"; >- }; >- 2E8D3EF519881D43004F6CC2 /* Products */ = { >- isa = PBXGroup; >- children = ( >- 2E8D3EF419881D43004F6CC2 /* LayoutTestRelay */, >- ); >- name = Products; >- sourceTree = "<group>"; >- }; >- 2E8D3EF619881D43004F6CC2 /* LayoutTestRelay */ = { >- isa = PBXGroup; >- children = ( >- 2E8D3EF719881D43004F6CC2 /* main.m */, >- CE1FBC151B290E79000136F5 /* CoreSimulatorSPI.h */, >- 2E8D3F0019881F29004F6CC2 /* LTRelay.h */, >- 2E8D3F0119881FD0004F6CC2 /* LTPipeRelay.m */, >- 2E8D3F0319881FE2004F6CC2 /* LTPipeRelay.h */, >- 2E8D3F0419882406004F6CC2 /* LTRelayController.h */, >- 2E8D3F0519882406004F6CC2 /* LTRelayController.m */, >- ); >- path = LayoutTestRelay; >- sourceTree = "<group>"; >- }; >-/* End PBXGroup section */ >- >-/* Begin PBXNativeTarget section */ >- 2E8D3EF319881D43004F6CC2 /* LayoutTestRelay */ = { >- isa = PBXNativeTarget; >- buildConfigurationList = 2E8D3EFB19881D43004F6CC2 /* Build configuration list for PBXNativeTarget "LayoutTestRelay" */; >- buildPhases = ( >- 2E8D3EF019881D43004F6CC2 /* Sources */, >- 2E8D3EF119881D43004F6CC2 /* Frameworks */, >- 2E8D3EF219881D43004F6CC2 /* CopyFiles */, >- ); >- buildRules = ( >- ); >- dependencies = ( >- ); >- name = LayoutTestRelay; >- productName = LayoutTestRelay; >- productReference = 2E8D3EF419881D43004F6CC2 /* LayoutTestRelay */; >- productType = "com.apple.product-type.tool"; >- }; >-/* End PBXNativeTarget section */ >- >-/* Begin PBXProject section */ >- 2E8D3EEC19881D43004F6CC2 /* Project object */ = { >- isa = PBXProject; >- attributes = { >- LastUpgradeCheck = 0600; >- ORGANIZATIONNAME = "Apple, Inc."; >- TargetAttributes = { >- 2E8D3EF319881D43004F6CC2 = { >- CreatedOnToolsVersion = 6.0; >- }; >- }; >- }; >- buildConfigurationList = 2E8D3EEF19881D43004F6CC2 /* Build configuration list for PBXProject "LayoutTestRelay" */; >- compatibilityVersion = "Xcode 3.2"; >- developmentRegion = English; >- hasScannedForEncodings = 0; >- knownRegions = ( >- en, >- ); >- mainGroup = 2E8D3EEB19881D43004F6CC2; >- productRefGroup = 2E8D3EF519881D43004F6CC2 /* Products */; >- projectDirPath = ""; >- projectRoot = ""; >- targets = ( >- 2E8D3EF319881D43004F6CC2 /* LayoutTestRelay */, >- ); >- }; >-/* End PBXProject section */ >- >-/* Begin PBXSourcesBuildPhase section */ >- 2E8D3EF019881D43004F6CC2 /* Sources */ = { >- isa = PBXSourcesBuildPhase; >- buildActionMask = 2147483647; >- files = ( >- 2E8D3F0619882406004F6CC2 /* LTRelayController.m in Sources */, >- 2E8D3EF819881D43004F6CC2 /* main.m in Sources */, >- 2E8D3F0219881FD0004F6CC2 /* LTPipeRelay.m in Sources */, >- ); >- runOnlyForDeploymentPostprocessing = 0; >- }; >-/* End PBXSourcesBuildPhase section */ >- >-/* Begin XCBuildConfiguration section */ >- 2E8D3EF919881D43004F6CC2 /* Debug */ = { >- isa = XCBuildConfiguration; >- baseConfigurationReference = 2E8D3EFE19881E13004F6CC2 /* DebugRelease.xcconfig */; >- buildSettings = { >- }; >- name = Debug; >- }; >- 2E8D3EFA19881D43004F6CC2 /* Release */ = { >- isa = XCBuildConfiguration; >- baseConfigurationReference = 2E8D3EFE19881E13004F6CC2 /* DebugRelease.xcconfig */; >- buildSettings = { >- }; >- name = Release; >- }; >- 2E8D3EFC19881D43004F6CC2 /* Debug */ = { >- isa = XCBuildConfiguration; >- baseConfigurationReference = 2E8D3EFE19881E13004F6CC2 /* DebugRelease.xcconfig */; >- buildSettings = { >- PRODUCT_NAME = "$(TARGET_NAME)"; >- }; >- name = Debug; >- }; >- 2E8D3EFD19881D43004F6CC2 /* Release */ = { >- isa = XCBuildConfiguration; >- baseConfigurationReference = 2E8D3EFE19881E13004F6CC2 /* DebugRelease.xcconfig */; >- buildSettings = { >- PRODUCT_NAME = "$(TARGET_NAME)"; >- }; >- name = Release; >- }; >-/* End XCBuildConfiguration section */ >- >-/* Begin XCConfigurationList section */ >- 2E8D3EEF19881D43004F6CC2 /* Build configuration list for PBXProject "LayoutTestRelay" */ = { >- isa = XCConfigurationList; >- buildConfigurations = ( >- 2E8D3EF919881D43004F6CC2 /* Debug */, >- 2E8D3EFA19881D43004F6CC2 /* Release */, >- ); >- defaultConfigurationIsVisible = 0; >- defaultConfigurationName = Release; >- }; >- 2E8D3EFB19881D43004F6CC2 /* Build configuration list for PBXNativeTarget "LayoutTestRelay" */ = { >- isa = XCConfigurationList; >- buildConfigurations = ( >- 2E8D3EFC19881D43004F6CC2 /* Debug */, >- 2E8D3EFD19881D43004F6CC2 /* Release */, >- ); >- defaultConfigurationIsVisible = 0; >- defaultConfigurationName = Release; >- }; >-/* End XCConfigurationList section */ >- }; >- rootObject = 2E8D3EEC19881D43004F6CC2 /* Project object */; >-} >Index: Tools/LayoutTestRelay/LayoutTestRelay/CoreSimulatorSPI.h >=================================================================== >--- Tools/LayoutTestRelay/LayoutTestRelay/CoreSimulatorSPI.h (revision 209886) >+++ Tools/LayoutTestRelay/LayoutTestRelay/CoreSimulatorSPI.h (nonexistent) >@@ -1,58 +0,0 @@ >-/* >- * Copyright (C) 2015, 2016 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >- * THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#if __has_include(<CoreSimulator/CoreSimulator.h>) >- >-/* FIXME: Remove the below #define once we require Xcode 7.3 with iOS 9.3 SDK or newer. */ >-#define __coresim_unavailable_msg(msg) >-#import <CoreSimulator/CoreSimulator.h> >- >-/* FIXME: Always use SimServiceContext once we require Xcode 7.3 with iOS 9.3 SDK or newer. */ >-#define USE_SIM_SERVICE_CONTEXT defined(CORESIM_API_MAX_ALLOWED) >- >-#else >- >-#import <Foundation/Foundation.h> >- >-#define USE_SIM_SERVICE_CONTEXT 1 >- >-#define kSimDeviceLaunchApplicationArguments @"arguments" >-#define kSimDeviceLaunchApplicationEnvironment @"environment" >- >-@interface SimDevice : NSObject >-- (BOOL)installApplication:(NSURL *)installURL withOptions:(NSDictionary *)options error:(NSError * __autoreleasing *)error; >-- (pid_t)launchApplicationWithID:(NSString *)bundleID options:(NSDictionary *)options error:(NSError * __autoreleasing *)error; >-@end >- >-@interface SimDeviceSet : NSObject >-@property (readonly, copy) NSDictionary *devicesByUDID; >-@end >- >-@interface SimServiceContext : NSObject >-+(SimServiceContext *)sharedServiceContextForDeveloperDir:(NSString *)developerDir error:(NSError * __autoreleasing *)error; >--(SimDeviceSet *)defaultDeviceSetWithError:(NSError * __autoreleasing *)error; >-@end >- >-#endif >Index: Tools/LayoutTestRelay/LayoutTestRelay/LTPipeRelay.h >=================================================================== >--- Tools/LayoutTestRelay/LayoutTestRelay/LTPipeRelay.h (revision 209886) >+++ Tools/LayoutTestRelay/LayoutTestRelay/LTPipeRelay.h (nonexistent) >@@ -1,36 +0,0 @@ >-/* >- * Copyright (C) 2014 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >- * THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#ifndef LTPipeRelay_h >-#define LTPipeRelay_h >- >-#import "LTRelay.h" >- >-@interface LTPipeRelay : NSObject <LTRelay> >-@property (weak) id<LTRelayDelegate> relayDelegate; >-- (id)initWithPrefix:(NSString *)prefix; >-@end >- >-#endif >Index: Tools/LayoutTestRelay/LayoutTestRelay/LTPipeRelay.m >=================================================================== >--- Tools/LayoutTestRelay/LayoutTestRelay/LTPipeRelay.m (revision 209886) >+++ Tools/LayoutTestRelay/LayoutTestRelay/LTPipeRelay.m (nonexistent) >@@ -1,158 +0,0 @@ >-/* >- * Copyright (C) 2014 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >- * THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#import "LTPipeRelay.h" >- >-#import <Foundation/Foundation.h> >-#include <sys/stat.h> >-#include <sys/types.h> >- >-@interface LTPipeRelay () >-@property (readonly, strong) NSString *fifoPrefix; >-@property (strong) NSOutputStream *standardInputPipe; >-@property (strong) NSInputStream *standardOutputPipe; >-@property (strong) NSInputStream *standardErrorPipe; >- >-- (void)createFIFOs; >-- (void)destroyFIFOs; >-@end >- >-@implementation LTPipeRelay >- >-- (NSString *)inPipePath >-{ >- return [_fifoPrefix stringByAppendingString:@"_IN"]; >-} >- >-- (NSString *)outPipePath >-{ >- return [_fifoPrefix stringByAppendingString:@"_OUT"]; >-} >- >-- (NSString *)errorPipePath >-{ >- return [_fifoPrefix stringByAppendingString:@"_ERROR"]; >-} >- >-- (NSOutputStream *) outputStream >-{ >- return _standardInputPipe; >-} >- >-- (id)initWithPrefix:(NSString *)prefix >-{ >- if ((self = [super init])) { >- _fifoPrefix = prefix; >- [self destroyFIFOs]; >- } >- return self; >-} >- >-- (void)setup >-{ >- [self destroyFIFOs]; >- [self createFIFOs]; >-} >- >-- (void)tearDown >-{ >- [self destroyFIFOs]; >-} >- >--(void) connect >-{ >- _standardInputPipe = [NSOutputStream outputStreamToFileAtPath:[self inPipePath] append:YES]; >- _standardOutputPipe = [NSInputStream inputStreamWithFileAtPath:[self outPipePath]]; >- _standardErrorPipe = [NSInputStream inputStreamWithFileAtPath:[self errorPipePath]]; >- >- [[self standardInputPipe] setDelegate:self]; >- [[self standardOutputPipe] setDelegate:self]; >- [[self standardErrorPipe] setDelegate:self]; >- >- [[self standardOutputPipe] scheduleInRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode]; >- [[self standardErrorPipe] scheduleInRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode]; >- >- [[self standardInputPipe] open]; >- [[self standardOutputPipe] open]; >- [[self standardErrorPipe] open]; >- >- [[self relayDelegate] didConnect]; >-} >- >-- (void)disconnect >-{ >- [[self standardOutputPipe] close]; >- [[self standardErrorPipe] close]; >- [[self standardInputPipe] close]; >- [[self relayDelegate] didDisconnect]; >-} >- >-- (void)createFIFOs >-{ >- mkfifo([[self inPipePath] UTF8String], 0666); >- mkfifo([[self outPipePath] UTF8String], 0666); >- mkfifo([[self errorPipePath] UTF8String], 0666); >-} >- >-- (void)destroyFIFOs >-{ >- unlink([[self inPipePath] UTF8String]); >- unlink([[self outPipePath] UTF8String]); >- unlink([[self errorPipePath] UTF8String]); >-} >- >-- (void) relayStream:(NSInputStream *)stream >-{ >- uint8_t bytes[1024]; >- NSInteger bytesRead = [stream read:bytes maxLength:1024]; >- NSData *data = [NSData dataWithBytes:bytes length:bytesRead]; >- >- if (stream == [self standardOutputPipe]) >- [[self relayDelegate] didReceiveStdoutData:data]; >- else >- [[self relayDelegate] didReceiveStderrData:data]; >-} >- >-- (void)stream:(NSStream *)aStream handleEvent:(NSStreamEvent)eventCode >-{ >- switch (eventCode) { >- case NSStreamEventNone: >- break; >- case NSStreamEventHasBytesAvailable: >- [self relayStream:(NSInputStream *)aStream]; >- case NSStreamEventHasSpaceAvailable: >- break; >- case NSStreamEventOpenCompleted: >- break; >- case NSStreamEventEndEncountered: >- [[self relayDelegate] didCrashWithMessage:nil]; >- break; >- case NSStreamEventErrorOccurred: >- [[self relayDelegate] didCrashWithMessage:[[aStream streamError] description]]; >- break; >- } >-} >- >-@end >Index: Tools/LayoutTestRelay/LayoutTestRelay/LTRelay.h >=================================================================== >--- Tools/LayoutTestRelay/LayoutTestRelay/LTRelay.h (revision 209886) >+++ Tools/LayoutTestRelay/LayoutTestRelay/LTRelay.h (nonexistent) >@@ -1,48 +0,0 @@ >-/* >- * Copyright (C) 2014 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >- * THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#ifndef LTRelay_h >-#define LTRelay_h >- >-#import <Foundation/Foundation.h> >- >-@protocol LTRelayDelegate <NSObject> >-- (void)didConnect; >-- (void)didDisconnect; >-- (void)didCrashWithMessage:(NSString *)message; >-- (void)didReceiveStdoutData:(NSData *)data; >-- (void)didReceiveStderrData:(NSData *)data; >-@end >- >-@protocol LTRelay <NSObject, NSStreamDelegate> >-- (void)setup; >-- (void)tearDown; >-- (void)connect; >-- (void)disconnect; >-@property (weak) id<LTRelayDelegate> relayDelegate; >-@property (readonly, strong) NSOutputStream *outputStream; >-@end >- >-#endif >Index: Tools/LayoutTestRelay/LayoutTestRelay/LTRelayController.h >=================================================================== >--- Tools/LayoutTestRelay/LayoutTestRelay/LTRelayController.h (revision 209886) >+++ Tools/LayoutTestRelay/LayoutTestRelay/LTRelayController.h (nonexistent) >@@ -1,40 +0,0 @@ >-/* >- * Copyright (C) 2014 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >- * THE POSSIBILITY OF SUCH DAMAGE. >- */ >-#ifndef LTRelayController_h >-#define LTRelayController_h >- >-#import "LTRelay.h" >- >-#import <Foundation/Foundation.h> >- >-@class SimDevice; >- >-@interface LTRelayController : NSObject <LTRelayDelegate> >-- (id)initWithDevice:(SimDevice *)device productDir:(NSString *)productDir appPath:(NSString *)appPath deviceUDID:(NSUUID *)udid dumpToolArguments:(NSArray *)arguments; >-- (void)start; >-- (void)finish; >-@end >- >-#endif >Index: Tools/LayoutTestRelay/LayoutTestRelay/LTRelayController.m >=================================================================== >--- Tools/LayoutTestRelay/LayoutTestRelay/LTRelayController.m (revision 209886) >+++ Tools/LayoutTestRelay/LayoutTestRelay/LTRelayController.m (nonexistent) >@@ -1,272 +0,0 @@ >-/* >- * Copyright (C) 2014 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >- * THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#import "LTRelayController.h" >- >-#import "CoreSimulatorSPI.h" >-#import "LTPipeRelay.h" >-#import <AppKit/AppKit.h> >-#import <crt_externs.h> >- >-@interface LTRelayController () >-@property (readonly, strong) dispatch_source_t standardInputDispatchSource; >-@property (readonly, strong) NSFileHandle *standardOutput; >-@property (readonly, strong) NSFileHandle *standardError; >-@property (readonly, strong) NSString *ipcIdentifier; >-@property (readonly, strong) NSString *appBundleIdentifier; >-@property (readonly, strong) NSString *appPath; >-@property (readonly, strong) NSUUID *deviceUDID; >-@property (readonly, strong) NSArray *dumpToolArguments; >-@property (readonly, strong) NSString *productDir; >-@property (strong) SimDevice *device; >-@property (strong) id<LTRelay> relay; >-@property pid_t pid; >-@property (strong) dispatch_source_t appDispatchSource; >-@end >- >-@implementation LTRelayController >- >-- (id)initWithDevice:(SimDevice *)device productDir:(NSString *)productDir appPath:(NSString *)appPath deviceUDID:(NSUUID *)udid dumpToolArguments:(NSArray *)arguments >-{ >- if ((self = [super init])) { >- _device = device; >- _productDir = productDir; >- _appPath = appPath; >- _appBundleIdentifier = [[NSBundle bundleWithPath:appPath] bundleIdentifier]; >- _deviceUDID = udid; >- _dumpToolArguments = arguments; >- _standardInputDispatchSource = dispatch_source_create(DISPATCH_SOURCE_TYPE_READ, STDIN_FILENO, 0, dispatch_get_main_queue()); >- _standardOutput = [NSFileHandle fileHandleWithStandardOutput]; >- _standardError = [NSFileHandle fileHandleWithStandardError]; >- >- dispatch_source_set_event_handler(_standardInputDispatchSource, ^{ >- uint8_t buffer[1024]; >- ssize_t len = read(STDIN_FILENO, buffer, sizeof(buffer)); >- if (len > 0) { >- @try { >- [[[self relay] outputStream] write:buffer maxLength:len]; >- } @catch (NSException *e) { >- // Broken pipe - the dump tool crashed. Time to die. >- [self didCrashWithMessage:nil]; >- } >- } else { >- // EOF Received on the relay's standard input. >- [self finish]; >- } >- }); >- >- _relay = [[LTPipeRelay alloc] initWithPrefix:[@"/tmp" stringByAppendingPathComponent:self.ipcIdentifier]]; >- [_relay setRelayDelegate:self]; >- } >- return self; >-} >- >-- (NSString *)ipcIdentifier >-{ >- return [NSString stringWithFormat:@"%@-%@", self.appBundleIdentifier, self.deviceUDID.UUIDString]; >-} >- >-- (NSString *)processName >-{ >- return [self.appBundleIdentifier componentsSeparatedByString:@"."].lastObject; >-} >- >-- (void)didReceiveStdoutData:(NSData *)data >-{ >- @try { >- [[self standardOutput] writeData:data]; >- } @catch (NSException *exception) { >- // NSFileHandleOperationException >- // Broken pipe - the test harness stopped listening to us, >- // probably because we timed out or a run was canceled. >- exit(EXIT_FAILURE); >- } >-} >- >-- (void)didReceiveStderrData:(NSData *)data >-{ >- @try { >- [[self standardError] writeData:data]; >- } @catch (NSException *exception) { >- // NSFileHandleOperationException >- // Broken pipe - the test harness stopped listening to us, >- // probably because we timed out or a run was canceled. >- exit(EXIT_FAILURE); >- } >-} >- >-- (void)didDisconnect >-{ >- dispatch_suspend([self standardInputDispatchSource]); >-} >- >-- (void)didConnect >-{ >- dispatch_resume([self standardInputDispatchSource]); >-} >- >-- (void)didCrashWithMessage:(NSString *)message >-{ >- [[self relay] disconnect]; >- NSString *crashMessage = [NSString stringWithFormat:@"\n#CRASHED - %@ (pid %d)\n", [self processName], [self pid]]; >- >- if (message) >- crashMessage = [crashMessage stringByAppendingFormat:@"%@\n", message]; >- >- [[self standardError] writeData:[crashMessage dataUsingEncoding:NSUTF8StringEncoding]]; >- [[self standardError] closeFile]; >- [[self standardOutput] closeFile]; >- exit(EXIT_FAILURE); >-} >- >-- (void)installApp >-{ >- NSDictionary *installOptions = @{ >- (NSString *)kCFBundleIdentifierKey: self.appBundleIdentifier, >- }; >- >- NSError *error = nil; >- BOOL installed = [self.device installApplication:[NSURL fileURLWithPath:self.appPath] withOptions:installOptions error:&error]; >- if (!installed) { >- NSLog(@"Couldn't install %@: %@", self.appPath, error.description); >- exit(EXIT_FAILURE); >- } >-} >- >-- (void)killApp >-{ >- dispatch_source_t dispatch = [self appDispatchSource]; >- >- if (dispatch) >- dispatch_source_cancel(dispatch); >- >- if ([self pid] > 1) { >- kill(self.pid, SIGKILL); >- [self setPid:-1]; >- } >- [self setAppDispatchSource:nil]; >-} >- >-- (NSDictionary *)_environmentVariables >-{ >- static NSDictionary *environmentVariables; >- static dispatch_once_t once; >- >- dispatch_once(&once, ^{ >- NSString *productDirectory = [self productDir]; >- >- NSMutableDictionary *dictionary = [@{ >- @"IPC_IDENTIFIER": self.ipcIdentifier, >- @"DYLD_FRAMEWORK_PATH": productDirectory, >- @"__XPC_DYLD_FRAMEWORK_PATH": productDirectory, >- @"DYLD_LIBRARY_PATH": productDirectory, >- @"__XPC_DYLD_LIBRARY_PATH": productDirectory, >- } mutableCopy]; >- >- for (NSString *keyName in @[@"DYLD_INSERT_LIBRARIES", @"MallocStackLogging", @"LOCAL_RESOURCE_ROOT", @"DUMPRENDERTREE_TEMP"]) { >- const char* value = getenv([keyName UTF8String]); >- if (value && strlen(value)) { >- NSString *nsValue = [NSString stringWithUTF8String:value]; >- [dictionary setObject:nsValue forKey:keyName]; >- [dictionary setObject:nsValue forKey:[@"__XPC_" stringByAppendingString:keyName]]; >- } >- } >- >- for (char** envp = *_NSGetEnviron(); *envp; envp++) { >- const char* env = *envp; >- if (!strncmp("JSC_", env, 4) || !strncmp("__XPC_JSC_", env, 10)) { >- const char* equal = strchr(env, '='); >- if (!equal) { >- NSLog(@"Missing '=' in env var '%s'", env); >- continue; >- } >- >- static const size_t maxKeyLength = 256; >- size_t keyLength = equal - env; >- if (keyLength >= maxKeyLength) { >- NSLog(@"Env var '%s' is too long", env); >- continue; >- } >- >- char key[maxKeyLength]; >- strncpy(key, env, keyLength); >- key[keyLength] = '\0'; >- const char* value = equal + 1; >- >- NSString *nsKey = [NSString stringWithUTF8String:key]; >- NSString *nsValue = [NSString stringWithUTF8String:value]; >- [dictionary setObject:nsValue forKey:nsKey]; >- } >- } >- >- environmentVariables = [dictionary copy]; >- }); >- >- return environmentVariables; >-} >- >-- (void)launchApp >-{ >- NSDictionary *launchOptions = @{ >- kSimDeviceLaunchApplicationEnvironment: [self _environmentVariables], >- kSimDeviceLaunchApplicationArguments: [self dumpToolArguments], >- }; >- >- NSError *error; >- pid_t pid = [self.device launchApplicationWithID:self.appBundleIdentifier options:launchOptions error:&error]; >- >- if (pid < 0) { >- NSLog(@"Couldn't launch %@: %@", self.appBundleIdentifier, error.description); >- exit(EXIT_FAILURE); >- } >- >- [self setPid:pid]; >- >- dispatch_queue_t queue = dispatch_get_main_queue(); >- dispatch_source_t simulatorAppExitDispatchSource = dispatch_source_create(DISPATCH_SOURCE_TYPE_PROC, [self pid], DISPATCH_PROC_EXIT, queue); >- [self setAppDispatchSource:simulatorAppExitDispatchSource]; >- dispatch_source_set_event_handler(simulatorAppExitDispatchSource, ^{ >- dispatch_source_cancel(simulatorAppExitDispatchSource); >- [self didCrashWithMessage:nil]; >- }); >- dispatch_resume(simulatorAppExitDispatchSource); >-} >- >-- (void)start >-{ >- [self installApp]; >- [[self relay] setup]; >- [self launchApp]; >- [[self relay] connect]; >-} >- >-- (void)finish >-{ >- [[self relay] disconnect]; >- [self killApp]; >- exit(EXIT_SUCCESS); >-} >- >-@end >Index: Tools/LayoutTestRelay/LayoutTestRelay/main.m >=================================================================== >--- Tools/LayoutTestRelay/LayoutTestRelay/main.m (revision 209886) >+++ Tools/LayoutTestRelay/LayoutTestRelay/main.m (nonexistent) >@@ -1,133 +0,0 @@ >-/* >- * Copyright (C) 2014, 2016 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >- * THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#import "CoreSimulatorSPI.h" >-#import "LTRelayController.h" >-#import <Foundation/Foundation.h> >- >-static LTRelayController *relayController; >- >-void usage() >-{ >- NSString *helpText = @"LayoutTestRelay: run a dump tool in the simulator. Not for direct consumption.\n" >- "Usage: LayoutTestRelay [-h] [options] -- [dump tool arguments]\n" >- "Required options:\n" >- " -udid <identifier> Simulator device identifier\n" >- " -app <app_path> Path to the built iOS .app bundle directory.\n" >- " -productDir <dir> /path/to/WebKitBuild/{configuration}-{short platform}.\n"; >- >- fprintf(stderr, "%s\n", [helpText UTF8String]); >-} >- >-NSString *getRequiredStringArgument(NSString *parameter) >-{ >- NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; >- NSString *argument = [defaults stringForKey:parameter]; >- >- if (!argument) { >- NSLog(@"-%@ is required.", parameter); >- usage(); >- exit(EXIT_FAILURE); >- } >- return argument; >-} >- >-NSArray *getDumpToolArguments() >-{ >- NSMutableArray *dumpToolArguments = [[NSMutableArray alloc] init]; >- NSArray *processArgs = [[NSProcessInfo processInfo] arguments]; >- BOOL appending = NO; >- for (NSString *arg in processArgs) { >- if ([arg isEqualToString:@"--"]) { >- appending = YES; >- continue; >- } >- if (appending) >- [dumpToolArguments addObject:arg]; >- } >- return dumpToolArguments; >-} >- >-void finish() >-{ >- [relayController finish]; >-} >- >-void receivedSignal(int signal) >-{ >- exit(EXIT_SUCCESS); >-} >- >-int main(int argc, const char * argv[]) >-{ >- @autoreleasepool { >- NSArray *helpArguments = @[@"-h", @"--help"]; >- for (NSString *helpArgument in helpArguments) { >- if ([[[NSProcessInfo processInfo] arguments] indexOfObject:helpArgument] != NSNotFound) { >- usage(); >- exit(EXIT_FAILURE); >- } >- } >- >-#if USE_SIM_SERVICE_CONTEXT >- NSString *developerDirectory = getRequiredStringArgument(@"developerDir"); >-#endif >- NSUUID *udid = [[NSUUID alloc] initWithUUIDString:getRequiredStringArgument(@"udid")]; >- NSString *appPath = getRequiredStringArgument(@"app"); >- NSString *productDirectory = getRequiredStringArgument(@"productDir"); >- NSArray *dumpToolArguments = getDumpToolArguments(); >- >-#if USE_SIM_SERVICE_CONTEXT >- NSError *error; >- SimServiceContext *serviceContext = [SimServiceContext sharedServiceContextForDeveloperDir:developerDirectory error:&error]; >- if (!serviceContext) { >- NSLog(@"Device context couldn't be found: %@", error); >- exit(EXIT_FAILURE); >- } >- SimDeviceSet *deviceSet = [serviceContext defaultDeviceSetWithError:nil]; >- if (!deviceSet) { >- NSLog(@"Default device set couldn't be found: %@", error); >- exit(EXIT_FAILURE); >- } >- SimDevice *device = [deviceSet.devicesByUDID objectForKey:udid]; >-#else >- SimDevice *device = [SimDeviceSet.defaultSet.devicesByUDID objectForKey:udid]; >-#endif >- if (!device) { >- NSLog(@"Device %@ couldn't be found", udid); >- exit(EXIT_FAILURE); >- } >- >- relayController = [[LTRelayController alloc] initWithDevice:device productDir:productDirectory appPath:appPath deviceUDID:udid dumpToolArguments:dumpToolArguments]; >- [relayController start]; >- >- atexit(finish); >- signal(SIGINT, receivedSignal); >- signal(SIGTERM, receivedSignal); >- >- [[NSRunLoop mainRunLoop] run]; >- } >- return 0; >-} >Index: Tools/Scripts/build-layouttestrelay >=================================================================== >--- Tools/Scripts/build-layouttestrelay (revision 209886) >+++ Tools/Scripts/build-layouttestrelay (working copy) >@@ -23,48 +23,6 @@ > # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF > # THE POSSIBILITY OF SUCH DAMAGE. > >-use strict; >-use File::Basename; >-use FindBin; >-use Getopt::Long qw(:config pass_through); >-use lib $FindBin::Bin; >-use webkitdirs; > >-my $showHelp = 0; >-my $clean = 0; >- >-my $programName = basename($0); >-my $usage = <<EOF; >-Usage: $programName [options] [options to pass to build system] >- --help Show this help message >- --clean Clean up the build directory >-EOF >- >-my $result = GetOptions( >- 'help' => \$showHelp, >- 'clean' => \$clean, >-); >- >-if ($showHelp or not $result) { >- print STDERR $usage; >- exit 1; >-} >- >-checkRequiredSystemConfig(); >-setConfiguration(); >-chdirWebKit(); >- >-chdir "Tools/LayoutTestRelay" or die; >- >-# FIXME: This tool is only useful when building WebKit for iOS Simulator. For now, >-# to avoid breaking some Apple Internal tools we support calling this script >-# without --ios-simulator so long as we are building on a Mac. >-if (isAppleMacWebKit() && !willUseIOSDeviceSDK()) { >- # FIXME: Changing SDK at this point results in an inconsistent webkitdirs state. >- # We should make it so that webkitdirs functions never see the wrong SDK. >- setXcodeSDK(undef); # Force use of Mac SDK if --ios-simulator was passed >- exit exitStatus(buildXCodeProject("LayoutTestRelay", $clean, XcodeOptions(), @ARGV)); >-} >- >-print STDERR "LayoutTestRelay is only supported for iOS Simulator.\n"; >+print STDERR "LayoutTestRelay is unsupported!\n"; > exit 1; >Index: Tools/Scripts/build-webkit >=================================================================== >--- Tools/Scripts/build-webkit (revision 209886) >+++ Tools/Scripts/build-webkit (working copy) >@@ -200,10 +200,6 @@ if (isAppleMacWebKit()) { > push @copyLibrariesArgs, productDir(); > print(join(" ", @copyLibrariesArgs) . "\n"); > (system(@copyLibrariesArgs) == 0) or die; >- >- if (willUseIOSSimulatorSDK()) { >- (system("perl", "Tools/Scripts/build-layouttestrelay", argumentsForConfiguration()) == 0) or die; >- } > } > > # Build Tools needed for Apple ports >Index: Tools/Scripts/webkitpy/common/ipc_pipe.py >=================================================================== >--- Tools/Scripts/webkitpy/common/ipc_pipe.py (nonexistent) >+++ Tools/Scripts/webkitpy/common/ipc_pipe.py (working copy) >@@ -0,0 +1,421 @@ >+# Copyright (C) 2016 Apple Inc. All rights reserved. >+# >+# Redistribution and use in source and binary forms, with or without >+# modification, are permitted provided that the following conditions >+# are met: >+# 1. Redistributions of source code must retain the above copyright >+# notice, this list of conditions and the following disclaimer. >+# 2. Redistributions in binary form must reproduce the above copyright >+# notice, this list of conditions and the following disclaimer in the >+# documentation and/or other materials provided with the distribution. >+# >+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+# THE POSSIBILITY OF SUCH DAMAGE. >+ >+import errno >+import io >+import os >+import Queue >+import select >+import signal >+import sys >+import time >+ >+if sys.platform.startswith('win'): >+ import msvcrt >+ import win32pipe >+ import win32file >+else: >+ import fcntl >+ import socket >+ >+ >+class UnixPipeServer(object): >+ >+ BUFFER = 4096 >+ >+ def __init__(self, path): >+ if sys.platform.startswith('win'): >+ raise OSError('UnixPipeServer not implemented on this platform') >+ self._path = path >+ self._connected = False >+ >+ try: >+ os.unlink(self._path) >+ except OSError: >+ if os.path.exists(self._path): >+ raise OSError("Could not unlink '" + self._path + "', the target path is a file not a pipe.") >+ >+ self._socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) >+ self._socket.settimeout(15) >+ self._socket.bind(self._path) >+ self._socket.listen(0) >+ >+ def connect(self): >+ if self._connected: >+ return True >+ try: >+ self._connection, self._address = self._socket.accept() >+ self._connection.setblocking(0) >+ self._connected = True >+ except socket.timeout: >+ return False >+ return True >+ >+ def disconnect(self): >+ if not self._connected: >+ return >+ self._socket.close() >+ self._connected = False >+ >+ def read(self): >+ try: >+ data = self._connection.recv(self.BUFFER) >+ if data: >+ return data >+ except socket.error, e: >+ err = e.args[0] >+ if err == errno.EAGAIN or err == errno.EWOULDBLOCK: >+ return [] >+ self.disconnect() >+ return [] >+ >+ def send(self, data): >+ if not self._connected: >+ return False >+ self._connection.send(data) >+ return True >+ >+ def path(self): >+ return self._path >+ >+ def isConnected(self): >+ return self._connected >+ >+ >+class AbstractPipe(object): >+ >+ def __init__(self): >+ self.clean() >+ >+ def connect(self): >+ return self.isConnected() >+ >+ def clean(self): >+ self._stdoutStream = io.BytesIO() >+ self._stderrStream = io.BytesIO() >+ self._stdoutTrc = 0 >+ self._stderrTrc = 0 >+ >+ def close(self): >+ return not self.isConnected() >+ >+ def send(self, data): >+ return False >+ >+ def isConnected(self): >+ return False >+ >+ def _parseMessage(self, isBlocking=False): >+ return False >+ >+ def readLine(self, isBlocking=False): >+ while True: >+ err = self.stderrRead() >+ if err: >+ return err >+ out = self.stdoutRead() >+ if out: >+ return out >+ self._parseMessage(isBlocking) >+ if not isBlocking: >+ break >+ return None >+ >+ def stdoutRead(self, isBlocking=False): >+ triedOnce = False >+ while True: >+ self._stdoutStream.seek(self._stdoutTrc, io.SEEK_SET) >+ data = self._stdoutStream.readline() >+ if data and data[-1] == '\n': >+ self._stdoutTrc = self._stdoutTrc + len(data) >+ return data >+ self._parseMessage(isBlocking) >+ if not isBlocking and triedOnce: >+ break >+ triedOnce = True >+ return None >+ >+ def stderrRead(self, isBlocking=False): >+ triedOnce = False >+ while True: >+ self._stderrStream.seek(self._stderrTrc, io.SEEK_SET) >+ data = self._stderrStream.readline() >+ if data and data[-1] == '\n': >+ self._stderrTrc = self._stderrTrc + len(data) >+ return data >+ self._parseMessage(isBlocking) >+ if not isBlocking and triedOnce: >+ break >+ triedOnce = True >+ return None >+ >+ def readBufferStdout(self): >+ self._stdoutStream.seek(0, io.SEEK_END) >+ endVal = self._stdoutStream.tell() >+ if endVal <= self._stdoutTrc: >+ return '' >+ self._stdoutStream.seek(self._stdoutTrc, io.SEEK_SET) >+ size = endVal - self._stdoutTrc >+ self._stdoutTrc = endVal >+ return self._stdoutStream.read(size) >+ >+ def readBufferStderr(self): >+ self._stderrStream.seek(0, io.SEEK_END) >+ endVal = self._stderrStream.tell() >+ if endVal <= self._stderrTrc: >+ return '' >+ self._stderrStream.seek(self._stderrTrc, io.SEEK_SET) >+ size = endVal - self._stderrTrc >+ self._stderrTrc = endVal >+ return self._stderrStream.read(size) >+ >+ def readBlockStdout(self, size, isBlocking=False): >+ triedOnce = False >+ while True: >+ self._stdoutStream.seek(0, io.SEEK_END) >+ if self._stdoutStream.tell() - self._stdoutTrc >= size: >+ self._stdoutStream.seek(self._stdoutTrc, io.SEEK_SET) >+ data = self._stdoutStream.read(size) >+ self._stdoutTrc = self._stdoutTrc + size >+ return data >+ self._parseMessage(isBlocking) >+ if not isBlocking and triedOnce: >+ break >+ triedOnce = True >+ return None >+ >+ def readBlockStderr(self, size, isBlocking=False): >+ triedOnce = False >+ while True: >+ self._stderrStream.seek(0, io.SEEK_END) >+ if self._stderrStream.tell() - self._stderrTrc >= size: >+ self._stderrStream.seek(self._stderrTrc, io.SEEK_SET) >+ data = self._stderrStream.read(size) >+ self._stderrTrc = self._stderrTrc + size >+ return data >+ self._parseMessage(isBlocking) >+ if not isBlocking and triedOnce: >+ break >+ triedOnce = True >+ return None >+ >+ >+class UnixPipe(AbstractPipe): >+ >+ STDIN_INDEX = 0 >+ STDOUT_INDEX = 1 >+ STDERR_INDEX = 2 >+ >+ def __init__(self, stdin, stdout, stderr): >+ AbstractPipe.__init__(self) >+ self.stdoutFile = stdout >+ self.stderrFile = stderr >+ >+ paths = [stdin, stdout, stderr] >+ self._sockets = [] >+ for i in range(0, 3): >+ self._sockets.append(UnixPipeServer(paths[i])) >+ >+ self.clean() >+ >+ def connect(self): >+ for sock in self._sockets: >+ sock.connect() >+ return self.isConnected() >+ >+ def close(self): >+ for sock in self._sockets: >+ sock.disconnect() >+ >+ def send(self, data): >+ return self._sockets[UnixPipe.STDIN_INDEX].send(data) >+ >+ def isConnected(self): >+ for sock in self._sockets: >+ if not sock.isConnected(): >+ return False >+ return True >+ >+ def _parseMessage(self, isBlocking=False): >+ while True: >+ stdErrData = [] >+ stdErrData = self._sockets[UnixPipe.STDERR_INDEX].read() >+ if stdErrData: >+ self._stderrStream.seek(0, io.SEEK_END) >+ self._stderrStream.write(stdErrData) >+ stdOutData = [] >+ stdOutData = self._sockets[UnixPipe.STDOUT_INDEX].read() >+ if stdOutData: >+ self._stdoutStream.seek(0, io.SEEK_END) >+ self._stdoutStream.write(stdOutData) >+ if stdErrData or stdOutData: >+ return True >+ if not isBlocking: >+ break >+ return False >+ >+ def handle_interrupt(self): >+ if not self.isConnected(): >+ raise KeyboardInterrupt >+ >+ >+class ProcessPipe(AbstractPipe): >+ >+ def __init__(self, port, cmd, enviro=None, uni_newlines=False): >+ >+ AbstractPipe.__init__(self) >+ >+ self._port = port >+ self._host = self._port.host >+ >+ self._proc = self._host.executive.popen(cmd, stdin=self._host.executive.PIPE, >+ stdout=self._host.executive.PIPE, >+ stderr=self._host.executive.PIPE, >+ close_fds=not self._host.platform.is_win(), >+ env=enviro, >+ universal_newlines=uni_newlines) >+ >+ self._use_win32_apis = sys.platform.startswith('win') >+ if not self._use_win32_apis: >+ fd = self._proc.stdout.fileno() >+ fl = fcntl.fcntl(fd, fcntl.F_GETFL) >+ fcntl.fcntl(fd, fcntl.F_SETFL, fl | os.O_NONBLOCK) >+ fd = self._proc.stderr.fileno() >+ fl = fcntl.fcntl(fd, fcntl.F_GETFL) >+ fcntl.fcntl(fd, fcntl.F_SETFL, fl | os.O_NONBLOCK) >+ >+ def pid(self): >+ return self._proc.pid >+ >+ def isConnected(self): >+ return not self._proc.poll() >+ >+ def handle_interrupt(self): >+ if self._proc.returncode in (-1073741510, -signal.SIGINT): >+ raise KeyboardInterrupt >+ >+ def close(self): >+ if self._proc.poll(): >+ self._host.executive.kill_process(self._proc.pid) >+ if self._proc.poll() is not None: >+ self._proc.wait() >+ >+ if self._proc.stdin: >+ self._proc.stdin.close() >+ if self._proc.stdout: >+ self._proc.stdout.close() >+ if self._proc.stderr: >+ self._proc.stderr.close() >+ return not self.isConnected() >+ >+ def send(self, bytes): >+ try: >+ self._proc.stdin.write(bytes) >+ except IOError, e: >+ return False >+ return True >+ >+ def _unixstdBlock(self): >+ if self._proc.stdout.closed: >+ return None >+ select_fds = [] >+ select_fds.append(self._proc.stdout.fileno()) >+ try: >+ read_fds, _, _ = select.select(select_fds, [], select_fds, 0) >+ except select.error, e: >+ if e.args[0] == errno.EINVAL: >+ return None >+ raise >+ >+ try: >+ if self._proc.stdout.fileno() in read_fds: >+ data = self._proc.stdout.read() >+ return data >+ except IOError, e: >+ pass >+ >+ return None >+ >+ def _unixerrBlock(self): >+ if self._proc.stderr.closed: >+ return None >+ select_fds = [] >+ select_fds.append(self._proc.stderr.fileno()) >+ try: >+ read_fds, _, _ = select.select(select_fds, [], select_fds, 0) >+ except select.error, e: >+ if e.args[0] == errno.EINVAL: >+ return None >+ raise >+ >+ try: >+ if self._proc.stderr.fileno() in read_fds: >+ data = self._proc.stderr.read() >+ return data >+ except IOError, e: >+ pass >+ >+ return None >+ >+ def _win32NonBlockingRead(self, handle): >+ try: >+ _, avail, _ = win32pipe.PeekNamedPipe(handle, 0) >+ if avail > 0: >+ _, buf = win32file.ReadFile(handle, avail, None) >+ return buf >+ except Exception, e: >+ if e[0] not in (109, errno.ESHUTDOWN): # 109 == win32 ERROR_BROKEN_PIPE >+ raise >+ return None >+ >+ def _win32stdBlock(self): >+ out_fh = msvcrt.get_osfhandle(self._proc.stdout.fileno()) >+ return self._win32NonBlockingRead(out_fh) >+ >+ def _win32errBlock(self): >+ err_fh = msvcrt.get_osfhandle(self._proc.stderr.fileno()) >+ return self._win32NonBlockingRead(err_fh) >+ >+ def _parseMessage(self, isBlocking=False): >+ while True: >+ stdErrData = [] >+ if self._use_win32_apis: >+ stdErrData = self._win32errBlock() >+ else: >+ stdErrData = self._unixerrBlock() >+ if stdErrData: >+ self._stderrStream.seek(0, io.SEEK_END) >+ self._stderrStream.write(stdErrData) >+ stdOutData = [] >+ if self._use_win32_apis: >+ stdOutData = self._win32stdBlock() >+ else: >+ stdOutData = self._unixstdBlock() >+ if stdOutData: >+ self._stdoutStream.seek(0, io.SEEK_END) >+ self._stdoutStream.write(stdOutData) >+ if stdErrData or stdOutData: >+ return True >+ if not isBlocking: >+ break >+ return False >Index: Tools/Scripts/webkitpy/common/ipc_pipe_testcase.py >=================================================================== >--- Tools/Scripts/webkitpy/common/ipc_pipe_testcase.py (nonexistent) >+++ Tools/Scripts/webkitpy/common/ipc_pipe_testcase.py (working copy) >@@ -0,0 +1,131 @@ >+# Copyright (C) 2016 Apple Inc. All rights reserved. >+# >+# Redistribution and use in source and binary forms, with or without >+# modification, are permitted provided that the following conditions >+# are met: >+# 1. Redistributions of source code must retain the above copyright >+# notice, this list of conditions and the following disclaimer. >+# 2. Redistributions in binary form must reproduce the above copyright >+# notice, this list of conditions and the following disclaimer in the >+# documentation and/or other materials provided with the distribution. >+# >+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+# THE POSSIBILITY OF SUCH DAMAGE. >+ >+import errno >+import io >+import socket >+import time >+ >+from webkitpy.common.ipc_pipe import AbstractPipe >+ >+ >+class DummyProcessPipe(AbstractPipe): >+ >+ def __init__(self, port=None, cmd=None, enviro=None, uni_newlines=False): >+ AbstractPipe.__init__(self) >+ self._port = port >+ if self._port: >+ self._host = self._port.host >+ else: >+ self._host = None >+ self.connectedForTesting = True >+ >+ def pid(self): >+ return 1 >+ >+ def isConnected(self): >+ return self.connectedForTesting >+ >+ def send(self, bytes): >+ return self.connectedForTesting >+ >+ def _parseMessage(self, isBlocking=False): >+ return False >+ >+ def pushDataForTesting(self, data, stderr=False, stdout=True): >+ if stderr: >+ self._stderrStream.seek(0, io.SEEK_END) >+ self._stderrStream.write(data) >+ elif stdout: >+ self._stdoutStream.seek(0, io.SEEK_END) >+ self._stdoutStream.write(data) >+ >+ >+class UnixPipeClient(object): >+ >+ BUFFER = 4096 >+ >+ def __init__(self, path): >+ self._path = path >+ self._connected = False >+ self._connection = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) >+ self._stream = io.BytesIO() >+ self._streamTrc = 0 >+ >+ def __del__(self): >+ self.disconnect() >+ >+ def connect(self): >+ if self._connected: >+ return True >+ try: >+ self._connection.connect(self._path) >+ self._connected = True >+ except: >+ return False >+ return True >+ >+ def disconnect(self): >+ if not self._connected: >+ return >+ self._connection.close() >+ self._connected = False >+ >+ def readline(self, isBlocking=False): >+ while True: >+ self._stream.seek(self._streamTrc, io.SEEK_SET) >+ data = self._stream.readline() >+ if data and data[-1] == '\n': >+ self._streamTrc = self._streamTrc + len(data) >+ return data >+ block = self.read() >+ if block: >+ self._stream.seek(0, io.SEEK_END) >+ self._stream.write(block) >+ if not isBlocking: >+ break >+ return None >+ >+ def read(self): >+ try: >+ data = self._connection.recv(self.BUFFER) >+ if data: >+ return data >+ except socket.error, e: >+ err = e.args[0] >+ if err == errno.EAGAIN or err == errno.EWOULDBLOCK: >+ return [] >+ self.disconnect() >+ return [] >+ >+ def send(self, data): >+ if not self._connected: >+ return False >+ self._connection.send(data) >+ return True >+ >+ def port(self): >+ return self._path >+ >+ def isConnected(self): >+ return self._connected >Index: Tools/Scripts/webkitpy/common/ipc_pipe_unittest.py >=================================================================== >--- Tools/Scripts/webkitpy/common/ipc_pipe_unittest.py (nonexistent) >+++ Tools/Scripts/webkitpy/common/ipc_pipe_unittest.py (working copy) >@@ -0,0 +1,157 @@ >+# Copyright (C) 2016 Apple Inc. All rights reserved. >+# >+# Redistribution and use in source and binary forms, with or without >+# modification, are permitted provided that the following conditions >+# are met: >+# 1. Redistributions of source code must retain the above copyright >+# notice, this list of conditions and the following disclaimer. >+# 2. Redistributions in binary form must reproduce the above copyright >+# notice, this list of conditions and the following disclaimer in the >+# documentation and/or other materials provided with the distribution. >+# >+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+# THE POSSIBILITY OF SUCH DAMAGE. >+ >+import os >+import sys >+import threading >+import time >+import unittest >+ >+from webkitpy.common.ipc_pipe import UnixPipeServer, UnixPipe >+from webkitpy.common.ipc_pipe_testcase import DummyProcessPipe, UnixPipeClient >+ >+ >+def UnixPipeClientTestingThread(source, path, arguments): >+ source.clientResults = [] >+ client = UnixPipeClient(path) >+ >+ deadline = time.time() + 1.0 >+ while time.time() < deadline and not client.isConnected(): >+ client.connect() >+ if not client.isConnected(): >+ return None >+ readingmode = False >+ for elm in arguments: >+ if elm == '--read': >+ data = client.readline(True) >+ source.clientResults.append(data) >+ else: >+ client.send(elm) >+ client.disconnect() >+ return source.clientResults >+ >+ >+class ipcPipeTest(unittest.TestCase): >+ >+ def __init__(self, *args, **kwargs): >+ super(ipcPipeTest, self).__init__(*args, **kwargs) >+ self.clientResults = [] >+ >+ def test_abstractpipe_stdout(self): >+ pipe = DummyProcessPipe() >+ >+ pipe.pushDataForTesting('coming from stdout\n') >+ self.assertEqual(pipe.stdoutRead(), 'coming from stdout\n') >+ >+ pipe.pushDataForTesting('coming from stderr\n', stderr=True) >+ self.assertEqual(pipe.stdoutRead(), None) >+ >+ def test_abstractpipe_stderr(self): >+ pipe = DummyProcessPipe() >+ >+ pipe.pushDataForTesting('coming from stdout\n') >+ self.assertEqual(pipe.stderrRead(), None) >+ >+ pipe.pushDataForTesting('coming from stderr\n', stderr=True) >+ self.assertEqual(pipe.stderrRead(), 'coming from stderr\n') >+ >+ def test_abstractpipe_duel_streams(self): >+ pipe = DummyProcessPipe() >+ >+ pipe.pushDataForTesting('coming from stdout\n') >+ pipe.pushDataForTesting('coming from stderr\n', stderr=True) >+ >+ self.assertEqual(pipe.readLine(), 'coming from stderr\n') >+ self.assertEqual(pipe.readLine(), 'coming from stdout\n') >+ >+ def test_abstractpipe_stdoutblock(self): >+ pipe = DummyProcessPipe() >+ >+ pipe.pushDataForTesting('stdout line\n') >+ pipe.pushDataForTesting('stdout block') >+ >+ self.assertEqual(pipe.readBufferStdout(), 'stdout line\nstdout block') >+ self.assertEqual(pipe.readBufferStderr(), '') >+ >+ def test_abstractpipe_stderrblock(self): >+ pipe = DummyProcessPipe() >+ >+ pipe.pushDataForTesting('stderr line\n', stderr=True) >+ pipe.pushDataForTesting('stderr block', stderr=True) >+ >+ self.assertEqual(pipe.readBufferStdout(), '') >+ self.assertEqual(pipe.readBufferStderr(), 'stderr line\nstderr block') >+ >+ def test_unixPipeServer(self): >+ try: >+ serv = UnixPipeServer('/tmp/unixPipe.pipe') >+ thread = threading.Thread(target=UnixPipeClientTestingThread, args=(self, serv.path(), ['--read', 'Line 1\n', 'Line 2\n', '--read'])) >+ thread.start() >+ serv.connect() >+ self.assertTrue(serv.isConnected()) >+ >+ serv.send('Server send 1\n') >+ serv.send('Server send 2\n') >+ >+ thread.join() >+ self.assertEqual(serv.read(), 'Line 1\nLine 2\n') >+ serv.disconnect() >+ >+ self.assertEqual('Server send 1\n', self.clientResults[0]) >+ self.assertEqual('Server send 2\n', self.clientResults[1]) >+ except OSError, e: >+ if not sys.platform.startswith('win') or str(e) != 'UnixPipeServer not implemented on this platform': >+ raise e >+ >+ def test_unixPipe(self): >+ try: >+ pipe = UnixPipe('/tmp/teststdin.pipe', '/tmp/teststdout.pipe', '/tmp/teststderr.pipe') >+ stdinThread = threading.Thread(target=UnixPipeClientTestingThread, args=(self, '/tmp/teststdin.pipe', ['--read', '--read'])) >+ stdoutThread = threading.Thread(target=UnixPipeClientTestingThread, args=(self, '/tmp/teststdout.pipe', ['stdout line 1\n', 'stdout line 2\n'])) >+ stderrThread = threading.Thread(target=UnixPipeClientTestingThread, args=(self, '/tmp/teststderr.pipe', ['stderr line 1\n', 'stderr line 2\n'])) >+ stdinThread.start() >+ stdoutThread.start() >+ stderrThread.start() >+ pipe.connect() >+ >+ self.assertTrue(pipe.isConnected()) >+ >+ pipe.send('Server send 1\n') >+ pipe.send('Server send 2\n') >+ >+ stdinThread.join() >+ stdoutThread.join() >+ stderrThread.join() >+ >+ self.assertEqual(pipe.stdoutRead(), 'stdout line 1\n') >+ self.assertEqual(pipe.stdoutRead(), 'stdout line 2\n') >+ self.assertEqual(pipe.stderrRead(), 'stderr line 1\n') >+ self.assertEqual(pipe.stderrRead(), 'stderr line 2\n') >+ >+ pipe.close() >+ >+ self.assertEqual('Server send 1\n', self.clientResults[0]) >+ self.assertEqual('Server send 2\n', self.clientResults[1]) >+ except OSError, e: >+ if not sys.platform.startswith('win') or str(e) != 'UnixPipeServer not implemented on this platform': >+ raise e >Index: Tools/Scripts/webkitpy/port/base.py >=================================================================== >--- Tools/Scripts/webkitpy/port/base.py (revision 209886) >+++ Tools/Scripts/webkitpy/port/base.py (working copy) >@@ -897,6 +897,12 @@ class Port(object): > > return clean_env > >+ def deviceDefined(self): >+ return False >+ >+ def runOnDevice(self, cmd, envi=None): >+ return None >+ > def _clear_global_caches_and_temporary_files(self): > pass > >Index: Tools/Scripts/webkitpy/port/base_unittest.py >=================================================================== >--- Tools/Scripts/webkitpy/port/base_unittest.py (revision 209886) >+++ Tools/Scripts/webkitpy/port/base_unittest.py (working copy) >@@ -395,6 +395,12 @@ class PortTest(unittest.TestCase): > self.assertTrue(port.is_w3c_resource_file(port.host.filesystem, port.layout_tests_dir() + "/imported/w3c/web-platform-tests/XMLHttpRequest", "xmlhttprequest-sync-block-defer-scripts-subframe.html")) > self.assertTrue(port.is_w3c_resource_file(port.host.filesystem, port.layout_tests_dir() + "/imported/w3c/web-platform-tests/dom/nodes/Document-createElement-namespace-tests", "test.html")) > >+ def test_device(self): >+ port = self.make_port() >+ self.assertFalse(port.deviceDefined()) >+ self.assertIsNone(port.runOnDevice(['ping', '<no-id>'])) >+ >+ > class NaturalCompareTest(unittest.TestCase): > def setUp(self): > self._port = TestPort(MockSystemHost()) >Index: Tools/Scripts/webkitpy/port/darwin.py >=================================================================== >--- Tools/Scripts/webkitpy/port/darwin.py (revision 209886) >+++ Tools/Scripts/webkitpy/port/darwin.py (working copy) >@@ -21,7 +21,10 @@ > # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > > import logging >+import multiprocessing > import os >+import plistlib >+import shutil > import time > > from webkitpy.common.system.crashlogs import CrashLogs >@@ -174,3 +177,24 @@ class DarwinPort(ApplePort): > except ScriptError: > _log.warn("xcrun failed; falling back to '%s'." % fallback) > return fallback >+ >+ def extractBundleID(self, app): >+ pid = str(multiprocessing.current_process().name).replace('/', '-') >+ >+ try: >+ shutil.copyfile(app + "/Info.plist", "/tmp/" + pid + "Info.plist") >+ if self._executive.run_command(['cp', app + '/Info.plist', '/tmp/' + pid + 'Info.plist'], return_exit_code=True): >+ return None >+ if self._executive.run_command(['plutil', '-convert', 'xml1', '/tmp/' + pid + 'Info.plist'], return_exit_code=True): >+ return None >+ pl = plistlib.readPlist("/tmp/" + pid + "Info.plist") >+ except Exception, err: >+ pl = None >+ >+ try: >+ os.remove("/tmp/" + pid + "Info.plist") >+ if pl: >+ return pl["CFBundleIdentifier"] >+ except: >+ pass >+ return None >Index: Tools/Scripts/webkitpy/port/darwin_testcase.py >=================================================================== >--- Tools/Scripts/webkitpy/port/darwin_testcase.py (revision 209886) >+++ Tools/Scripts/webkitpy/port/darwin_testcase.py (working copy) >@@ -20,6 +20,9 @@ > # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE > # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > >+import os >+import plistlib >+ > from webkitpy.port import port_testcase > from webkitpy.common.system.filesystem_mock import MockFileSystem > from webkitpy.common.system.outputcapture import OutputCapture >@@ -119,3 +122,10 @@ class DarwinTest(port_testcase.PortTestC > port = self.make_port() > port._executive = MockExecutive2(run_command_fn=throwing_run_command) > OutputCapture().assert_outputs(self, port.sample_process, args=['test', 42]) >+ >+ def test_plist(self): >+ port = self.make_port() >+ pl = dict(CFBundleIdentifier="org.webkit.demo") >+ plistlib.writePlist(pl, "/tmp/Info.plist") >+ self.assertEqual(port.extractBundleID("/tmp"), None) >+ os.remove("/tmp/Info.plist") >Index: Tools/Scripts/webkitpy/port/driver.py >=================================================================== >--- Tools/Scripts/webkitpy/port/driver.py (revision 209886) >+++ Tools/Scripts/webkitpy/port/driver.py (working copy) >@@ -138,7 +138,7 @@ class Driver(object): > self._driver_user_directory_suffix = None > self._driver_user_cache_directory = None > >- # WebKitTestRunner/LayoutTestRelay can report back subprocess crashes by printing >+ # WebKitTestRunner can report back subprocess crashes by printing > # "#CRASHED - PROCESSNAME". Since those can happen at any time and ServerProcess > # won't be aware of them (since the actual tool didn't crash, just a subprocess) > # we record the crashed subprocess name here. >@@ -182,6 +182,7 @@ class Driver(object): > """ > start_time = time.time() > self.start(driver_input.should_run_pixel_test, driver_input.args) >+ self._server_process.clean() > test_begin_time = time.time() > self._driver_timed_out = False > self._crash_report_from_driver = None >@@ -327,7 +328,7 @@ class Driver(object): > > def _setup_environ_for_driver(self, environment): > build_root_path = str(self._port._build_path()) >- # FIXME: DYLD_* variables should be Mac-only. Even iOS Simulator doesn't need them, as LayoutTestRelay is a host binary. >+ # FIXME: DYLD_* variables should be Mac-only. iOS simulators should include them in it's app bundle. > self._append_environment_variable_path(environment, 'DYLD_LIBRARY_PATH', build_root_path) > self._append_environment_variable_path(environment, '__XPC_DYLD_LIBRARY_PATH', build_root_path) > self._append_environment_variable_path(environment, 'DYLD_FRAMEWORK_PATH', build_root_path) >@@ -610,24 +611,20 @@ class Driver(object): > > > # FIXME: this should be abstracted out via the Port subclass somehow. >-class IOSSimulatorDriver(Driver): >+class DeviceDriver(Driver): > def cmd_line(self, pixel_tests, per_test_args): >- cmd = super(IOSSimulatorDriver, self).cmd_line(pixel_tests, per_test_args) >- relay_tool = self._port.relay_path >+ cmd = super(DeviceDriver, self).cmd_line(pixel_tests, per_test_args) >+ relay_tool = 'run-on-device' > dump_tool = cmd[0] > dump_tool_args = cmd[1:] > product_dir = self._port._build_path() >- relay_args = [ >- '-developerDir', self._port.developer_dir, >- '-udid', self._port.device_id_for_worker_number(self._worker_number), >- '-productDir', product_dir, >- '-app', dump_tool, >- ] >- return [relay_tool] + relay_args + ['--'] + dump_tool_args >+ >+ relay_args = [self._port.device_id_for_worker_number(self._worker_number), dump_tool] >+ return [relay_tool] + relay_args + dump_tool_args > > def _setup_environ_for_driver(self, environment): > environment['DEVELOPER_DIR'] = self._port.developer_dir >- return super(IOSSimulatorDriver, self)._setup_environ_for_driver(environment) >+ return super(DeviceDriver, self)._setup_environ_for_driver(environment) > > > class ContentBlock(object): >Index: Tools/Scripts/webkitpy/port/ios.py >=================================================================== >--- Tools/Scripts/webkitpy/port/ios.py (revision 209886) >+++ Tools/Scripts/webkitpy/port/ios.py (working copy) >@@ -34,14 +34,108 @@ from webkitpy.layout_tests.models.test_c > from webkitpy.port import config as port_config > from webkitpy.port import driver, image_diff > from webkitpy.port.darwin import DarwinPort >-from webkitpy.xcode.simulator import Simulator, Runtime, DeviceType >+from webkitpy.xcode.simulator import Simulator, Runtime, DeviceType, Device > from webkitpy.common.system.crashlogs import CrashLogs > >- > _log = logging.getLogger(__name__) > > >-class IOSPort(DarwinPort): >+class IOSBase(DarwinPort): >+ >+ SUBPROCESS_CRASH_REGEX = re.compile('#CRASHED - (?P<subprocess_name>\S+) \(pid (?P<subprocess_pid>\d+)\)') >+ >+ def __init__(self, host, port_name, **kwargs): >+ DarwinPort.__init__(self, host, port_name, **kwargs) >+ self._printing_cmd_line = False >+ >+ def driver_name(self): >+ if self.get_option('driver_name'): >+ return self.get_option('driver_name') >+ if self.get_option('webkit_test_runner'): >+ return 'WebKitTestRunnerApp.app' >+ return 'DumpRenderTree.app' >+ >+ def _get_crash_log(self, name, pid, stdout, stderr, newer_than, time_fn=time.time, sleep_fn=time.sleep, wait_for_log=True): >+ time_fn = time_fn or time.time >+ sleep_fn = sleep_fn or time.sleep >+ >+ # FIXME: We should collect the actual crash log for DumpRenderTree.app because it includes more >+ # information (e.g. exception codes) than is available in the stack trace written to standard error. >+ stderr_lines = [] >+ crashed_subprocess_name_and_pid = None # e.g. ('DumpRenderTree.app', 1234) >+ for line in (stderr or '').splitlines(): >+ if not crashed_subprocess_name_and_pid: >+ match = self.SUBPROCESS_CRASH_REGEX.match(line) >+ if match: >+ crashed_subprocess_name_and_pid = (match.group('subprocess_name'), int(match.group('subprocess_pid'))) >+ continue >+ stderr_lines.append(line) >+ >+ if crashed_subprocess_name_and_pid: >+ return self._get_crash_log(crashed_subprocess_name_and_pid[0], crashed_subprocess_name_and_pid[1], stdout, >+ '\n'.join(stderr_lines), newer_than, time_fn, sleep_fn, wait_for_log) >+ >+ _log.debug('looking for crash log for %s:%s' % (name, str(pid))) >+ crash_log = '' >+ crash_logs = CrashLogs(self.host) >+ now = time_fn() >+ deadline = now + 5 * int(self.get_option('child_processes', 1)) >+ while not crash_log and now <= deadline: >+ crash_log = crash_logs.find_newest_log(name, pid, include_errors=True, newer_than=newer_than) >+ if not wait_for_log: >+ break >+ if not crash_log or not [line for line in crash_log.splitlines() if not line.startswith('ERROR')]: >+ sleep_fn(0.1) >+ now = time_fn() >+ >+ if not crash_log: >+ return stderr, None >+ return stderr, crash_log >+ >+ def _testing_device(self, number): >+ return None >+ >+ def device_id_for_worker_number(self, number): >+ if self._printing_cmd_line or not self._testing_device(number): >+ return '<dummy id>' >+ return self._testing_device(number).udid >+ >+ def _driver_class(self): >+ return driver.DeviceDriver >+ >+ def deviceDefined(self): >+ return True >+ >+ def _devicePing(self, device): >+ return False >+ >+ def _deviceInstall(self, device, app): >+ return False >+ >+ def _deviceRun(self, cmd, envi=None): >+ return None >+ >+ def _deviceKill(self, device, app): >+ return False >+ >+ def runOnDevice(self, cmd, envi=None): >+ if not cmd: >+ return None >+ if cmd[0] == 'ping': >+ if len(cmd) >= 2: >+ return self._devicePing(cmd[1]) >+ else: >+ return self._devicePing(None) >+ elif cmd[0] == 'run': >+ return self._deviceRun(cmd[1:], envi) >+ elif cmd[0] == 'install': >+ return self._deviceInstall(cmd[1], cmd[2]) >+ elif cmd[0] == 'kill': >+ return self._deviceKill(cmd[1], cmd[2]) >+ return None >+ >+ >+class IOSPort(IOSBase): > port_name = "ios" > > ARCHITECTURES = ['armv7', 'armv7s', 'arm64'] >@@ -66,7 +160,7 @@ class IOSPort(DarwinPort): > return 'ios' > > >-class IOSSimulatorPort(DarwinPort): >+class IOSSimulatorPort(IOSBase): > port_name = "ios-simulator" > > FUTURE_VERSION = 'future' >@@ -78,7 +172,6 @@ class IOSSimulatorPort(DarwinPort): > SDK = 'iphonesimulator' > > SIMULATOR_BUNDLE_ID = 'com.apple.iphonesimulator' >- relay_name = 'LayoutTestRelay' > SIMULATOR_DIRECTORY = "/tmp/WebKitTestingSimulators/" > LSREGISTER_PATH = "/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Versions/Current/Support/lsregister" > PROCESS_COUNT_ESTIMATE_PER_SIMULATOR_INSTANCE = 100 >@@ -96,10 +189,9 @@ class IOSSimulatorPort(DarwinPort): > } > > def __init__(self, host, port_name, **kwargs): >- DarwinPort.__init__(self, host, port_name, **kwargs) >+ IOSBase.__init__(self, host, port_name, **kwargs) > > optional_device_class = self.get_option('device_class') >- self._printing_cmd_line = False > self._device_class = optional_device_class if optional_device_class else self.DEFAULT_DEVICE_CLASS > _log.debug('IOSSimulatorPort _device_class is %s', self._device_class) > >@@ -148,16 +240,6 @@ class IOSSimulatorPort(DarwinPort): > device_type = DeviceType.from_name(device_name) > return device_type > >- @property >- @memoized >- def relay_path(self): >- if self._root_was_set: >- path = self._filesystem.abspath(self.get_option('root')) >- else: >- mac_config = port_config.Config(self._executive, self._filesystem, 'mac') >- path = mac_config.build_directory(self.get_option('configuration')) >- return self._filesystem.join(path, self.relay_name) >- > @memoized > def child_processes(self): > return int(self.get_option('child_processes')) >@@ -182,75 +264,12 @@ class IOSSimulatorPort(DarwinPort): > > return min(maximum_simulator_count_on_this_system, best_child_process_count_for_cpu) > >- def _check_relay(self): >- if not self._filesystem.exists(self.relay_path): >- _log.error("%s was not found at %s" % (self.relay_name, self.relay_path)) >- return False >- return True >- > def _check_port_build(self): >- if not self._root_was_set and self.get_option('build') and not self._build_relay(): >- return False >- if not self._check_relay(): >- return False >- return True >- >- def _get_crash_log(self, name, pid, stdout, stderr, newer_than, time_fn=time.time, sleep_fn=time.sleep, wait_for_log=True): >- time_fn = time_fn or time.time >- sleep_fn = sleep_fn or time.sleep >- >- # FIXME: We should collect the actual crash log for DumpRenderTree.app because it includes more >- # information (e.g. exception codes) than is available in the stack trace written to standard error. >- stderr_lines = [] >- crashed_subprocess_name_and_pid = None # e.g. ('DumpRenderTree.app', 1234) >- for line in (stderr or '').splitlines(): >- if not crashed_subprocess_name_and_pid: >- match = self.SUBPROCESS_CRASH_REGEX.match(line) >- if match: >- crashed_subprocess_name_and_pid = (match.group('subprocess_name'), int(match.group('subprocess_pid'))) >- continue >- stderr_lines.append(line) >- >- if crashed_subprocess_name_and_pid: >- return self._get_crash_log(crashed_subprocess_name_and_pid[0], crashed_subprocess_name_and_pid[1], stdout, >- '\n'.join(stderr_lines), newer_than, time_fn, sleep_fn, wait_for_log) >- >- # LayoutTestRelay crashed >- _log.debug('looking for crash log for %s:%s' % (name, str(pid))) >- crash_log = '' >- crash_logs = CrashLogs(self.host) >- now = time_fn() >- deadline = now + 5 * int(self.get_option('child_processes', 1)) >- while not crash_log and now <= deadline: >- crash_log = crash_logs.find_newest_log(name, pid, include_errors=True, newer_than=newer_than) >- if not wait_for_log: >- break >- if not crash_log or not [line for line in crash_log.splitlines() if not line.startswith('ERROR')]: >- sleep_fn(0.1) >- now = time_fn() >- >- if not crash_log: >- return stderr, None >- return stderr, crash_log >- >- def _build_relay(self): >- environment = self.host.copy_current_environment() >- environment.disable_gcc_smartquotes() >- env = environment.to_dictionary() >- >- try: >- # FIXME: We should be passing _arguments_for_configuration(), which respects build configuration and port, >- # instead of hardcoding --ios-simulator. >- self._run_script("build-layouttestrelay", args=["--ios-simulator"], env=env) >- except ScriptError, e: >- _log.error(e.message_with_output(output_limit=None)) >- return False > return True > > def _build_driver(self): > built_tool = super(IOSSimulatorPort, self)._build_driver() >- built_relay = self._build_relay() >- return built_tool and built_relay >+ return built_tool > > def _build_driver_flags(self): > archs = ['ARCHS=i386'] if self.architecture() == 'x86' else [] >@@ -264,9 +283,6 @@ class IOSSimulatorPort(DarwinPort): > configurations.append(TestConfiguration(version=self._version, architecture=architecture, build_type=build_type)) > return configurations > >- def _driver_class(self): >- return driver.IOSSimulatorDriver >- > def default_baseline_search_path(self): > if self.get_option('webkit_test_runner'): > fallback_names = [self._wk2_port_name()] + [self.port_name] + ['wk2'] >@@ -399,8 +415,6 @@ class IOSSimulatorPort(DarwinPort): > return False > return super(IOSSimulatorPort, self).check_sys_deps(needs_http) > >- SUBPROCESS_CRASH_REGEX = re.compile('#CRASHED - (?P<subprocess_name>\S+) \(pid (?P<subprocess_pid>\d+)\)') >- > def _using_dedicated_simulators(self): > return self.get_option('dedicated_simulators') > >@@ -475,3 +489,57 @@ class IOSSimulatorPort(DarwinPort): > subprocess.check_output(["install_name_tool", "-add_rpath", self.developer_dir + "/../Frameworks/", destination + "/Contents/MacOS/Simulator"]) > subprocess.check_output(["codesign", "-fs", "-", destination]) > subprocess.check_output([self.LSREGISTER_PATH, "-f", destination]) >+ >+ def _devicePing(self, device): >+ data = self._executive.run_command(['xcrun', 'simctl', 'list']) >+ if device and device + ') (Booted)' in data: >+ return True >+ return False >+ >+ def _deviceInstall(self, device, app): >+ if not self._devicePing(device): >+ return False >+ return not self._executive.run_command([ >+ 'xcrun', >+ 'simctl', >+ 'install', >+ device, >+ app, >+ ], return_exit_code=True) >+ >+ def _deviceRun(self, cmd, envi=None): >+ if not self._devicePing(cmd[0]): >+ return False >+ appid = self.extractBundleID(cmd[1]) >+ if not appid: >+ return False >+ self._deviceKill(cmd[0], cmd[1]) >+ >+ transferedEnvironment = {} >+ for value in envi: >+ if not "SIMCTL_CHILD_" in value: >+ transferedEnvironment['SIMCTL_CHILD_' + value] = envi[value] >+ transferedEnvironment[value] = envi[value] >+ >+ return not self._executive.run_command([ >+ 'xcrun', >+ 'simctl', >+ 'launch', >+ cmd[0], >+ appid, >+ ] + cmd[2:], >+ env=transferedEnvironment, >+ return_exit_code=True) >+ return True >+ >+ def _deviceKill(self, device, app): >+ addid = self.extractBundleID(app) >+ if not addid: >+ return False >+ return not self._executive.run_command([ >+ 'xcrun', >+ 'simctl', >+ 'terminate', >+ device, >+ addid, >+ ], return_exit_code=True) >Index: Tools/Scripts/webkitpy/port/ios_unittest.py >=================================================================== >--- Tools/Scripts/webkitpy/port/ios_unittest.py (revision 209886) >+++ Tools/Scripts/webkitpy/port/ios_unittest.py (working copy) >@@ -22,8 +22,9 @@ > > import time > >+from webkitpy.port.ios import IOSPort > from webkitpy.port.ios import IOSSimulatorPort >-from webkitpy.port import darwin_testcase >+from webkitpy.port import iosbase_testcase > from webkitpy.common.system.filesystem_mock import MockFileSystem > from webkitpy.common.system.outputcapture import OutputCapture > from webkitpy.tool.mocktool import MockOptions >@@ -31,7 +32,20 @@ from webkitpy.common.system.executive_mo > from webkitpy.common.system.systemhost_mock import MockSystemHost > > >-class iosTest(darwin_testcase.DarwinTest): >+class IOSTest(iosbase_testcase.IOSBaseTest): >+ os_name = 'ios' >+ os_version = '' >+ port_name = 'ios' >+ port_maker = IOSPort >+ is_simulator = False >+ >+ def make_port(self, host=None, port_name=None, options=None, os_name=None, os_version=None, **kwargs): >+ port = super(IOSTest, self).make_port(host=host, port_name=port_name, options=options, os_name=os_name, s_version=os_version, kwargs=kwargs) >+ port.set_option('child_processes', 1) >+ return port >+ >+ >+class IOSSimulatorTest(iosbase_testcase.IOSBaseTest): > os_name = 'ios-simulator' > os_version = '' > port_name = 'ios-simulator' >@@ -39,7 +53,7 @@ class iosTest(darwin_testcase.DarwinTest > is_simulator = True > > def make_port(self, host=None, port_name=None, options=None, os_name=None, os_version=None, **kwargs): >- port = super(iosTest, self).make_port(host=host, port_name=port_name, options=options, os_name=os_name, s_version=os_version, kwargs=kwargs) >+ port = super(IOSSimulatorTest, self).make_port(host=host, port_name=port_name, options=options, os_name=os_name, s_version=os_version, kwargs=kwargs) > port.set_option('child_processes', 1) > return port > >@@ -53,14 +67,6 @@ class iosTest(darwin_testcase.DarwinTest > def test_operating_system(self): > self.assertEqual('ios-simulator', self.make_port().operating_system()) > >- def test_get_crash_log(self): >- # Mac crash logs are tested elsewhere, so here we just make sure we don't crash. >- def fake_time_cb(): >- times = [0, 20, 40] >- return lambda: times.pop(0) >- port = self.make_port(port_name='ios-simulator') >- port._get_crash_log('DumpRenderTree', 1234, None, None, time.time(), wait_for_log=False) >- > def test_32bit(self): > port = self.make_port(options=MockOptions(architecture='x86')) > >@@ -70,7 +76,7 @@ class iosTest(darwin_testcase.DarwinTest > port._run_script = run_script > self.assertEqual(port.architecture(), 'x86') > port._build_driver() >- self.assertEqual(self.args, ['--ios-simulator']) >+ self.assertEqual(self.args, ['ARCHS=i386', '--sdk', 'iphonesimulator']) > > def test_64bit(self): > # Apple Mac port is 64-bit by default >@@ -82,7 +88,7 @@ class iosTest(darwin_testcase.DarwinTest > > port._run_script = run_script > port._build_driver() >- self.assertEqual(self.args, ['--ios-simulator']) >+ self.assertEqual(self.args, ['--sdk', 'iphonesimulator']) > > def test_sdk_name(self): > port = self.make_port() >@@ -97,3 +103,7 @@ class iosTest(darwin_testcase.DarwinTest > port._executive = MockExecutive2(run_command_fn=throwing_run_command) > expected_stdout = "['xcrun', '--sdk', 'iphonesimulator', '-find', 'test']\n" > OutputCapture().assert_outputs(self, port.xcrun_find, args=['test', 'falling'], expected_stdout=expected_stdout) >+ >+ def test_ping(self): >+ port = self.make_port() >+ self.assertFalse(port.runOnDevice(['ping', '<devid>'])) >Index: Tools/Scripts/webkitpy/port/iosbase_testcase.py >=================================================================== >--- Tools/Scripts/webkitpy/port/iosbase_testcase.py (nonexistent) >+++ Tools/Scripts/webkitpy/port/iosbase_testcase.py (working copy) >@@ -0,0 +1,40 @@ >+# Copyright (C) 2014-2016 Apple Inc. All rights reserved. >+# >+# Redistribution and use in source and binary forms, with or without >+# modification, are permitted provided that the following conditions >+# are met: >+# 1. Redistributions of source code must retain the above copyright >+# notice, this list of conditions and the following disclaimer. >+# 2. Redistributions in binary form must reproduce the above copyright >+# notice, this list of conditions and the following disclaimer in the >+# documentation and/or other materials provided with the distribution. >+# >+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND >+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED >+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >+# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR >+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL >+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR >+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER >+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, >+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ >+import time >+ >+from webkitpy.port import darwin_testcase >+ >+ >+class IOSBaseTest(darwin_testcase.DarwinTest): >+ >+ def test_deviceFlag(self): >+ port = self.make_port() >+ self.assertTrue(port.deviceDefined()) >+ >+ def test_get_crash_log(self): >+ # Mac crash logs are tested elsewhere, so here we just make sure we don't crash. >+ def fake_time_cb(): >+ times = [0, 20, 40] >+ return lambda: times.pop(0) >+ port = self.make_port(port_name='ios-simulator') >+ port._get_crash_log('DumpRenderTree', 1234, None, None, time.time(), wait_for_log=False) >Index: Tools/Scripts/webkitpy/port/server_process.py >=================================================================== >--- Tools/Scripts/webkitpy/port/server_process.py (revision 209886) >+++ Tools/Scripts/webkitpy/port/server_process.py (working copy) >@@ -1,3 +1,4 @@ >+# Copyright (C) 2016 Apple Inc. All rights reserved. > # Copyright (C) 2010 Google Inc. All rights reserved. > # > # Redistribution and use in source and binary forms, with or without >@@ -30,10 +31,13 @@ > > import errno > import logging >+import multiprocessing > import signal > import sys > import time > >+from webkitpy.common.ipc_pipe import ProcessPipe, UnixPipe >+ > # Note that although win32 python does provide an implementation of > # the win32 select API, it only works on sockets, and not on the named pipes > # used by subprocess, so we have to use the native APIs directly. >@@ -71,32 +75,25 @@ class ServerProcess(object): > self._host = self._port.host > self._pid = None > self._reset() >- >- # See comment in imports for why we need the win32 APIs and can't just use select. >- # FIXME: there should be a way to get win32 vs. cygwin from platforminfo. >+ self._pipe = None > self._use_win32_apis = sys.platform.startswith('win') > >+ if "run-on-device" == self._cmd[0]: >+ self._port.runOnDevice(['install', self._cmd[1], self._cmd[2]]) >+ > def name(self): > return self._name > > def pid(self): > return self._pid > >+ def clean(self): >+ self._pipe.clean() >+ > def _reset(self): >- if getattr(self, '_proc', None): >- if self._proc.stdin: >- self._proc.stdin.close() >- self._proc.stdin = None >- if self._proc.stdout: >- self._proc.stdout.close() >- self._proc.stdout = None >- if self._proc.stderr: >- self._proc.stderr.close() >- self._proc.stderr = None >- >- self._proc = None >- self._output = str() # bytesarray() once we require Python 2.6 >- self._error = str() # bytesarray() once we require Python 2.6 >+ self._pipe = None >+ self._pid = None >+ > self._crashed = False > self.timed_out = False > >@@ -104,75 +101,85 @@ class ServerProcess(object): > return self._name > > def _start(self): >- if self._proc: >+ self._pid = None >+ if self._pipe: > raise ValueError("%s already running" % self._name) > self._reset() >- # close_fds is a workaround for http://bugs.python.org/issue2320 >- close_fds = not self._host.platform.is_win() >- self._proc = self._host.executive.popen(self._cmd, stdin=self._host.executive.PIPE, >- stdout=self._host.executive.PIPE, >- stderr=self._host.executive.PIPE, >- close_fds=close_fds, >- env=self._env, >- universal_newlines=self._universal_newlines) >- self._pid = self._proc.pid >- self._port.find_system_pid(self.name(), self._pid) >- fd = self._proc.stdout.fileno() >- if not self._use_win32_apis: >- fl = fcntl.fcntl(fd, fcntl.F_GETFL) >- fcntl.fcntl(fd, fcntl.F_SETFL, fl | os.O_NONBLOCK) >- fd = self._proc.stderr.fileno() >- fl = fcntl.fcntl(fd, fcntl.F_GETFL) >- fcntl.fcntl(fd, fcntl.F_SETFL, fl | os.O_NONBLOCK) >- >- def _handle_possible_interrupt(self): >- """This routine checks to see if the process crashed or exited >- because of a keyboard interrupt and raises KeyboardInterrupt >- accordingly.""" >- # FIXME: Linux and Mac set the returncode to -signal.SIGINT if a >- # subprocess is killed with a ctrl^C. Previous comments in this >- # routine said that supposedly Windows returns 0xc000001d, but that's not what >- # -1073741510 evaluates to. Figure out what the right value is >- # for win32 and cygwin here ... >- if self._proc.returncode in (-1073741510, -signal.SIGINT): >- raise KeyboardInterrupt >+ >+ if "run-on-device" == self._cmd[0]: >+ self._env['IPC_IDENTIFIER'] = self._port.extractBundleID(self._cmd[2]) + "-" + self._cmd[1] >+ file_location = '/tmp/' + self._env['IPC_IDENTIFIER'] >+ self._pipe = UnixPipe(file_location + '_IN', file_location + '_OUT', file_location + '_ERROR') >+ self._port.runOnDevice(['run'] + self._cmd[1:], self._env) >+ self._pipe.connect() >+ if self._pipe.isConnected(): >+ pid = self.read_stderr_line(time.time() + 1.0) >+ if pid: >+ self._pid = int(pid[6:-1]) >+ else: >+ _log.debug('No pid received from Unix-pipe based client') >+ self._crashed = True >+ else: >+ _log.debug('Failed to connect to launching app') >+ self._crashed = True >+ >+ else: >+ self._pipe = ProcessPipe(self._port, self._cmd, self._env, self._universal_newlines) >+ self._pid = self._pipe.pid() >+ >+ if not self.poll(): >+ self._port.find_system_pid(self.name(), self.pid()) > > def poll(self): > """Check to see if the underlying process is running; returns None > if it still is (wrapper around subprocess.poll).""" >- if self._proc: >- return self._proc.poll() >- return None >+ if self._pipe and self._pipe.isConnected(): >+ return None >+ return True > > def write(self, bytes, ignore_crash=False): >+ > """Write a request to the subprocess. The subprocess is (re-)start()'ed > if is not already running.""" >- if not self._proc: >+ if not self._pipe: > self._start() >- try: >- self._proc.stdin.write(bytes) >- except IOError, e: >- self.stop(0.0) >- # stop() calls _reset(), so we have to set crashed to True after calling stop() >- # unless we already know that this is a timeout. >+ success = False >+ if self._pipe: >+ success = self._pipe.send(bytes) >+ >+ if not success: >+ self.stop() > if not ignore_crash: > _log.debug('This test marked as a crash because of a broken pipe when writing to stdin of the server process.') > self._crashed = True > > def _pop_stdout_line_if_ready(self): >- index_after_newline = self._output.find('\n') + 1 >- if index_after_newline > 0: >- return self._pop_output_bytes(index_after_newline) >+ data = [] >+ if self._pipe: >+ data = self._pipe.stdoutRead() >+ >+ if data: >+ return data > return None > > def _pop_stderr_line_if_ready(self): >- index_after_newline = self._error.find('\n') + 1 >- if index_after_newline > 0: >- return self._pop_error_bytes(index_after_newline) >+ data = [] >+ if self._pipe: >+ data = self._pipe.stderrRead() >+ if data: >+ return data > return None > > def pop_all_buffered_stderr(self): >- return self._pop_error_bytes(len(self._error)) >+ _error = "" >+ _current_error = [] >+ while True: >+ if self._pipe: >+ _current_error = self._pipe.stderrRead() >+ if not _current_error: >+ return _error >+ else: >+ _error = _error + _current_error + '\n' > > def read_stdout_line(self, deadline): > return self._read(deadline, self._pop_stdout_line_if_ready) >@@ -191,7 +198,6 @@ class ServerProcess(object): > return None # Instructs the caller to keep waiting. > > return_value = self._read(deadline, retrieve_bytes_from_buffers) >- # FIXME: This is a bit of a hack around the fact that _read normally only returns one value, but this caller wants it to return two. > if return_value is None: > return None, None > return return_value >@@ -201,117 +207,25 @@ class ServerProcess(object): > raise ValueError('ServerProcess.read() called with a non-positive size: %d ' % size) > > def retrieve_bytes_from_stdout_buffer(): >- if len(self._output) >= size: >- return self._pop_output_bytes(size) >+ if self._pipe: >+ return self._pipe.readBlockStdout(size) > return None > > return self._read(deadline, retrieve_bytes_from_stdout_buffer) > >- def _log(self, message): >- # This is a bit of a hack, but we first log a blank line to avoid >- # messing up the master process's output. >- _log.info('') >- _log.info(message) >- > def _handle_timeout(self): > self.timed_out = True > if self._port.get_option("sample_on_timeout"): > self._port.sample_process(self._name, self._proc.pid) > >- def _split_string_after_index(self, string, index): >- return string[:index], string[index:] >- >- def _pop_output_bytes(self, bytes_count): >- output, self._output = self._split_string_after_index(self._output, bytes_count) >- return output >- >- def _pop_error_bytes(self, bytes_count): >- output, self._error = self._split_string_after_index(self._error, bytes_count) >- return output >- >- def _wait_for_data_and_update_buffers_using_select(self, deadline, stopping=False): >- if self._proc.stdout.closed or self._proc.stderr.closed: >- # If the process crashed and is using FIFOs, like Chromium Android, the >- # stdout and stderr pipes will be closed. >- return >- >- out_fd = self._proc.stdout.fileno() >- err_fd = self._proc.stderr.fileno() >- select_fds = (out_fd, err_fd) >- try: >- read_fds, _, _ = select.select(select_fds, [], select_fds, max(deadline - time.time(), 0)) >- except select.error, e: >- # We can ignore EINVAL since it's likely the process just crashed and we'll >- # figure that out the next time through the loop in _read(). >- if e.args[0] == errno.EINVAL: >- return >- raise >- >- try: >- # Note that we may get no data during read() even though >- # select says we got something; see the select() man page >- # on linux. I don't know if this happens on Mac OS and >- # other Unixen as well, but we don't bother special-casing >- # Linux because it's relatively harmless either way. >- if out_fd in read_fds: >- data = self._proc.stdout.read() >- if not data and not stopping and (self._treat_no_data_as_crash or self._proc.poll()): >- _log.debug('This test marked as a crash because of no data while reading stdout for the server process.') >- self._crashed = True >- self._output += data >- >- if err_fd in read_fds: >- data = self._proc.stderr.read() >- if not data and not stopping and (self._treat_no_data_as_crash or self._proc.poll()): >- _log.debug('This test marked as a crash because of no data while reading stdout for the server process.') >- self._crashed = True >- self._error += data >- except IOError, e: >- # We can ignore the IOErrors because we will detect if the subporcess crashed >- # the next time through the loop in _read() >- pass >- >- def _wait_for_data_and_update_buffers_using_win32_apis(self, deadline): >- # See http://code.activestate.com/recipes/440554-module-to-allow-asynchronous-subprocess-use-on-win/ >- # and http://docs.activestate.com/activepython/2.6/pywin32/modules.html >- # for documentation on all of these win32-specific modules. >- now = time.time() >- out_fh = msvcrt.get_osfhandle(self._proc.stdout.fileno()) >- err_fh = msvcrt.get_osfhandle(self._proc.stderr.fileno()) >- while (self._proc.poll() is None) and (now < deadline): >- output = self._non_blocking_read_win32(out_fh) >- error = self._non_blocking_read_win32(err_fh) >- if output or error: >- if output: >- self._output += output >- if error: >- self._error += error >- return >- time.sleep(0.01) >- now = time.time() >- return >- >- def _non_blocking_read_win32(self, handle): >- try: >- _, avail, _ = win32pipe.PeekNamedPipe(handle, 0) >- if avail > 0: >- _, buf = win32file.ReadFile(handle, avail, None) >- return buf >- except Exception, e: >- if e[0] not in (109, errno.ESHUTDOWN): # 109 == win32 ERROR_BROKEN_PIPE >- raise >- return None >- > def has_crashed(self): > if not self._crashed and self.poll(): > _log.debug('This test marked as a crash because of failure to poll the server process.') > self._crashed = True >- self._handle_possible_interrupt() >+ if self._pipe: >+ self._pipe.handle_interrupt() > return self._crashed > >- # This read function is a bit oddly-designed, as it polls both stdout and stderr, yet >- # only reads/returns from one of them (buffering both in local self._output/self._error). >- # It might be cleaner to pass in the file descriptor to poll instead. > def _read(self, deadline, fetch_bytes_from_buffers_callback): > while True: > if self.has_crashed(): >@@ -325,63 +239,36 @@ class ServerProcess(object): > if bytes is not None: > return bytes > >- if self._use_win32_apis: >- self._wait_for_data_and_update_buffers_using_win32_apis(deadline) >- else: >- self._wait_for_data_and_update_buffers_using_select(deadline) >- > def start(self): >- if not self._proc: >+ if not self._pipe: > self._start() > > def stop(self, timeout_secs=3.0): >- if not self._proc: >- return (None, None) >+ deadline = time.time() + timeout_secs > >- # Only bother to check for leaks or stderr if the process is still running. >- if self.poll() is None: >- self._port.check_for_leaks(self.name(), self.pid()) >- >- now = time.time() >- if self._proc.stdin: >- self._proc.stdin.close() >- self._proc.stdin = None >- killed = False >- if timeout_secs: >- deadline = now + timeout_secs >- while self._proc.poll() is None and time.time() < deadline: >- time.sleep(0.01) >- if self._proc.poll() is None: >- _log.warning('stopping %s(pid %d) timed out, killing it' % (self._name, self._proc.pid)) >- >- if self._proc.poll() is None: >- self._kill() >- killed = True >- _log.debug('killed pid %d' % self._proc.pid) >- >- # read any remaining data on the pipes and return it. >- if not killed: >- if self._use_win32_apis: >- self._wait_for_data_and_update_buffers_using_win32_apis(now) >- else: >- self._wait_for_data_and_update_buffers_using_select(now, stopping=True) >- out, err = self._output, self._error >+ out = [] >+ err = [] >+ >+ if self._pipe == None: >+ return (out, err) >+ if not self._pipe.isConnected(): >+ self._pipe.close() >+ self._reset() >+ return (out, err) >+ >+ out = self._pipe.readBufferStdout() >+ err = self._pipe.readBufferStderr() >+ >+ while self._pipe.isConnected() and deadline > time.time(): >+ out = out + self._pipe.readBufferStdout() >+ err = err + self._pipe.readBufferStderr() >+ >+ if "run-on-device" == self._cmd[0]: >+ self._port.runOnDevice(['kill', self._cmd[1], self._cmd[2]]) >+ self._pipe.close() > self._reset() > return (out, err) > > def kill(self): > self.stop(0.0) > >- def _kill(self): >- self._host.executive.kill_process(self._proc.pid) >- if self._proc.poll() is not None: >- self._proc.wait() >- >- def replace_outputs(self, stdout, stderr): >- assert self._proc >- if stdout: >- self._proc.stdout.close() >- self._proc.stdout = stdout >- if stderr: >- self._proc.stderr.close() >- self._proc.stderr = stderr >Index: Tools/Scripts/webkitpy/port/server_process_unittest.py >=================================================================== >--- Tools/Scripts/webkitpy/port/server_process_unittest.py (revision 209886) >+++ Tools/Scripts/webkitpy/port/server_process_unittest.py (working copy) >@@ -1,3 +1,4 @@ >+# Copyright (C) 2016 Apple Inc. All rights reserved. > # Copyright (C) 2011 Google Inc. All rights reserved. > # > # Redistribution and use in source and binary forms, with or without >@@ -32,6 +33,7 @@ import unittest > > from webkitpy.port.factory import PortFactory > from webkitpy.port import server_process >+from webkitpy.common.ipc_pipe_testcase import DummyProcessPipe > from webkitpy.common.system.systemhost import SystemHost > from webkitpy.common.system.systemhost_mock import MockSystemHost > from webkitpy.common.system.outputcapture import OutputCapture >@@ -53,48 +55,11 @@ class TrivialMockPort(object): > return 1 > > >-class MockFile(object): >- def __init__(self, server_process): >- self._server_process = server_process >- self.closed = False >- >- def fileno(self): >- return 1 >- >- def write(self, line): >- self._server_process.broken_pipes.append(self) >- raise IOError >- >- def read(self, size=0): >- # This means end of file >- return '' >- >- def close(self): >- self.closed = True >- >- >-class MockProc(object): >- def __init__(self, server_process): >- self.stdin = MockFile(server_process) >- self.stdout = MockFile(server_process) >- self.stderr = MockFile(server_process) >- self.pid = 1 >- >- def poll(self): >- return 1 >- >- def wait(self): >- return 0 >- >- > class FakeServerProcess(server_process.ServerProcess): > def _start(self): >- self._proc = MockProc(self) >- self.stdin = self._proc.stdin >- self.stdout = self._proc.stdout >- self.stderr = self._proc.stderr >- self._pid = self._proc.pid >- self.broken_pipes = [] >+ self._pipe = DummyProcessPipe(self._port, self._cmd, self._env, self._universal_newlines) >+ self._pid = self._pipe.pid() >+ self._pipe.connectedForTesting = False > > > class TestServerProcess(unittest.TestCase): >@@ -135,9 +100,7 @@ class TestServerProcess(unittest.TestCas > server_process = FakeServerProcess(port_obj=port_obj, name="test", cmd=["test"]) > server_process._start() > server_process.stop() >- self.assertTrue(server_process.stdin.closed) >- self.assertTrue(server_process.stdout.closed) >- self.assertTrue(server_process.stderr.closed) >+ self.assertIsNone(server_process._pipe) > > def test_broken_pipe(self): > port_obj = TrivialMockPort() >@@ -146,13 +109,12 @@ class TestServerProcess(unittest.TestCas > server_process = FakeServerProcess(port_obj=port_obj, name="test", cmd=["test"]) > server_process.write("should break") > self.assertTrue(server_process.has_crashed()) >- self.assertIsNotNone(server_process.pid()) >- self.assertIsNone(server_process._proc) >- self.assertEqual(server_process.broken_pipes, [server_process.stdin]) >+ self.assertIsNone(server_process._pipe) >+ self.assertIsNone(server_process.pid()) > > port_obj.host.platform.os_name = 'mac' > server_process = FakeServerProcess(port_obj=port_obj, name="test", cmd=["test"]) > server_process.write("should break") > self.assertTrue(server_process.has_crashed()) >- self.assertIsNone(server_process._proc) >- self.assertEqual(server_process.broken_pipes, [server_process.stdin]) >+ self.assertIsNone(server_process._pipe) >+ self.assertIsNone(server_process.pid()) >Index: Tools/Scripts/webkitpy/style/checkers/python.py >=================================================================== >--- Tools/Scripts/webkitpy/style/checkers/python.py (revision 209886) >+++ Tools/Scripts/webkitpy/style/checkers/python.py (working copy) >@@ -103,7 +103,7 @@ class Pylinter(object): > > def run(self, argv): > output = _FilteredStringIO(self.FALSE_POSITIVES) >- lint.Run(['--rcfile', self._pylintrc] + argv, reporter=ParseableTextReporter(output=output), exit=False) >+ lint.Run(['--ignored-classes=_socketobject', '--rcfile', self._pylintrc] + argv, reporter=ParseableTextReporter(output=output), exit=False) > return output > > >Index: Tools/TestRunnerShared/unixLoggingPipes.h >=================================================================== >--- Tools/TestRunnerShared/unixLoggingPipes.h (nonexistent) >+++ Tools/TestRunnerShared/unixLoggingPipes.h (working copy) >@@ -0,0 +1,36 @@ >+/* >+ * Copyright (C) 2016 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * 3. Neither the name of Apple Inc. ("Apple") nor the names of >+ * its contributors may be used to endorse or promote products derived >+ * from this software without specific prior written permission. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED >+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY >+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES >+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; >+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND >+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF >+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+namespace WTR { >+ >+void setupUnixLoggingPipes(); >+void teardownUnixLoggingPipes(); >+ >+} >Index: Tools/TestRunnerShared/unixLoggingPipes.mm >=================================================================== >--- Tools/TestRunnerShared/unixLoggingPipes.mm (nonexistent) >+++ Tools/TestRunnerShared/unixLoggingPipes.mm (working copy) >@@ -0,0 +1,90 @@ >+/* >+ * Copyright (C) 2016 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * 3. Neither the name of Apple Inc. ("Apple") nor the names of >+ * its contributors may be used to endorse or promote products derived >+ * from this software without specific prior written permission. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED >+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY >+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES >+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; >+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND >+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF >+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#import "config.h" >+#import "unixLoggingPipes.h" >+ >+#import <netdb.h> >+#import <sys/un.h> >+ >+namespace WTR { >+ >+static const int STDIN_INDEX = 0; >+static const int STDOUT_INDEX = 1; >+static const int STDERR_INDEX = 2; >+static const int NUM_SOCKETS = 3; >+ >+static int sockets[NUM_SOCKETS]; >+static struct sockaddr_un address[NUM_SOCKETS]; >+static FILE* oldFiles[NUM_SOCKETS]; >+static FILE** files[NUM_SOCKETS]; >+ >+void setupUnixLoggingPipes() >+{ >+ const char* identifier = getenv("IPC_IDENTIFIER"); >+ const char *socketPaths[3]; >+ socketPaths[STDIN_INDEX] = [[NSString stringWithFormat:@"/tmp/%s_IN", identifier] UTF8String]; >+ socketPaths[STDOUT_INDEX] = [[NSString stringWithFormat:@"/tmp/%s_OUT", identifier] UTF8String]; >+ socketPaths[STDERR_INDEX] = [[NSString stringWithFormat:@"/tmp/%s_ERROR", identifier] UTF8String]; >+ >+ files[STDIN_INDEX] = &stdin; >+ files[STDOUT_INDEX] = &stdout; >+ files[STDERR_INDEX] = &stderr; >+ >+ for (int i = 0; i < NUM_SOCKETS; ++i) { >+ sockets[i] = socket(AF_UNIX, SOCK_STREAM, 0); >+ memset((char*) &address[i], 0, sizeof(address[i])); >+ address[i].sun_family = AF_UNIX; >+ strncpy(address[i].sun_path, socketPaths[i], sizeof(address[i].sun_path)); >+ >+ if (::connect(sockets[i], (struct sockaddr*) &address[i], sizeof(address[i])) < 0) >+ abort(); >+ oldFiles[i] = *files[i]; >+ fflush(oldFiles[i]); >+ if (i == STDIN_INDEX) >+ *files[i] = fdopen(sockets[i], "rb"); >+ else >+ *files[i] = fdopen(sockets[i], "wb"); >+ setlinebuf(*files[i]); >+ } >+ fprintf(stderr, "#PID: %d\n", getpid()); >+} >+ >+void teardownUnixLoggingPipes() >+{ >+ for (int i = 0; i < NUM_SOCKETS; ++i) { >+ fflush(*files[i]); >+ fclose(*files[i]); >+ >+ shutdown(sockets[i], SHUT_RDWR); >+ ::close(sockets[i]); >+ *files[i] = oldFiles[i]; >+ } >+} >+ >+} >Index: Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj >=================================================================== >--- Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj (revision 209886) >+++ Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj (working copy) >@@ -74,6 +74,7 @@ > 2E63EDA11891B291002A7AFC /* AccessibilityUIElementIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2E63ED781891ACE9002A7AFC /* AccessibilityUIElementIOS.mm */; }; > 2E63EDA61891BDC0002A7AFC /* TestRunner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCC9981711D3F51E0017BCA2 /* TestRunner.cpp */; }; > 2E749BF21891EBFA007FC175 /* EventSenderProxyIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2E63ED7A1891ACE9002A7AFC /* EventSenderProxyIOS.mm */; }; >+ 31B09CC41E033530006F4E4D /* unixLoggingPipes.mm in Sources */ = {isa = PBXBuildFile; fileRef = 31B09CC31E033440006F4E4D /* unixLoggingPipes.mm */; }; > 51058AD51D678820009A538C /* libWebCoreTestSupport.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 41230E16138C78BF00BCCFCA /* libWebCoreTestSupport.dylib */; }; > 51058AD61D678825009A538C /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0F5169CA1445222D00E0A9D7 /* WebKit.framework */; }; > 5641E2D014335E95008307E5 /* JSTextInputController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5641E2CE14335E95008307E5 /* JSTextInputController.cpp */; }; >@@ -256,6 +257,8 @@ > 2EE52D161890A9FB0010ED21 /* mainIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = mainIOS.mm; path = ../ios/mainIOS.mm; sourceTree = "<group>"; }; > 3110BE0F15BA011400D216AC /* WebNotificationProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebNotificationProvider.h; sourceTree = "<group>"; }; > 3164C8EF15D1ADA100EF1FE0 /* WebNotificationProvider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebNotificationProvider.cpp; sourceTree = "<group>"; }; >+ 31B09CC21E033440006F4E4D /* unixLoggingPipes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = unixLoggingPipes.h; path = ../TestRunnerShared/unixLoggingPipes.h; sourceTree = "<group>"; }; >+ 31B09CC31E033440006F4E4D /* unixLoggingPipes.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = unixLoggingPipes.mm; path = ../TestRunnerShared/unixLoggingPipes.mm; sourceTree = "<group>"; }; > 378D442213346D00006A777B /* config.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = "<group>"; }; > 41230E16138C78BF00BCCFCA /* libWebCoreTestSupport.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; path = libWebCoreTestSupport.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; > 4181731B138AD39D0057AAA4 /* WebCoreTestSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebCoreTestSupport.h; path = WebCoreTestSupport/WebCoreTestSupport.h; sourceTree = BUILT_PRODUCTS_DIR; }; >@@ -456,6 +459,8 @@ > 0F18E71A1D6BC4BC0027E547 /* TestRunnerShared */ = { > isa = PBXGroup; > children = ( >+ 31B09CC21E033440006F4E4D /* unixLoggingPipes.h */, >+ 31B09CC31E033440006F4E4D /* unixLoggingPipes.mm */, > 0F18E71B1D6BC4E60027E547 /* Bindings */, > 0F73B5471BA782FE004B3EF4 /* UIScriptContext */, > ); >@@ -953,6 +958,7 @@ > 2E749BF21891EBFA007FC175 /* EventSenderProxyIOS.mm in Sources */, > 0FEBF85A1BB61DF20028722D /* HIDEventGenerator.mm in Sources */, > 2E63ED941891ADAD002A7AFC /* mainIOS.mm in Sources */, >+ 31B09CC41E033530006F4E4D /* unixLoggingPipes.mm in Sources */, > 2E63ED911891ADAD002A7AFC /* PlatformWebViewIOS.mm in Sources */, > 2E63ED921891ADAD002A7AFC /* TestControllerIOS.mm in Sources */, > ); >Index: Tools/WebKitTestRunner/ios/TestControllerIOS.mm >=================================================================== >--- Tools/WebKitTestRunner/ios/TestControllerIOS.mm (revision 209886) >+++ Tools/WebKitTestRunner/ios/TestControllerIOS.mm (working copy) >@@ -26,11 +26,13 @@ > #import "config.h" > #import "TestController.h" > >+ > #import "PlatformWebView.h" > #import "TestInvocation.h" > #import "TestRunnerWKWebView.h" > #import <Foundation/Foundation.h> > #import <UIKit/UIKit.h> >+#import "unixLoggingPipes.h" > #import <WebKit/WKPreferencesRefPrivate.h> > #import <WebKit/WKProcessPoolPrivate.h> > #import <WebKit/WKStringCF.h> >@@ -47,21 +49,12 @@ void TestController::notifyDone() > > void TestController::platformInitialize() > { >- const char* identifier = getenv("IPC_IDENTIFIER"); >- const char *stdinPath = [[NSString stringWithFormat:@"/tmp/%s_IN", identifier] UTF8String]; >- const char *stdoutPath = [[NSString stringWithFormat:@"/tmp/%s_OUT", identifier] UTF8String]; >- const char *stderrPath = [[NSString stringWithFormat:@"/tmp/%s_ERROR", identifier] UTF8String]; >- >- int infd = open(stdinPath, O_RDWR); >- dup2(infd, STDIN_FILENO); >- int outfd = open(stdoutPath, O_RDWR); >- dup2(outfd, STDOUT_FILENO); >- int errfd = open(stderrPath, O_RDWR | O_NONBLOCK); >- dup2(errfd, STDERR_FILENO); >+ setupUnixLoggingPipes(); > } > > void TestController::platformDestroy() > { >+ teardownUnixLoggingPipes(); > } > > void TestController::initializeInjectedBundlePath()
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 165927
:
297242
|
297244
|
297250
|
297325
|
297333
|
297341
|
298112
|
298113
|
298114
|
298480
|
298485
|
298790
|
298791
|
298792
|
298794
|
299251
|
299284
|
299554
|
299619
|
299846
|
299874
|
299965
|
299967
|
299984
|
300076
|
300113
|
300129
|
301048