Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 from measurements import startup | 5 from measurements import startup |
| 6 import page_sets | 6 import page_sets |
| 7 from telemetry import benchmark | 7 from telemetry import benchmark |
| 8 | 8 |
| 9 | 9 |
| 10 class _StartupCold(benchmark.Benchmark): | 10 class _StartupCold(benchmark.Benchmark): |
| 11 """Measures cold startup time with a clean profile.""" | 11 """Measures cold startup time with a clean profile.""" |
| 12 options = {'pageset_repeat': 5} | 12 options = {'pageset_repeat': 5} |
| 13 | 13 |
| 14 @classmethod | 14 @classmethod |
| 15 def Name(cls): | 15 def Name(cls): |
| 16 return 'startup' | 16 return 'startup' |
| 17 | 17 |
| 18 def CreatePageTest(self, options): | 18 def CreatePageTest(self, options): |
| 19 return startup.Startup(cold=True) | 19 return startup.Startup(cold=True) |
| 20 | 20 |
| 21 | 21 |
| 22 class _StartupWarm(benchmark.Benchmark): | 22 class _StartupWarm(benchmark.Benchmark): |
| 23 """Measures warm startup time with a clean profile.""" | 23 """Measures warm startup time with a clean profile.""" |
| 24 options = {'pageset_repeat': 20} | 24 options = {'pageset_repeat': 20} |
| 25 | 25 |
| 26 @classmethod | 26 @classmethod |
| 27 def Name(cls): | 27 def Name(cls): |
| 28 return 'startup' | 28 return 'startup' |
| 29 | 29 |
| 30 @classmethod | |
| 31 def ProcessCommandLineArgs(cls, parser, args): | |
| 32 args.discard_first_result = True | |
|
nednguyen
2015/02/27 13:27:35
ditto, otherwise the options setting at line 24 is
| |
| 33 | |
| 30 def CreatePageTest(self, options): | 34 def CreatePageTest(self, options): |
| 31 return startup.Startup(cold=False) | 35 return startup.Startup(cold=False) |
| 32 | 36 |
| 33 | 37 |
| 34 @benchmark.Enabled('has tabs') | 38 @benchmark.Enabled('has tabs') |
| 35 @benchmark.Disabled('snowleopard') # crbug.com/336913 | 39 @benchmark.Disabled('snowleopard') # crbug.com/336913 |
| 36 class StartupColdBlankPage(_StartupCold): | 40 class StartupColdBlankPage(_StartupCold): |
| 37 """Measures cold startup time with a clean profile.""" | 41 """Measures cold startup time with a clean profile.""" |
| 38 tag = 'cold' | 42 tag = 'cold' |
| 39 page_set = page_sets.BlankPageSet | 43 page_set = page_sets.BlankPageSet |
| 40 | 44 |
| 41 @classmethod | 45 @classmethod |
| 42 def Name(cls): | 46 def Name(cls): |
| 43 return 'startup.cold.blank_page' | 47 return 'startup.cold.blank_page' |
| 44 | 48 |
| 45 | 49 |
| 46 @benchmark.Enabled('has tabs') | 50 @benchmark.Enabled('has tabs') |
| 47 class StartupWarmBlankPage(_StartupWarm): | 51 class StartupWarmBlankPage(_StartupWarm): |
| 48 """Measures warm startup time with a clean profile.""" | 52 """Measures warm startup time with a clean profile.""" |
| 49 tag = 'warm' | 53 tag = 'warm' |
| 50 page_set = page_sets.BlankPageSet | 54 page_set = page_sets.BlankPageSet |
| 51 | 55 |
| 52 @classmethod | 56 @classmethod |
| 53 def Name(cls): | 57 def Name(cls): |
| 54 return 'startup.warm.blank_page' | 58 return 'startup.warm.blank_page' |
| OLD | NEW |