Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Unified Diff: chrome/test/kasko/kasko_integration_test.py

Issue 1543803005: Added an integration test for kasko hang reports (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Set executable bit for python scripts Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/kasko/hang_watcher_integration_test.py ('k') | chrome/test/kasko/py/kasko/__init__.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/kasko/kasko_integration_test.py
diff --git a/chrome/test/kasko/kasko_integration_test.py b/chrome/test/kasko/kasko_integration_test.py
index e88a3f1c98420a3440facf2e8155efa39ea48ba5..0646fc78cd413714df13ef3131a2fa50a6e5f80e 100755
--- a/chrome/test/kasko/kasko_integration_test.py
+++ b/chrome/test/kasko/kasko_integration_test.py
@@ -19,7 +19,7 @@ Typical usage (assuming in root 'src' directory):
- generate project files with the following GYP variables:
syzyasan=1 win_z7=0 chromium_win_pch=0
- build the release Chrome binaries:
- ninja -C out\Release chrome.exe
+ ninja -C out\Release chrome.exe chromedriver.exe
- run the test:
python chrome/test/kasko/kasko_integration_test.py
"""
@@ -40,49 +40,13 @@ _LOGGER = logging.getLogger(os.path.basename(__file__))
def Main():
options = kasko.config.ParseCommandLine()
- # Generate a temporary directory for use in the tests.
- with kasko.util.ScopedTempDir() as temp_dir:
- # Prevent the temporary directory from self cleaning if requested.
- if options.keep_temp_dirs:
- temp_dir_path = temp_dir.release()
- else:
- temp_dir_path = temp_dir.path
+ kasko.integration_test.RunTest(
+ options,
+ 'chrome://kasko/send-report',
+ 10,
+ {'kasko-set-crash-key-value-impl': 'SetCrashKeyValueImpl'})
- # Use the specified user data directory if requested.
- if options.user_data_dir:
- user_data_dir = options.user_data_dir
- else:
- user_data_dir = os.path.join(temp_dir_path, 'user-data-dir')
-
- kasko_dir = os.path.join(temp_dir_path, 'kasko')
- os.makedirs(kasko_dir)
-
- # Launch the test server.
- server = kasko.crash_server.CrashServer()
- with kasko.util.ScopedStartStop(server):
- _LOGGER.info('Started server on port %d', server.port)
-
- # Configure the environment so Chrome can find the test crash server.
- os.environ['KASKO_CRASH_SERVER_URL'] = (
- 'http://127.0.0.1:%d/crash' % server.port)
-
- # Launch Chrome and navigate it to the test URL.
- chrome = kasko.process.ChromeInstance(options.chromedriver,
- options.chrome, user_data_dir)
- with kasko.util.ScopedStartStop(chrome):
- _LOGGER.info('Navigating to Kasko debug URL')
- chrome.navigate_to('chrome://kasko/send-report')
-
- _LOGGER.info('Waiting for Kasko report')
- if not server.wait_for_report(10):
- raise Exception('No Kasko report received.')
-
- report = server.crash(0)
- kasko.report.LogCrashKeys(report)
- kasko.report.ValidateCrashReport(report,
- {'kasko-set-crash-key-value-impl': 'SetCrashKeyValueImpl'})
-
- return 0
+ _LOGGER.info('Test passed successfully!')
if __name__ == '__main__':
« no previous file with comments | « chrome/test/kasko/hang_watcher_integration_test.py ('k') | chrome/test/kasko/py/kasko/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698