- Revision
- 217856
- Author
- [email protected]
- Date
- 2017-06-06 14:02:55 -0700 (Tue, 06 Jun 2017)
Log Message
webkitpy: Return correct process names from SimulatorProcess
https://bugs.webkit.org/show_bug.cgi?id=172940
Reviewed by Aakash Jain.
* Scripts/webkitpy/port/darwin.py:
(DarwinPort.plist_data_from_bundle): Share plist access code for accessing different plist entries.
(DarwinPort.app_identifier_from_bundle): Use plist_data_from_bundle.
(DarwinPort.app_executable_from_bundle): Access name of app executable from provided app bundle.
* Scripts/webkitpy/port/driver.py:
(Driver.has_crashed): Use _server_process.process_name() instead of _server_process.name() since
_server_process.name() will not return the correct process name for iOS.
(Driver._check_for_driver_crash_or_unresponsiveness): Ditto.
(Driver._read_block): Ditto.
* Scripts/webkitpy/port/driver_unittest.py:
(DriverTest.test_check_for_driver_crash.FakeServerProcess.process_name): Update since Driver uses
process_name() instead of name().
* Scripts/webkitpy/port/server_process.py:
(ServerProcess._start): Use process_name() instead of name().
(ServerProcess.stop): Ditto.
(ServerProcess.name): Deleted.
* Scripts/webkitpy/port/simulator_process.py:
(SimulatorProcess.process_name): Check the provided bundle for the process name.
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (217855 => 217856)
--- trunk/Tools/ChangeLog 2017-06-06 20:39:08 UTC (rev 217855)
+++ trunk/Tools/ChangeLog 2017-06-06 21:02:55 UTC (rev 217856)
@@ -1,3 +1,29 @@
+2017-06-06 Jonathan Bedard <[email protected]>
+
+ webkitpy: Return correct process names from SimulatorProcess
+ https://bugs.webkit.org/show_bug.cgi?id=172940
+
+ Reviewed by Aakash Jain.
+
+ * Scripts/webkitpy/port/darwin.py:
+ (DarwinPort.plist_data_from_bundle): Share plist access code for accessing different plist entries.
+ (DarwinPort.app_identifier_from_bundle): Use plist_data_from_bundle.
+ (DarwinPort.app_executable_from_bundle): Access name of app executable from provided app bundle.
+ * Scripts/webkitpy/port/driver.py:
+ (Driver.has_crashed): Use _server_process.process_name() instead of _server_process.name() since
+ _server_process.name() will not return the correct process name for iOS.
+ (Driver._check_for_driver_crash_or_unresponsiveness): Ditto.
+ (Driver._read_block): Ditto.
+ * Scripts/webkitpy/port/driver_unittest.py:
+ (DriverTest.test_check_for_driver_crash.FakeServerProcess.process_name): Update since Driver uses
+ process_name() instead of name().
+ * Scripts/webkitpy/port/server_process.py:
+ (ServerProcess._start): Use process_name() instead of name().
+ (ServerProcess.stop): Ditto.
+ (ServerProcess.name): Deleted.
+ * Scripts/webkitpy/port/simulator_process.py:
+ (SimulatorProcess.process_name): Check the provided bundle for the process name.
+
2017-06-06 Dean Johnson <[email protected]>
test-webkitpy: stop forking unsafely from within a spawned process
Modified: trunk/Tools/Scripts/webkitpy/port/darwin.py (217855 => 217856)
--- trunk/Tools/Scripts/webkitpy/port/darwin.py 2017-06-06 20:39:08 UTC (rev 217855)
+++ trunk/Tools/Scripts/webkitpy/port/darwin.py 2017-06-06 21:02:55 UTC (rev 217856)
@@ -238,10 +238,16 @@
return fallback
@memoized
- def app_identifier_from_bundle(self, app_bundle):
+ def _plist_data_from_bundle(self, app_bundle, entry):
plist_path = self._filesystem.join(app_bundle, 'Info.plist')
if not self._filesystem.exists(plist_path):
plist_path = self._filesystem.join(app_bundle, 'Contents', 'Info.plist')
if not self._filesystem.exists(plist_path):
return None
- return self._executive.run_command(['/usr/libexec/PlistBuddy', '-c', 'Print CFBundleIdentifier', plist_path]).rstrip()
+ return self._executive.run_command(['/usr/libexec/PlistBuddy', '-c', 'Print {}'.format(entry), plist_path]).rstrip()
+
+ def app_identifier_from_bundle(self, app_bundle):
+ return self._plist_data_from_bundle(app_bundle, 'CFBundleIdentifier')
+
+ def app_executable_from_bundle(self, app_bundle):
+ return self._plist_data_from_bundle(app_bundle, 'CFBundleExecutable')
Modified: trunk/Tools/Scripts/webkitpy/port/driver.py (217855 => 217856)
--- trunk/Tools/Scripts/webkitpy/port/driver.py 2017-06-06 20:39:08 UTC (rev 217855)
+++ trunk/Tools/Scripts/webkitpy/port/driver.py 2017-06-06 21:02:55 UTC (rev 217856)
@@ -312,7 +312,7 @@
if self._crashed_process_name:
return True
if self._server_process.has_crashed():
- self._crashed_process_name = self._server_process.name()
+ self._crashed_process_name = self._server_process.process_name()
self._crashed_pid = self._server_process.pid()
return True
return False
@@ -453,7 +453,7 @@
def _check_for_driver_crash_or_unresponsiveness(self, error_line):
crashed_check = error_line.rstrip('\r\n')
if crashed_check == "#CRASHED":
- self._crashed_process_name = self._server_process.name()
+ self._crashed_process_name = self._server_process.process_name()
self._crashed_pid = self._server_process.pid()
return True
elif error_line.startswith("#CRASHED - "):
@@ -607,7 +607,7 @@
self.error_from_test += err_line
if asan_violation_detected and not self._crashed_process_name:
- self._crashed_process_name = self._server_process.name()
+ self._crashed_process_name = self._server_process.process_name()
self._crashed_pid = self._server_process.pid()
block.decode_content()
Modified: trunk/Tools/Scripts/webkitpy/port/driver_unittest.py (217855 => 217856)
--- trunk/Tools/Scripts/webkitpy/port/driver_unittest.py 2017-06-06 20:39:08 UTC (rev 217855)
+++ trunk/Tools/Scripts/webkitpy/port/driver_unittest.py 2017-06-06 21:02:55 UTC (rev 217856)
@@ -200,7 +200,7 @@
def pid(self):
return 1234
- def name(self):
+ def process_name(self):
return 'FakeServerProcess'
def has_crashed(self):
Modified: trunk/Tools/Scripts/webkitpy/port/server_process.py (217855 => 217856)
--- trunk/Tools/Scripts/webkitpy/port/server_process.py 2017-06-06 20:39:08 UTC (rev 217855)
+++ trunk/Tools/Scripts/webkitpy/port/server_process.py 2017-06-06 21:02:55 UTC (rev 217856)
@@ -77,9 +77,6 @@
# FIXME: there should be a way to get win32 vs. cygwin from platforminfo.
self._use_win32_apis = sys.platform.startswith('win')
- def name(self):
- return self._name
-
def pid(self):
return self._pid
@@ -123,7 +120,7 @@
env=self._env,
universal_newlines=self._universal_newlines)
self._pid = self._proc.pid
- self._port.find_system_pid(self.name(), self._pid)
+ self._port.find_system_pid(self.process_name(), self._pid)
if not self._use_win32_apis:
self._set_file_nonblocking(self._proc.stdout)
self._set_file_nonblocking(self._proc.stderr)
@@ -345,7 +342,7 @@
# 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())
+ self._port.check_for_leaks(self.process_name(), self.pid())
now = time.time()
if self._proc.stdin:
Modified: trunk/Tools/Scripts/webkitpy/port/simulator_process.py (217855 => 217856)
--- trunk/Tools/Scripts/webkitpy/port/simulator_process.py 2017-06-06 20:39:08 UTC (rev 217855)
+++ trunk/Tools/Scripts/webkitpy/port/simulator_process.py 2017-06-06 21:02:55 UTC (rev 217856)
@@ -76,6 +76,9 @@
self._bundle_id = port_obj.app_identifier_from_bundle(cmd[0])
+ def process_name(self):
+ return self._port.app_executable_from_bundle(self._cmd[0])
+
@staticmethod
def _accept_connection_create_file(server, type):
connection, address = server.accept()