Commit 7bd3c532 authored by Brian Sheedy's avatar Brian Sheedy Committed by Commit Bot

Switch remaining GPU expected color tests

Switches all remaining uses of expected colors in the GPU pixel tests to
regular pixel tests. Initially, these are set to use the very permissive
Sobel algorithm so that images are auto-triaged until enough data is
collected to calculate suitable less permissive parameters. The tests
have grace periods defined until June 22nd, so any flakes that are not
caught by the permissive algorithm will not affect the bots.

Bug: 1078914
Change-Id: Ia59bba2d5117b66a537b4be3894cc9b2725ead56
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2219585
Auto-Submit: Brian Sheedy <bsheedy@chromium.org>
Reviewed-by: default avatarYuly Novikov <ynovikov@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#773911}
parent d429ec69
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
import json import datetime
import os import os
import sys import sys
...@@ -20,7 +20,7 @@ _MAPS_PERF_TEST_PATH = os.path.join(path_util.GetChromiumSrcDir(), 'tools', ...@@ -20,7 +20,7 @@ _MAPS_PERF_TEST_PATH = os.path.join(path_util.GetChromiumSrcDir(), 'tools',
_DATA_PATH = os.path.join(path_util.GetChromiumSrcDir(), 'content', 'test', _DATA_PATH = os.path.join(path_util.GetChromiumSrcDir(), 'content', 'test',
'gpu', 'gpu_tests') 'gpu', 'gpu_tests')
_TOLERANCE = 6 _TEST_NAME = 'Maps_maps'
class MapsIntegrationTest( class MapsIntegrationTest(
...@@ -68,12 +68,10 @@ class MapsIntegrationTest( ...@@ -68,12 +68,10 @@ class MapsIntegrationTest(
# artifact of the failure to help with debugging. There are no accepted # artifact of the failure to help with debugging. There are no accepted
# positive baselines recorded in Skia Gold, so its diff will not be # positive baselines recorded in Skia Gold, so its diff will not be
# sufficient to debugging the failure. # sufficient to debugging the failure.
yield ('Maps_maps', 'file://performance.html', yield ('Maps_maps', 'file://performance.html', ())
('maps_pixel_expectations.json'))
def RunActualGpuTest(self, url, *args): def RunActualGpuTest(self, url, *_):
tab = self.tab tab = self.tab
pixel_expectations_file = args[0]
action_runner = tab.action_runner action_runner = tab.action_runner
action_runner.Navigate(url) action_runner.Navigate(url)
action_runner.WaitForJavaScriptCondition('window.startTest != undefined') action_runner.WaitForJavaScriptCondition('window.startTest != undefined')
...@@ -94,17 +92,8 @@ class MapsIntegrationTest( ...@@ -94,17 +92,8 @@ class MapsIntegrationTest(
dpr = tab.EvaluateJavaScript('window.devicePixelRatio') dpr = tab.EvaluateJavaScript('window.devicePixelRatio')
print 'Maps\' devicePixelRatio is ' + str(dpr) print 'Maps\' devicePixelRatio is ' + str(dpr)
# Even though the Maps test uses a fixed devicePixelRatio so that page = _GetMapsPageForUrl(url)
# it fetches all of the map tiles at the same resolution, on two self._UploadTestResultToSkiaGold(_TEST_NAME, screenshot, page,
# different devices with the same devicePixelRatio (a Retina
# MacBook Pro and a Nexus 9), different scale factors of the final
# screenshot are observed. Hack around this by specifying a scale
# factor for these bots in the test expectations. This relies on
# the test-machine-name argument being specified on the command
# line.
expected = _ReadPixelExpectations(pixel_expectations_file)
page = _MapsExpectationToPixelExpectation(url, expected, _TOLERANCE)
self._ValidateScreenshotSamplesWithSkiaGold(tab, page, screenshot, dpr,
self._GetBuildIdArgs()) self._GetBuildIdArgs())
@classmethod @classmethod
...@@ -116,22 +105,15 @@ class MapsIntegrationTest( ...@@ -116,22 +105,15 @@ class MapsIntegrationTest(
] ]
def _ReadPixelExpectations(expectations_file): def _GetMapsPageForUrl(url):
expectations_path = os.path.join(_DATA_PATH, expectations_file)
with open(expectations_path, 'r') as f:
json_contents = json.load(f)
return json_contents
def _MapsExpectationToPixelExpectation(url, expected_colors, tolerance):
page = pixel_test_pages.PixelTestPage( page = pixel_test_pages.PixelTestPage(
url=url, url=url,
name=('Maps_maps'), name=_TEST_NAME,
# Exact test_rect is arbitrary, just needs to encapsulate all pixels # Exact test_rect is arbitrary, just needs to encapsulate all pixels
# that are tested. # that are tested.
test_rect=[0, 0, 600, 400], test_rect=[0, 0, 600, 400],
tolerance=tolerance, grace_period_end=datetime.date(2020, 6, 22),
expected_colors=expected_colors) matching_algorithm=pixel_test_pages.VERY_PERMISSIVE_SOBEL_ALGO)
return page return page
......
[
{
"comment": "scale factor overrides",
"scale_factor_overrides": [
{
"device_type": "Nexus 5",
"scale_factor": 1.105
},
{
"device_type": "Nexus 5X",
"scale_factor": 1.105
},
{
"device_type": "Nexus 6",
"scale_factor": 1.47436
},
{
"device_type": "Nexus 6P",
"scale_factor": 1.472
},
{
"device_type": "Nexus 9",
"scale_factor": 1.566
},
{
"comment": "NVIDIA Shield",
"device_type": "sb_na_wf",
"scale_factor": 1.226
}
]
},
{
"comment": "light green",
"location": [ 43, 247 ],
"size": [ 1, 1 ],
"color": [ 214, 232, 186 ]
},
{
"comment": "darker green",
"location": [ 326, 111 ],
"size": [ 1, 1 ],
"color": [ 203, 230, 163 ]
},
{
"comment": "blue lake",
"location": [ 593, 393 ],
"size": [ 1, 1 ],
"color": [ 163, 205, 255 ]
},
{
"comment": "gray",
"location": [ 95, 117 ],
"size": [ 1, 1 ],
"color": [ 232, 232, 232 ]
},
{
"comment": "tan",
"location": [ 344, 263 ],
"size": [ 1, 1 ],
"color": [ 240, 237, 230 ]
}
]
...@@ -9,40 +9,16 @@ import datetime ...@@ -9,40 +9,16 @@ import datetime
from gpu_tests import skia_gold_matching_algorithms as algo from gpu_tests import skia_gold_matching_algorithms as algo
_FOUR_COLOR_VIDEO_240x135_EXPECTED_COLORS = [
{
'comment': 'top left video, yellow',
'location': [5, 5],
'size': [110, 57],
'color': [255, 255, 15],
},
{
'comment': 'top right video, red',
'location': [125, 5],
'size': [110, 57],
'color': [255, 17, 24],
},
{
'comment': 'bottom left video, blue',
'location': [5, 72],
'size': [110, 57],
'color': [12, 12, 255],
},
{
'comment': 'bottom right video, green',
'location': [125, 72],
'size': [110, 57],
'color': [44, 255, 16],
},
]
CRASH_TYPE_GPU = 'gpu' CRASH_TYPE_GPU = 'gpu'
# Meant to be used when we know a test is going to be noisy, and we want any # Meant to be used when we know a test is going to be noisy, and we want any
# images it generates to be auto-triaged until we have enough data to calculate # images it generates to be auto-triaged until we have enough data to calculate
# more suitable/less permissive parameters. # more suitable/less permissive parameters.
VERY_PERMISSIVE_SOBEL_ALGO = algo.SobelMatchingAlgorithm( VERY_PERMISSIVE_SOBEL_ALGO = algo.SobelMatchingAlgorithm(
max_different_pixels=1000000, pixel_delta_threshold=255, edge_threshold=0) max_different_pixels=100000000,
pixel_delta_threshold=255,
edge_threshold=0,
ignored_border_thickness=1)
class PixelTestPage(object): class PixelTestPage(object):
...@@ -178,14 +154,6 @@ class PixelTestPages(object): ...@@ -178,14 +154,6 @@ class PixelTestPages(object):
def DefaultPages(base_name): def DefaultPages(base_name):
sw_compositing_args = ['--disable-gpu-compositing'] sw_compositing_args = ['--disable-gpu-compositing']
# Tolerance of 10% is required for all the formats to match gold/pixel
# expectations on all the platforms for pixel video tests. Hence setting it
# to 20.
# Bug filed on MacOSX to investigate the tolerance -
# https://crbug.com/911895.
tolerance = 20
tolerance_vp9 = 20
return [ return [
PixelTestPage('pixel_background_image.html', PixelTestPage('pixel_background_image.html',
base_name + '_BackgroundImage', base_name + '_BackgroundImage',
...@@ -235,198 +203,51 @@ class PixelTestPages(object): ...@@ -235,198 +203,51 @@ class PixelTestPages(object):
PixelTestPage('pixel_background.html', PixelTestPage('pixel_background.html',
base_name + '_SolidColorBackground', base_name + '_SolidColorBackground',
test_rect=[500, 500, 100, 100]), test_rect=[500, 500, 100, 100]),
PixelTestPage( PixelTestPage('pixel_video_mp4.html',
'pixel_video_mp4.html',
base_name + '_Video_MP4', base_name + '_Video_MP4',
test_rect=[0, 0, 240, 135], test_rect=[0, 0, 240, 135],
tolerance=tolerance, grace_period_end=datetime.date(2020, 6, 22),
expected_colors=_FOUR_COLOR_VIDEO_240x135_EXPECTED_COLORS), matching_algorithm=VERY_PERMISSIVE_SOBEL_ALGO),
PixelTestPage( PixelTestPage('pixel_video_mp4.html',
'pixel_video_mp4.html',
base_name + '_Video_MP4_DXVA', base_name + '_Video_MP4_DXVA',
browser_args=['--disable-features=D3D11VideoDecoder'], browser_args=['--disable-features=D3D11VideoDecoder'],
test_rect=[0, 0, 240, 135], test_rect=[0, 0, 240, 135],
tolerance=tolerance, grace_period_end=datetime.date(2020, 6, 22),
expected_colors=_FOUR_COLOR_VIDEO_240x135_EXPECTED_COLORS), matching_algorithm=VERY_PERMISSIVE_SOBEL_ALGO),
PixelTestPage('pixel_video_mp4_four_colors_aspect_4x3.html', PixelTestPage('pixel_video_mp4_four_colors_aspect_4x3.html',
base_name + '_Video_MP4_FourColors_Aspect_4x3', base_name + '_Video_MP4_FourColors_Aspect_4x3',
test_rect=[0, 0, 240, 135], test_rect=[0, 0, 240, 135],
tolerance=tolerance, grace_period_end=datetime.date(2020, 6, 22),
expected_colors=[ matching_algorithm=VERY_PERMISSIVE_SOBEL_ALGO),
{
'comment':
'outside video content, left side, white',
'location': [1, 1],
'size': [28, 133],
'color': [255, 255, 255],
},
{
'comment':
'outside video content, right side, white',
'location': [211, 1],
'size': [28, 133],
'color': [255, 255, 255],
},
{
'comment': 'top left video, yellow',
'location': [35, 5],
'size': [80, 57],
'color': [255, 255, 15],
},
{
'comment': 'top right video, red',
'location': [125, 5],
'size': [80, 57],
'color': [255, 17, 24],
},
{
'comment': 'bottom left video, blue',
'location': [35, 73],
'size': [80, 57],
'color': [12, 12, 255],
},
{
'comment': 'bottom right video, green',
'location': [125, 73],
'size': [80, 57],
'color': [44, 255, 16],
},
]),
PixelTestPage('pixel_video_mp4_four_colors_rot_90.html', PixelTestPage('pixel_video_mp4_four_colors_rot_90.html',
base_name + '_Video_MP4_FourColors_Rot_90', base_name + '_Video_MP4_FourColors_Rot_90',
test_rect=[0, 0, 270, 240], test_rect=[0, 0, 270, 240],
tolerance=tolerance, grace_period_end=datetime.date(2020, 6, 22),
expected_colors=[ matching_algorithm=VERY_PERMISSIVE_SOBEL_ALGO),
{
'comment':
'outside video content, left side, white',
'location': [1, 1],
'size': [60, 238],
'color': [255, 255, 255],
},
{
'comment':
'outside video content, right side, white',
'location': [210, 1],
'size': [60, 238],
'color': [255, 255, 255],
},
{
'comment': 'top left video, red',
'location': [73, 5],
'size': [55, 110],
'color': [255, 17, 24],
},
{
'comment': 'top right video, green',
'location': [141, 5],
'size': [55, 110],
'color': [44, 255, 16],
},
{
'comment': 'bottom left video, yellow',
'location': [73, 125],
'size': [55, 110],
'color': [255, 255, 15],
},
{
'comment': 'bottom right video, blue',
'location': [141, 125],
'size': [55, 110],
'color': [12, 12, 255],
},
]),
PixelTestPage('pixel_video_mp4_four_colors_rot_180.html', PixelTestPage('pixel_video_mp4_four_colors_rot_180.html',
base_name + '_Video_MP4_FourColors_Rot_180', base_name + '_Video_MP4_FourColors_Rot_180',
test_rect=[0, 0, 240, 135], test_rect=[0, 0, 240, 135],
tolerance=tolerance, grace_period_end=datetime.date(2020, 6, 22),
expected_colors=[ matching_algorithm=VERY_PERMISSIVE_SOBEL_ALGO),
{
'comment': 'top left video, green',
'location': [5, 5],
'size': [110, 57],
'color': [44, 255, 16],
},
{
'comment': 'top right video, blue',
'location': [125, 5],
'size': [110, 57],
'color': [12, 12, 255],
},
{
'comment': 'bottom left video, red',
'location': [5, 72],
'size': [110, 57],
'color': [255, 17, 24],
},
{
'comment': 'bottom right video, yellow',
'location': [125, 72],
'size': [110, 57],
'color': [255, 255, 15],
},
]),
PixelTestPage('pixel_video_mp4_four_colors_rot_270.html', PixelTestPage('pixel_video_mp4_four_colors_rot_270.html',
base_name + '_Video_MP4_FourColors_Rot_270', base_name + '_Video_MP4_FourColors_Rot_270',
test_rect=[0, 0, 270, 240], test_rect=[0, 0, 270, 240],
tolerance=tolerance, grace_period_end=datetime.date(2020, 6, 22),
expected_colors=[ matching_algorithm=VERY_PERMISSIVE_SOBEL_ALGO),
{
'comment':
'outside video content, left side, white',
'location': [1, 1],
'size': [60, 238],
'color': [255, 255, 255],
},
{
'comment':
'outside video content, right side, white',
'location': [210, 1],
'size': [60, 238],
'color': [255, 255, 255],
},
{
'comment': 'top left video, blue',
'location': [73, 5],
'size': [55, 110],
'color': [12, 12, 255],
},
{
'comment': 'top right video, yellow',
'location': [141, 5],
'size': [55, 110],
'color': [255, 255, 15],
},
{
'comment': 'bottom left video, green',
'location': [73, 125],
'size': [55, 110],
'color': [44, 255, 16],
},
{
'comment': 'bottom right video, red',
'location': [141, 125],
'size': [55, 110],
'color': [255, 17, 24],
},
]),
PixelTestPage('pixel_video_mp4_rounded_corner.html', PixelTestPage('pixel_video_mp4_rounded_corner.html',
base_name + '_Video_MP4_Rounded_Corner', base_name + '_Video_MP4_Rounded_Corner',
test_rect=[0, 0, 240, 135], test_rect=[0, 0, 240, 135]),
tolerance=tolerance), PixelTestPage('pixel_video_vp9.html',
PixelTestPage(
'pixel_video_vp9.html',
base_name + '_Video_VP9', base_name + '_Video_VP9',
test_rect=[0, 0, 240, 135], test_rect=[0, 0, 240, 135],
tolerance=tolerance_vp9, grace_period_end=datetime.date(2020, 6, 22),
expected_colors=_FOUR_COLOR_VIDEO_240x135_EXPECTED_COLORS), matching_algorithm=VERY_PERMISSIVE_SOBEL_ALGO),
PixelTestPage( PixelTestPage('pixel_video_vp9.html',
'pixel_video_vp9.html',
base_name + '_Video_VP9_DXVA', base_name + '_Video_VP9_DXVA',
browser_args=['--disable-features=D3D11VideoDecoder'], browser_args=['--disable-features=D3D11VideoDecoder'],
test_rect=[0, 0, 240, 135], test_rect=[0, 0, 240, 135],
tolerance=tolerance_vp9, grace_period_end=datetime.date(2020, 6, 22),
expected_colors=_FOUR_COLOR_VIDEO_240x135_EXPECTED_COLORS), matching_algorithm=VERY_PERMISSIVE_SOBEL_ALGO),
# The MP4 contains H.264 which is primarily hardware decoded on bots. # The MP4 contains H.264 which is primarily hardware decoded on bots.
PixelTestPage( PixelTestPage(
...@@ -434,8 +255,8 @@ class PixelTestPages(object): ...@@ -434,8 +255,8 @@ class PixelTestPages(object):
'/media/test/data/four-colors.mp4', '/media/test/data/four-colors.mp4',
base_name + '_Video_Context_Loss_MP4', base_name + '_Video_Context_Loss_MP4',
test_rect=[0, 0, 240, 135], test_rect=[0, 0, 240, 135],
tolerance=tolerance, grace_period_end=datetime.date(2020, 6, 22),
expected_colors=_FOUR_COLOR_VIDEO_240x135_EXPECTED_COLORS, matching_algorithm=VERY_PERMISSIVE_SOBEL_ALGO,
expected_per_process_crashes={ expected_per_process_crashes={
CRASH_TYPE_GPU: 1, CRASH_TYPE_GPU: 1,
}), }),
...@@ -445,15 +266,14 @@ class PixelTestPages(object): ...@@ -445,15 +266,14 @@ class PixelTestPages(object):
'?src=/media/test/data/four-colors-vp9.webm'), '?src=/media/test/data/four-colors-vp9.webm'),
base_name + '_Video_Context_Loss_VP9', base_name + '_Video_Context_Loss_VP9',
test_rect=[0, 0, 240, 135], test_rect=[0, 0, 240, 135],
tolerance=tolerance_vp9, grace_period_end=datetime.date(2020, 6, 22),
expected_colors=_FOUR_COLOR_VIDEO_240x135_EXPECTED_COLORS, matching_algorithm=VERY_PERMISSIVE_SOBEL_ALGO,
expected_per_process_crashes={ expected_per_process_crashes={
CRASH_TYPE_GPU: 1, CRASH_TYPE_GPU: 1,
}), }),
PixelTestPage('pixel_video_backdrop_filter.html', PixelTestPage('pixel_video_backdrop_filter.html',
base_name + '_Video_BackdropFilter', base_name + '_Video_BackdropFilter',
test_rect=[0, 0, 240, 135], test_rect=[0, 0, 240, 135]),
tolerance=tolerance),
PixelTestPage('pixel_webgl_premultiplied_alpha_false.html', PixelTestPage('pixel_webgl_premultiplied_alpha_false.html',
base_name + '_WebGL_PremultipliedAlpha_False', base_name + '_WebGL_PremultipliedAlpha_False',
test_rect=[0, 0, 150, 150]), test_rect=[0, 0, 150, 150]),
...@@ -486,87 +306,27 @@ class PixelTestPages(object): ...@@ -486,87 +306,27 @@ class PixelTestPages(object):
base_name + '_WebGLReadPixelsTabSwitch', base_name + '_WebGLReadPixelsTabSwitch',
test_rect=[0, 0, 100, 100], test_rect=[0, 0, 100, 100],
optional_action='SwitchTabs', optional_action='SwitchTabs',
tolerance=3, grace_period_end=datetime.date(2020, 6, 22),
expected_colors=[ matching_algorithm=VERY_PERMISSIVE_SOBEL_ALGO),
{
'comment': 'top left, red',
'location': [5, 5],
'size': [40, 40],
'color': [255, 0, 0],
},
{
'comment': 'bottom right, red',
'location': [55, 55],
'size': [40, 40],
'color': [255, 0, 0],
},
{
'comment': 'top right, blue',
'location': [55, 5],
'size': [40, 40],
'color': [0, 0, 255],
},
{
'comment': 'bottom left, green',
'location': [5, 55],
'size': [40, 40],
'color': [0, 255, 0],
},
]),
PixelTestPage('pixel_webgl_read_pixels_tab_switch.html', PixelTestPage('pixel_webgl_read_pixels_tab_switch.html',
base_name + base_name +
'_WebGLReadPixelsTabSwitch_SoftwareCompositing', '_WebGLReadPixelsTabSwitch_SoftwareCompositing',
test_rect=[0, 0, 100, 100], test_rect=[0, 0, 100, 100],
browser_args=sw_compositing_args, browser_args=sw_compositing_args,
optional_action='SwitchTabs', optional_action='SwitchTabs',
tolerance=3, grace_period_end=datetime.date(2020, 6, 22),
expected_colors=[ matching_algorithm=VERY_PERMISSIVE_SOBEL_ALGO),
{
'comment': 'top left, red',
'location': [5, 5],
'size': [40, 40],
'color': [255, 0, 0],
},
{
'comment': 'bottom right, red',
'location': [55, 55],
'size': [40, 40],
'color': [255, 0, 0],
},
{
'comment': 'top right, blue',
'location': [55, 5],
'size': [40, 40],
'color': [0, 0, 255],
},
{
'comment': 'bottom left, green',
'location': [5, 55],
'size': [40, 40],
'color': [0, 255, 0],
},
]),
PixelTestPage('pixel_offscreen_canvas_ibrc_webgl_main.html', PixelTestPage('pixel_offscreen_canvas_ibrc_webgl_main.html',
base_name + '_OffscreenCanvasIBRCWebGLMain', base_name + '_OffscreenCanvasIBRCWebGLMain',
test_rect=[0, 0, 300, 300], test_rect=[0, 0, 300, 300],
tolerance=3, grace_period_end=datetime.date(2020, 6, 22),
expected_colors=[{ matching_algorithm=VERY_PERMISSIVE_SOBEL_ALGO,
'comment': 'solid green',
'location': [100, 100],
'size': [100, 100],
'color': [0, 255, 0],
}],
optional_action='RunOffscreenCanvasIBRCWebGLTest'), optional_action='RunOffscreenCanvasIBRCWebGLTest'),
PixelTestPage('pixel_offscreen_canvas_ibrc_webgl_worker.html', PixelTestPage('pixel_offscreen_canvas_ibrc_webgl_worker.html',
base_name + '_OffscreenCanvasIBRCWebGLWorker', base_name + '_OffscreenCanvasIBRCWebGLWorker',
test_rect=[0, 0, 300, 300], test_rect=[0, 0, 300, 300],
tolerance=3, grace_period_end=datetime.date(2020, 6, 22),
expected_colors=[{ matching_algorithm=VERY_PERMISSIVE_SOBEL_ALGO,
'comment': 'solid green',
'location': [100, 100],
'size': [100, 100],
'color': [0, 255, 0],
}],
optional_action='RunOffscreenCanvasIBRCWebGLTest'), optional_action='RunOffscreenCanvasIBRCWebGLTest'),
] ]
...@@ -577,120 +337,19 @@ class PixelTestPages(object): ...@@ -577,120 +337,19 @@ class PixelTestPages(object):
'--force-gpu-rasterization', '--disable-software-compositing-fallback' '--force-gpu-rasterization', '--disable-software-compositing-fallback'
] ]
return [ return [
PixelTestPage( PixelTestPage('pixel_background.html',
'pixel_background.html',
base_name + '_GpuRasterization_BlueBox', base_name + '_GpuRasterization_BlueBox',
test_rect=[0, 0, 220, 220], test_rect=[0, 0, 220, 220],
browser_args=browser_args, browser_args=browser_args,
tolerance=0, grace_period_end=datetime.date(2020, 6, 22),
expected_colors=[ matching_algorithm=VERY_PERMISSIVE_SOBEL_ALGO),
{ PixelTestPage('concave_paths.html',
'comment': 'body-t',
'location': [5, 5],
'size': [1, 1],
'color': [0, 128, 0],
},
{
'comment': 'body-r',
'location': [215, 5],
'size': [1, 1],
'color': [0, 128, 0],
},
{
'comment': 'body-b',
'location': [215, 215],
'size': [1, 1],
'color': [0, 128, 0],
},
{
'comment': 'body-l',
'location': [5, 215],
'size': [1, 1],
'color': [0, 128, 0],
},
{
'comment': 'background-t',
'location': [30, 30],
'size': [1, 1],
'color': [0, 0, 0],
},
{
'comment': 'background-r',
'location': [170, 30],
'size': [1, 1],
'color': [0, 0, 0],
},
{
'comment': 'background-b',
'location': [170, 170],
'size': [1, 1],
'color': [0, 0, 0],
},
{
'comment': 'background-l',
'location': [30, 170],
'size': [1, 1],
'color': [0, 0, 0],
},
{
'comment': 'box-t',
'location': [70, 70],
'size': [1, 1],
'color': [0, 0, 255],
},
{
'comment': 'box-r',
'location': [140, 70],
'size': [1, 1],
'color': [0, 0, 255],
},
{
'comment': 'box-b',
'location': [140, 140],
'size': [1, 1],
'color': [0, 0, 255],
},
{
'comment': 'box-l',
'location': [70, 140],
'size': [1, 1],
'color': [0, 0, 255],
},
]),
PixelTestPage(
'concave_paths.html',
base_name + '_GpuRasterization_ConcavePaths', base_name + '_GpuRasterization_ConcavePaths',
test_rect=[0, 0, 100, 100], test_rect=[0, 0, 100, 100],
browser_args=browser_args, browser_args=browser_args,
tolerance=0, grace_period_end=datetime.date(2020, 6, 22),
expected_colors=[ matching_algorithm=VERY_PERMISSIVE_SOBEL_ALGO),
{ PixelTestPage('pixel_precision_rounded_corner.html',
'comment': 'outside',
'location': [80, 60],
'size': [1, 1],
'color': [255, 255, 255],
},
{
'comment': 'outside',
'location': [28, 20],
'size': [1, 1],
'color': [255, 255, 255],
},
{
'comment': 'inside',
'location': [32, 25],
'size': [1, 1],
'color': [255, 215, 0],
},
{
'comment': 'inside',
'location': [80, 80],
'size': [1, 1],
'color': [255, 215, 0],
},
]),
PixelTestPage(
'pixel_precision_rounded_corner.html',
base_name + '_PrecisionRoundedCorner', base_name + '_PrecisionRoundedCorner',
test_rect=[0, 0, 400, 400], test_rect=[0, 0, 400, 400],
browser_args=browser_args, browser_args=browser_args,
...@@ -731,84 +390,59 @@ class PixelTestPages(object): ...@@ -731,84 +390,59 @@ class PixelTestPages(object):
] ]
return [ return [
PixelTestPage( PixelTestPage('pixel_offscreenCanvas_transfer_after_style_resize.html',
'pixel_offscreenCanvas_transfer_after_style_resize.html',
base_name + '_OffscreenCanvasTransferAfterStyleResize', base_name + '_OffscreenCanvasTransferAfterStyleResize',
test_rect=[0, 0, 350, 350], test_rect=[0, 0, 350, 350],
browser_args=browser_args), browser_args=browser_args),
PixelTestPage( PixelTestPage('pixel_offscreenCanvas_transfer_before_style_resize.html',
'pixel_offscreenCanvas_transfer_before_style_resize.html',
base_name + '_OffscreenCanvasTransferBeforeStyleResize', base_name + '_OffscreenCanvasTransferBeforeStyleResize',
test_rect=[0, 0, 350, 350], test_rect=[0, 0, 350, 350],
browser_args=browser_args), browser_args=browser_args),
PixelTestPage( PixelTestPage('pixel_offscreenCanvas_webgl_paint_after_resize.html',
'pixel_offscreenCanvas_webgl_paint_after_resize.html',
base_name + '_OffscreenCanvasWebGLPaintAfterResize', base_name + '_OffscreenCanvasWebGLPaintAfterResize',
test_rect=[0, 0, 200, 200], test_rect=[0, 0, 200, 200],
browser_args=browser_args, browser_args=browser_args,
tolerance=0, grace_period_end=datetime.date(2020, 6, 22),
expected_colors=[ matching_algorithm=VERY_PERMISSIVE_SOBEL_ALGO),
SCALE_FACTOR_OVERRIDES, PixelTestPage('pixel_offscreenCanvas_transferToImageBitmap_main.html',
{
'comment': 'resized area',
'location': [1, 1],
'size': [48, 98],
'color': [0, 255, 0],
},
{
'comment': 'outside resized area',
'location': [51, 1],
'size': [48, 98],
'color': [255, 255, 255],
},
]),
PixelTestPage(
'pixel_offscreenCanvas_transferToImageBitmap_main.html',
base_name + '_OffscreenCanvasTransferToImageBitmap', base_name + '_OffscreenCanvasTransferToImageBitmap',
test_rect=[0, 0, 300, 300], test_rect=[0, 0, 300, 300],
browser_args=browser_args), browser_args=browser_args),
PixelTestPage( PixelTestPage('pixel_offscreenCanvas_transferToImageBitmap_worker.html',
'pixel_offscreenCanvas_transferToImageBitmap_worker.html',
base_name + '_OffscreenCanvasTransferToImageBitmapWorker', base_name + '_OffscreenCanvasTransferToImageBitmapWorker',
test_rect=[0, 0, 300, 300], test_rect=[0, 0, 300, 300],
browser_args=browser_args), browser_args=browser_args),
PixelTestPage( PixelTestPage('pixel_offscreenCanvas_webgl_commit_main.html',
'pixel_offscreenCanvas_webgl_commit_main.html',
base_name + '_OffscreenCanvasWebGLDefault', base_name + '_OffscreenCanvasWebGLDefault',
test_rect=[0, 0, 360, 200], test_rect=[0, 0, 360, 200],
browser_args=browser_args), browser_args=browser_args),
PixelTestPage( PixelTestPage('pixel_offscreenCanvas_webgl_commit_worker.html',
'pixel_offscreenCanvas_webgl_commit_worker.html',
base_name + '_OffscreenCanvasWebGLDefaultWorker', base_name + '_OffscreenCanvasWebGLDefaultWorker',
test_rect=[0, 0, 360, 200], test_rect=[0, 0, 360, 200],
browser_args=browser_args), browser_args=browser_args),
PixelTestPage( PixelTestPage('pixel_offscreenCanvas_webgl_commit_main.html',
'pixel_offscreenCanvas_webgl_commit_main.html',
base_name + '_OffscreenCanvasWebGLSoftwareCompositing', base_name + '_OffscreenCanvasWebGLSoftwareCompositing',
test_rect=[0, 0, 360, 200], test_rect=[0, 0, 360, 200],
browser_args=browser_args + ['--disable-gpu-compositing']), browser_args=browser_args +
['--disable-gpu-compositing']),
PixelTestPage( PixelTestPage(
'pixel_offscreenCanvas_webgl_commit_worker.html', 'pixel_offscreenCanvas_webgl_commit_worker.html',
base_name + '_OffscreenCanvasWebGLSoftwareCompositingWorker', base_name + '_OffscreenCanvasWebGLSoftwareCompositingWorker',
test_rect=[0, 0, 360, 200], test_rect=[0, 0, 360, 200],
browser_args=browser_args + ['--disable-gpu-compositing']), browser_args=browser_args + ['--disable-gpu-compositing']),
PixelTestPage( PixelTestPage('pixel_offscreenCanvas_2d_commit_main.html',
'pixel_offscreenCanvas_2d_commit_main.html',
base_name + '_OffscreenCanvasAccelerated2D', base_name + '_OffscreenCanvasAccelerated2D',
test_rect=[0, 0, 360, 200], test_rect=[0, 0, 360, 200],
browser_args=browser_args + accelerated_args), browser_args=browser_args + accelerated_args),
PixelTestPage( PixelTestPage('pixel_offscreenCanvas_2d_commit_worker.html',
'pixel_offscreenCanvas_2d_commit_worker.html',
base_name + '_OffscreenCanvasAccelerated2DWorker', base_name + '_OffscreenCanvasAccelerated2DWorker',
test_rect=[0, 0, 360, 200], test_rect=[0, 0, 360, 200],
browser_args=browser_args + accelerated_args), browser_args=browser_args + accelerated_args),
PixelTestPage( PixelTestPage('pixel_offscreenCanvas_2d_commit_main.html',
'pixel_offscreenCanvas_2d_commit_main.html',
base_name + '_OffscreenCanvasUnaccelerated2D', base_name + '_OffscreenCanvasUnaccelerated2D',
test_rect=[0, 0, 360, 200], test_rect=[0, 0, 360, 200],
browser_args=browser_args + unaccelerated_args), browser_args=browser_args + unaccelerated_args),
PixelTestPage( PixelTestPage('pixel_offscreenCanvas_2d_commit_worker.html',
'pixel_offscreenCanvas_2d_commit_worker.html',
base_name + '_OffscreenCanvasUnaccelerated2DWorker', base_name + '_OffscreenCanvasUnaccelerated2DWorker',
test_rect=[0, 0, 360, 200], test_rect=[0, 0, 360, 200],
browser_args=browser_args + unaccelerated_args), browser_args=browser_args + unaccelerated_args),
...@@ -822,23 +456,19 @@ class PixelTestPages(object): ...@@ -822,23 +456,19 @@ class PixelTestPages(object):
base_name + '_OffscreenCanvasUnaccelerated2DGPUCompositingWorker', base_name + '_OffscreenCanvasUnaccelerated2DGPUCompositingWorker',
test_rect=[0, 0, 360, 200], test_rect=[0, 0, 360, 200],
browser_args=browser_args + ['--disable-accelerated-2d-canvas']), browser_args=browser_args + ['--disable-accelerated-2d-canvas']),
PixelTestPage( PixelTestPage('pixel_offscreenCanvas_2d_resize_on_worker.html',
'pixel_offscreenCanvas_2d_resize_on_worker.html',
base_name + '_OffscreenCanvas2DResizeOnWorker', base_name + '_OffscreenCanvas2DResizeOnWorker',
test_rect=[0, 0, 200, 200], test_rect=[0, 0, 200, 200],
browser_args=browser_args), browser_args=browser_args),
PixelTestPage( PixelTestPage('pixel_offscreenCanvas_webgl_resize_on_worker.html',
'pixel_offscreenCanvas_webgl_resize_on_worker.html',
base_name + '_OffscreenCanvasWebglResizeOnWorker', base_name + '_OffscreenCanvasWebglResizeOnWorker',
test_rect=[0, 0, 200, 200], test_rect=[0, 0, 200, 200],
browser_args=browser_args), browser_args=browser_args),
PixelTestPage( PixelTestPage('pixel_canvas_display_srgb.html',
'pixel_canvas_display_srgb.html',
base_name + '_CanvasDisplaySRGBAccelerated2D', base_name + '_CanvasDisplaySRGBAccelerated2D',
test_rect=[0, 0, 140, 140], test_rect=[0, 0, 140, 140],
browser_args=browser_args + accelerated_args), browser_args=browser_args + accelerated_args),
PixelTestPage( PixelTestPage('pixel_canvas_display_srgb.html',
'pixel_canvas_display_srgb.html',
base_name + '_CanvasDisplaySRGBUnaccelerated2D', base_name + '_CanvasDisplaySRGBUnaccelerated2D',
test_rect=[0, 0, 140, 140], test_rect=[0, 0, 140, 140],
browser_args=browser_args + unaccelerated_args), browser_args=browser_args + unaccelerated_args),
...@@ -847,31 +477,20 @@ class PixelTestPages(object): ...@@ -847,31 +477,20 @@ class PixelTestPages(object):
base_name + '_CanvasDisplaySRGBUnaccelerated2DGPUCompositing', base_name + '_CanvasDisplaySRGBUnaccelerated2DGPUCompositing',
test_rect=[0, 0, 140, 140], test_rect=[0, 0, 140, 140],
browser_args=browser_args + ['--disable-accelerated-2d-canvas']), browser_args=browser_args + ['--disable-accelerated-2d-canvas']),
PixelTestPage( PixelTestPage('pixel_canvas_low_latency_2d.html',
'pixel_canvas_low_latency_2d.html',
base_name + '_CanvasLowLatency2D', base_name + '_CanvasLowLatency2D',
test_rect=[0, 0, 100, 100], test_rect=[0, 0, 100, 100],
browser_args=browser_args), browser_args=browser_args),
PixelTestPage( PixelTestPage('pixel_canvas_low_latency_2d.html',
'pixel_canvas_low_latency_2d.html',
base_name + '_CanvasUnacceleratedLowLatency2D', base_name + '_CanvasUnacceleratedLowLatency2D',
test_rect=[0, 0, 100, 100], test_rect=[0, 0, 100, 100],
browser_args=browser_args + unaccelerated_args), browser_args=browser_args + unaccelerated_args),
PixelTestPage( PixelTestPage('pixel_canvas_low_latency_webgl.html',
'pixel_canvas_low_latency_webgl.html',
base_name + '_CanvasLowLatencyWebGL', base_name + '_CanvasLowLatencyWebGL',
test_rect=[0, 0, 200, 200], test_rect=[0, 0, 200, 200],
browser_args=browser_args, browser_args=browser_args,
tolerance=0, grace_period_end=datetime.date(2020, 6, 22),
expected_colors=[ matching_algorithm=VERY_PERMISSIVE_SOBEL_ALGO),
SCALE_FACTOR_OVERRIDES,
{
'comment': 'green',
'location': [1, 1],
'size': [98, 98],
'color': [0, 255, 0],
},
]),
] ]
@staticmethod @staticmethod
...@@ -880,41 +499,22 @@ class PixelTestPages(object): ...@@ -880,41 +499,22 @@ class PixelTestPages(object):
'--enable-features=LowLatencyWebGLSwapChain,LowLatencyCanvas2dSwapChain' '--enable-features=LowLatencyWebGLSwapChain,LowLatencyCanvas2dSwapChain'
] ]
return [ return [
PixelTestPage( PixelTestPage('pixel_canvas_low_latency_2d.html',
'pixel_canvas_low_latency_2d.html',
base_name + '_CanvasLowLatency2DSwapChain', base_name + '_CanvasLowLatency2DSwapChain',
test_rect=[0, 0, 100, 100], test_rect=[0, 0, 100, 100],
browser_args=browser_args), browser_args=browser_args),
PixelTestPage( PixelTestPage('pixel_canvas_low_latency_webgl.html',
'pixel_canvas_low_latency_webgl.html',
base_name + '_CanvasLowLatencyWebGLSwapChain', base_name + '_CanvasLowLatencyWebGLSwapChain',
test_rect=[0, 0, 200, 200], test_rect=[0, 0, 200, 200],
browser_args=browser_args, browser_args=browser_args,
tolerance=0, grace_period_end=datetime.date(2020, 6, 22),
expected_colors=[ matching_algorithm=VERY_PERMISSIVE_SOBEL_ALGO),
SCALE_FACTOR_OVERRIDES, PixelTestPage('pixel_canvas_low_latency_webgl_alpha_false.html',
{
'comment': 'green',
'location': [1, 1],
'size': [98, 98],
'color': [0, 255, 0],
},
]),
PixelTestPage(
'pixel_canvas_low_latency_webgl_alpha_false.html',
base_name + '_CanvasLowLatencyWebGLSwapChainAlphaFalse', base_name + '_CanvasLowLatencyWebGLSwapChainAlphaFalse',
test_rect=[0, 0, 200, 200], test_rect=[0, 0, 200, 200],
browser_args=browser_args, browser_args=browser_args,
tolerance=0, grace_period_end=datetime.date(2020, 6, 22),
expected_colors=[ matching_algorithm=VERY_PERMISSIVE_SOBEL_ALGO),
SCALE_FACTOR_OVERRIDES,
{
'comment': 'green',
'location': [1, 1],
'size': [98, 98],
'color': [0, 255, 0, 255],
},
]),
] ]
# Only add these tests on platforms where SwiftShader is enabled. # Only add these tests on platforms where SwiftShader is enabled.
...@@ -924,37 +524,24 @@ class PixelTestPages(object): ...@@ -924,37 +524,24 @@ class PixelTestPages(object):
browser_args = ['--disable-gpu'] browser_args = ['--disable-gpu']
suffix = "_SwiftShader" suffix = "_SwiftShader"
return [ return [
PixelTestPage( PixelTestPage('pixel_canvas2d.html',
'pixel_canvas2d.html',
base_name + '_Canvas2DRedBox' + suffix, base_name + '_Canvas2DRedBox' + suffix,
test_rect=[0, 0, 300, 300], test_rect=[0, 0, 300, 300],
browser_args=browser_args), browser_args=browser_args),
PixelTestPage( PixelTestPage('pixel_css3d.html',
'pixel_css3d.html',
base_name + '_CSS3DBlueBox' + suffix, base_name + '_CSS3DBlueBox' + suffix,
test_rect=[0, 0, 300, 300], test_rect=[0, 0, 300, 300],
browser_args=browser_args), browser_args=browser_args),
PixelTestPage( PixelTestPage('pixel_webgl_aa_alpha.html',
'pixel_webgl_aa_alpha.html',
base_name + '_WebGLGreenTriangle_AA_Alpha' + suffix, base_name + '_WebGLGreenTriangle_AA_Alpha' + suffix,
test_rect=[0, 0, 300, 300], test_rect=[0, 0, 300, 300],
browser_args=browser_args), browser_args=browser_args),
PixelTestPage( PixelTestPage('pixel_repeated_webgl_to_2d.html',
'pixel_repeated_webgl_to_2d.html',
base_name + '_RepeatedWebGLTo2D' + suffix, base_name + '_RepeatedWebGLTo2D' + suffix,
test_rect=[0, 0, 256, 256], test_rect=[0, 0, 256, 256],
browser_args=browser_args, browser_args=browser_args,
tolerance=3, grace_period_end=datetime.date(2020, 6, 22),
expected_colors=[ matching_algorithm=VERY_PERMISSIVE_SOBEL_ALGO),
SCALE_FACTOR_OVERRIDES,
{
'comment': 'green',
# 64x64 rectangle around the center at (128,128)
'location': [96, 96],
'size': [64, 64],
'color': [0, 255, 0],
},
]),
] ]
# Test rendering where GPU process is blocked. # Test rendering where GPU process is blocked.
...@@ -1044,25 +631,12 @@ class PixelTestPages(object): ...@@ -1044,25 +631,12 @@ class PixelTestPages(object):
matching_algorithm=filter_effect_fuzzy_algo), matching_algorithm=filter_effect_fuzzy_algo),
# Test WebGL's premultipliedAlpha:false without the CA compositor. # Test WebGL's premultipliedAlpha:false without the CA compositor.
PixelTestPage( PixelTestPage('pixel_webgl_premultiplied_alpha_false.html',
'pixel_webgl_premultiplied_alpha_false.html',
base_name + '_WebGL_PremultipliedAlpha_False_NoOverlays', base_name + '_WebGL_PremultipliedAlpha_False_NoOverlays',
test_rect=[0, 0, 150, 150], test_rect=[0, 0, 150, 150],
browser_args=no_overlays_args, browser_args=no_overlays_args,
tolerance=3, grace_period_end=datetime.date(2020, 6, 22),
expected_colors=[ matching_algorithm=VERY_PERMISSIVE_SOBEL_ALGO),
SCALE_FACTOR_OVERRIDES,
{
'comment': 'brown',
'location': [1, 1],
'size': [148, 148],
# This is the color on an NVIDIA based MacBook Pro if the
# sRGB profile's applied correctly.
'color': [102, 77, 0],
# This is the color if it isn't.
# 'color': [101, 76, 12],
},
]),
] ]
# Pages that should be run only on dual-GPU MacBook Pros (at the # Pages that should be run only on dual-GPU MacBook Pros (at the
...@@ -1070,65 +644,37 @@ class PixelTestPages(object): ...@@ -1070,65 +644,37 @@ class PixelTestPages(object):
@staticmethod @staticmethod
def DualGPUMacSpecificPages(base_name): def DualGPUMacSpecificPages(base_name):
return [ return [
PixelTestPage( PixelTestPage('pixel_webgl_high_to_low_power.html',
'pixel_webgl_high_to_low_power.html',
base_name + '_WebGLHighToLowPower', base_name + '_WebGLHighToLowPower',
test_rect=[0, 0, 300, 300], test_rect=[0, 0, 300, 300],
tolerance=3, grace_period_end=datetime.date(2020, 6, 22),
expected_colors=[{ matching_algorithm=VERY_PERMISSIVE_SOBEL_ALGO,
'comment': 'solid green',
'location': [100, 100],
'size': [100, 100],
'color': [0, 255, 0],
}],
optional_action='RunTestWithHighPerformanceTab'), optional_action='RunTestWithHighPerformanceTab'),
PixelTestPage( PixelTestPage('pixel_webgl_low_to_high_power.html',
'pixel_webgl_low_to_high_power.html',
base_name + '_WebGLLowToHighPower', base_name + '_WebGLLowToHighPower',
test_rect=[0, 0, 300, 300], test_rect=[0, 0, 300, 300],
tolerance=3, grace_period_end=datetime.date(2020, 6, 22),
expected_colors=[{ matching_algorithm=VERY_PERMISSIVE_SOBEL_ALGO,
'comment': 'solid green',
'location': [100, 100],
'size': [100, 100],
'color': [0, 255, 0],
}],
optional_action='RunLowToHighPowerTest'), optional_action='RunLowToHighPowerTest'),
PixelTestPage( PixelTestPage('pixel_webgl_low_to_high_power_alpha_false.html',
'pixel_webgl_low_to_high_power_alpha_false.html',
base_name + '_WebGLLowToHighPowerAlphaFalse', base_name + '_WebGLLowToHighPowerAlphaFalse',
test_rect=[0, 0, 300, 300], test_rect=[0, 0, 300, 300],
tolerance=3, grace_period_end=datetime.date(2020, 6, 22),
expected_colors=[{ matching_algorithm=VERY_PERMISSIVE_SOBEL_ALGO,
'comment': 'solid green',
'location': [100, 100],
'size': [100, 100],
'color': [0, 255, 0],
}],
optional_action='RunLowToHighPowerTest'), optional_action='RunLowToHighPowerTest'),
PixelTestPage( PixelTestPage(
'pixel_offscreen_canvas_ibrc_webgl_main.html', 'pixel_offscreen_canvas_ibrc_webgl_main.html',
base_name + '_OffscreenCanvasIBRCWebGLHighPerfMain', base_name + '_OffscreenCanvasIBRCWebGLHighPerfMain',
test_rect=[0, 0, 300, 300], test_rect=[0, 0, 300, 300],
tolerance=3, grace_period_end=datetime.date(2020, 6, 22),
expected_colors=[{ matching_algorithm=VERY_PERMISSIVE_SOBEL_ALGO,
'comment': 'solid green',
'location': [100, 100],
'size': [100, 100],
'color': [0, 255, 0],
}],
optional_action='RunOffscreenCanvasIBRCWebGLHighPerfTest'), optional_action='RunOffscreenCanvasIBRCWebGLHighPerfTest'),
PixelTestPage( PixelTestPage(
'pixel_offscreen_canvas_ibrc_webgl_worker.html', 'pixel_offscreen_canvas_ibrc_webgl_worker.html',
base_name + '_OffscreenCanvasIBRCWebGLHighPerfWorker', base_name + '_OffscreenCanvasIBRCWebGLHighPerfWorker',
test_rect=[0, 0, 300, 300], test_rect=[0, 0, 300, 300],
tolerance=3, grace_period_end=datetime.date(2020, 6, 22),
expected_colors=[{ matching_algorithm=VERY_PERMISSIVE_SOBEL_ALGO,
'comment': 'solid green',
'location': [100, 100],
'size': [100, 100],
'color': [0, 255, 0],
}],
optional_action='RunOffscreenCanvasIBRCWebGLHighPerfTest'), optional_action='RunOffscreenCanvasIBRCWebGLHighPerfTest'),
] ]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment