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

Unified Diff: tools/telemetry/telemetry/page/record_wpr.py

Issue 465213002: [Telemetry] Remove arbitrary sleep in record_wpr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix import order Created 6 years, 4 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/telemetry/telemetry/page/record_wpr.py
diff --git a/tools/telemetry/telemetry/page/record_wpr.py b/tools/telemetry/telemetry/page/record_wpr.py
old mode 100755
new mode 100644
index a864cc67ce1fc9e782d3ac81251d4f7a2d52097e..7d67d68455f816eec26d59df5cb0b6f549613e9b
--- a/tools/telemetry/telemetry/page/record_wpr.py
+++ b/tools/telemetry/telemetry/page/record_wpr.py
@@ -1,14 +1,14 @@
-#!/usr/bin/env python
# Copyright 2012 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.
+
import logging
import sys
-import time
from telemetry import benchmark
from telemetry.core import browser_options
from telemetry.core import discover
+from telemetry.core import util
from telemetry.core import wpr_modes
from telemetry.page import page_runner
from telemetry.page import page_set
@@ -52,13 +52,7 @@ class RecorderPageTest(page_test.PageTest): # pylint: disable=W0223
def RunPage(self, page, tab, results):
tab.WaitForDocumentReadyStateToBeComplete()
-
- # When recording, sleep to catch any resources that load post-onload.
- # TODO(tonyg): This should probably monitor resource timing for activity
- # and sleep until 2s since the last network event with some timeout like
- # 20s. We could wrap this up as WaitForNetworkIdle() and share with the
- # speed index metric.
- time.sleep(3)
+ util.WaitFor(tab.HasReachedQuiescence, 30)
if self.page_test:
self._action_name_to_run = self.page_test.action_name_to_run
« 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