| 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 core import path_util | 10 from core import path_util |
| 11 from core import perf_benchmark | 11 from core import perf_benchmark |
| 12 | 12 |
| 13 from telemetry import benchmark | 13 from telemetry import benchmark |
| 14 from telemetry import page as page_module | 14 from telemetry import page as page_module |
| 15 from telemetry.page import page_test | 15 from telemetry.page import legacy_page_test |
| 16 from telemetry import story | 16 from telemetry import story |
| 17 from telemetry.value import list_of_scalar_values | 17 from telemetry.value import list_of_scalar_values |
| 18 from telemetry.value import scalar | 18 from telemetry.value import scalar |
| 19 | 19 |
| 20 DESCRIPTIONS = { | 20 DESCRIPTIONS = { |
| 21 'canvasDrawImageFullClear': | 21 'canvasDrawImageFullClear': |
| 22 'Using a canvas element to render. Bitmaps are blitted to the canvas ' | 22 'Using a canvas element to render. Bitmaps are blitted to the canvas ' |
| 23 'using the "drawImage" function and the canvas is fully cleared at ' | 23 'using the "drawImage" function and the canvas is fully cleared at ' |
| 24 'the beginning of each frame.', | 24 'the beginning of each frame.', |
| 25 'canvasDrawImageFullClearAlign': | 25 'canvasDrawImageFullClearAlign': |
| (...skipping 16 matching lines...) Expand all Loading... |
| 42 'css2dImg': | 42 'css2dImg': |
| 43 'Same as css2dBackground, but using img elements instead of div ' | 43 'Same as css2dBackground, but using img elements instead of div ' |
| 44 'elements.', | 44 'elements.', |
| 45 'css3dBackground': | 45 'css3dBackground': |
| 46 'Same as css2dBackground, but using CSS-3D transforms.', | 46 'Same as css2dBackground, but using CSS-3D transforms.', |
| 47 'css3dImg': | 47 'css3dImg': |
| 48 'Same as css2dImage but using CSS-3D tranforms.', | 48 'Same as css2dImage but using CSS-3D tranforms.', |
| 49 } | 49 } |
| 50 | 50 |
| 51 | 51 |
| 52 class _SpaceportMeasurement(page_test.PageTest): | 52 class _SpaceportMeasurement(legacy_page_test.LegacyPageTest): |
| 53 | 53 |
| 54 def __init__(self): | 54 def __init__(self): |
| 55 super(_SpaceportMeasurement, self).__init__() | 55 super(_SpaceportMeasurement, self).__init__() |
| 56 | 56 |
| 57 def CustomizeBrowserOptions(self, options): | 57 def CustomizeBrowserOptions(self, options): |
| 58 options.AppendExtraBrowserArgs('--disable-gpu-vsync') | 58 options.AppendExtraBrowserArgs('--disable-gpu-vsync') |
| 59 | 59 |
| 60 def ValidateAndMeasurePage(self, page, tab, results): | 60 def ValidateAndMeasurePage(self, page, tab, results): |
| 61 tab.WaitForJavaScriptExpression( | 61 tab.WaitForJavaScriptExpression( |
| 62 '!document.getElementById("start-performance-tests").disabled', 60) | 62 '!document.getElementById("start-performance-tests").disabled', 60) |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 @classmethod | 113 @classmethod |
| 114 def Name(cls): | 114 def Name(cls): |
| 115 return 'spaceport' | 115 return 'spaceport' |
| 116 | 116 |
| 117 def CreateStorySet(self, options): | 117 def CreateStorySet(self, options): |
| 118 spaceport_dir = os.path.join(path_util.GetChromiumSrcDir(), 'chrome', | 118 spaceport_dir = os.path.join(path_util.GetChromiumSrcDir(), 'chrome', |
| 119 'test', 'data', 'third_party', 'spaceport') | 119 'test', 'data', 'third_party', 'spaceport') |
| 120 ps = story.StorySet(base_dir=spaceport_dir) | 120 ps = story.StorySet(base_dir=spaceport_dir) |
| 121 ps.AddStory(page_module.Page('file://index.html', ps, ps.base_dir)) | 121 ps.AddStory(page_module.Page('file://index.html', ps, ps.base_dir)) |
| 122 return ps | 122 return ps |
| OLD | NEW |