Index: Tools/Scripts/webkitpy/layout_tests/port/browser_test.py |
diff --git a/Source/devtools/front_end/cm/PRESUBMIT.py b/Tools/Scripts/webkitpy/layout_tests/port/browser_test.py |
similarity index 51% |
copy from Source/devtools/front_end/cm/PRESUBMIT.py |
copy to Tools/Scripts/webkitpy/layout_tests/port/browser_test.py |
index 6e4973c4c69bf2e77a58f4ac33bc614546072a27..8dd81e1950a18c7229a6c85269ca75d7e9149727 100644 |
--- a/Source/devtools/front_end/cm/PRESUBMIT.py |
+++ b/Tools/Scripts/webkitpy/layout_tests/port/browser_test.py |
@@ -10,7 +10,7 @@ |
# copyright notice, this list of conditions and the following disclaimer |
# in the documentation and/or other materials provided with the |
# distribution. |
-# * Neither the name of Google Inc. nor the names of its |
+# * Neither the Google name nor the names of its |
Dirk Pranke
2014/07/17 00:31:15
this is an odd diff ...
ivandavid
2014/07/17 03:04:47
O_o ... I don't know how that happened.
ivandavid
2014/07/17 03:04:47
Done.
|
# contributors may be used to endorse or promote products derived from |
# this software without specific prior written permission. |
# |
@@ -26,21 +26,44 @@ |
# (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.layout_tests.port import base |
Dirk Pranke
2014/07/17 00:31:15
you don't need to import base (see below)
ivandavid
2014/07/17 03:04:48
Done.
|
+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 _CheckCodeMirrorChanges(input_api, output_api): |
- errorText = ("ERROR: Attempt to modify CodeMirror. The only allowed changes are " |
- "rolls from the upstream (http://codemirror.net). If this is a roll, " |
- "make sure you mention 'roll CodeMirror' (no quotes) in the change description.\n" |
- "CodeMirror rolling instructions:\n" |
- " https://sites.google.com/a/chromium.org/devtools-codemirror-rolling") |
- changeDescription = input_api.change.DescriptionText() |
- errors = [] |
- if not "roll codemirror" in changeDescription.lower(): |
- errors.append(output_api.PresubmitError(errorText)) |
- return errors |
+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 |
-def CheckChangeOnUpload(input_api, output_api): |
- results = [] |
- results.extend(_CheckCodeMirrorChanges(input_api, output_api)) |
- return results |
+ |
+class BrowserTestPortOverrides(base.Port): |
Dirk Pranke
2014/07/17 00:31:15
this should just be object, not base.Port, since i
ivandavid
2014/07/17 03:04:48
Done.
ivandavid
2014/07/17 03:04:48
I had to swap the order of inheritance, ie.
linux
Dirk Pranke
2014/07/17 21:20:12
Correct, the overriding class (the mixin) needs to
|
+ """Set of overrides that every browser test platform port should have.""" |
+ |
+ 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.path_from_chromium_base('chrome', 'test', 'data', 'printing', 'layout_tests', 'tests') |
+ |
+ |
+class BrowserTestLinuxPort(linux.LinuxPort, BrowserTestPortOverrides): |
+ pass |
+ |
+ |
+class BrowserTestMacPort(mac.MacPort, BrowserTestPortOverrides): |
+ def _path_to_driver(self, configuration=None): |
+ return self._build_path_with_configuration(configuration, self.driver_name()) |
+ |
+ |
+class BrowserTestWinPort(win.WinPort, BrowserTestPortOverrides): |
+ pass |