| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2016 The Chromium Authors. All rights reserved. | 2 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """A Windows-only end-to-end integration test for Kasko and SyzyAsan. | 6 """A Windows-only end-to-end integration test for Kasko and SyzyAsan. |
| 7 | 7 |
| 8 This test ensures that the interface between SyzyAsan, Kasko and Chrome works | 8 This test ensures that the interface between SyzyAsan, Kasko and Chrome works |
| 9 as expected. The test causes a crash that should be detected by SyzyAsan and | 9 as expected. The test causes a crash that should be detected by SyzyAsan and |
| 10 delivered via Kasko to a locally hosted test crash server. | 10 delivered via Kasko to a locally hosted test crash server. |
| 11 | 11 |
| 12 Note that this test only works against non-component Release and Official builds | 12 Note that this test only works against non-component Release and Official builds |
| 13 of Chrome with Chrome branding, and attempting to use it with anything else will | 13 of Chrome with Chrome branding, and attempting to use it with anything else will |
| 14 most likely lead to constant failures. | 14 most likely lead to constant failures. |
| 15 | 15 |
| 16 Typical usage (assuming in root 'src' directory): | 16 Typical usage (assuming in root 'src' directory): |
| 17 | 17 |
| 18 - generate project files with the following GYP variables: | 18 - generate project files with the following GYP variables: |
| 19 syzyasan=1 win_z7=0 chromium_win_pch=0 | 19 syzyasan=1 win_z7=0 chromium_win_pch=0 |
| 20 - build the release Chrome binaries: | 20 - build the release Chrome binaries: |
| 21 ninja -C out\Release chrome.exe | 21 ninja -C out\Release chrome.exe chromedriver.exe |
| 22 - run the test: | 22 - run the test: |
| 23 python chrome/test/kasko/syzyasan_integration_test.py | 23 python chrome/test/kasko/syzyasan_integration_test.py |
| 24 """ | 24 """ |
| 25 | 25 |
| 26 import logging | 26 import logging |
| 27 import os | 27 import os |
| 28 import optparse | 28 import optparse |
| 29 import re | 29 import re |
| 30 import shutil | 30 import shutil |
| 31 import subprocess | 31 import subprocess |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 chrome.navigate_to('chrome://crash/browser-use-after-free') | 261 chrome.navigate_to('chrome://crash/browser-use-after-free') |
| 262 | 262 |
| 263 _LOGGER.info('Waiting for Kasko report') | 263 _LOGGER.info('Waiting for Kasko report') |
| 264 if not server.wait_for_report(10): | 264 if not server.wait_for_report(10): |
| 265 raise Exception('No Kasko report received.') | 265 raise Exception('No Kasko report received.') |
| 266 | 266 |
| 267 report = server.crash(0) | 267 report = server.crash(0) |
| 268 kasko.report.LogCrashKeys(report) | 268 kasko.report.LogCrashKeys(report) |
| 269 kasko.report.ValidateCrashReport(report, {'asan-error-type': 'SyzyAsan'}) | 269 kasko.report.ValidateCrashReport(report, {'asan-error-type': 'SyzyAsan'}) |
| 270 | 270 |
| 271 _LOGGER.info('Test passed successfully!') |
| 272 |
| 271 return 0 | 273 return 0 |
| 272 | 274 |
| 273 | 275 |
| 274 if __name__ == '__main__': | 276 if __name__ == '__main__': |
| 275 sys.exit(Main()) | 277 sys.exit(Main()) |
| OLD | NEW |