OLD | NEW |
---|---|
(Empty) | |
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. | |
4 | |
5 from telemetry import multi_page_benchmark | |
6 from telemetry import util | |
7 | |
8 class Dromaeo(multi_page_benchmark.MultiPageBenchmark): | |
9 def MeasurePage(self, page, tab, results): | |
10 js_is_done = 'window.document.cookie.indexOf("__done=1") >= 0' | |
11 def _IsDone(): | |
12 return bool(tab.runtime.Evaluate(js_is_done)) | |
13 util.WaitFor(_IsDone, 600, poll_interval=5) | |
14 | |
15 js_get_results = 'JSON.stringify(window.automation.GetResults())' | |
16 print js_get_results | |
17 score = eval(tab.runtime.Evaluate(js_get_results)) | |
18 | |
19 def Escape(k): | |
20 chars = [' ', '-', '/', '(', ')', '*'] | |
21 for c in chars: | |
22 k = k.replace(c, '_') | |
23 return k | |
24 | |
25 for k, v in score.iteritems(): | |
26 results.Add(Escape(k), 'runs/s', v) | |
tonyg
2012/11/21 20:11:44
Let's match the existing output:
results.Add('scor
bulach
2012/11/21 20:44:06
Done.
| |
27 | |
28 js_get_results = 'window.automation.GetScore()' | |
29 score = tab.runtime.Evaluate(js_get_results) | |
30 suffix = page.url[page.url.index('?') + 1 : page.url.index('&')] | |
31 results.Add('dromaeo_' + suffix, '', score) | |
tonyg
2012/11/21 20:11:44
Again, matching the current format:
results.Add('s
bulach
2012/11/21 20:44:06
right, I'm not entirely sure what the "unimportant
| |
OLD | NEW |