Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: content/test/gpu/gpu_tests/screenshot_sync.py

Issue 1384823002: Add "--test-type=gpu" to suppress API Keys InfoBar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comments Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/test/gpu/gpu_tests/pixel.py ('k') | content/test/gpu/gpu_tests/webgl_conformance.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 import random 5 import random
6 6
7 import gpu_test_base 7 import gpu_test_base
8 import path_util 8 import path_util
9 import screenshot_sync_expectations as expectations 9 import screenshot_sync_expectations as expectations
10 10
11 from telemetry import benchmark 11 from telemetry import benchmark
12 from telemetry.page import page_test 12 from telemetry.page import page_test
13 from telemetry.story import story_set as story_set_module 13 from telemetry.story import story_set as story_set_module
14 from telemetry.util import image_util 14 from telemetry.util import image_util
15 15
16 data_path = os.path.join( 16 data_path = os.path.join(
17 path_util.GetChromiumSrcDir(), 'content', 'test', 'data', 'gpu') 17 path_util.GetChromiumSrcDir(), 'content', 'test', 'data', 'gpu')
18 18
19 class ScreenshotSyncValidator(gpu_test_base.ValidatorBase): 19 class ScreenshotSyncValidator(gpu_test_base.ValidatorBase):
20 def CustomizeBrowserOptions(self, options): 20 def CustomizeBrowserOptions(self, options):
21 options.AppendExtraBrowserArgs('--force-gpu-rasterization') 21 # --test-type=gpu is used only to suppress the "Google API Keys are missing"
22 # infobar, which causes flakiness in tests.
23 options.AppendExtraBrowserArgs(['--force-gpu-rasterization',
24 '--test-type=gpu'])
22 25
23 def ValidateAndMeasurePage(self, page, tab, results): 26 def ValidateAndMeasurePage(self, page, tab, results):
24 if not tab.screenshot_supported: 27 if not tab.screenshot_supported:
25 raise page_test.Failure('Browser does not support screenshot capture') 28 raise page_test.Failure('Browser does not support screenshot capture')
26 29
27 def CheckColorMatch(canvasRGB, screenshotRGB): 30 def CheckColorMatch(canvasRGB, screenshotRGB):
28 for i in range(0, 3): 31 for i in range(0, 3):
29 if abs(canvasRGB[i] - screenshotRGB[i]) > 1: 32 if abs(canvasRGB[i] - screenshotRGB[i]) > 1:
30 raise page_test.Failure('Color mismatch in component #%d: %d vs %d' % 33 raise page_test.Failure('Color mismatch in component #%d: %d vs %d' %
31 (i, canvasRGB[i], screenshotRGB[i])) 34 (i, canvasRGB[i], screenshotRGB[i]))
(...skipping 30 matching lines...) Expand all
62 def Name(cls): 65 def Name(cls):
63 return 'screenshot_sync' 66 return 'screenshot_sync'
64 67
65 def _CreateExpectations(self): 68 def _CreateExpectations(self):
66 return expectations.ScreenshotSyncExpectations() 69 return expectations.ScreenshotSyncExpectations()
67 70
68 def CreateStorySet(self, options): 71 def CreateStorySet(self, options):
69 ps = story_set_module.StorySet(base_dir=data_path, serving_dirs=['']) 72 ps = story_set_module.StorySet(base_dir=data_path, serving_dirs=[''])
70 ps.AddStory(ScreenshotSyncPage(ps, ps.base_dir, self.GetExpectations())) 73 ps.AddStory(ScreenshotSyncPage(ps, ps.base_dir, self.GetExpectations()))
71 return ps 74 return ps
OLDNEW
« no previous file with comments | « content/test/gpu/gpu_tests/pixel.py ('k') | content/test/gpu/gpu_tests/webgl_conformance.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698