Chromium Code Reviews| Index: Tools/Scripts/webkitpy/layout_tests/port/browser_test.py |
| diff --git a/Tools/Scripts/webkitpy/layout_tests/port/browser_test.py b/Tools/Scripts/webkitpy/layout_tests/port/browser_test.py |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..944c739b413f0e2319ecb993f6441be60e4e171e |
| --- /dev/null |
| +++ b/Tools/Scripts/webkitpy/layout_tests/port/browser_test.py |
| @@ -0,0 +1,72 @@ |
| +# Copyright (C) 2014 Google Inc. All rights reserved. |
| +# |
| +# Redistribution and use in source and binary forms, with or without |
| +# modification, are permitted provided that the following conditions are |
| +# met: |
| +# |
| +# * Redistributions of source code must retain the above copyright |
| +# notice, this list of conditions and the following disclaimer. |
| +# * Redistributions in binary form must reproduce the above |
| +# copyright notice, this list of conditions and the following disclaimer |
| +# in the documentation and/or other materials provided with the |
| +# distribution. |
| +# * Neither the Google name nor the names of its |
| +# contributors may be used to endorse or promote products derived from |
| +# this software without specific prior written permission. |
| +# |
| +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| + |
| +from webkitpy.common import webkit_finder |
| +from webkitpy.layout_tests.port import linux |
| +from webkitpy.layout_tests.port import mac |
| +from webkitpy.layout_tests.port import win |
| +from webkitpy.layout_tests.port import browser_test_driver |
| + |
| + |
| +def get_port_class_name(port_name): |
| + if 'linux' in port_name: |
| + return 'BrowserTestLinuxPort' |
| + elif 'mac' in port_name: |
| + return 'BrowserTestMacPort' |
| + elif 'win' in port_name: |
| + return 'BrowserTestWinPort' |
| + return None |
| + |
| + |
| +class BrowserTestPortOverrides(object): |
| + """Set of overrides that every browser test platform port should have.""" |
| + def __init__(self, host, port_name, **kwargs): |
| + super(BrowserTestPortOverrides, self).__init__(host, port_name, **kwargs) |
| + self._webkit_finder = webkit_finder.WebKitFinder(host.filesystem) |
|
ivandavid
2014/07/17 03:04:48
'git cl upload' didn't like when I just inherited
Dirk Pranke
2014/07/17 21:20:13
That sounds like a bug in pylint/presubmit. If the
ivandavid
2014/07/18 04:24:59
Done.
ivandavid
2014/07/18 04:24:59
I just disabled the pylint error message. I notice
|
| + |
| + def _driver_class(self): |
| + return browser_test_driver.BrowserTestDriver |
| + |
| + def layout_tests_dir(self): |
| + """Overriden function from the base port class. Redirects everything |
| + to src/chrome/test/data/printing/layout_tests. |
| + """ |
| + return self._webkit_finder.path_from_chromium_base('chrome', 'test', 'data', 'printing', 'layout_tests', 'tests') |
| + |
| + |
| +class BrowserTestLinuxPort(BrowserTestPortOverrides, linux.LinuxPort): |
| + pass |
| + |
| + |
| +class BrowserTestMacPort(BrowserTestPortOverrides, mac.MacPort): |
| + def _path_to_driver(self, configuration=None): |
| + return self._build_path_with_configuration(configuration, self.driver_name()) |
| + |
| + |
| +class BrowserTestWinPort(BrowserTestPortOverrides, win.WinPort): |
| + pass |