Roll src/third_party/WebKit f36d5e0:68b67cd (svn 193299:193303)
[chromium-blink-merge.git] / tools / perf / benchmarks / startup.py
blob41b08f0a217bea1fd621b9deb793cb484ff073f8
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
8 import page_sets
11 class _StartupCold(benchmark.Benchmark):
12 """Measures cold startup time with a clean profile."""
13 options = {'pageset_repeat': 5}
15 @classmethod
16 def Name(cls):
17 return 'startup'
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}
27 @classmethod
28 def Name(cls):
29 return 'startup'
31 @classmethod
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."""
43 tag = 'cold'
44 page_set = page_sets.BlankPageSet
46 @classmethod
47 def Name(cls):
48 return 'startup.cold.blank_page'
51 @benchmark.Enabled('has tabs')
52 class StartupWarmBlankPage(_StartupWarm):
53 """Measures warm startup time with a clean profile."""
54 tag = 'warm'
55 page_set = page_sets.BlankPageSet
57 @classmethod
58 def Name(cls):
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
65 @benchmark.Disabled
66 class StartupLargeProfileColdBlankPage(_StartupCold):
67 """Measures cold startup time with a large profile."""
68 tag = 'cold'
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"
76 @classmethod
77 def Name(cls):
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
84 @benchmark.Disabled
85 class StartupLargeProfileWarmBlankPage(_StartupWarm):
86 """Measures warm startup time with a large profile."""
87 tag = 'warm'
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"
95 @classmethod
96 def Name(cls):
97 return 'startup.large_profile.warm.blank_page'