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

Unified Diff: tools/perf/measurements/page_cycler.py

Issue 543243002: Drop DidStartHTTPServer to simplify object interactions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix spell-o Created 6 years, 3 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 | tools/perf/measurements/page_cycler_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/measurements/page_cycler.py
diff --git a/tools/perf/measurements/page_cycler.py b/tools/perf/measurements/page_cycler.py
index 84c9dc25aa6f744de1491e3f1a6cfb46ad826628..c18d2ccdee5ce12b51129eed9df5c05a384be9aa 100644
--- a/tools/perf/measurements/page_cycler.py
+++ b/tools/perf/measurements/page_cycler.py
@@ -45,6 +45,7 @@ class PageCycler(page_test.PageTest):
self._cpu_metric = None
self._v8_object_stats_metric = None
self._has_loaded_page = collections.defaultdict(int)
+ self._initial_renderer_url = None # to avoid cross-renderer navigation
@classmethod
def AddCommandLineArgs(cls, parser):
@@ -94,12 +95,15 @@ class PageCycler(page_test.PageTest):
if self._record_v8_object_stats:
self._v8_object_stats_metric = v8_object_stats.V8ObjectStatsMetric()
- def DidStartHTTPServer(self, tab):
- # Avoid paying for a cross-renderer navigation on the first page on legacy
- # page cyclers which use the filesystem.
- tab.Navigate(tab.browser.http_server.UrlOf('nonexistent.html'))
-
def WillNavigateToPage(self, page, tab):
+ if page.is_file:
+ # For legacy page cyclers which use the filesystem, do an initial
+ # navigate to avoid paying for a cross-renderer navigation.
+ initial_url = tab.browser.http_server.UrlOf('nonexistent.html')
+ if self._initial_renderer_url != initial_url:
+ self._initial_renderer_url = initial_url
+ tab.Navigate(self._initial_renderer_url)
+
page.script_to_evaluate_on_commit = self._page_cycler_js
if self.ShouldRunCold(page.url):
tab.ClearCache(force=True)
« no previous file with comments | « no previous file | tools/perf/measurements/page_cycler_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698