| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 os | 5 import os |
| 6 | 6 |
| 7 from gpu_tests import gpu_integration_test | 7 from gpu_tests import gpu_integration_test |
| 8 from gpu_tests import depth_capture_expectations | 8 from gpu_tests import depth_capture_expectations |
| 9 from gpu_tests import path_util | 9 from gpu_tests import path_util |
| 10 | 10 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 class DepthCaptureIntegrationTest(gpu_integration_test.GpuIntegrationTest): | 47 class DepthCaptureIntegrationTest(gpu_integration_test.GpuIntegrationTest): |
| 48 | 48 |
| 49 @classmethod | 49 @classmethod |
| 50 def Name(cls): | 50 def Name(cls): |
| 51 return 'depth_capture' | 51 return 'depth_capture' |
| 52 | 52 |
| 53 @classmethod | 53 @classmethod |
| 54 def CustomizeOptions(cls): | 54 def CustomizeOptions(cls): |
| 55 options = cls._finder_options.browser_options | 55 options = cls._finder_options.browser_options |
| 56 options.AppendExtraBrowserArgs( | 56 options.AppendExtraBrowserArgs('--disable-domain-blocking-for-3d-apis') |
| 57 '--disable-domain-blocking-for-3d-apis') | 57 options.AppendExtraBrowserArgs('--enable-es3-apis') |
| 58 options.AppendExtraBrowserArgs( | 58 options.AppendExtraBrowserArgs('--use-fake-ui-for-media-stream') |
| 59 '--use-fake-ui-for-media-stream') | |
| 60 options.AppendExtraBrowserArgs( | 59 options.AppendExtraBrowserArgs( |
| 61 '--use-fake-device-for-media-stream=device-count=2') | 60 '--use-fake-device-for-media-stream=device-count=2') |
| 62 # Required for about:gpucrash handling from Telemetry. | 61 # Required for about:gpucrash handling from Telemetry. |
| 63 options.AppendExtraBrowserArgs('--enable-gpu-benchmarking') | 62 options.AppendExtraBrowserArgs('--enable-gpu-benchmarking') |
| 64 | 63 |
| 65 @classmethod | 64 @classmethod |
| 66 def GenerateGpuTests(cls, options): | 65 def GenerateGpuTests(cls, options): |
| 67 tests = (('DepthCapture_depthStreamToRGBAUint8Texture', | 66 tests = (('DepthCapture_depthStreamToRGBAUint8Texture', |
| 68 'getusermedia-depth-capture.html?query=RGBAUint8'), | 67 'getusermedia-depth-capture.html?query=RGBAUint8'), |
| 69 ('DepthCapture_depthStreamToRGBAFloatTexture', | 68 ('DepthCapture_depthStreamToRGBAFloatTexture', |
| 70 'getusermedia-depth-capture.html?query=RGBAFloat')) | 69 'getusermedia-depth-capture.html?query=RGBAFloat'), |
| 70 ('DepthCapture_depthStreamToR32FloatTexture', |
| 71 'getusermedia-depth-capture.html?query=R32Float')) |
| 71 for t in tests: | 72 for t in tests: |
| 72 yield (t[0], t[1], ('_' + t[0])) | 73 yield (t[0], t[1], ('_' + t[0])) |
| 73 | 74 |
| 74 def RunActualGpuTest(self, test_path, *args): | 75 def RunActualGpuTest(self, test_path, *args): |
| 75 url = self.UrlOfStaticFilePath(test_path) | 76 url = self.UrlOfStaticFilePath(test_path) |
| 76 tab = self.tab | 77 tab = self.tab |
| 77 tab.Navigate(url, script_to_evaluate_on_commit=harness_script) | 78 tab.Navigate(url, script_to_evaluate_on_commit=harness_script) |
| 78 tab.action_runner.WaitForJavaScriptCondition( | 79 tab.action_runner.WaitForJavaScriptCondition( |
| 79 'domAutomationController._finished', timeout_in_seconds=60) | 80 'domAutomationController._finished', timeout_in_seconds=60) |
| 80 if not tab.EvaluateJavaScript('domAutomationController._succeeded'): | 81 if not tab.EvaluateJavaScript('domAutomationController._succeeded'): |
| 81 self.fail('page indicated test failure:' + | 82 self.fail('page indicated test failure:' + |
| 82 tab.EvaluateJavaScript('domAutomationController._error_msg')) | 83 tab.EvaluateJavaScript('domAutomationController._error_msg')) |
| 83 | 84 |
| 84 @classmethod | 85 @classmethod |
| 85 def _CreateExpectations(cls): | 86 def _CreateExpectations(cls): |
| 86 return depth_capture_expectations.DepthCaptureExpectations() | 87 return depth_capture_expectations.DepthCaptureExpectations() |
| 87 | 88 |
| 88 @classmethod | 89 @classmethod |
| 89 def setUpClass(cls): | 90 def setUpClass(cls): |
| 90 super(cls, DepthCaptureIntegrationTest).setUpClass() | 91 super(cls, DepthCaptureIntegrationTest).setUpClass() |
| 91 cls.CustomizeOptions() | 92 cls.CustomizeOptions() |
| 92 cls.SetBrowserOptions(cls._finder_options) | 93 cls.SetBrowserOptions(cls._finder_options) |
| 93 cls.StartBrowser() | 94 cls.StartBrowser() |
| 94 cls.SetStaticServerDirs([data_path]) | 95 cls.SetStaticServerDirs([data_path]) |
| OLD | NEW |