1 # Copyright (c) 2012 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
.core
import util
6 from telemetry
.page
import page_benchmark
8 class Dromaeo(page_benchmark
.PageBenchmark
):
9 def MeasurePage(self
, page
, tab
, results
):
10 js_is_done
= 'window.document.cookie.indexOf("__done=1") >= 0'
12 return bool(tab
.EvaluateJavaScript(js_is_done
))
13 util
.WaitFor(_IsDone
, 600, poll_interval
=5)
15 js_get_results
= 'JSON.stringify(window.automation.GetResults())'
17 score
= eval(tab
.EvaluateJavaScript(js_get_results
))
20 chars
= [' ', '-', '/', '(', ')', '*']
25 suffix
= page
.url
[page
.url
.index('?') + 1 : page
.url
.index('&')]
26 for k
, v
in score
.iteritems():
27 data_type
= 'unimportant'
30 results
.Add(Escape(k
), 'runs/s', v
, data_type
=data_type
)