<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[214553] trunk/Tools</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/214553">214553</a></dd>
<dt>Author</dt> <dd>jbedard@apple.com</dd>
<dt>Date</dt> <dd>2017-03-29 12:23:32 -0700 (Wed, 29 Mar 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Use TCP instead of FIFOs for Simulator/Device communication
https://bugs.webkit.org/show_bug.cgi?id=169419
&lt;rdar://problem/30949615&gt;

Reviewed by Alexey Proskuryakov.

Using TCP instead of FIFOs when communicating with devices allows the device being tested
to be on a different machine then the one handling the management of the test run.

* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
* DumpRenderTree/mac/DumpRenderTree.mm:
(dumpRenderTree): Call setUp/tearDownIOSLayoutTestCommunication() instead of using FIFOs.
* Scripts/webkitpy/port/device.py:
(Device.__init__): Initialize the listening_socket.
(Device.listening_port): Return port of listening socket.
(Device.prepare_for_testing): Open listening socket on an open port, prepare platform device
fro testing.
(Device.finished_testing): Close listening socket associated with this device, call the
platform device's finished_testing function if it exists.
* Scripts/webkitpy/port/ios.py:
(IOSPort.setup_test_run): Prepare each device for testing.
(IOSPort.clean_up_test_run): Notify each device that testing has completed.
* Scripts/webkitpy/port/ios_simulator.py:
(IOSSimulatorPort): Work around device persistence bug.
(IOSSimulatorPort.__init__): Ditto.
* Scripts/webkitpy/port/simulator_process.py:
(SimulatorProcess):
(SimulatorProcess.NonBlockingFileFromSocket): Add to work around shortcomings in
Python 2’s makefile.
(SimulatorProcess.NonBlockingFileFromSocket.__init__): Initialize file with socket.
(SimulatorProcess.ReadFileSocket.close): Close file and then socket;
(SimulatorProcess.__init__): Pass TCP port over environment, remove FIFO names.
(SimulatorProcess.__getattr__): Expose all file attributes.
(SimulatorProcess._accept_connection_create_file): Wait for connection from server and
create and return a file-like object from the incoming connection.
(SimulatorProcess._start): Use TCP connections instead of FIFOs.
(SimulatorProcess._start.handler): Output server port in timeout exception.
(SimulatorProcess._reset): Deleted.
* TestRunnerShared/IOSLayoutTestCommunication.cpp: Added.
(connectToServer): Return socket connected to the provided server address.
(setupiOSLayoutTestCommunication): Connect stdin, stdout and stderr as socket to a
TCP server running on localhost.
(tearDownIOSLayoutTestCommunication): Close stdin, stdout and stderr TCP sockets.
* TestRunnerShared/IOSLayoutTestCommunication.h: Added.
* WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
* WebKitTestRunner/ios/TestControllerIOS.mm:
(WTR::TestController::platformInitialize): Call setUpIOSLayoutTestCommunication()
instead of using FIFOs.
(WTR::TestController::platformDestroy): Call tearDownIOSLayoutTestCommunication().</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsDumpRenderTreeDumpRenderTreexcodeprojprojectpbxproj">trunk/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkToolsDumpRenderTreemacDumpRenderTreemm">trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm</a></li>
<li><a href="#trunkToolsScriptswebkitpyportdevicepy">trunk/Tools/Scripts/webkitpy/port/device.py</a></li>
<li><a href="#trunkToolsScriptswebkitpyportiospy">trunk/Tools/Scripts/webkitpy/port/ios.py</a></li>
<li><a href="#trunkToolsScriptswebkitpyportios_simulatorpy">trunk/Tools/Scripts/webkitpy/port/ios_simulator.py</a></li>
<li><a href="#trunkToolsScriptswebkitpyportsimulator_processpy">trunk/Tools/Scripts/webkitpy/port/simulator_process.py</a></li>
<li><a href="#trunkToolsWebKitTestRunnerWebKitTestRunnerxcodeprojprojectpbxproj">trunk/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkToolsWebKitTestRunneriosTestControllerIOSmm">trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkToolsTestRunnerSharedIOSLayoutTestCommunicationcpp">trunk/Tools/TestRunnerShared/IOSLayoutTestCommunication.cpp</a></li>
<li><a href="#trunkToolsTestRunnerSharedIOSLayoutTestCommunicationh">trunk/Tools/TestRunnerShared/IOSLayoutTestCommunication.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (214552 => 214553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2017-03-29 19:23:21 UTC (rev 214552)
+++ trunk/Tools/ChangeLog        2017-03-29 19:23:32 UTC (rev 214553)
</span><span class="lines">@@ -1,5 +1,57 @@
</span><span class="cx"> 2017-03-29  Jonathan Bedard  &lt;jbedard@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Use TCP instead of FIFOs for Simulator/Device communication
+        https://bugs.webkit.org/show_bug.cgi?id=169419
+        &lt;rdar://problem/30949615&gt;
+
+        Reviewed by Alexey Proskuryakov.
+
+        Using TCP instead of FIFOs when communicating with devices allows the device being tested
+        to be on a different machine then the one handling the management of the test run.
+
+        * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (dumpRenderTree): Call setUp/tearDownIOSLayoutTestCommunication() instead of using FIFOs.
+        * Scripts/webkitpy/port/device.py:
+        (Device.__init__): Initialize the listening_socket.
+        (Device.listening_port): Return port of listening socket.
+        (Device.prepare_for_testing): Open listening socket on an open port, prepare platform device
+        fro testing.
+        (Device.finished_testing): Close listening socket associated with this device, call the
+        platform device's finished_testing function if it exists.
+        * Scripts/webkitpy/port/ios.py:
+        (IOSPort.setup_test_run): Prepare each device for testing.
+        (IOSPort.clean_up_test_run): Notify each device that testing has completed.
+        * Scripts/webkitpy/port/ios_simulator.py:
+        (IOSSimulatorPort): Work around device persistence bug.
+        (IOSSimulatorPort.__init__): Ditto.
+        * Scripts/webkitpy/port/simulator_process.py:
+        (SimulatorProcess):
+        (SimulatorProcess.NonBlockingFileFromSocket): Add to work around shortcomings in
+        Python 2’s makefile.
+        (SimulatorProcess.NonBlockingFileFromSocket.__init__): Initialize file with socket.
+        (SimulatorProcess.ReadFileSocket.close): Close file and then socket;
+        (SimulatorProcess.__init__): Pass TCP port over environment, remove FIFO names.
+        (SimulatorProcess.__getattr__): Expose all file attributes.
+        (SimulatorProcess._accept_connection_create_file): Wait for connection from server and
+        create and return a file-like object from the incoming connection.
+        (SimulatorProcess._start): Use TCP connections instead of FIFOs.
+        (SimulatorProcess._start.handler): Output server port in timeout exception.
+        (SimulatorProcess._reset): Deleted.
+        * TestRunnerShared/IOSLayoutTestCommunication.cpp: Added.
+        (connectToServer): Return socket connected to the provided server address.
+        (setupiOSLayoutTestCommunication): Connect stdin, stdout and stderr as socket to a
+        TCP server running on localhost.
+        (tearDownIOSLayoutTestCommunication): Close stdin, stdout and stderr TCP sockets.
+        * TestRunnerShared/IOSLayoutTestCommunication.h: Added.
+        * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
+        * WebKitTestRunner/ios/TestControllerIOS.mm:
+        (WTR::TestController::platformInitialize): Call setUpIOSLayoutTestCommunication()
+        instead of using FIFOs.
+        (WTR::TestController::platformDestroy): Call tearDownIOSLayoutTestCommunication().
+
+2017-03-29  Jonathan Bedard  &lt;jbedard@apple.com&gt;
+
</ins><span class="cx">         webkitpy: Add IOSDevicePort and IOSPort tests
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=170206
</span><span class="cx">         &lt;rdar://problem/31308364&gt;
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreeDumpRenderTreexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj (214552 => 214553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj        2017-03-29 19:23:21 UTC (rev 214552)
+++ trunk/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj        2017-03-29 19:23:32 UTC (rev 214553)
</span><span class="lines">@@ -80,6 +80,7 @@
</span><span class="cx">                 2D403F1B15087209005358D2 /* LayoutTestHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D403EA215087142005358D2 /* LayoutTestHelper.m */; };
</span><span class="cx">                 2DA2E3A51E1BA54100A3BBD0 /* DumpRenderTreeSpellChecker.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2DA2E3A41E1BA54100A3BBD0 /* DumpRenderTreeSpellChecker.mm */; };
</span><span class="cx">                 31117B3D15D9A56A00163BC8 /* MockWebNotificationProvider.mm in Sources */ = {isa = PBXBuildFile; fileRef = 31117B3B15D9A56A00163BC8 /* MockWebNotificationProvider.mm */; };
</span><ins>+                312943F91E71F2B4001EE2CC /* IOOSLayoutTestCommunication.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3148A0551E6F90F400D3B316 /* IOSLayoutTestCommunication.cpp */; };
</ins><span class="cx">                 4464CABE1C20A08B00E5BB55 /* DumpRenderTreeAppMain.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4464CABD1C20A07000E5BB55 /* DumpRenderTreeAppMain.mm */; };
</span><span class="cx">                 4AD6A11413C8124000EA9737 /* FormValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4AD6A11313C8124000EA9737 /* FormValue.cpp */; };
</span><span class="cx">                 5106803E15CC7B10001A8A23 /* SlowNPPNew.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5106803D15CC7B10001A8A23 /* SlowNPPNew.cpp */; };
</span><span class="lines">@@ -294,6 +295,8 @@
</span><span class="cx">                 2DA2E3A41E1BA54100A3BBD0 /* DumpRenderTreeSpellChecker.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = DumpRenderTreeSpellChecker.mm; path = mac/DumpRenderTreeSpellChecker.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 31117B3A15D9A56A00163BC8 /* MockWebNotificationProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MockWebNotificationProvider.h; path = mac/MockWebNotificationProvider.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 31117B3B15D9A56A00163BC8 /* MockWebNotificationProvider.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MockWebNotificationProvider.mm; path = mac/MockWebNotificationProvider.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                3148A0551E6F90F400D3B316 /* IOSLayoutTestCommunication.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IOSLayoutTestCommunication.cpp; path = ../TestRunnerShared/IOSLayoutTestCommunication.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                3148A0561E6F90F400D3B316 /* IOSLayoutTestCommunication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IOSLayoutTestCommunication.h; path = ../TestRunnerShared/IOSLayoutTestCommunication.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 32A70AAB03705E1F00C91783 /* DumpRenderTreePrefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DumpRenderTreePrefix.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 375F09710DAC3CB600C8B4E5 /* WebKitWeightWatcher100.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = WebKitWeightWatcher100.ttf; path = fonts/WebKitWeightWatcher100.ttf; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 375F09720DAC3CB600C8B4E5 /* WebKitWeightWatcher200.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = WebKitWeightWatcher200.ttf; path = fonts/WebKitWeightWatcher200.ttf; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -472,6 +475,7 @@
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="cx">                                 0F18E6F11D6B9C640027E547 /* DerivedSources.make */,
</span><ins>+                                3148A0651E6F90F400D3B316 /* TestRunnerShared */,
</ins><span class="cx">                                 0F18E6E71D6B9BF50027E547 /* UIScriptContext */,
</span><span class="cx">                                 A1158D6A18927CE10088C17B /* ios */,
</span><span class="cx">                                 A134E53418905E6C00901D06 /* config.h */,
</span><span class="lines">@@ -695,6 +699,16 @@
</span><span class="cx">                         name = LayoutTestHelper;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="cx">                 };
</span><ins>+                3148A0651E6F90F400D3B316 /* TestRunnerShared */ = {
+                        isa = PBXGroup;
+                        children = (
+                                3148A0551E6F90F400D3B316 /* IOSLayoutTestCommunication.cpp */,
+                                3148A0561E6F90F400D3B316 /* IOSLayoutTestCommunication.h */,
+                        );
+                        name = TestRunnerShared;
+                        path = ../WebKitTestRunner;
+                        sourceTree = &quot;&lt;group&gt;&quot;;
+                };
</ins><span class="cx">                 417DA9181373674D007C57FB /* WebCoreTestSupport */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="lines">@@ -1145,6 +1159,7 @@
</span><span class="cx">                                 7CBBC3231DDFCF9A00786B9D /* TestOptions.mm in Sources */,
</span><span class="cx">                                 0F18E70F1D6BACB60027E547 /* UIScriptControllerMac.mm in Sources */,
</span><span class="cx">                                 BC9D90240C97472E0099A4A3 /* WorkQueue.cpp in Sources */,
</span><ins>+                                312943F91E71F2B4001EE2CC /* IOSLayoutTestCommunication.cpp in Sources */,
</ins><span class="cx">                                 BCA18B260C9B015C00114369 /* WorkQueueItemMac.mm in Sources */,
</span><span class="cx">                         );
</span><span class="cx">                         runOnlyForDeploymentPostprocessing = 0;
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreemacDumpRenderTreemm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm (214552 => 214553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm        2017-03-29 19:23:21 UTC (rev 214552)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm        2017-03-29 19:23:32 UTC (rev 214553)
</span><span class="lines">@@ -103,6 +103,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> #import &quot;DumpRenderTreeBrowserView.h&quot;
</span><ins>+#import &quot;IOSLayoutTestCommunication.h&quot;
</ins><span class="cx"> #import &quot;UIKitSPI.h&quot;
</span><span class="cx"> #import &lt;QuartzCore/QuartzCore.h&gt;
</span><span class="cx"> #import &lt;WebCore/CoreGraphicsSPI.h&gt;
</span><span class="lines">@@ -1236,17 +1237,7 @@
</span><span class="cx"> void dumpRenderTree(int argc, const char *argv[])
</span><span class="cx"> {
</span><span class="cx"> #if PLATFORM(IOS)
</span><del>-    const char* identifier = getenv(&quot;IPC_IDENTIFIER&quot;);
-    const char *stdinPath = [[NSString stringWithFormat:@&quot;/tmp/%s_IN&quot;, identifier] UTF8String];
-    const char *stdoutPath = [[NSString stringWithFormat:@&quot;/tmp/%s_OUT&quot;, identifier] UTF8String];
-    const char *stderrPath = [[NSString stringWithFormat:@&quot;/tmp/%s_ERROR&quot;, 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);
</del><ins>+    setUpIOSLayoutTestCommunication();
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     signal(SIGILL, &amp;writeCrashedMessageOnFatalError);
</span><span class="lines">@@ -1307,9 +1298,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><del>-    close(infd);
-    close(outfd);
-    close(errfd);
</del><ins>+    tearDownIOSLayoutTestCommunication();
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpyportdevicepy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/port/device.py (214552 => 214553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/port/device.py        2017-03-29 19:23:21 UTC (rev 214552)
+++ trunk/Tools/Scripts/webkitpy/port/device.py        2017-03-29 19:23:32 UTC (rev 214553)
</span><span class="lines">@@ -20,11 +20,18 @@
</span><span class="cx"> # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
</span><span class="cx"> # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> 
</span><ins>+import socket
</ins><span class="cx"> 
</span><span class="cx"> class Device(object):
</span><span class="cx">     def __init__(self, platform_device):
</span><span class="cx">         self.platform_device = platform_device
</span><ins>+        self.listening_socket = None
</ins><span class="cx"> 
</span><ins>+    def listening_port(self):
+        if not self.listening_socket:
+            return None
+        return self.listening_socket.getsockname()[1]
+
</ins><span class="cx">     def install_app(self, app_path, env=None):
</span><span class="cx">         return self.platform_device.install_app(app_path, env)
</span><span class="cx"> 
</span><span class="lines">@@ -31,6 +38,21 @@
</span><span class="cx">     def launch_app(self, bundle_id, args, env=None):
</span><span class="cx">         return self.platform_device.launch_app(bundle_id, args, env)
</span><span class="cx"> 
</span><ins>+    def prepare_for_testing(self):
+        if not self.listening_socket:
+            self.listening_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+            self.listening_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
+            self.listening_socket.bind(('127.0.0.1', 0))
+
+        if hasattr(self.platform_device, 'prepare_for_testing'):
+            self.platform_device.prepare_for_testing()
+
+    def finished_testing(self):
+        if hasattr(self.platform_device, 'teardown'):
+            self.platform_device.finished_testing()
+
+        self.listening_socket = None
+
</ins><span class="cx">     @property
</span><span class="cx">     def executive(self):
</span><span class="cx">         return self.platform_device.executive
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpyportiospy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/port/ios.py (214552 => 214553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/port/ios.py        2017-03-29 19:23:21 UTC (rev 214552)
+++ trunk/Tools/Scripts/webkitpy/port/ios.py        2017-03-29 19:23:32 UTC (rev 214553)
</span><span class="lines">@@ -117,3 +117,12 @@
</span><span class="cx">             # crash, but this crash will occur post-launch, after install_app has already killed the process.
</span><span class="cx">             if not device.install_app(self._path_to_driver(), {'DYLD_LIBRARY_PATH': self._build_path()}):
</span><span class="cx">                 raise RuntimeError('Failed to install app {} on device {}'.format(self._path_to_driver(), device.udid))
</span><ins>+
+        for i in xrange(self.child_processes()):
+            self.device_for_worker_number(i).prepare_for_testing()
+
+    def clean_up_test_run(self):
+        super(IOSPort, self).clean_up_test_run()
+
+        for i in xrange(self.child_processes()):
+            self.device_for_worker_number(i).finished_testing()
</ins></span></pre></div>
<a id="trunkToolsScriptswebkitpyportios_simulatorpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/port/ios_simulator.py (214552 => 214553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/port/ios_simulator.py        2017-03-29 19:23:21 UTC (rev 214552)
+++ trunk/Tools/Scripts/webkitpy/port/ios_simulator.py        2017-03-29 19:23:32 UTC (rev 214553)
</span><span class="lines">@@ -66,7 +66,10 @@
</span><span class="cx">         },
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    #FIXME: Ports are recreated in each process. This is a problem for IOSSimulatorPort, it means devices are not
+    # persistent and devices hold a listening socket expected to be persistent across processes.
</ins><span class="cx">     _DEVICE_MAP = {}
</span><ins>+    _CURRENT_DEVICE = None
</ins><span class="cx"> 
</span><span class="cx">     def __init__(self, host, port_name, **kwargs):
</span><span class="cx">         super(IOSSimulatorPort, self).__init__(host, port_name, **kwargs)
</span><span class="lines">@@ -75,7 +78,9 @@
</span><span class="cx">         self._device_class = optional_device_class if optional_device_class else self.DEFAULT_DEVICE_CLASS
</span><span class="cx">         _log.debug('IOSSimulatorPort _device_class is %s', self._device_class)
</span><span class="cx"> 
</span><del>-        self._current_device = Device(Simulator(host).current_device())
</del><ins>+        if not IOSSimulatorPort._CURRENT_DEVICE:
+            IOSSimulatorPort._CURRENT_DEVICE = Device(Simulator(host).current_device())
+        self._current_device = IOSSimulatorPort._CURRENT_DEVICE
</ins><span class="cx">         if not self._current_device:
</span><span class="cx">             self.set_option('dedicated_simulators', True)
</span><span class="cx">         if not self.get_option('dedicated_simulators'):
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpyportsimulator_processpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/port/simulator_process.py (214552 => 214553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/port/simulator_process.py        2017-03-29 19:23:21 UTC (rev 214552)
+++ trunk/Tools/Scripts/webkitpy/port/simulator_process.py        2017-03-29 19:23:32 UTC (rev 214553)
</span><span class="lines">@@ -54,64 +54,60 @@
</span><span class="cx">                 time.sleep(0.01)  # In seconds
</span><span class="cx">             return self.returncode
</span><span class="cx"> 
</span><ins>+    # Python 2's implementation of makefile does not return a non-blocking file.
+    class NonBlockingFileFromSocket(object):
+
+        def __init__(self, sock, type):
+            self.socket = sock
+            self._file = os.fdopen(sock.fileno(), type, 0)
+            ServerProcess._set_file_nonblocking(self._file)
+
+        def __getattr__(self, name):
+            return getattr(self._file, name)
+
+        def close(self):
+            result = self._file.close()
+            self.socket.close()
+            return result
+
+
</ins><span class="cx">     def __init__(self, port_obj, name, cmd, env=None, universal_newlines=False, treat_no_data_as_crash=False, worker_number=None):
</span><span class="cx">         self._bundle_id = port_obj.app_identifier_from_bundle(cmd[0])
</span><span class="cx">         self._device = port_obj.device_for_worker_number(worker_number)
</span><del>-        env['IPC_IDENTIFIER'] = self._bundle_id + '-' + self._device.udid
</del><span class="cx"> 
</span><del>-        # This location matches the location used by WebKitTestRunner and DumpRenderTree
-        # for the other side of these fifos.
-        file_location = '/tmp/' + env['IPC_IDENTIFIER']
-        self._in_path = file_location + '_IN'
-        self._out_path = file_location + '_OUT'
-        self._error_path = file_location + '_ERROR'
-
</del><ins>+        env['PORT'] = str(self._device.listening_port())
</ins><span class="cx">         super(SimulatorProcess, self).__init__(port_obj, name, cmd, env, universal_newlines, treat_no_data_as_crash)
</span><span class="cx"> 
</span><del>-    def _reset(self):
-        super(SimulatorProcess, self)._reset()
</del><ins>+    @staticmethod
+    def _accept_connection_create_file(server, type):
+        connection, address = server.accept()
+        assert address[0] == '127.0.0.1'
+        return SimulatorProcess.NonBlockingFileFromSocket(connection, type)
</ins><span class="cx"> 
</span><del>-        # Unlinks are needed on reset in the event that the Python code unexpectedly
-        # fails between _start() and kill().  This can be caused by a SIGKILL or a crash.
-        # This ensures that os.mkfifo() will not be obstructed by previous fifos.
-        # Other files will still cause os.mkfifo() to fail.
-        try:
-            os.unlink(self._in_path)
-        except:
-            pass
-        try:
-            os.unlink(self._out_path)
-        except:
-            pass
-        try:
-            os.unlink(self._error_path)
-        except:
-            pass
-
</del><span class="cx">     def _start(self):
</span><span class="cx">         if self._proc:
</span><span class="cx">             raise ValueError('{} already running'.format(self._name))
</span><span class="cx">         self._reset()
</span><span class="cx"> 
</span><del>-        FIFO_PERMISSION_FLAGS = 0600  # Only owner can read and write
-        os.mkfifo(self._in_path, FIFO_PERMISSION_FLAGS)
-        os.mkfifo(self._out_path, FIFO_PERMISSION_FLAGS)
-        os.mkfifo(self._error_path, FIFO_PERMISSION_FLAGS)
-
-        stdout = os.fdopen(os.open(self._out_path, os.O_RDONLY | os.O_NONBLOCK), 'rb')
-        stderr = os.fdopen(os.open(self._error_path, os.O_RDONLY | os.O_NONBLOCK), 'rb')
-
</del><ins>+        # Each device has a listening socket intitilaized during the port's setup_test_run.
+        # 3 client connections will be accepted for stdin, stdout and stderr in that order.
+        self._device.listening_socket.listen(3)
</ins><span class="cx">         self._pid = self._device.launch_app(self._bundle_id, self._cmd[1:], env=self._env)
</span><span class="cx"> 
</span><span class="cx">         def handler(signum, frame):
</span><span class="cx">             assert signum == signal.SIGALRM
</span><del>-            raise Exception('Timed out waiting for process to open {}'.format(self._in_path))
</del><ins>+            raise Exception('Timed out waiting for process to connect at port {}'.format(self._device.listening_port()))
</ins><span class="cx">         signal.signal(signal.SIGALRM, handler)
</span><span class="cx">         signal.alarm(3)  # In seconds
</span><span class="cx"> 
</span><span class="cx">         stdin = None
</span><ins>+        stdout = None
+        stderr = None
</ins><span class="cx">         try:
</span><del>-            stdin = open(self._in_path, 'w', 0)  # Opening with no buffering, like popen
</del><ins>+            # This order matches the client side connections in Tools/TestRunnerShared/IOSLayoutTestCommunication.cpp setUpIOSLayoutTestCommunication()
+            stdin = SimulatorProcess._accept_connection_create_file(self._device.listening_socket, 'w')
+            stdout = SimulatorProcess._accept_connection_create_file(self._device.listening_socket, 'rb')
+            stderr = SimulatorProcess._accept_connection_create_file(self._device.listening_socket, 'rb')
</ins><span class="cx">         except:
</span><span class="cx">             # We set self._proc as _reset() and _kill() depend on it.
</span><span class="cx">             self._proc = SimulatorProcess.Popen(self._pid, stdin, stdout, stderr, self._device)
</span></span></pre></div>
<a id="trunkToolsTestRunnerSharedIOSLayoutTestCommunicationcpp"></a>
<div class="addfile"><h4>Added: trunk/Tools/TestRunnerShared/IOSLayoutTestCommunication.cpp (0 => 214553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestRunnerShared/IOSLayoutTestCommunication.cpp                                (rev 0)
+++ trunk/Tools/TestRunnerShared/IOSLayoutTestCommunication.cpp        2017-03-29 19:23:32 UTC (rev 214553)
</span><span class="lines">@@ -0,0 +1,79 @@
</span><ins>+/*
+ * Copyright (C) 2017 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.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;IOSLayoutTestCommunication.h&quot;
+
+#include &lt;netdb.h&gt;
+#include &lt;netinet/in.h&gt;
+#include &lt;sys/socket.h&gt;
+#include &lt;sys/types.h&gt;
+#include &lt;unistd.h&gt;
+#include &lt;wtf/Assertions.h&gt;
+
+static int stdinSocket;
+static int stdoutSocket;
+static int stderrSocket;
+
+static int connectToServer(sockaddr_in&amp; serverAddress)
+{
+    int result = socket(AF_INET, SOCK_STREAM, 0);
+    RELEASE_ASSERT(result &gt;= 0);
+    RELEASE_ASSERT(connect(result, (struct sockaddr *) &amp;serverAddress, sizeof(serverAddress)) &gt;= 0);
+    return result;
+}
+
+void setUpIOSLayoutTestCommunication()
+{
+    int port = atoi(getenv(&quot;PORT&quot;));
+    RELEASE_ASSERT(port &gt; 0);
+
+    struct hostent* host = gethostbyname(&quot;127.0.0.1&quot;);
+    struct sockaddr_in serverAddress;
+    memset((char*) &amp;serverAddress, 0, sizeof(serverAddress));
+    serverAddress.sin_family = AF_INET;
+    memcpy(
+        (char*)&amp;serverAddress.sin_addr.s_addr,
+        (char*)host-&gt;h_addr,
+        host-&gt;h_length);
+    serverAddress.sin_port = htons(port);
+    
+    // This order matches the server side listener in Tools/Scripts/webkitpy/port/simulator_process.py SimulatorProcess._start()
+    stdinSocket = connectToServer(serverAddress);
+    dup2(stdinSocket, STDIN_FILENO);
+
+    stdoutSocket = connectToServer(serverAddress);
+    dup2(stdoutSocket, STDOUT_FILENO);
+
+    stderrSocket = connectToServer(serverAddress);
+    dup2(stderrSocket, STDERR_FILENO);
+}
+
+void tearDownIOSLayoutTestCommunication()
+{
+    close(stdinSocket);
+    close(stdoutSocket);
+    close(stderrSocket);
+}
</ins></span></pre></div>
<a id="trunkToolsTestRunnerSharedIOSLayoutTestCommunicationh"></a>
<div class="addfile"><h4>Added: trunk/Tools/TestRunnerShared/IOSLayoutTestCommunication.h (0 => 214553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestRunnerShared/IOSLayoutTestCommunication.h                                (rev 0)
+++ trunk/Tools/TestRunnerShared/IOSLayoutTestCommunication.h        2017-03-29 19:23:32 UTC (rev 214553)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+/*
+ * Copyright (C) 2017 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.
+ */
+
+#pragma once
+
+void setUpIOSLayoutTestCommunication();
+void tearDownIOSLayoutTestCommunication();
</ins></span></pre></div>
<a id="trunkToolsWebKitTestRunnerWebKitTestRunnerxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj (214552 => 214553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj        2017-03-29 19:23:21 UTC (rev 214552)
+++ trunk/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj        2017-03-29 19:23:32 UTC (rev 214553)
</span><span class="lines">@@ -73,6 +73,7 @@
</span><span class="cx">                 2E63EDA11891B291002A7AFC /* AccessibilityUIElementIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2E63ED781891ACE9002A7AFC /* AccessibilityUIElementIOS.mm */; };
</span><span class="cx">                 2E63EDA61891BDC0002A7AFC /* TestRunner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCC9981711D3F51E0017BCA2 /* TestRunner.cpp */; };
</span><span class="cx">                 2E749BF21891EBFA007FC175 /* EventSenderProxyIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2E63ED7A1891ACE9002A7AFC /* EventSenderProxyIOS.mm */; };
</span><ins>+                31DA8A3D1E7205CC00E1DF2F /* IOSLayoutTestCommunication.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3148A0531E6F85B600D3B316 /* IOSLayoutTestCommunication.cpp */; };
</ins><span class="cx">                 51058AD51D678820009A538C /* libWebCoreTestSupport.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 41230E16138C78BF00BCCFCA /* libWebCoreTestSupport.dylib */; };
</span><span class="cx">                 51058AD61D678825009A538C /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0F5169CA1445222D00E0A9D7 /* WebKit.framework */; };
</span><span class="cx">                 5641E2D014335E95008307E5 /* JSTextInputController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5641E2CE14335E95008307E5 /* JSTextInputController.cpp */; };
</span><span class="lines">@@ -252,6 +253,8 @@
</span><span class="cx">                 2EE52D141890A9FB0010ED21 /* TestControllerIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TestControllerIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2EE52D161890A9FB0010ED21 /* mainIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = mainIOS.mm; path = ../ios/mainIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 3110BE0F15BA011400D216AC /* WebNotificationProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebNotificationProvider.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                3148A0531E6F85B600D3B316 /* IOSLayoutTestCommunication.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IOSLayoutTestCommunication.cpp; path = ../TestRunnerShared/IOSLayoutTestCommunication.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                3148A0541E6F85B600D3B316 /* IOSLayoutTestCommunication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IOSLayoutTestCommunication.h; path = ../TestRunnerShared/IOSLayoutTestCommunication.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 3164C8EF15D1ADA100EF1FE0 /* WebNotificationProvider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebNotificationProvider.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 378D442213346D00006A777B /* config.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 41230E16138C78BF00BCCFCA /* libWebCoreTestSupport.dylib */ = {isa = PBXFileReference; lastKnownFileType = &quot;compiled.mach-o.dylib&quot;; path = libWebCoreTestSupport.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
</span><span class="lines">@@ -450,6 +453,8 @@
</span><span class="cx">                 0F18E71A1D6BC4BC0027E547 /* TestRunnerShared */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                3148A0531E6F85B600D3B316 /* IOSLayoutTestCommunication.cpp */,
+                                3148A0541E6F85B600D3B316 /* IOSLayoutTestCommunication.h */,
</ins><span class="cx">                                 0F18E71B1D6BC4E60027E547 /* Bindings */,
</span><span class="cx">                                 0F73B5471BA782FE004B3EF4 /* UIScriptContext */,
</span><span class="cx">                         );
</span><span class="lines">@@ -970,6 +975,7 @@
</span><span class="cx">                                 A18510401B9AE13100744AEB /* PixelDumpSupport.cpp in Sources */,
</span><span class="cx">                                 A18510411B9AE13800744AEB /* TestController.cpp in Sources */,
</span><span class="cx">                                 A185103B1B9AE0E200744AEB /* TestControllerCocoa.mm in Sources */,
</span><ins>+                                31DA8A3D1E7205CC00E1DF2F /* IOSLayoutTestCommunication.cpp in Sources */,
</ins><span class="cx">                                 A18510421B9AE13E00744AEB /* TestInvocation.cpp in Sources */,
</span><span class="cx">                                 A185103D1B9AE10600744AEB /* TestInvocationCG.cpp in Sources */,
</span><span class="cx">                                 0F622CE91BBB3A1A00838AD3 /* TestOptions.cpp in Sources */,
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunneriosTestControllerIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm (214552 => 214553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm        2017-03-29 19:23:21 UTC (rev 214552)
+++ trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm        2017-03-29 19:23:32 UTC (rev 214553)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #import &quot;TestController.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #import &quot;HIDEventGenerator.h&quot;
</span><ins>+#import &quot;IOSLayoutTestCommunication.h&quot;
</ins><span class="cx"> #import &quot;PlatformWebView.h&quot;
</span><span class="cx"> #import &quot;TestInvocation.h&quot;
</span><span class="cx"> #import &quot;TestRunnerWKWebView.h&quot;
</span><span class="lines">@@ -49,21 +50,12 @@
</span><span class="cx"> 
</span><span class="cx"> void TestController::platformInitialize()
</span><span class="cx"> {
</span><del>-    const char* identifier = getenv(&quot;IPC_IDENTIFIER&quot;);
-    const char *stdinPath = [[NSString stringWithFormat:@&quot;/tmp/%s_IN&quot;, identifier] UTF8String];
-    const char *stdoutPath = [[NSString stringWithFormat:@&quot;/tmp/%s_OUT&quot;, identifier] UTF8String];
-    const char *stderrPath = [[NSString stringWithFormat:@&quot;/tmp/%s_ERROR&quot;, 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);
</del><ins>+    setUpIOSLayoutTestCommunication();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TestController::platformDestroy()
</span><span class="cx"> {
</span><ins>+    tearDownIOSLayoutTestCommunication();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TestController::initializeInjectedBundlePath()
</span></span></pre>
</div>
</div>

</body>
</html>