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

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

Issue 1582613002: [win] Create a SyzyAsan/Chrome/Kasko/Crashpad integration test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update file permissions. 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/py/kasko/process.py ('k') | chrome/test/kasko/py/kasko/util.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/kasko/py/kasko/report.py
diff --git a/chrome/test/kasko/py/kasko/report.py b/chrome/test/kasko/py/kasko/report.py
new file mode 100755
index 0000000000000000000000000000000000000000..6e0c350732b6583dcef240055e4dd27fc5ddd229
--- /dev/null
+++ b/chrome/test/kasko/py/kasko/report.py
@@ -0,0 +1,35 @@
+#!/usr/bin/env python
+# 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.
+
+"""Utility functions for dealing with crash reports."""
+
+import logging
+import os
+_LOGGER = logging.getLogger(os.path.basename(__file__))
+
+
+def LogCrashKeys(report):
+ for key in sorted(report.keys()):
+ val = report[key][0]
+ if (len(val) < 64):
+ _LOGGER.debug('Got crashkey "%s": "%s"', key, val)
+ else:
+ _LOGGER.debug('Got crashkey "%s": ...%d bytes...', key, len(val))
+
+
+def ValidateCrashReport(report, expectations=None):
+ # Generate default expectations, and merge in any additional ones.
+ expected_keys = {'guid': 'GetCrashKeysForKasko',
+ 'kasko-generated-by-version': 'Kasko',
+ 'kasko-uploaded-by-version': 'Kasko'}
+ if expectations:
+ for key, value in expectations.iteritems():
+ expected_keys[key] = value
+
+ # Validate the expectations.
+ for expected_key, error in expected_keys.iteritems():
+ if expected_key not in report:
+ _LOGGER.error('Missing expected "%s" crash key.', expected_key)
+ raise Exception('"%s" integration appears broken.' % error)
« no previous file with comments | « chrome/test/kasko/py/kasko/process.py ('k') | chrome/test/kasko/py/kasko/util.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698