Changeset 217946 in webkit
- Timestamp:
- Jun 8, 2017 1:39:00 PM (7 years ago)
- Location:
- trunk/Tools
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r217942 r217946 1 2017-06-08 Jonathan Bedard <jbedard@apple.com> 2 3 webkitpy: Run sample/spindump on iOS devices 4 https://bugs.webkit.org/show_bug.cgi?id=171881 5 <rdar://problem/32084602> 6 7 Reviewed by Daniel Bates. 8 9 * Scripts/webkitpy/port/darwin.py: 10 (DarwinPort.sample_process): Only add sudo prefix if the platform is Mac, which 11 requires sudo to run spindump. 12 * Scripts/webkitpy/port/ios_device.py: 13 (IOSDevicePort.look_for_new_samples): Deleted. 14 (IOSDevicePort.sample_process): Deleted. 15 * Scripts/webkitpy/port/ios_device_unittest.py: 16 (IOSDeviceTest): iOS devices use 'ios' and their os_name. 17 (IOSDeviceTest.test_spindump): 18 (IOSDeviceTest.test_sample_process): 19 (IOSDeviceTest.test_sample_process_exception): 20 * Scripts/webkitpy/port/ios_simulator_unittest.py: 21 (IOSSimulatorTest): iOS Simulators run on Mac and use 'mac' as their os_name. 22 1 23 2017-06-08 Keith Miller <keith_miller@apple.com> 2 24 -
trunk/Tools/Scripts/webkitpy/port/darwin.py
r217856 r217946 155 155 host = target_host or self.host 156 156 tempdir = host.filesystem.mkdtemp() 157 exit_status = host.executive.run_command([ 158 "/usr/bin/sudo", 159 "-n", 160 "/usr/sbin/spindump", 157 command = [ 158 '/usr/sbin/spindump', 161 159 pid, 162 160 10, 163 161 10, 164 "-file",162 '-file', 165 163 DarwinPort.spindump_file_path(host, name, pid, str(tempdir)), 166 ], return_exit_code=True) 164 ] 165 if self.host.platform.is_mac(): 166 command = ['/usr/bin/sudo', '-n'] + command 167 exit_status = host.executive.run_command(command, return_exit_code=True) 167 168 if exit_status: 168 169 try: 169 170 host.executive.run_command([ 170 "/usr/bin/sample",171 '/usr/bin/sample', 171 172 pid, 172 173 10, 173 174 10, 174 "-file",175 '-file', 175 176 DarwinPort.sample_file_path(host, name, pid, str(tempdir)), 176 177 ]) -
trunk/Tools/Scripts/webkitpy/port/ios_device.py
r217853 r217946 96 96 pass 97 97 98 def look_for_new_samples(self, unresponsive_processes, start_time):99 return {}100 101 def sample_process(self, name, pid, target_host=None):102 pass103 104 98 # Despite their names, these flags do not actually get passed all the way down to webkit-build. 105 99 def _build_driver_flags(self): -
trunk/Tools/Scripts/webkitpy/port/ios_device_unittest.py
r217853 r217946 23 23 import time 24 24 25 from webkitpy.common.system.outputcapture import OutputCapture 26 from webkitpy.common.system.executive_mock import MockExecutive2, ScriptError 25 27 from webkitpy.port.ios_device import IOSDevicePort 26 28 from webkitpy.port import ios_testcase … … 28 30 29 31 class IOSDeviceTest(ios_testcase.IOSTest): 30 os_name = 'ios -device'32 os_name = 'ios' 31 33 os_version = '' 32 34 port_name = 'ios-device' … … 45 47 port.path_to_crash_logs() 46 48 49 def test_spindump(self): 50 def logging_run_command(args): 51 print args 52 53 port = self.make_port() 54 port.host.filesystem.files['/__im_tmp/tmp_0_/test-42-spindump.txt'] = 'Spindump file' 55 port.host.executive = MockExecutive2(run_command_fn=logging_run_command) 56 expected_stdout = "['/usr/sbin/spindump', 42, 10, 10, '-file', '/__im_tmp/tmp_0_/test-42-spindump.txt']\n" 57 OutputCapture().assert_outputs(self, port.sample_process, args=['test', 42], expected_stdout=expected_stdout) 58 self.assertEqual(port.host.filesystem.files['/mock-build/layout-test-results/test-42-spindump.txt'], 'Spindump file') 59 self.assertIsNone(port.host.filesystem.files['/__im_tmp/tmp_0_/test-42-spindump.txt']) 60 61 def test_sample_process(self): 62 def logging_run_command(args): 63 if args[0] == '/usr/sbin/spindump': 64 return 1 65 print args 66 return 0 67 68 port = self.make_port() 69 port.host.filesystem.files['/__im_tmp/tmp_0_/test-42-sample.txt'] = 'Sample file' 70 port.host.executive = MockExecutive2(run_command_fn=logging_run_command) 71 expected_stdout = "['/usr/bin/sample', 42, 10, 10, '-file', '/__im_tmp/tmp_0_/test-42-sample.txt']\n" 72 OutputCapture().assert_outputs(self, port.sample_process, args=['test', 42], expected_stdout=expected_stdout) 73 self.assertEqual(port.host.filesystem.files['/mock-build/layout-test-results/test-42-sample.txt'], 'Sample file') 74 self.assertIsNone(port.host.filesystem.files['/__im_tmp/tmp_0_/test-42-sample.txt']) 75 76 def test_sample_process_exception(self): 77 def throwing_run_command(args): 78 if args[0] == '/usr/sbin/spindump': 79 return 1 80 raise ScriptError('MOCK script error') 81 82 port = self.make_port() 83 port.host.executive = MockExecutive2(run_command_fn=throwing_run_command) 84 OutputCapture().assert_outputs(self, port.sample_process, args=['test', 42]) 85 47 86 def test_get_crash_log(self): 48 87 port = self.make_port(port_name=self.port_name) 49 88 with self.assertRaises(RuntimeError): 50 89 port._get_crash_log('DumpRenderTree', 1234, None, None, time.time(), wait_for_log=False) 51 52 # FIXME: Update tests when <rdar://problem/30497991> is completed.53 def test_spindump(self):54 pass55 56 def test_sample_process(self):57 pass58 59 def test_sample_process_exception(self):60 pass -
trunk/Tools/Scripts/webkitpy/port/ios_simulator_unittest.py
r216556 r217946 31 31 32 32 class IOSSimulatorTest(ios_testcase.IOSTest): 33 os_name = 'ios-simulator' 33 # FIXME: https://bugs.webkit.org/show_bug.cgi?id=173107 34 os_name = 'mac' 34 35 os_version = '' 35 36 port_name = 'ios-simulator'
Note: See TracChangeset
for help on using the changeset viewer.