OLD | NEW |
(Empty) | |
| 1 # Copyright 2017 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 |
| 5 import os |
| 6 import logging |
| 7 |
| 8 from core import perf_benchmark |
| 9 |
| 10 from contrib.cros_benchmarks import tab_switching_measure |
| 11 from contrib.cros_benchmarks import tab_switching_stories |
| 12 from telemetry import benchmark |
| 13 from telemetry import story |
| 14 |
| 15 |
| 16 @benchmark.Owner(emails=['vovoy@chromium.org'], |
| 17 component='OS>Performance') |
| 18 @benchmark.Enabled('chromeos') |
| 19 class CrosTabSwitchingTypical24(perf_benchmark.PerfBenchmark): |
| 20 """Measures tab switching performance with 24 tabs. |
| 21 |
| 22 The script opens 24 pages in 24 different tabs, waits for them to load, |
| 23 and then switches to each tabs and measures the tabs paint time. The 24 |
| 24 pages were chosen from Alexa top ranking sites. Tab paint time is the |
| 25 time between tab being requested and the first paint event. |
| 26 |
| 27 Benchmark specific option: |
| 28 --tabset-repeat=N: Duplicate tab set for N times. |
| 29 The following usage example opens 120 tabs. |
| 30 $ ./run_benchmark --browser=cros-chrome --remote=DUT_IP |
| 31 cros_tab_switching.typical_24 --tabset-repeat=5 |
| 32 """ |
| 33 test = tab_switching_measure.CrosTabSwitchingMeasurement |
| 34 |
| 35 @classmethod |
| 36 def AddBenchmarkCommandLineArgs(cls, parser): |
| 37 parser.add_option('--tabset-repeat', type='int', default=1, |
| 38 help='repeat tab page set') |
| 39 |
| 40 def CreateStorySet(self, options): |
| 41 if not options.cros_remote: |
| 42 # Raise exception here would fail the presubmit check. |
| 43 logging.error('Must specify --remote=DUT_IP to run this test.') |
| 44 story_set = story.StorySet( |
| 45 archive_data_file='data/tab_switching.json', |
| 46 base_dir=os.path.dirname(os.path.abspath(__file__)), |
| 47 cloud_storage_bucket=story.PARTNER_BUCKET) |
| 48 story_set.AddStory(tab_switching_stories.CrosMultiTabTypical24Story( |
| 49 story_set, options.cros_remote, options.tabset_repeat)) |
| 50 return story_set |
| 51 |
| 52 @classmethod |
| 53 def Name(cls): |
| 54 return 'cros_tab_switching.typical_24' |
OLD | NEW |