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

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
« no previous file with comments | « tools/perf/page_sets/tab_switching.json ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 class TabSwitchingBenchmark(page_benchmark.PageBenchmark):
11 def CustomizeBrowserOptions(self, options):
12 options.AppendExtraBrowserArg('--dom-automation')
13 options.AppendExtraBrowserArg('--reduce-security-for-dom-automation-tests')
14
15 def WillNavigateToPage(self, page, tab):
16 # pylint: disable=W0201
17 self.histogram = histogram_measurement.HistogramMeasurement(
18 {'name': 'MPArch.RWH_TabSwitchPaintDuration', 'units': ''},
19 histogram_measurement.BROWSER_HISTOGRAM)
20
21 self.histogram.Start(page, tab)
22
23 def MeasurePage(self, page, tab, results):
24 page_path = os.path.join('..', '..', '..', 'data', 'tab_switching')
25 tab_urls = [
26 "espn.go.com", "bugzilla.mozilla.org", "news.cnet.com", "www.amazon.com",
27 "allegro.pl", "www.bbc.co.uk", "126.com", "www.altavista.com",
28 ]
29
30 tabs = [tab] + [tab.browser.tabs.New() for i in xrange(len(tab_urls) - 1)]
31
32 for i in xrange(len(tabs)):
33 cur_filename = os.path.join(page_path, tab_urls[i], 'index.html')
34 cur_target_side_url = tab.browser.http_server.UrlOf(cur_filename)
35
36 tabs[i].Navigate(cur_target_side_url)
37
38 for i in range(1):
39 for t in tabs:
40 t.Activate()
41 def _IsDone():
42 return not t.EvaluateJavaScript('document.webkitHidden')
43 util.WaitFor(_IsDone, 500, poll_interval=5)
44
45 self.histogram.GetValue(page, tab, results)
OLDNEW
« no previous file with comments | « 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