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

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

Issue 668753002: [Telemetry] Migrate bitmap.py from bitmaptools.cc to numpy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years 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/gpu_rasterization.py ('k') | content/test/gpu/gpu_tests/pixel.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 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
18 from telemetry.core import util 17 from telemetry.core import util
19 from telemetry.page import page 18 from telemetry.page import page
20 from telemetry.page import page_set 19 from telemetry.page import page_set
21 from telemetry.page import page_test 20 from telemetry.page import page_test
22 21
23 class _MapsValidator(cloud_storage_test_base.ValidatorBase): 22 class _MapsValidator(cloud_storage_test_base.ValidatorBase):
24 def CustomizeBrowserOptions(self, options): 23 def CustomizeBrowserOptions(self, options):
25 options.AppendExtraBrowserArgs('--enable-gpu-benchmarking') 24 options.AppendExtraBrowserArgs('--enable-gpu-benchmarking')
26 25
27 def ValidateAndMeasurePage(self, page, tab, results): 26 def ValidateAndMeasurePage(self, page, tab, results):
28 # TODO: This should not be necessary, but it's not clear if the test is 27 # 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 28 # failing on the bots in it's absence. Remove once we can verify that it's
30 # safe to do so. 29 # safe to do so.
31 _MapsValidator.SpinWaitOnRAF(tab, 3) 30 _MapsValidator.SpinWaitOnRAF(tab, 3)
32 31
33 if not tab.screenshot_supported: 32 if not tab.screenshot_supported:
34 raise page_test.Failure('Browser does not support screenshot capture') 33 raise page_test.Failure('Browser does not support screenshot capture')
35 screenshot = tab.Screenshot(5) 34 screenshot = tab.Screenshot(5)
36 if not screenshot: 35 if screenshot is None:
37 raise page_test.Failure('Could not capture screenshot') 36 raise page_test.Failure('Could not capture screenshot')
38 37
39 dpr = tab.EvaluateJavaScript('window.devicePixelRatio') 38 dpr = tab.EvaluateJavaScript('window.devicePixelRatio')
40 expected = self._ReadPixelExpectations(page) 39 expected = self._ReadPixelExpectations(page)
41 self._ValidateScreenshotSamples( 40 self._ValidateScreenshotSamples(
42 page.display_name, screenshot, expected, dpr) 41 page.display_name, screenshot, expected, dpr)
43 42
44 @staticmethod 43 @staticmethod
45 def SpinWaitOnRAF(tab, iterations, timeout = 60): 44 def SpinWaitOnRAF(tab, iterations, timeout = 60):
46 waitScript = r""" 45 waitScript = r"""
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 return maps_expectations.MapsExpectations() 94 return maps_expectations.MapsExpectations()
96 95
97 def CreatePageSet(self, options): 96 def CreatePageSet(self, options):
98 page_set_path = os.path.join( 97 page_set_path = os.path.join(
99 util.GetChromiumSrcDir(), 'content', 'test', 'gpu', 'page_sets') 98 util.GetChromiumSrcDir(), 'content', 'test', 'gpu', 'page_sets')
100 ps = page_set.PageSet(archive_data_file='data/maps.json', 99 ps = page_set.PageSet(archive_data_file='data/maps.json',
101 file_path=page_set_path, 100 file_path=page_set_path,
102 bucket=page_set.PUBLIC_BUCKET) 101 bucket=page_set.PUBLIC_BUCKET)
103 ps.AddUserStory(MapsPage(ps, ps.base_dir)) 102 ps.AddUserStory(MapsPage(ps, ps.base_dir))
104 return ps 103 return ps
OLDNEW
« no previous file with comments | « content/test/gpu/gpu_tests/gpu_rasterization.py ('k') | content/test/gpu/gpu_tests/pixel.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698