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

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

Issue 562243004: Revert of Change PageTest.WillStartBrowser to depend on platform instead of browser object as it would not ha… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « tools/perf/measurements/smoothness_unittest.py ('k') | tools/perf/measurements/webrtc.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 """The tab switching measurement. 5 """The tab switching measurement.
6 6
7 This measurement opens pages in different tabs. After all the tabs have opened, 7 This measurement opens pages in different tabs. After all the tabs have opened,
8 it cycles through each tab in sequence, and records a histogram of the time 8 it cycles through each tab in sequence, and records a histogram of the time
9 between when a tab was first requested to be shown, and when it was painted. 9 between when a tab was first requested to be shown, and when it was painted.
10 Power usage is also measured. 10 Power usage is also measured.
(...skipping 20 matching lines...) Expand all
31 self._power_metric = None 31 self._power_metric = None
32 32
33 def CustomizeBrowserOptions(self, options): 33 def CustomizeBrowserOptions(self, options):
34 options.AppendExtraBrowserArgs([ 34 options.AppendExtraBrowserArgs([
35 '--enable-stats-collection-bindings' 35 '--enable-stats-collection-bindings'
36 ]) 36 ])
37 # Enable background networking so we can test its impact on power usage. 37 # Enable background networking so we can test its impact on power usage.
38 options.disable_background_networking = False 38 options.disable_background_networking = False
39 power.PowerMetric.CustomizeBrowserOptions(options) 39 power.PowerMetric.CustomizeBrowserOptions(options)
40 40
41 def WillStartBrowser(self, platform): 41 def WillStartBrowser(self, browser):
42 self._first_page_in_pageset = True 42 self._first_page_in_pageset = True
43 self._power_metric = power.PowerMetric(platform, TabSwitching.SAMPLE_TIME) 43 self._power_metric = power.PowerMetric(browser, TabSwitching.SAMPLE_TIME)
44 44
45 def TabForPage(self, page, browser): 45 def TabForPage(self, page, browser):
46 if self._first_page_in_pageset: 46 if self._first_page_in_pageset:
47 # The initial browser window contains a single tab, navigate that tab 47 # The initial browser window contains a single tab, navigate that tab
48 # rather than creating a new one. 48 # rather than creating a new one.
49 self._first_page_in_pageset = False 49 self._first_page_in_pageset = False
50 return browser.tabs[0] 50 return browser.tabs[0]
51 51
52 return browser.tabs.New() 52 return browser.tabs.New()
53 53
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 92
93 last_histogram = histogram_util.GetHistogram( 93 last_histogram = histogram_util.GetHistogram(
94 histogram_type, histogram_name, tab) 94 histogram_type, histogram_name, tab)
95 diff_histogram = histogram_util.SubtractHistogram(last_histogram, 95 diff_histogram = histogram_util.SubtractHistogram(last_histogram,
96 first_histogram) 96 first_histogram)
97 97
98 results.AddSummaryValue( 98 results.AddSummaryValue(
99 histogram.HistogramValue(None, display_name, '', 99 histogram.HistogramValue(None, display_name, '',
100 raw_value_json=diff_histogram, 100 raw_value_json=diff_histogram,
101 important=False)) 101 important=False))
OLDNEW
« no previous file with comments | « tools/perf/measurements/smoothness_unittest.py ('k') | tools/perf/measurements/webrtc.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698