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

Unified Diff: content/test/gpu/gpu_tests/gpu_rasterization.py

Issue 2607073002: Fold the GPU rasterization tests into the pixel tests step. (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
Index: content/test/gpu/gpu_tests/gpu_rasterization.py
diff --git a/content/test/gpu/gpu_tests/gpu_rasterization.py b/content/test/gpu/gpu_tests/gpu_rasterization.py
deleted file mode 100644
index 03aea17cd97ce176cf9d274359792295b129b8f1..0000000000000000000000000000000000000000
--- a/content/test/gpu/gpu_tests/gpu_rasterization.py
+++ /dev/null
@@ -1,87 +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 gpu_tests import cloud_storage_test_base
-from gpu_tests import gpu_rasterization_expectations
-import page_sets
-
-from telemetry.page import legacy_page_test
-from telemetry.util import image_util
-
-
-test_harness_script = r"""
- var domAutomationController = {};
- domAutomationController._succeeded = false;
- domAutomationController._finished = false;
-
- domAutomationController.setAutomationId = function(id) {}
- domAutomationController.send = function(msg) {
- domAutomationController._finished = true;
- if (msg.toLowerCase() == "success")
- domAutomationController._succeeded = true;
- else
- domAutomationController._succeeded = false;
- }
-
- window.domAutomationController = domAutomationController;
-"""
-
-def _DidTestSucceed(tab):
- return tab.EvaluateJavaScript('domAutomationController._succeeded')
-
-class GpuRasterizationValidator(cloud_storage_test_base.ValidatorBase):
- def CustomizeBrowserOptions(self, options):
- # --test-type=gpu is used only to suppress the "Google API Keys are missing"
- # infobar, which causes flakiness in tests.
- options.AppendExtraBrowserArgs(['--force-gpu-rasterization',
- '--test-type=gpu'])
-
- def ValidateAndMeasurePage(self, page, tab, results):
- if not _DidTestSucceed(tab):
- raise legacy_page_test.Failure('Page indicated a failure')
-
- if not hasattr(page, 'expectations') or not page.expectations:
- raise legacy_page_test.Failure('Expectations not specified')
-
- if not tab.screenshot_supported:
- raise legacy_page_test.Failure(
- 'Browser does not support screenshot capture')
-
- screenshot = tab.Screenshot()
- if screenshot is None:
- raise legacy_page_test.Failure('Could not capture screenshot')
-
- device_pixel_ratio = tab.EvaluateJavaScript('window.devicePixelRatio')
- if hasattr(page, 'test_rect'):
- test_rect = [int(x * device_pixel_ratio) for x in page.test_rect]
- screenshot = image_util.Crop(screenshot, test_rect[0], test_rect[1],
- test_rect[2], test_rect[3])
-
- self._ValidateScreenshotSamples(
- tab,
- page.display_name,
- screenshot,
- page.expectations,
- device_pixel_ratio)
-
-
-class GpuRasterization(cloud_storage_test_base.CloudStorageTestBase):
- """Tests that GPU rasterization produces valid content"""
- test = GpuRasterizationValidator
-
- def __init__(self, max_failures=None):
- super(GpuRasterization, self).__init__(max_failures=max_failures)
-
- @classmethod
- def Name(cls):
- return 'gpu_rasterization'
-
- def CreateStorySet(self, options):
- story_set = page_sets.GpuRasterizationTestsStorySet(self.GetExpectations())
- for page in story_set:
- page.script_to_evaluate_on_commit = test_harness_script
- return story_set
-
- def _CreateExpectations(self):
- return gpu_rasterization_expectations.GpuRasterizationExpectations()
« no previous file with comments | « content/test/gpu/generate_buildbot_json.py ('k') | content/test/gpu/gpu_tests/gpu_rasterization_expectations.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698