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

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

Issue 161473002: [Android] Don't wait for background tabs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix commit message Created 6 years, 10 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/metrics/startup_metric.py » ('j') | tools/perf/metrics/startup_metric.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/measurements/session_restore.py
diff --git a/tools/perf/measurements/session_restore.py b/tools/perf/measurements/session_restore.py
index 5ad03a1065fe7d222aabeb4d68b23a4a722c314e..b889f232020a1fe7141d2a6da5f75a08a9a8dc25 100644
--- a/tools/perf/measurements/session_restore.py
+++ b/tools/perf/measurements/session_restore.py
@@ -50,11 +50,14 @@ class SessionRestore(startup.Startup):
self._cpu_metric.Start(None, None)
def MeasurePage(self, page, tab, results):
- # Wait for all tabs to finish loading.
- for i in xrange(len(tab.browser.tabs)):
- t = tab.browser.tabs[i]
- t.WaitForDocumentReadyStateToBeComplete()
-
+ # Wait for foreground tab to finish loading. We can't wait for all tabs to
+ # finish loading because on Android the data of the background tabs is
+ # loaded on demand, when the user switches to them, rather than during
+ # startup.
+ # We are assuming that the foreground tab is tab[0]. This is true in current
+ # code, but is not guaranteed by the APIs.
+ t = tab.browser.tabs[0]
jeremy 2014/02/13 13:35:26 Looks like we have no way of checking that this is
aberent 2014/02/13 15:59:30 Fixed, I think (just testing) although it only wor
+ t.WaitForDocumentReadyStateToBeComplete()
# Record CPU usage from browser start to when all pages have loaded.
self._cpu_metric.Stop(None, None)
self._cpu_metric.AddResults(tab, results, 'cpu_utilization')
« no previous file with comments | « no previous file | tools/perf/metrics/startup_metric.py » ('j') | tools/perf/metrics/startup_metric.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698