| 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 import glob | 4 import glob |
| 5 import logging | 5 import logging |
| 6 import os | 6 import os |
| 7 import re | 7 import re |
| 8 import sys | 8 import sys |
| 9 | 9 |
| 10 from gpu_tests import cloud_storage_integration_test_base | 10 from gpu_tests import cloud_storage_integration_test_base |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 @classmethod | 87 @classmethod |
| 88 def RestartBrowserIfNecessaryWithArgs(cls, browser_args): | 88 def RestartBrowserIfNecessaryWithArgs(cls, browser_args): |
| 89 if not browser_args: | 89 if not browser_args: |
| 90 browser_args = [] | 90 browser_args = [] |
| 91 if set(browser_args) != cls._last_launched_browser_args: | 91 if set(browser_args) != cls._last_launched_browser_args: |
| 92 logging.warning('Restarting browser with arguments: ' + str(browser_args)) | 92 logging.warning('Restarting browser with arguments: ' + str(browser_args)) |
| 93 cls.StopBrowser() | 93 cls.StopBrowser() |
| 94 cls.ResetGpuInfo() | 94 cls.ResetGpuInfo() |
| 95 cls.CustomizeBrowserArgs(browser_args) | 95 cls.CustomizeBrowserArgs(browser_args) |
| 96 cls.StartBrowser() | 96 cls.StartBrowser() |
| 97 cls.tab = cls.browser.tabs[0] | |
| 98 | 97 |
| 99 @classmethod | 98 @classmethod |
| 100 def AddCommandlineArgs(cls, parser): | 99 def AddCommandlineArgs(cls, parser): |
| 101 super(PixelIntegrationTest, cls).AddCommandlineArgs(parser) | 100 super(PixelIntegrationTest, cls).AddCommandlineArgs(parser) |
| 102 parser.add_option( | 101 parser.add_option( |
| 103 '--reference-dir', | 102 '--reference-dir', |
| 104 help='Overrides the default on-disk location for reference images ' | 103 help='Overrides the default on-disk location for reference images ' |
| 105 '(only used for local testing without a cloud storage account)', | 104 '(only used for local testing without a cloud storage account)', |
| 106 default=default_reference_image_dir) | 105 default=default_reference_image_dir) |
| 107 | 106 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 ref_png = None | 219 ref_png = None |
| 221 | 220 |
| 222 if ref_png is not None: | 221 if ref_png is not None: |
| 223 return ref_png | 222 return ref_png |
| 224 | 223 |
| 225 print ('Reference image not found. Writing tab contents as reference to: ' + | 224 print ('Reference image not found. Writing tab contents as reference to: ' + |
| 226 image_path) | 225 image_path) |
| 227 | 226 |
| 228 self._WriteImage(image_path, screenshot) | 227 self._WriteImage(image_path, screenshot) |
| 229 return screenshot | 228 return screenshot |
| OLD | NEW |