| 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 optparse | 5 import optparse |
| 6 import cloud_storage_test_base | 6 import cloud_storage_test_base |
| 7 | 7 |
| 8 test_harness_script = r""" | 8 test_harness_script = r""" |
| 9 var domAutomationController = {}; | 9 var domAutomationController = {}; |
| 10 domAutomationController._succeeded = false; | 10 domAutomationController._succeeded = false; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 return tab.EvaluateJavaScript('domAutomationController._succeeded') | 26 return tab.EvaluateJavaScript('domAutomationController._succeeded') |
| 27 | 27 |
| 28 class GpuRasterizationValidator(cloud_storage_test_base.ValidatorBase): | 28 class GpuRasterizationValidator(cloud_storage_test_base.ValidatorBase): |
| 29 def __init__(self): | 29 def __init__(self): |
| 30 super(GpuRasterizationValidator, self).__init__('ValidatePage') | 30 super(GpuRasterizationValidator, self).__init__('ValidatePage') |
| 31 | 31 |
| 32 def CustomizeBrowserOptions(self, options): | 32 def CustomizeBrowserOptions(self, options): |
| 33 options.AppendExtraBrowserArgs(['--force-compositing-mode', | 33 options.AppendExtraBrowserArgs(['--force-compositing-mode', |
| 34 '--enable-threaded-compositing', | 34 '--enable-threaded-compositing', |
| 35 '--enable-impl-side-painting', | 35 '--enable-impl-side-painting', |
| 36 '--enable-gpu-rasterization', | 36 '--enable-universal-gpu-rasterization', |
| 37 '--enable-gpu-benchmarking']) | 37 '--enable-gpu-benchmarking']) |
| 38 | 38 |
| 39 def ValidatePage(self, page, tab, results): | 39 def ValidatePage(self, page, tab, results): |
| 40 if not _DidTestSucceed(tab): | 40 if not _DidTestSucceed(tab): |
| 41 raise page_test.Failure('Page indicated a failure') | 41 raise page_test.Failure('Page indicated a failure') |
| 42 | 42 |
| 43 if not tab.screenshot_supported: | 43 if not tab.screenshot_supported: |
| 44 raise page_test.Failure('Browser does not support screenshot capture') | 44 raise page_test.Failure('Browser does not support screenshot capture') |
| 45 | 45 |
| 46 screenshot = tab.Screenshot() | 46 screenshot = tab.Screenshot() |
| (...skipping 24 matching lines...) Expand all Loading... |
| 71 def AddTestCommandLineOptions(parser): | 71 def AddTestCommandLineOptions(parser): |
| 72 group = optparse.OptionGroup(parser, 'GpuRasterization test options') | 72 group = optparse.OptionGroup(parser, 'GpuRasterization test options') |
| 73 cloud_storage_test_base.TestBase._AddTestCommandLineOptions(parser, group) | 73 cloud_storage_test_base.TestBase._AddTestCommandLineOptions(parser, group) |
| 74 parser.add_option_group(group) | 74 parser.add_option_group(group) |
| 75 | 75 |
| 76 def CreatePageSet(self, options): | 76 def CreatePageSet(self, options): |
| 77 page_set = super(GpuRasterization, self).CreatePageSet(options) | 77 page_set = super(GpuRasterization, self).CreatePageSet(options) |
| 78 for page in page_set.pages: | 78 for page in page_set.pages: |
| 79 page.script_to_evaluate_on_commit = test_harness_script | 79 page.script_to_evaluate_on_commit = test_harness_script |
| 80 return page_set | 80 return page_set |
| OLD | NEW |