12017-05-31 Jonathan Bedard <jbedard@apple.com>
2
3 webkitpy: Process crash-logs for iOS devices
4 https://bugs.webkit.org/show_bug.cgi?id=171976
5 <rdar://problem/32134551>
6
7 Reviewed by NOBODY (OOPS!).
8
9 When running layout tests on an iOS device, crash logs should be processed.
10 Implement crash log searching and parsing for iOS devices.
11
12 * Scripts/webkitpy/common/system/crashlogs.py:
13 (CrashLogs.find_newest_log): Add iOS as a potential platform.
14 (CrashLogs.find_all_logs): Ditto.
15 (CrashLogs._find_newest_log_darwin): Support iOS device crash logs. Check
16 cached_crashlogs for efficiency and symbolicate the crashlog before parsing it. Continue searching
17 for process ID until it is found in log.
18 (CrashLogs._find_all_logs_darwin):Ditto.
19 * Scripts/webkitpy/common/system/crashlogs_unittest.py:
20 (make_mock_crash_report_darwin): Crashlogs may not have their process on the first line.
21 * Scripts/webkitpy/common/system/platforminfo.py:
22 (PlatformInfo.is_ios): Added.
23 * Scripts/webkitpy/common/system/platforminfo_mock.py:
24 (MockPlatformInfo.is_ios): Added.
25 * Scripts/webkitpy/common/system/systemhost.py:
26 (SystemHost.__init__): Initialize cached_crash_logs array.
27 (SystemHost.symbolicate_crash_log_if_needed): The symbolicated crash log for most systems
28 is just the crashlog, use this behavior by default.
29 * Scripts/webkitpy/common/system/systemhost_mock.py: Ditto.
30 * Scripts/webkitpy/layout_tests/controllers/manager.py:
31 (Manager._set_up_run): Cache crash logs currently on the target hosts before running tests.
32 * Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py:
33 (RunTest.test_crash_log): Initialize cached_crash_logs before running so that the crash
34 logs we're testing are not ignored.
35 (RunTest.test_web_process_crash_log): Ditto.
36 * Scripts/webkitpy/layout_tests/controllers/manager.py:
37 (Manager._set_up_run): Cache crash logs already on the host so we don't have to read them.
38 * Scripts/webkitpy/port/base.py:
39 (Port._get_crash_log): Pass optional target host when getting crashlogs.
40 * Scripts/webkitpy/port/darwin.py:
41 (DarwinPort._get_crash_log): Pass optional target host when getting crashlogs.
42 * Scripts/webkitpy/port/device.py:
43 (Device.__init__): Initialize cached_crash_logs array.
44 (Device.symbolicate_crash_log_if_needed): If the platform device has a function with this
45 name, call it. Otherwise, assume the crash log is already symbolicated.
46 * Scripts/webkitpy/port/driver.py:
47 (Driver._get_crash_log): Pass optional target host when getting crashlogs.
48 * Scripts/webkitpy/port/gtk.py:
49 (GtkPort._get_crash_log): Pass optional target host when getting crashlogs.
50 * Scripts/webkitpy/port/ios_device.py:
51 (IOSDevicePort.path_to_crash_logs): Consult apple_additions for the path to crash logs.
52 (IOSDevicePort._look_for_all_crash_logs_in_log_dir): Search every connected device for
53 crash logs.
54 (IOSDevicePort._get_crash_log): Search the specified target host for a crash log
55 if a target host is specified. Else, search all connected devices for the specified
56 crash-log.
57 (IOSDevicePort.look_for_new_crash_logs): Deleted, use Darwin implementation.
58 * Scripts/webkitpy/port/ios_device_unittest.py:
59 (IOSDeviceTest.test_crashlog_path): Without apple_additions, path_to_crash_logs should raise
60 an exception.
61 * Scripts/webkitpy/port/win.py:
62 (WinPort._get_crash_log): Pass optional target host when getting crashlogs.
63 * Scripts/webkitpy/port/wpe.py:
64 (WPEPort._get_crash_log): Pass optional target host when getting crashlogs.
65