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

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

Issue 23512005: BrowserOptions.extra_browser_args is now a set. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: AppendExtraBrowserArgs Created 7 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 | Annotate | Revision Log
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 """ 10 """
11 11
12 from metrics import histogram_util 12 from metrics import histogram_util
13 from telemetry.core import util 13 from telemetry.core import util
14 from telemetry.page import page_measurement 14 from telemetry.page import page_measurement
15 from telemetry.page import page_runner 15 from telemetry.page import page_runner
16 16
17 # TODO: Revisit this test once multitab support is finalized. 17 # TODO: Revisit this test once multitab support is finalized.
18 18
19 class TabSwitching(page_measurement.PageMeasurement): 19 class TabSwitching(page_measurement.PageMeasurement):
20 def CustomizeBrowserOptions(self, options): 20 def CustomizeBrowserOptions(self, options):
21 options.AppendExtraBrowserArg('--enable-stats-collection-bindings') 21 options.AppendExtraBrowserArgs([
22 options.AppendExtraBrowserArg('--dom-automation') 22 '--enable-stats-collection-bindings',
23 options.AppendExtraBrowserArg('--reduce-security-for-dom-automation-tests') 23 '--dom-automation',
24 '--reduce-security-for-dom-automation-tests'
25 ])
24 26
25 def CanRunForPage(self, page): 27 def CanRunForPage(self, page):
26 return not page.page_set.pages.index(page) 28 return not page.page_set.pages.index(page)
27 29
28 def DidNavigateToPage(self, page, tab): 30 def DidNavigateToPage(self, page, tab):
29 for i in xrange(1, len(page.page_set.pages)): 31 for i in xrange(1, len(page.page_set.pages)):
30 t = tab.browser.tabs.New() 32 t = tab.browser.tabs.New()
31 33
32 page_state = page_runner.PageState() 34 page_state = page_runner.PageState()
33 page_state.PreparePage(page.page_set.pages[i], t) 35 page_state.PreparePage(page.page_set.pages[i], t)
(...skipping 23 matching lines...) Expand all
57 prev_histogram = histogram_util.GetHistogramFromDomAutomation( 59 prev_histogram = histogram_util.GetHistogramFromDomAutomation(
58 histogram_type, histogram_name, tab) 60 histogram_type, histogram_name, tab)
59 61
60 last_histogram = histogram_util.GetHistogramFromDomAutomation( 62 last_histogram = histogram_util.GetHistogramFromDomAutomation(
61 histogram_type, histogram_name, tab) 63 histogram_type, histogram_name, tab)
62 diff_histogram = histogram_util.SubtractHistogram(last_histogram, 64 diff_histogram = histogram_util.SubtractHistogram(last_histogram,
63 first_histogram) 65 first_histogram)
64 66
65 results.AddSummary(histogram_name, '', diff_histogram, 67 results.AddSummary(histogram_name, '', diff_histogram,
66 data_type='unimportant-histogram') 68 data_type='unimportant-histogram')
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698