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 """Runs a Google Maps pixel test. | 5 """Runs a Google Maps pixel test. |
6 Performs several common navigation actions on the map (pan, zoom, rotate) then | 6 Performs several common navigation actions on the map (pan, zoom, rotate) then |
7 captures a screenshot and compares selected pixels against expected values""" | 7 captures a screenshot and compares selected pixels against expected values""" |
8 | 8 |
9 import json | 9 import json |
10 import optparse | 10 import optparse |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 def __init__(self, page_set, base_dir): | 77 def __init__(self, page_set, base_dir): |
78 super(MapsPage, self).__init__( | 78 super(MapsPage, self).__init__( |
79 url='http://localhost:10020/tracker.html', | 79 url='http://localhost:10020/tracker.html', |
80 page_set=page_set, | 80 page_set=page_set, |
81 base_dir=base_dir, | 81 base_dir=base_dir, |
82 name='Maps.maps_002') | 82 name='Maps.maps_002') |
83 self.pixel_expectations = 'data/maps_002_expectations.json' | 83 self.pixel_expectations = 'data/maps_002_expectations.json' |
84 | 84 |
85 def RunNavigateSteps(self, action_runner): | 85 def RunNavigateSteps(self, action_runner): |
86 action_runner.NavigateToPage(self) | 86 action_runner.NavigateToPage(self) |
87 action_runner.RunAction(WaitAction({'javascript': 'window.testDone', | 87 action_runner.WaitForJavaScriptCondition('window.testDone', timeout=180) |
88 'timeout': 180})) | |
89 | 88 |
90 | 89 |
91 class Maps(cloud_storage_test_base.TestBase): | 90 class Maps(cloud_storage_test_base.TestBase): |
92 """Google Maps pixel tests.""" | 91 """Google Maps pixel tests.""" |
93 test = _MapsValidator | 92 test = _MapsValidator |
94 | 93 |
95 def CreateExpectations(self, page_set): | 94 def CreateExpectations(self, page_set): |
96 return maps_expectations.MapsExpectations() | 95 return maps_expectations.MapsExpectations() |
97 | 96 |
98 def CreatePageSet(self, options): | 97 def CreatePageSet(self, options): |
99 page_set_path = os.path.join( | 98 page_set_path = os.path.join( |
100 util.GetChromiumSrcDir(), 'content', 'test', 'gpu', 'page_sets') | 99 util.GetChromiumSrcDir(), 'content', 'test', 'gpu', 'page_sets') |
101 ps = page_set.PageSet(archive_data_file='data/maps.json', | 100 ps = page_set.PageSet(archive_data_file='data/maps.json', |
102 make_javascript_deterministic=False, | 101 make_javascript_deterministic=False, |
103 file_path=page_set_path) | 102 file_path=page_set_path) |
104 ps.AddPage(MapsPage(ps, ps.base_dir)) | 103 ps.AddPage(MapsPage(ps, ps.base_dir)) |
105 return ps | 104 return ps |
OLD | NEW |