summaryrefslogtreecommitdiffstats
path: root/tools/perf/benchmarks/start_with_url.py
blob: 4bf45d5f6e9e66155e189dc8401f72da279ef201 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

from core import perf_benchmark

from measurements import startup
from telemetry import benchmark
import page_sets


class _StartWithUrl(perf_benchmark.PerfBenchmark):
  page_set = page_sets.StartupPagesPageSet
  test = startup.StartWithUrl

  @classmethod
  def Name(cls):
    return 'start_with_url.startup_pages'

  def CreatePageTest(self, options):
    is_cold = (self.tag == 'cold')
    return self.test(cold=is_cold)


@benchmark.Enabled('has tabs')
@benchmark.Disabled('chromeos', 'linux', 'mac', 'win')
class StartWithUrlCold(_StartWithUrl):
  """Measure time to start Chrome cold with startup URLs"""
  tag = 'cold'
  options = {'pageset_repeat': 5}

  @classmethod
  def Name(cls):
    return 'start_with_url.cold.startup_pages'


@benchmark.Enabled('has tabs')
@benchmark.Disabled('chromeos', 'linux', 'mac', 'win')
class StartWithUrlWarm(_StartWithUrl):
  """Measure time to start Chrome warm with startup URLs"""
  tag = 'warm'
  options = {'pageset_repeat': 10}
  @classmethod
  def Name(cls):
    return 'start_with_url.warm.startup_pages'