| 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 | 5 |
| 6 import screenshot_sync_expectations as expectations | 6 import screenshot_sync_expectations as expectations |
| 7 | 7 |
| 8 from telemetry import test | 8 from telemetry import benchmark |
| 9 from telemetry.core import util | 9 from telemetry.core import util |
| 10 from telemetry.page import page | 10 from telemetry.page import page |
| 11 from telemetry.page import page_set | 11 from telemetry.page import page_set |
| 12 from telemetry.page import page_test | 12 from telemetry.page import page_test |
| 13 # pylint: disable=W0401,W0614 | 13 # pylint: disable=W0401,W0614 |
| 14 from telemetry.page.actions.all_page_actions import * | 14 from telemetry.page.actions.all_page_actions import * |
| 15 | 15 |
| 16 data_path = os.path.join( | 16 data_path = os.path.join( |
| 17 util.GetChromiumSrcDir(), 'content', 'test', 'data', 'gpu') | 17 util.GetChromiumSrcDir(), 'content', 'test', 'data', 'gpu') |
| 18 | 18 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 35 base_dir=base_dir, | 35 base_dir=base_dir, |
| 36 name='ScreenshotSync') | 36 name='ScreenshotSync') |
| 37 self.user_agent_type = 'desktop' | 37 self.user_agent_type = 'desktop' |
| 38 | 38 |
| 39 def RunNavigateSteps(self, action_runner): | 39 def RunNavigateSteps(self, action_runner): |
| 40 action_runner.NavigateToPage(self) | 40 action_runner.NavigateToPage(self) |
| 41 action_runner.WaitForJavaScriptCondition( | 41 action_runner.WaitForJavaScriptCondition( |
| 42 'window.__testComplete', timeout=120) | 42 'window.__testComplete', timeout=120) |
| 43 | 43 |
| 44 | 44 |
| 45 class ScreenshotSyncProcess(test.Test): | 45 class ScreenshotSyncProcess(benchmark.Benchmark): |
| 46 """Tests that screenhots are properly synchronized with the frame one which | 46 """Tests that screenhots are properly synchronized with the frame one which |
| 47 they were requested""" | 47 they were requested""" |
| 48 test = _ScreenshotSyncValidator | 48 test = _ScreenshotSyncValidator |
| 49 | 49 |
| 50 def CreateExpectations(self, page_set): | 50 def CreateExpectations(self, page_set): |
| 51 return expectations.ScreenshotSyncExpectations() | 51 return expectations.ScreenshotSyncExpectations() |
| 52 | 52 |
| 53 def CreatePageSet(self, options): | 53 def CreatePageSet(self, options): |
| 54 ps = page_set.PageSet(file_path=data_path, serving_dirs=['']) | 54 ps = page_set.PageSet(file_path=data_path, serving_dirs=['']) |
| 55 ps.AddPage(ScreenshotSyncPage(ps, ps.base_dir)) | 55 ps.AddPage(ScreenshotSyncPage(ps, ps.base_dir)) |
| 56 return ps | 56 return ps |
| OLD | NEW |