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

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

Issue 2496563002: tools: Add a tool to load pages on a device, and pull the predictor database. (Closed)
Patch Set: lint. Created 4 years, 1 month 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 | « tools/android/loading/controller.py ('k') | tools/resource_prefetch_predictor/generate_database.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/android/loading/devtools_monitor.py
diff --git a/tools/android/loading/devtools_monitor.py b/tools/android/loading/devtools_monitor.py
index cd52dfba7f57d00b6e5cd4fe4a0e6cdb49e906fb..b64e468d5c210c447c8cd7178214f27413e93382 100644
--- a/tools/android/loading/devtools_monitor.py
+++ b/tools/android/loading/devtools_monitor.py
@@ -235,9 +235,9 @@ class DevToolsConnection(object):
Args:
url: (str) a URL to navigate to before starting monitoring loop.
timeout_seconds: timeout in seconds for monitoring loop.
- stop_delay_multiplier: How long to wait after page load completed before
- tearing down, relative to the time it took to reach the page load to
- complete.
+ stop_delay_multiplier: (float) How long to wait after page load completed
+ before tearing down, relative to the time it took to reach the page load
+ to complete.
"""
for domain in self._domains_to_enable:
self._ws.RegisterDomain(domain, self._OnDataReceived)
@@ -271,11 +271,13 @@ class DevToolsConnection(object):
elif self._monitoring_stop_timestamp is None:
assert self._monitoring_start_timestamp is not None
current_time = datetime.datetime.now()
- stop_delay_duration = self._stop_delay_multiplier * (
- current_time - self._monitoring_start_timestamp)
- logging.info('Delaying monitoring stop for %ds',
- stop_delay_duration.total_seconds())
- self._monitoring_stop_timestamp = current_time + stop_delay_duration
+ stop_delay_duration_seconds = self._stop_delay_multiplier * (
+ current_time - self._monitoring_start_timestamp).seconds
pasko 2016/11/14 13:21:27 was it also assuming seconds before or something m
Benoit L 2016/11/14 13:26:19 It was seconds as well, but couldn't handle non-in
+ logging.info('Delaying monitoring stop for %.1fs',
+ stop_delay_duration_seconds)
+ self._monitoring_stop_timestamp = (
+ current_time + datetime.timedelta(
+ seconds=stop_delay_duration_seconds))
def ExecuteJavaScript(self, expression):
"""Run JavaScript expression.
« no previous file with comments | « tools/android/loading/controller.py ('k') | tools/resource_prefetch_predictor/generate_database.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698