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

Unified Diff: content/test/gpu/page_sets/pixel_tests.py

Issue 2604153005: Port trace_test to the new gpu_integration_test harness. (Closed)
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/test/gpu/page_sets/__init__.py ('k') | testing/buildbot/chromium.gpu.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/gpu/page_sets/pixel_tests.py
diff --git a/content/test/gpu/page_sets/pixel_tests.py b/content/test/gpu/page_sets/pixel_tests.py
deleted file mode 100644
index bb66d3ed2a20a52461a78999a5990a06d5e3fd68..0000000000000000000000000000000000000000
--- a/content/test/gpu/page_sets/pixel_tests.py
+++ /dev/null
@@ -1,321 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-from telemetry.story import story_set as story_set_module
-
-import sys
-
-from gpu_tests import gpu_test_base
-
-
-class PixelTestsPage(gpu_test_base.PageBase):
-
- def __init__(self, url, name, test_rect, revision, story_set,
- shared_page_state_class, expectations, expected_colors=None,
- tolerance=2):
- super(PixelTestsPage, self).__init__(
- url=url, page_set=story_set, name=name,
- shared_page_state_class=shared_page_state_class,
- expectations=expectations)
- self.test_rect = test_rect
- self.revision = revision
-
- # The tolerance when comparing against the reference image.
- self.tolerance = tolerance
- if expected_colors:
- self.expected_colors = expected_colors
-
- def RunNavigateSteps(self, action_runner):
- super(PixelTestsPage, self).RunNavigateSteps(action_runner)
- action_runner.WaitForJavaScriptCondition(
- 'domAutomationController._finished', timeout_in_seconds=30)
-
-
-class PixelTestsES3SharedPageState(gpu_test_base.GpuSharedPageState):
- def __init__(self, test, finder_options, story_set):
- super(PixelTestsES3SharedPageState, self).__init__(
- test, finder_options, story_set)
- finder_options.browser_options.AppendExtraBrowserArgs(
- ['--enable-es3-apis'])
-
-
-class IOSurface2DCanvasSharedPageState(gpu_test_base.GpuSharedPageState):
- def __init__(self, test, finder_options, story_set):
- super(IOSurface2DCanvasSharedPageState, self).__init__(
- test, finder_options, story_set)
- finder_options.browser_options.AppendExtraBrowserArgs(
- ['--enable-accelerated-2d-canvas',
- '--disable-display-list-2d-canvas'])
-
-
-class WebGLNonChromiumImageSharedPageState(gpu_test_base.GpuSharedPageState):
- def __init__(self, test, finder_options, story_set):
- super(WebGLNonChromiumImageSharedPageState, self).__init__(
- test, finder_options, story_set)
- finder_options.browser_options.AppendExtraBrowserArgs(
- ['--disable-webgl-image-chromium'])
-
-
-class DisableMacOverlaysSharedPageState(gpu_test_base.GpuSharedPageState):
- def __init__(self, test, finder_options, story_set):
- super(DisableMacOverlaysSharedPageState, self).__init__(
- test, finder_options, story_set)
- finder_options.browser_options.AppendExtraBrowserArgs(
- ['--disable-mac-overlays'])
-
-
-class EnableExperimentalCanvasFeaturesSharedPageState(
- gpu_test_base.GpuSharedPageState):
- def __init__(self, test, finder_options, story_set):
- super(EnableExperimentalCanvasFeaturesSharedPageState, self).__init__(
- test, finder_options, story_set)
- finder_options.browser_options.AppendExtraBrowserArgs(
- ['--enable-experimental-canvas-features'])
-
-class PixelTestsStorySet(story_set_module.StorySet):
-
- """ Some basic test cases for GPU. """
- def __init__(self, expectations, base_name='Pixel', try_es3=False):
- super(PixelTestsStorySet, self).__init__()
- self._AddAllPages(expectations, base_name, False)
-
- # Pages requiring the use of --enable-experimental-canvas-features
- self.AddStory(PixelTestsPage(
- url='file://../../data/gpu/pixel_offscreenCanvas_transferToImageBitmap_main.html',
- name=base_name + '.OffscreenCanvasTransferToImageBitmap',
- test_rect=[0, 0, 300, 300],
- revision=1,
- story_set=self,
- shared_page_state_class=EnableExperimentalCanvasFeaturesSharedPageState,
- expectations=expectations))
-
- self.AddStory(PixelTestsPage(
- url='file://../../data/gpu/pixel_offscreenCanvas_transferToImageBitmap_worker.html',
- name=base_name + '.OffscreenCanvasTransferToImageBitmapWorker',
- test_rect=[0, 0, 300, 300],
- revision=1,
- story_set=self,
- shared_page_state_class=EnableExperimentalCanvasFeaturesSharedPageState,
- expectations=expectations))
-
- self.AddStory(PixelTestsPage(
- url='file://../../data/gpu/pixel_offscreenCanvas_webgl_commit_main.html',
- name=base_name + '.OffscreenCanvasWebGLGreenBox',
- test_rect=[0, 0, 300, 300],
- revision=2,
- story_set=self,
- shared_page_state_class=EnableExperimentalCanvasFeaturesSharedPageState,
- expectations=expectations))
-
- self.AddStory(PixelTestsPage(
- url='file://../../data/gpu/pixel_offscreenCanvas_webgl_commit_worker.html',
- name=base_name + '.OffscreenCanvasWebGLRedBoxWorker',
- test_rect=[0, 0, 300, 300],
- revision=3,
- story_set=self,
- shared_page_state_class=EnableExperimentalCanvasFeaturesSharedPageState,
- expectations=expectations))
-
- self.AddStory(PixelTestsPage(
- url='file://../../data/gpu/pixel_offscreenCanvas_2d_commit_main.html',
- name=base_name + '.OffscreenCanvasAccelerated2D',
- test_rect=[0, 0, 350, 350],
- revision=1,
- story_set=self,
- shared_page_state_class=EnableExperimentalCanvasFeaturesSharedPageState,
- expectations=expectations))
-
- self.AddStory(PixelTestsPage(
- url='file://../../data/gpu/pixel_offscreenCanvas_2d_commit_worker.html',
- name=base_name + '.OffscreenCanvasAccelerated2DWorker',
- test_rect=[0, 0, 350, 350],
- revision=1,
- story_set=self,
- shared_page_state_class=EnableExperimentalCanvasFeaturesSharedPageState,
- expectations=expectations))
-
-
- # Would be better to fetch this from Telemetry.
- # TODO(kbr): enable this on all platforms. Don't know what will
- # happen on Android right now.
- if try_es3 and sys.platform.startswith('darwin'):
- # Add all the tests again, this time with the
- # --enable-es3-apis command line argument. This has the
- # side-effect of enabling the Core Profile rendering path on Mac
- # OS.
- self._AddAllPages(expectations, base_name, True)
-
- if sys.platform.startswith('darwin'):
- # On OS X, test the IOSurface 2D Canvas compositing path.
- self.AddStory(PixelTestsPage(
- url='file://../../data/gpu/pixel_canvas2d_accelerated.html',
- name=base_name + '.IOSurface2DCanvas',
- test_rect=[0, 0, 400, 400],
- revision=1,
- story_set=self,
- shared_page_state_class=IOSurface2DCanvasSharedPageState,
- expectations=expectations))
- self.AddStory(PixelTestsPage(
- url='file://../../data/gpu/pixel_canvas2d_webgl.html',
- name=base_name + '.IOSurface2DCanvasWebGL',
- test_rect=[0, 0, 300, 300],
- revision=2,
- story_set=self,
- shared_page_state_class=IOSurface2DCanvasSharedPageState,
- expectations=expectations))
-
- # On OS X, test WebGL non-Chromium Image compositing path.
- self.AddStory(PixelTestsPage(
- url='file://../../data/gpu/pixel_webgl_aa_alpha.html',
- name=base_name + '.WebGLGreenTriangle.NonChromiumImage.AA.Alpha',
- test_rect=[0, 0, 300, 300],
- revision=1,
- story_set=self,
- shared_page_state_class=WebGLNonChromiumImageSharedPageState,
- expectations=expectations))
-
- self.AddStory(PixelTestsPage(
- url='file://../../data/gpu/pixel_webgl_noaa_alpha.html',
- name=base_name + '.WebGLGreenTriangle.NonChromiumImage.NoAA.Alpha',
- test_rect=[0, 0, 300, 300],
- revision=1,
- story_set=self,
- shared_page_state_class=WebGLNonChromiumImageSharedPageState,
- expectations=expectations))
-
- self.AddStory(PixelTestsPage(
- url='file://../../data/gpu/pixel_webgl_aa_noalpha.html',
- name=base_name + '.WebGLGreenTriangle.NonChromiumImage.AA.NoAlpha',
- test_rect=[0, 0, 300, 300],
- revision=1,
- story_set=self,
- shared_page_state_class=WebGLNonChromiumImageSharedPageState,
- expectations=expectations))
-
- self.AddStory(PixelTestsPage(
- url='file://../../data/gpu/pixel_webgl_noaa_noalpha.html',
- name=base_name + '.WebGLGreenTriangle.NonChromiumImage.NoAA.NoAlpha',
- test_rect=[0, 0, 300, 300],
- revision=1,
- story_set=self,
- shared_page_state_class=WebGLNonChromiumImageSharedPageState,
- expectations=expectations))
-
- # On macOS, test CSS filter effects with and without the CA compositor.
- self.AddStory(PixelTestsPage(
- url='file://../../data/gpu/filter_effects.html',
- name=base_name + '.CSSFilterEffects',
- test_rect=[0, 0, 300, 300],
- revision=2,
- story_set=self,
- shared_page_state_class=gpu_test_base.GpuSharedPageState,
- expectations=expectations,
- tolerance=10))
-
- self.AddStory(PixelTestsPage(
- url='file://../../data/gpu/filter_effects.html',
- name=base_name + '.CSSFilterEffects.NoOverlays',
- test_rect=[0, 0, 300, 300],
- revision=2,
- story_set=self,
- shared_page_state_class=DisableMacOverlaysSharedPageState,
- expectations=expectations,
- tolerance=10))
-
- def _AddAllPages(self, expectations, base_name, use_es3):
- if use_es3:
- es3_suffix = 'ES3'
- shared_page_state_class = PixelTestsES3SharedPageState
- else:
- es3_suffix = ''
- shared_page_state_class = gpu_test_base.GpuSharedPageState
-
- self.AddStory(PixelTestsPage(
- url='file://../../data/gpu/pixel_canvas2d.html',
- name=base_name + '.Canvas2DRedBox' + es3_suffix,
- test_rect=[0, 0, 300, 300],
- revision=7,
- story_set=self,
- shared_page_state_class=shared_page_state_class,
- expectations=expectations))
-
- self.AddStory(PixelTestsPage(
- url='file://../../data/gpu/pixel_css3d.html',
- name=base_name + '.CSS3DBlueBox' + es3_suffix,
- test_rect=[0, 0, 300, 300],
- revision=15,
- story_set=self,
- shared_page_state_class=shared_page_state_class,
- expectations=expectations))
-
- self.AddStory(PixelTestsPage(
- url='file://../../data/gpu/pixel_webgl_aa_alpha.html',
- name=base_name + '.WebGLGreenTriangle.AA.Alpha' + es3_suffix,
- test_rect=[0, 0, 300, 300],
- revision=1,
- story_set=self,
- shared_page_state_class=shared_page_state_class,
- expectations=expectations))
-
- self.AddStory(PixelTestsPage(
- url='file://../../data/gpu/pixel_webgl_noaa_alpha.html',
- name=base_name + '.WebGLGreenTriangle.NoAA.Alpha' + es3_suffix,
- test_rect=[0, 0, 300, 300],
- revision=1,
- story_set=self,
- shared_page_state_class=shared_page_state_class,
- expectations=expectations))
-
- self.AddStory(PixelTestsPage(
- url='file://../../data/gpu/pixel_webgl_aa_noalpha.html',
- name=base_name + '.WebGLGreenTriangle.AA.NoAlpha' + es3_suffix,
- test_rect=[0, 0, 300, 300],
- revision=1,
- story_set=self,
- shared_page_state_class=shared_page_state_class,
- expectations=expectations))
-
- self.AddStory(PixelTestsPage(
- url='file://../../data/gpu/pixel_webgl_noaa_noalpha.html',
- name=base_name + '.WebGLGreenTriangle.NoAA.NoAlpha' + es3_suffix,
- test_rect=[0, 0, 300, 300],
- revision=1,
- story_set=self,
- shared_page_state_class=shared_page_state_class,
- expectations=expectations))
-
- self.AddStory(PixelTestsPage(
- url='file://../../data/gpu/pixel_scissor.html',
- name=base_name + '.ScissorTestWithPreserveDrawingBuffer' + es3_suffix,
- test_rect=[0, 0, 300, 300],
- revision=0, # This is not used.
- story_set=self,
- shared_page_state_class=shared_page_state_class,
- expectations=expectations,
- expected_colors='../../data/gpu/pixel_scissor_expectations.json'))
-
- self.AddStory(PixelTestsPage(
- url='file://../../data/gpu/pixel_canvas2d_webgl.html',
- name=base_name + '.2DCanvasWebGL' + es3_suffix,
- test_rect=[0, 0, 300, 300],
- revision=3,
- story_set=self,
- shared_page_state_class=shared_page_state_class,
- expectations=expectations))
-
- self.AddStory(PixelTestsPage(
- url='file://../../data/gpu/pixel_background.html',
- name=base_name + '.SolidColorBackground' + es3_suffix,
- test_rect=[500, 500, 100, 100],
- revision=1,
- story_set=self,
- shared_page_state_class=shared_page_state_class,
- expectations=expectations))
-
- @property
- def allow_mixed_story_states(self):
- # Return True here in order to be able to add the same tests with
- # a different SharedPageState on Mac which tests them with the
- # Core Profile rendering path.
- return True
« no previous file with comments | « content/test/gpu/page_sets/__init__.py ('k') | testing/buildbot/chromium.gpu.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698