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

Side by Side Diff: tools/perf/measurements/memory_multi_tab.py

Issue 44883004: [telemetry] Move tab from RunState to PageState. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comment nit. Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/perf/measurements/memory.py ('k') | tools/perf/measurements/memory_pressure.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Multi tab memory test. 5 """Multi tab memory test.
6 6
7 This test is a multi tab test, but we're interested in measurements for 7 This test is a multi tab test, but we're interested in measurements for
8 the entire test rather than each single page. 8 the entire test rather than each single page.
9 """ 9 """
10 10
(...skipping 24 matching lines...) Expand all
35 35
36 def DidStartBrowser(self, browser): 36 def DidStartBrowser(self, browser):
37 self._memory_metric = memory.MemoryMetric(browser) 37 self._memory_metric = memory.MemoryMetric(browser)
38 38
39 def CustomizeBrowserOptions(self, options): 39 def CustomizeBrowserOptions(self, options):
40 memory.MemoryMetric.CustomizeBrowserOptions(options) 40 memory.MemoryMetric.CustomizeBrowserOptions(options)
41 # Since this is a memory benchmark, we want to sample memory histograms at 41 # Since this is a memory benchmark, we want to sample memory histograms at
42 # a high frequency. 42 # a high frequency.
43 options.AppendExtraBrowserArgs('--memory-metrics') 43 options.AppendExtraBrowserArgs('--memory-metrics')
44 44
45 def TabForPage(self, page, tab): 45 def TabForPage(self, page, browser):
46 return tab.browser.tabs.New() 46 return browser.tabs.New()
47 47
48 def DidNavigateToPage(self, page, tab): 48 def DidNavigateToPage(self, page, tab):
49 # Start measurement on the first tab. 49 # Start measurement on the first tab.
50 if not self._first_tab: 50 if not self._first_tab:
51 self._memory_metric.Start(page, tab) 51 self._memory_metric.Start(page, tab)
52 self._first_tab = tab 52 self._first_tab = tab
53 53
54 def MeasurePage(self, page, tab, results): 54 def MeasurePage(self, page, tab, results):
55 # Finalize measurement on the last tab. 55 # Finalize measurement on the last tab.
56 if len(tab.browser.tabs) == len(page.page_set.pages): 56 if len(tab.browser.tabs) == len(page.page_set.pages):
57 self._memory_metric.Stop(page, self._first_tab) 57 self._memory_metric.Stop(page, self._first_tab)
58 self._memory_metric.AddResults(self._first_tab, results) 58 self._memory_metric.AddResults(self._first_tab, results)
59 59
60 def DidRunTest(self, tab, results): 60 def DidRunTest(self, browser, results):
61 self._memory_metric.AddSummaryResults(results) 61 self._memory_metric.AddSummaryResults(results)
OLDNEW
« no previous file with comments | « tools/perf/measurements/memory.py ('k') | tools/perf/measurements/memory_pressure.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698