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

Unified Diff: chrome/test/kasko/hang_watcher_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: Using components for integration test. Rewrote unittests 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
Index: chrome/test/kasko/hang_watcher_integration_test.py
diff --git a/chrome/test/kasko/kasko_integration_test.py b/chrome/test/kasko/hang_watcher_integration_test.py
old mode 100755
new mode 100644
similarity index 70%
copy from chrome/test/kasko/kasko_integration_test.py
copy to chrome/test/kasko/hang_watcher_integration_test.py
index e88a3f1c98420a3440facf2e8155efa39ea48ba5..db1a9dbd8699c05e43abcb9459e1870b39ac0a1e
--- a/chrome/test/kasko/kasko_integration_test.py
+++ b/chrome/test/kasko/hang_watcher_integration_test.py
@@ -1,14 +1,13 @@
#!/usr/bin/env python
-# Copyright 2015 The Chromium Authors. All rights reserved.
+# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-"""A Windows-only end-to-end integration test for Kasko, Chrome and Crashpad.
+"""A Windows-only end-to-end integration test for the Chrome hang watcher.
-This test ensures that the interface between Kasko and Chrome and Crashpad works
-as expected. The test causes Kasko to set certain crash keys and invoke a crash
-report, which is in turn delivered to a locally hosted test crash server. If the
-crash report is received intact with the expected crash keys then all is well.
+This test ensures that the hang watcher is able to detect when Chrome hangs and
+to generate a Kasko report. The report is then delivered to a locally hosted
+test crash server. If a crash report is received then all is well.
Note that this test only works against non-component Release and Official builds
of Chrome with Chrome branding, and attempting to use it with anything else will
@@ -17,11 +16,12 @@ most likely lead to constant failures.
Typical usage (assuming in root 'src' directory):
- generate project files with the following GYP variables:
- syzyasan=1 win_z7=0 chromium_win_pch=0
+ branding=Chrome kasko=1 kasko_hang_reports=1
- build the release Chrome binaries:
ninja -C out\Release chrome.exe
+ ninja -C out\Release chromedriver.exe
chrisha 2016/01/20 22:20:31 This may as well be ninja -C out\Release chrome.ex
Patrick Monette 2016/01/21 00:05:10 Done.
- run the test:
- python chrome/test/kasko/kasko_integration_test.py
+ python chrome/test/kasko/hang_watcher_integration_test.py
"""
import logging
@@ -71,16 +71,28 @@ def Main():
options.chrome, user_data_dir)
with kasko.util.ScopedStartStop(chrome):
_LOGGER.info('Navigating to Kasko debug URL')
- chrome.navigate_to('chrome://kasko/send-report')
+ chrome.navigate_to('chrome://delayeduithreadhang')
_LOGGER.info('Waiting for Kasko report')
- if not server.wait_for_report(10):
+ if not server.wait_for_report(120):
raise Exception('No Kasko report received.')
+ # Verify a few crash keys.
report = server.crash(0)
kasko.report.LogCrashKeys(report)
- kasko.report.ValidateCrashReport(report,
- {'kasko-set-crash-key-value-impl': 'SetCrashKeyValueImpl'})
+ expected_keys = [
+ 'guid',
+ 'kasko-generated-by-version',
+ 'kasko-uploaded-by-version',
+ 'pid',
+ 'plat',
+ 'prod',
+ 'report-id',
+ 'ver',
chrisha 2016/01/20 22:20:31 You should be able to use ValidateCrashReport as i
Patrick Monette 2016/01/21 00:05:10 Done.
+ ]
+ kasko.report.ValidateNonEmptyCrashKeys(report, expected_keys)
+
+ _LOGGER.info('Test passed successfully!')
chrisha 2016/01/20 22:20:31 Ditto to adding this to the other couple tests...
Patrick Monette 2016/01/21 00:05:10 Done.
return 0

Powered by Google App Engine
This is Rietveld 408576698