OLD | NEW |
1 # Copyright 2012 The Chromium Authors. All rights reserved. | 1 # Copyright 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Runs spaceport.io's PerfMarks benchmark.""" | 5 """Runs spaceport.io's PerfMarks benchmark.""" |
6 | 6 |
7 import logging | 7 import logging |
8 import os | 8 import os |
9 | 9 |
10 from telemetry import test | 10 from telemetry import benchmark |
11 from telemetry.core import util | 11 from telemetry.core import util |
12 from telemetry.page import page_measurement | 12 from telemetry.page import page_measurement |
13 from telemetry.page import page_set | 13 from telemetry.page import page_set |
14 | 14 |
15 | 15 |
16 class _SpaceportMeasurement(page_measurement.PageMeasurement): | 16 class _SpaceportMeasurement(page_measurement.PageMeasurement): |
17 def __init__(self): | 17 def __init__(self): |
18 super(_SpaceportMeasurement, self).__init__() | 18 super(_SpaceportMeasurement, self).__init__() |
19 | 19 |
20 def CustomizeBrowserOptions(self, options): | 20 def CustomizeBrowserOptions(self, options): |
(...skipping 28 matching lines...) Expand all Loading... |
49 'JSON.stringify(window.__results)')) | 49 'JSON.stringify(window.__results)')) |
50 for key in result_dict: | 50 for key in result_dict: |
51 chart, trace = key.split('.', 1) | 51 chart, trace = key.split('.', 1) |
52 results.Add(trace, 'objects (bigger is better)', float(result_dict[key]), | 52 results.Add(trace, 'objects (bigger is better)', float(result_dict[key]), |
53 chart_name=chart, data_type='unimportant') | 53 chart_name=chart, data_type='unimportant') |
54 results.Add('Score', 'objects (bigger is better)', | 54 results.Add('Score', 'objects (bigger is better)', |
55 [float(x) for x in result_dict.values()]) | 55 [float(x) for x in result_dict.values()]) |
56 | 56 |
57 | 57 |
58 # crbug.com/166703: This test frequently times out on Windows. | 58 # crbug.com/166703: This test frequently times out on Windows. |
59 @test.Disabled('mac', 'win') | 59 @benchmark.Disabled('mac', 'win') |
60 class Spaceport(test.Test): | 60 class Spaceport(benchmark.Benchmark): |
61 """spaceport.io's PerfMarks benchmark.""" | 61 """spaceport.io's PerfMarks benchmark.""" |
62 test = _SpaceportMeasurement | 62 test = _SpaceportMeasurement |
63 | 63 |
64 def CreatePageSet(self, options): | 64 def CreatePageSet(self, options): |
65 spaceport_dir = os.path.join(util.GetChromiumSrcDir(), 'chrome', 'test', | 65 spaceport_dir = os.path.join(util.GetChromiumSrcDir(), 'chrome', 'test', |
66 'data', 'third_party', 'spaceport') | 66 'data', 'third_party', 'spaceport') |
67 ps = page_set.PageSet(file_path=spaceport_dir) | 67 ps = page_set.PageSet(file_path=spaceport_dir) |
68 ps.AddPageWithDefaultRunNavigate('file://index.html') | 68 ps.AddPageWithDefaultRunNavigate('file://index.html') |
69 return ps | 69 return ps |
OLD | NEW |