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
3 # found in the LICENSE file.
5 from telemetry
import benchmark
7 from measurements
import startup
11 class _StartupCold(benchmark
.Benchmark
):
12 """Measures cold startup time with a clean profile."""
13 options
= {'pageset_repeat': 5}
19 def CreatePageTest(self
, options
):
20 return startup
.Startup(cold
=True)
23 class _StartupWarm(benchmark
.Benchmark
):
24 """Measures warm startup time with a clean profile."""
25 options
= {'pageset_repeat': 20}
32 def ValueCanBeAddedPredicate(cls
, _
, is_first_result
):
33 return not is_first_result
35 def CreatePageTest(self
, options
):
36 return startup
.Startup(cold
=False)
39 @benchmark.Enabled('has tabs')
40 @benchmark.Disabled('snowleopard') # crbug.com/336913
41 class StartupColdBlankPage(_StartupCold
):
42 """Measures cold startup time with a clean profile."""
44 page_set
= page_sets
.BlankPageSet
48 return 'startup.cold.blank_page'
51 @benchmark.Enabled('has tabs')
52 class StartupWarmBlankPage(_StartupWarm
):
53 """Measures warm startup time with a clean profile."""
55 page_set
= page_sets
.BlankPageSet
59 return 'startup.warm.blank_page'
61 @benchmark.Enabled('has tabs')
62 @benchmark.Enabled('win', 'linux', 'mac')
63 # TODO(erikchen): Investigate source of 30s browser hang on startup.
64 # http://crbug.com/473827
66 class StartupLargeProfileColdBlankPage(_StartupCold
):
67 """Measures cold startup time with a large profile."""
69 page_set
= page_sets
.BlankPageSet
70 options
= {'pageset_repeat': 1}
72 def __init__(self
, max_failures
=None):
73 super(StartupLargeProfileColdBlankPage
, self
).__init
__(max_failures
)
74 self
.generated_profile_archive
= "large_profile.zip"
78 return 'startup.large_profile.cold.blank_page'
80 @benchmark.Enabled('has tabs')
81 @benchmark.Enabled('win', 'linux', 'mac')
82 # TODO(erikchen): Investigate source of 30s browser hang on startup.
83 # http://crbug.com/473827
85 class StartupLargeProfileWarmBlankPage(_StartupWarm
):
86 """Measures warm startup time with a large profile."""
88 page_set
= page_sets
.BlankPageSet
89 options
= {'pageset_repeat': 1}
91 def __init__(self
, max_failures
=None):
92 super(StartupLargeProfileWarmBlankPage
, self
).__init
__(max_failures
)
93 self
.generated_profile_archive
= "large_profile.zip"
97 return 'startup.large_profile.warm.blank_page'