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

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

Issue 312043003: Fixes crbug.com/378064 - record_wpr no longerworks with benchmark (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Run the test specific steps after the action sequence Created 6 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/telemetry/telemetry/page/record_wpr.py
diff --git a/tools/telemetry/telemetry/page/record_wpr.py b/tools/telemetry/telemetry/page/record_wpr.py
index a55b238570dbae31234d4f55b123c438b32cd4c2..427290e05aa01f8361354632aeb755d4f556dc69 100755
--- a/tools/telemetry/telemetry/page/record_wpr.py
+++ b/tools/telemetry/telemetry/page/record_wpr.py
@@ -41,6 +41,7 @@ class RecordPage(page_test.PageTest): # pylint: disable=W0223
"""Override to ensure all resources are fetched from network."""
tab.ClearCache(force=False)
if self.test:
+ self.test.options = self.options
self.test.WillNavigateToPage(page, tab)
def DidNavigateToPage(self, page, tab):
@@ -49,20 +50,14 @@ class RecordPage(page_test.PageTest): # pylint: disable=W0223
self.test.DidNavigateToPage(page, tab)
def RunPage(self, page, tab, results):
- # When recording, sleep to catch any resources that load post-onload.
tab.WaitForDocumentReadyStateToBeComplete()
- if self.test:
- dummy_results = page_measurement_results.PageMeasurementResults()
- dummy_results.WillMeasurePage(page)
- self.test.MeasurePage(page, tab, dummy_results)
- dummy_results.DidMeasurePage()
- else:
- # 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)
+ # 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)
# Run the actions for all measurements. Reload the page between
# actions.
@@ -80,6 +75,12 @@ class RecordPage(page_test.PageTest): # pylint: disable=W0223
self._RunMethod(page, action_name, action_runner)
should_reload = True
+ # Run the PageTest's validator, so that we capture any additional resources
+ # that are loaded by the test.
+ if self.test:
+ dummy_results = page_measurement_results.PageMeasurementResults()
+ self.test.ValidatePage(page, tab, dummy_results)
+
def Main(base_dir):
measurements = {
« 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