| 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 test |
| 9 from telemetry.core import util | 9 from telemetry.core import util |
| 10 from telemetry.page import page | 10 from telemetry.page import page |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 class ScreenshotSyncPage(page.Page): | 30 class ScreenshotSyncPage(page.Page): |
| 31 def __init__(self, page_set, base_dir): | 31 def __init__(self, page_set, base_dir): |
| 32 super(ScreenshotSyncPage, self).__init__( | 32 super(ScreenshotSyncPage, self).__init__( |
| 33 url='file://screenshot_sync.html', | 33 url='file://screenshot_sync.html', |
| 34 page_set=page_set, | 34 page_set=page_set, |
| 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.RunAction(NavigateAction()) | 40 action_runner.NavigateToPage(self) |
| 41 action_runner.RunAction(WaitAction({ | 41 action_runner.RunAction(WaitAction({ |
| 42 'javascript': 'window.__testComplete', | 42 'javascript': 'window.__testComplete', |
| 43 'timeout': 120})) | 43 'timeout': 120})) |
| 44 | 44 |
| 45 | 45 |
| 46 class ScreenshotSyncProcess(test.Test): | 46 class ScreenshotSyncProcess(test.Test): |
| 47 """Tests that screenhots are properly synchronized with the frame one which | 47 """Tests that screenhots are properly synchronized with the frame one which |
| 48 they were requested""" | 48 they were requested""" |
| 49 test = _ScreenshotSyncValidator | 49 test = _ScreenshotSyncValidator |
| 50 | 50 |
| 51 def CreateExpectations(self, page_set): | 51 def CreateExpectations(self, page_set): |
| 52 return expectations.ScreenshotSyncExpectations() | 52 return expectations.ScreenshotSyncExpectations() |
| 53 | 53 |
| 54 def CreatePageSet(self, options): | 54 def CreatePageSet(self, options): |
| 55 ps = page_set.PageSet( | 55 ps = page_set.PageSet( |
| 56 file_path=data_path, | 56 file_path=data_path, |
| 57 description='Test cases for screenshot synchronization', | 57 description='Test cases for screenshot synchronization', |
| 58 serving_dirs=['']) | 58 serving_dirs=['']) |
| 59 ps.AddPage(ScreenshotSyncPage(ps, ps.base_dir)) | 59 ps.AddPage(ScreenshotSyncPage(ps, ps.base_dir)) |
| 60 return ps | 60 return ps |
| OLD | NEW |