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..d7b657cf2077f86958669d787d025082628915f2 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 |
# contributors may be used to endorse or promote products derived from |
# this software without specific prior written permission. |
# |
@@ -26,21 +26,42 @@ |
# (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 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(object): |
+ """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') # pylint: disable=E1101 |
+ |
+ |
+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 |