| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 import os | 5 import os |
| 6 | 6 |
| 7 from core import path_util | 7 from core import path_util |
| 8 from core import perf_benchmark | 8 from core import perf_benchmark |
| 9 | 9 |
| 10 from telemetry import benchmark | 10 from telemetry import benchmark |
| 11 from telemetry import page as page_module | 11 from telemetry import page as page_module |
| 12 from telemetry.page import page_test | 12 from telemetry.page import legacy_page_test |
| 13 from telemetry.page import shared_page_state | 13 from telemetry.page import shared_page_state |
| 14 from telemetry import story | 14 from telemetry import story |
| 15 from telemetry.value import list_of_scalar_values | 15 from telemetry.value import list_of_scalar_values |
| 16 | 16 |
| 17 from benchmarks import pywebsocket_server | 17 from benchmarks import pywebsocket_server |
| 18 from page_sets import webgl_supported_shared_state | 18 from page_sets import webgl_supported_shared_state |
| 19 | 19 |
| 20 | 20 |
| 21 BLINK_PERF_BASE_DIR = os.path.join(path_util.GetChromiumSrcDir(), | 21 BLINK_PERF_BASE_DIR = os.path.join(path_util.GetChromiumSrcDir(), |
| 22 'third_party', 'WebKit', 'PerformanceTests') | 22 'third_party', 'WebKit', 'PerformanceTests') |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 _AddPage(path) | 64 _AddPage(path) |
| 65 ps = story.StorySet(base_dir=os.getcwd() + os.sep, | 65 ps = story.StorySet(base_dir=os.getcwd() + os.sep, |
| 66 serving_dirs=serving_dirs) | 66 serving_dirs=serving_dirs) |
| 67 for url in page_urls: | 67 for url in page_urls: |
| 68 ps.AddStory(page_module.Page( | 68 ps.AddStory(page_module.Page( |
| 69 url, ps, ps.base_dir, | 69 url, ps, ps.base_dir, |
| 70 shared_page_state_class=shared_page_state_class)) | 70 shared_page_state_class=shared_page_state_class)) |
| 71 return ps | 71 return ps |
| 72 | 72 |
| 73 | 73 |
| 74 class _BlinkPerfMeasurement(page_test.PageTest): | 74 class _BlinkPerfMeasurement(legacy_page_test.LegacyPageTest): |
| 75 """Tuns a blink performance test and reports the results.""" | 75 """Tuns a blink performance test and reports the results.""" |
| 76 | 76 |
| 77 def __init__(self): | 77 def __init__(self): |
| 78 super(_BlinkPerfMeasurement, self).__init__() | 78 super(_BlinkPerfMeasurement, self).__init__() |
| 79 with open(os.path.join(os.path.dirname(__file__), | 79 with open(os.path.join(os.path.dirname(__file__), |
| 80 'blink_perf.js'), 'r') as f: | 80 'blink_perf.js'), 'r') as f: |
| 81 self._blink_perf_js = f.read() | 81 self._blink_perf_js = f.read() |
| 82 | 82 |
| 83 def WillNavigateToPage(self, page, tab): | 83 def WillNavigateToPage(self, page, tab): |
| 84 page.script_to_evaluate_on_commit = self._blink_perf_js | 84 page.script_to_evaluate_on_commit = self._blink_perf_js |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 | 333 |
| 334 def CreateStorySet(self, options): | 334 def CreateStorySet(self, options): |
| 335 path = os.path.join(BLINK_PERF_BASE_DIR, 'Pywebsocket') | 335 path = os.path.join(BLINK_PERF_BASE_DIR, 'Pywebsocket') |
| 336 return CreateStorySetFromPath( | 336 return CreateStorySetFromPath( |
| 337 path, SKIPPED_FILE, | 337 path, SKIPPED_FILE, |
| 338 shared_page_state_class=_SharedPywebsocketPageState) | 338 shared_page_state_class=_SharedPywebsocketPageState) |
| 339 | 339 |
| 340 @classmethod | 340 @classmethod |
| 341 def ShouldDisable(cls, possible_browser): | 341 def ShouldDisable(cls, possible_browser): |
| 342 return cls.IsSvelte(possible_browser) # http://crbug.com/551950 | 342 return cls.IsSvelte(possible_browser) # http://crbug.com/551950 |
| OLD | NEW |