Chromium Code Reviews| 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') |