| 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.page import page_measurement | |
| 6 | |
| 7 class Dromaeo(page_measurement.PageMeasurement): | |
| 8 def MeasurePage(self, page, tab, results): | |
| 9 tab.WaitForJavaScriptExpression( | |
| 10 'window.document.cookie.indexOf("__done=1") >= 0', 600) | |
| 11 | |
| 12 js_get_results = 'JSON.stringify(window.automation.GetResults())' | |
| 13 print js_get_results | |
| 14 score = eval(tab.EvaluateJavaScript(js_get_results)) | |
| 15 | |
| 16 def Escape(k): | |
| 17 chars = [' ', '-', '/', '(', ')', '*'] | |
| 18 for c in chars: | |
| 19 k = k.replace(c, '_') | |
| 20 return k | |
| 21 | |
| 22 suffix = page.url[page.url.index('?') + 1 : page.url.index('&')] | |
| 23 for k, v in score.iteritems(): | |
| 24 data_type = 'unimportant' | |
| 25 if k == suffix: | |
| 26 data_type = 'default' | |
| 27 results.Add(Escape(k), 'runs/s', v, data_type=data_type) | |
| OLD | NEW |