summaryrefslogtreecommitdiffstats
path: root/tools/perf/perf_tools/robohornetpro.py
blob: 59632c357fcc7ede04c51d99a38eab9eeeb12443 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Copyright (c) 2012 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 telemetry import multi_page_benchmark
from telemetry import util

class RobohornetPro(multi_page_benchmark.MultiPageBenchmark):
  def CustomizeBrowserOptions(self, options):
    # Benchmark require use of real Date.now() for measurement.
    options.wpr_make_javascript_deterministic = False

  def MeasurePage(self, _, tab, results):
    tab.runtime.Execute('ToggleRoboHornet()')

    done = 'document.getElementById("results").innerHTML.indexOf("Total") != -1'
    def _IsDone():
      return tab.runtime.Evaluate(done)
    util.WaitFor(_IsDone, 60)

    result = int(tab.runtime.Evaluate('stopTime - startTime'))
    results.Add('Total', 'ms', result)