cygprofile: increase timeouts to allow showing web contents
[chromium-blink-merge.git] / tools / perf / measurements / startup.py
blobe1cbc3ace9225a70ec725084cfdd62ea76b95d20
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.page import page_test
7 from metrics import keychain_metric
8 from metrics import startup_metric
11 class Startup(page_test.PageTest):
12 """Performs a measurement of Chromium's startup performance.
14 Uses cold start if cold==True, otherwise uses warm start. A cold start means
15 none of the Chromium files are in the disk cache. A warm start assumes the OS
16 has already cached much of Chromium's content. For warm tests, you should
17 repeat the page set to ensure it's cached.
18 """
20 def __init__(self, cold=False):
21 super(Startup, self).__init__(needs_browser_restart_after_each_page=True)
22 self._cold = cold
24 def CustomizeBrowserOptions(self, options):
25 if self._cold:
26 options.clear_sytem_cache_for_browser_and_profile_on_start = True
27 options.AppendExtraBrowserArgs([
28 '--enable-stats-collection-bindings'
30 keychain_metric.KeychainMetric.CustomizeBrowserOptions(options)
32 def ValidateAndMeasurePage(self, page, tab, results):
33 keychain_metric.KeychainMetric().AddResults(tab, results)
34 startup_metric.StartupMetric().AddResults(tab, results)
37 class StartWithUrl(Startup):
38 """Performs a measurement of Chromium's performance starting with a URL.
40 Uses cold start if cold==True, otherwise uses warm start. A cold start means
41 none of the Chromium files are in the disk cache. A warm start assumes the OS
42 has already cached much of Chromium's content. For warm tests, you should
43 repeat the page set to ensure it's cached.
45 The startup URL is taken from the page's startup_url. This
46 allows the testing of multiple different URLs in a single benchmark.
47 """
49 def __init__(self, cold=False):
50 super(StartWithUrl, self).__init__(cold=cold)