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 core
import perf_benchmark
7 from measurements
import startup
9 from telemetry
import benchmark
12 class _StartupCold(perf_benchmark
.PerfBenchmark
):
13 """Measures cold startup time with a clean profile."""
14 options
= {'pageset_repeat': 5}
20 def CreatePageTest(self
, options
):
21 return startup
.Startup(cold
=True)
24 class _StartupWarm(perf_benchmark
.PerfBenchmark
):
25 """Measures warm startup time with a clean profile."""
26 options
= {'pageset_repeat': 20}
33 def ValueCanBeAddedPredicate(cls
, _
, is_first_result
):
34 return not is_first_result
36 def CreatePageTest(self
, options
):
37 return startup
.Startup(cold
=False)
40 @benchmark.Enabled('has tabs')
41 @benchmark.Disabled('snowleopard') # crbug.com/336913
42 class StartupColdBlankPage(_StartupCold
):
43 """Measures cold startup time with a clean profile."""
45 page_set
= page_sets
.BlankPageSet
49 return 'startup.cold.blank_page'
52 @benchmark.Enabled('has tabs')
53 class StartupWarmBlankPage(_StartupWarm
):
54 """Measures warm startup time with a clean profile."""
56 page_set
= page_sets
.BlankPageSet
60 return 'startup.warm.blank_page'
62 @benchmark.Enabled('has tabs')
63 @benchmark.Enabled('win', 'linux', 'mac')
64 @benchmark.Disabled('reference', 'android') # http://crbug.com/481919
65 class StartupLargeProfileColdBlankPage(_StartupCold
):
66 """Measures cold startup time with a large profile."""
68 page_set
= page_sets
.BlankPageSetWithLargeProfile
69 options
= {'pageset_repeat': 3}
71 def __init__(self
, max_failures
=None):
72 super(StartupLargeProfileColdBlankPage
, self
).__init
__(max_failures
)
74 def SetExtraBrowserOptions(self
, options
):
75 options
.browser_startup_timeout
= 10 * 60
79 return 'startup.large_profile.cold.blank_page'
81 @benchmark.Enabled('has tabs')
82 @benchmark.Enabled('win', 'linux', 'mac')
83 @benchmark.Disabled('reference', 'android') # http://crbug.com/481919
84 class StartupLargeProfileWarmBlankPage(_StartupWarm
):
85 """Measures warm startup time with a large profile."""
87 page_set
= page_sets
.BlankPageSetWithLargeProfile
88 options
= {'pageset_repeat': 4}
90 def __init__(self
, max_failures
=None):
91 super(StartupLargeProfileWarmBlankPage
, self
).__init
__(max_failures
)
93 def SetExtraBrowserOptions(self
, options
):
94 options
.browser_startup_timeout
= 10 * 60
98 return 'startup.large_profile.warm.blank_page'