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 gpu_test_base | 14 import gpu_test_base |
15 import maps_expectations | 15 import maps_expectations |
16 import path_util | 16 import path_util |
17 | 17 |
18 from telemetry.core import util | 18 from telemetry.core import util |
19 from telemetry.page import page_test | 19 from telemetry.page import page_test |
20 from telemetry import story as story_module | 20 from telemetry import story as story_module |
21 from telemetry.story import story_set as story_set_module | 21 from telemetry.story import story_set as story_set_module |
22 | 22 |
23 class MapsValidator(cloud_storage_test_base.ValidatorBase): | 23 class MapsValidator(cloud_storage_test_base.ValidatorBase): |
24 def CustomizeBrowserOptions(self, options): | 24 def CustomizeBrowserOptions(self, options): |
25 options.AppendExtraBrowserArgs('--enable-gpu-benchmarking') | 25 # --test-type=gpu is used only to suppress the "Google API Keys are missing" |
| 26 # infobar, which causes flakiness in tests. |
| 27 options.AppendExtraBrowserArgs(['--enable-gpu-benchmarking', |
| 28 '--test-type=gpu']) |
26 | 29 |
27 def ValidateAndMeasurePage(self, page, tab, results): | 30 def ValidateAndMeasurePage(self, page, tab, results): |
28 # TODO: This should not be necessary, but it's not clear if the test is | 31 # TODO: This should not be necessary, but it's not clear if the test is |
29 # failing on the bots in it's absence. Remove once we can verify that it's | 32 # failing on the bots in it's absence. Remove once we can verify that it's |
30 # safe to do so. | 33 # safe to do so. |
31 MapsValidator.SpinWaitOnRAF(tab, 3) | 34 MapsValidator.SpinWaitOnRAF(tab, 3) |
32 | 35 |
33 if not tab.screenshot_supported: | 36 if not tab.screenshot_supported: |
34 raise page_test.Failure('Browser does not support screenshot capture') | 37 raise page_test.Failure('Browser does not support screenshot capture') |
35 screenshot = tab.Screenshot(5) | 38 screenshot = tab.Screenshot(5) |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 | 104 |
102 def CreateStorySet(self, options): | 105 def CreateStorySet(self, options): |
103 story_set_path = os.path.join( | 106 story_set_path = os.path.join( |
104 path_util.GetChromiumSrcDir(), 'content', 'test', 'gpu', 'page_sets') | 107 path_util.GetChromiumSrcDir(), 'content', 'test', 'gpu', 'page_sets') |
105 ps = story_set_module.StorySet( | 108 ps = story_set_module.StorySet( |
106 archive_data_file='data/maps.json', | 109 archive_data_file='data/maps.json', |
107 base_dir=story_set_path, | 110 base_dir=story_set_path, |
108 cloud_storage_bucket=story_module.PUBLIC_BUCKET) | 111 cloud_storage_bucket=story_module.PUBLIC_BUCKET) |
109 ps.AddStory(MapsPage(ps, ps.base_dir, self.GetExpectations())) | 112 ps.AddStory(MapsPage(ps, ps.base_dir, self.GetExpectations())) |
110 return ps | 113 return ps |
OLD | NEW |