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

Unified Diff: tools/android/loading/sandwich_runner.py

Issue 2102053002: sandwich: Properly detect page load failures (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@af00
Patch Set: Rebase on landing dependency Created 4 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/android/loading/sandwich_runner.py
diff --git a/tools/android/loading/sandwich_runner.py b/tools/android/loading/sandwich_runner.py
index 640b068a39b3335286a83ce4e7cb6a555995a098..5c3bb94947f0fe3b548c5acffc4475257c292cbc 100644
--- a/tools/android/loading/sandwich_runner.py
+++ b/tools/android/loading/sandwich_runner.py
@@ -47,6 +47,7 @@ _TRACING_CATEGORIES = [
'blink.user_timing',
'devtools.timeline',
'java',
+ 'navigation',
'toplevel',
'v8',
'-cc', # A lot of unnecessary events are enabled by default in "cc".
@@ -79,6 +80,10 @@ class CacheOperation(object):
CLEAR, SAVE, PUSH = range(3)
+class SandwichRunnerError(Exception):
+ pass
+
+
class SandwichRunner(object):
"""Sandwich runner.
@@ -209,6 +214,12 @@ class SandwichRunner(object):
trace = RecordTrace()
else:
trace = RecordTrace()
+ for event in trace.request_track.GetEvents():
+ if event.failed:
+ logging.warning(
+ 'request to %s failed: %s', event.url, event.error_text)
+ if not trace.tracing_track.HasLoadingSucceeded():
+ raise SandwichRunnerError('Page load has failed.')
if run_path is not None:
trace_path = os.path.join(run_path, TRACE_FILENAME)
trace.ToJsonFile(trace_path)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698