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
6 from measurements
import startup
8 from telemetry
import benchmark
11 class _StartupCold(perf_benchmark
.PerfBenchmark
):
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(perf_benchmark
.PerfBenchmark
):
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.Disabled('snowleopard') # crbug.com/336913
40 class StartupColdBlankPage(_StartupCold
):
41 """Measures cold startup time with a clean profile."""
43 page_set
= page_sets
.BlankPageSet
47 return 'startup.cold.blank_page'
50 class StartupWarmBlankPage(_StartupWarm
):
51 """Measures warm startup time with a clean profile."""
53 page_set
= page_sets
.BlankPageSet
57 return 'startup.warm.blank_page'
60 @benchmark.Disabled('reference', # http://crbug.com/476882
61 'android', # http://crbug.com/481919
62 'content-shell', 'mandoline') # No pregenerated profiles.
63 class StartupLargeProfileColdBlankPage(_StartupCold
):
64 """Measures cold startup time with a large profile."""
66 page_set
= page_sets
.BlankPageSetWithLargeProfile
67 options
= {'pageset_repeat': 3}
69 def __init__(self
, max_failures
=None):
70 super(StartupLargeProfileColdBlankPage
, self
).__init
__(max_failures
)
72 def SetExtraBrowserOptions(self
, options
):
73 options
.browser_startup_timeout
= 10 * 60
77 return 'startup.large_profile.cold.blank_page'
80 @benchmark.Disabled('reference', # http://crbug.com/476882
81 'android', # http://crbug.com/481919
82 'content-shell', 'mandoline') # No pregenerated profiles.
83 class StartupLargeProfileWarmBlankPage(_StartupWarm
):
84 """Measures warm startup time with a large profile."""
86 page_set
= page_sets
.BlankPageSetWithLargeProfile
87 options
= {'pageset_repeat': 4}
89 def __init__(self
, max_failures
=None):
90 super(StartupLargeProfileWarmBlankPage
, self
).__init
__(max_failures
)
92 def SetExtraBrowserOptions(self
, options
):
93 options
.browser_startup_timeout
= 10 * 60
97 return 'startup.large_profile.warm.blank_page'