| OLD | NEW |
| 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 | 4 |
| 5 import cloud_storage_test_base | 5 import cloud_storage_test_base |
| 6 import optparse | 6 import optparse |
| 7 import page_sets | 7 import page_sets |
| 8 | 8 |
| 9 | 9 |
| 10 test_harness_script = r""" | 10 test_harness_script = r""" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 def _DidTestSucceed(tab): | 27 def _DidTestSucceed(tab): |
| 28 return tab.EvaluateJavaScript('domAutomationController._succeeded') | 28 return tab.EvaluateJavaScript('domAutomationController._succeeded') |
| 29 | 29 |
| 30 class _GpuRasterizationValidator(cloud_storage_test_base.ValidatorBase): | 30 class _GpuRasterizationValidator(cloud_storage_test_base.ValidatorBase): |
| 31 def CustomizeBrowserOptions(self, options): | 31 def CustomizeBrowserOptions(self, options): |
| 32 options.AppendExtraBrowserArgs(['--enable-threaded-compositing', | 32 options.AppendExtraBrowserArgs(['--enable-threaded-compositing', |
| 33 '--enable-impl-side-painting', | 33 '--enable-impl-side-painting', |
| 34 '--force-gpu-rasterization', | 34 '--force-gpu-rasterization', |
| 35 '--enable-gpu-benchmarking']) | 35 '--enable-gpu-benchmarking']) |
| 36 | 36 |
| 37 def ValidatePage(self, page, tab, results): | 37 def ValidateAndMeasurePage(self, page, tab, results): |
| 38 if not _DidTestSucceed(tab): | 38 if not _DidTestSucceed(tab): |
| 39 raise page_test.Failure('Page indicated a failure') | 39 raise page_test.Failure('Page indicated a failure') |
| 40 | 40 |
| 41 if not hasattr(page, 'expectations') or not page.expectations: | 41 if not hasattr(page, 'expectations') or not page.expectations: |
| 42 raise page_test.Failure('Expectations not specified') | 42 raise page_test.Failure('Expectations not specified') |
| 43 | 43 |
| 44 if not tab.screenshot_supported: | 44 if not tab.screenshot_supported: |
| 45 raise page_test.Failure('Browser does not support screenshot capture') | 45 raise page_test.Failure('Browser does not support screenshot capture') |
| 46 | 46 |
| 47 screenshot = tab.Screenshot() | 47 screenshot = tab.Screenshot() |
| (...skipping 17 matching lines...) Expand all Loading... |
| 65 class GpuRasterization(cloud_storage_test_base.TestBase): | 65 class GpuRasterization(cloud_storage_test_base.TestBase): |
| 66 """Tests that GPU rasterization produces valid content""" | 66 """Tests that GPU rasterization produces valid content""" |
| 67 test = _GpuRasterizationValidator | 67 test = _GpuRasterizationValidator |
| 68 page_set = page_sets.GpuRasterizationTestsPageSet | 68 page_set = page_sets.GpuRasterizationTestsPageSet |
| 69 | 69 |
| 70 def CreatePageSet(self, options): | 70 def CreatePageSet(self, options): |
| 71 page_set = super(GpuRasterization, self).CreatePageSet(options) | 71 page_set = super(GpuRasterization, self).CreatePageSet(options) |
| 72 for page in page_set.pages: | 72 for page in page_set.pages: |
| 73 page.script_to_evaluate_on_commit = test_harness_script | 73 page.script_to_evaluate_on_commit = test_harness_script |
| 74 return page_set | 74 return page_set |
| OLD | NEW |