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 |
11 import os | 11 import os |
12 | 12 |
13 import cloud_storage_test_base | 13 import cloud_storage_test_base |
14 import maps_expectations | 14 import maps_expectations |
15 | 15 |
16 from telemetry import benchmark | 16 from telemetry import benchmark |
17 from telemetry.core import bitmap | 17 from telemetry.core import bitmap |
18 from telemetry.core import util | 18 from telemetry.core import util |
19 from telemetry.page import page | 19 from telemetry.page import page |
20 from telemetry.page import page_set | 20 from telemetry.page import page_set |
21 from telemetry.page import page_test | 21 from telemetry.page import page_test |
22 # pylint: disable=W0401,W0614 | |
23 from telemetry.page.actions.all_page_actions import * | |
24 | 22 |
25 class _MapsValidator(cloud_storage_test_base.ValidatorBase): | 23 class _MapsValidator(cloud_storage_test_base.ValidatorBase): |
26 def CustomizeBrowserOptions(self, options): | 24 def CustomizeBrowserOptions(self, options): |
27 options.AppendExtraBrowserArgs('--enable-gpu-benchmarking') | 25 options.AppendExtraBrowserArgs('--enable-gpu-benchmarking') |
28 | 26 |
29 def ValidatePage(self, page, tab, results): | 27 def ValidatePage(self, page, tab, results): |
30 # TODO: This should not be necessary, but it's not clear if the test is | 28 # TODO: This should not be necessary, but it's not clear if the test is |
31 # failing on the bots in it's absence. Remove once we can verify that it's | 29 # failing on the bots in it's absence. Remove once we can verify that it's |
32 # safe to do so. | 30 # safe to do so. |
33 _MapsValidator.SpinWaitOnRAF(tab, 3) | 31 _MapsValidator.SpinWaitOnRAF(tab, 3) |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 return maps_expectations.MapsExpectations() | 94 return maps_expectations.MapsExpectations() |
97 | 95 |
98 def CreatePageSet(self, options): | 96 def CreatePageSet(self, options): |
99 page_set_path = os.path.join( | 97 page_set_path = os.path.join( |
100 util.GetChromiumSrcDir(), 'content', 'test', 'gpu', 'page_sets') | 98 util.GetChromiumSrcDir(), 'content', 'test', 'gpu', 'page_sets') |
101 ps = page_set.PageSet(archive_data_file='data/maps.json', | 99 ps = page_set.PageSet(archive_data_file='data/maps.json', |
102 make_javascript_deterministic=False, | 100 make_javascript_deterministic=False, |
103 file_path=page_set_path) | 101 file_path=page_set_path) |
104 ps.AddPage(MapsPage(ps, ps.base_dir)) | 102 ps.AddPage(MapsPage(ps, ps.base_dir)) |
105 return ps | 103 return ps |
OLD | NEW |