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

Side by Side Diff: tools/perf/perf_tools/tab_switching_benchmark.py

Issue 13328004: Telemetry tab_switching_test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes from review. Created 7 years, 8 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
OLDNEW
(Empty)
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4 import os
5
6 from perf_tools import histogram_measurement
7 from telemetry.core import util
8 from telemetry.page import page_benchmark
9
10 TAB_SWITCHING_HISTOGRAMS = [
11 {'name': 'MPArch.RWH_TabSwitchPaintDuration', 'units': ''},]
tonyg 2013/03/29 22:14:17 This is unused now
shatch 2013/03/29 22:59:12 Done.
12
13 class TabSwitchingBenchmark(page_benchmark.PageBenchmark):
14 def CustomizeBrowserOptions(self, options):
15 options.AppendExtraBrowserArg('--dom-automation')
16 options.AppendExtraBrowserArg('--reduce-security-for-dom-automation-tests')
17
18 def WillNavigateToPage(self, page, tab):
19 # pylint: disable=W0201
20 self.histogram = histogram_measurement.HistogramMeasurement(
21 {'name': 'MPArch.RWH_TabSwitchPaintDuration', 'units': ''},
22 histogram_measurement.BROWSER_HISTOGRAM)
23
24 self.histogram.Start(page, tab)
25
26 def MeasurePage(self, page, tab, results):
27 page_path = os.path.join('..', '..', '..', 'data', 'tab_switching')
28 tab_urls = [
29 "espn.go.com", "bugzilla.mozilla.org", "news.cnet.com", "www.amazon.com",
30 "allegro.pl", "www.bbc.co.uk", "126.com", "www.altavista.com",
31 ]
32
33 tabs = [tab] + [tab.browser.tabs.New() for i in xrange(len(tab_urls) - 1)]
34
35 for i in xrange(len(tabs)):
36 cur_filename = os.path.join(page_path, tab_urls[i], 'index.html')
37 cur_target_side_url = tab.browser.http_server.UrlOf(cur_filename)
38
39 tabs[i].Navigate(cur_target_side_url)
40
41 for i in range(1):
42 for t in tabs:
43 t.Activate()
44 def _IsDone():
45 return bool(not t.EvaluateJavaScript('document.webkitHidden'))
tonyg 2013/03/29 22:14:17 Either the bool is unnecessary or the not is in th
shatch 2013/03/29 22:59:12 Done.
46 util.WaitFor(_IsDone, 500, poll_interval=5)
47
48 self.histogram.GetValue(page, tab, results)
OLDNEW
« tools/perf/page_sets/tab_switching.json ('K') | « tools/perf/page_sets/tab_switching.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698