| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 import os | 4 import os |
| 5 import random | 5 import random |
| 6 | 6 |
| 7 from gpu_tests import gpu_test_base | 7 from gpu_tests import gpu_test_base |
| 8 from gpu_tests import path_util | 8 from gpu_tests import path_util |
| 9 from gpu_tests import screenshot_sync_expectations | 9 from gpu_tests import screenshot_sync_expectations |
| 10 | 10 |
| 11 from telemetry import benchmark | |
| 12 from telemetry.page import page_test | 11 from telemetry.page import page_test |
| 13 from telemetry.story import story_set as story_set_module | 12 from telemetry.story import story_set as story_set_module |
| 14 from telemetry.util import image_util | 13 from telemetry.util import image_util |
| 15 | 14 |
| 16 data_path = os.path.join( | 15 data_path = os.path.join( |
| 17 path_util.GetChromiumSrcDir(), 'content', 'test', 'data', 'gpu') | 16 path_util.GetChromiumSrcDir(), 'content', 'test', 'data', 'gpu') |
| 18 | 17 |
| 19 class ScreenshotSyncValidator(gpu_test_base.ValidatorBase): | 18 class ScreenshotSyncValidator(gpu_test_base.ValidatorBase): |
| 20 def CustomizeBrowserOptions(self, options): | 19 def CustomizeBrowserOptions(self, options): |
| 21 # --test-type=gpu is used only to suppress the "Google API Keys are missing" | 20 # --test-type=gpu is used only to suppress the "Google API Keys are missing" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 48 class ScreenshotSyncPage(gpu_test_base.PageBase): | 47 class ScreenshotSyncPage(gpu_test_base.PageBase): |
| 49 def __init__(self, story_set, base_dir, expectations): | 48 def __init__(self, story_set, base_dir, expectations): |
| 50 super(ScreenshotSyncPage, self).__init__( | 49 super(ScreenshotSyncPage, self).__init__( |
| 51 url='file://screenshot_sync.html', | 50 url='file://screenshot_sync.html', |
| 52 page_set=story_set, | 51 page_set=story_set, |
| 53 base_dir=base_dir, | 52 base_dir=base_dir, |
| 54 name='ScreenshotSync', | 53 name='ScreenshotSync', |
| 55 expectations=expectations) | 54 expectations=expectations) |
| 56 | 55 |
| 57 | 56 |
| 58 @benchmark.Disabled('linux', 'mac', 'win') | |
| 59 class ScreenshotSyncProcess(gpu_test_base.TestBase): | 57 class ScreenshotSyncProcess(gpu_test_base.TestBase): |
| 60 """Tests that screenhots are properly synchronized with the frame one which | 58 """Tests that screenhots are properly synchronized with the frame one which |
| 61 they were requested""" | 59 they were requested""" |
| 62 test = ScreenshotSyncValidator | 60 test = ScreenshotSyncValidator |
| 63 | 61 |
| 64 @classmethod | 62 @classmethod |
| 65 def Name(cls): | 63 def Name(cls): |
| 66 return 'screenshot_sync' | 64 return 'screenshot_sync' |
| 67 | 65 |
| 68 def _CreateExpectations(self): | 66 def _CreateExpectations(self): |
| 69 return screenshot_sync_expectations.ScreenshotSyncExpectations() | 67 return screenshot_sync_expectations.ScreenshotSyncExpectations() |
| 70 | 68 |
| 71 def CreateStorySet(self, options): | 69 def CreateStorySet(self, options): |
| 72 ps = story_set_module.StorySet(base_dir=data_path, serving_dirs=['']) | 70 ps = story_set_module.StorySet(base_dir=data_path, serving_dirs=['']) |
| 73 ps.AddStory(ScreenshotSyncPage(ps, ps.base_dir, self.GetExpectations())) | 71 ps.AddStory(ScreenshotSyncPage(ps, ps.base_dir, self.GetExpectations())) |
| 74 return ps | 72 return ps |
| OLD | NEW |