Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(678)

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py

Issue 2014063002: Run format-webkit on webkitpy code (without string conversion). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py
index 944044f6928554248430d7b5e4e0a5d6c698ac34..73e336cb89d3dc071a846a175802c54c4f57d113 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py
@@ -197,24 +197,68 @@ class MiscTests(Base):
def test_needs_rebaseline_reftest(self):
try:
filesystem = self._port.host.filesystem
- filesystem.write_text_file(filesystem.join(self._port.layout_tests_dir(), 'reftests/failures/expected/needsrebaseline.html'), 'content')
- filesystem.write_text_file(filesystem.join(self._port.layout_tests_dir(), 'reftests/failures/expected/needsrebaseline-expected.html'), 'content')
- filesystem.write_text_file(filesystem.join(self._port.layout_tests_dir(), 'reftests/failures/expected/needsrebaseline_with_txt.html'), 'content')
- filesystem.write_text_file(filesystem.join(self._port.layout_tests_dir(), 'reftests/failures/expected/needsrebaseline_with_txt-expected.html'), 'content')
- filesystem.write_text_file(filesystem.join(self._port.layout_tests_dir(), 'reftests/failures/expected/needsrebaseline_with_txt-expected.txt'), 'content')
- filesystem.write_text_file(filesystem.join(self._port.layout_tests_dir(), 'reftests/failures/expected/needsmanualrebaseline.html'), 'content')
- filesystem.write_text_file(filesystem.join(self._port.layout_tests_dir(), 'reftests/failures/expected/needsmanualrebaseline-expected.html'), 'content')
- filesystem.write_text_file(filesystem.join(self._port.layout_tests_dir(), 'reftests/failures/expected/needsmanualrebaseline_with_txt.html'), 'content')
- filesystem.write_text_file(filesystem.join(self._port.layout_tests_dir(), 'reftests/failures/expected/needsmanualrebaseline_with_txt.html'), 'content')
- filesystem.write_text_file(filesystem.join(self._port.layout_tests_dir(), 'reftests/failures/expected/needsmanualrebaseline_with_txt-expected.html'), 'content')
- filesystem.write_text_file(filesystem.join(self._port.layout_tests_dir(), 'reftests/failures/expected/needsmanualrebaseline_with_txt-expected.txt'), 'content')
+ filesystem.write_text_file(
+ filesystem.join(
+ self._port.layout_tests_dir(),
+ 'reftests/failures/expected/needsrebaseline.html'),
+ 'content')
+ filesystem.write_text_file(
+ filesystem.join(
+ self._port.layout_tests_dir(),
+ 'reftests/failures/expected/needsrebaseline-expected.html'),
+ 'content')
+ filesystem.write_text_file(
+ filesystem.join(
+ self._port.layout_tests_dir(),
+ 'reftests/failures/expected/needsrebaseline_with_txt.html'),
+ 'content')
+ filesystem.write_text_file(
+ filesystem.join(
+ self._port.layout_tests_dir(),
+ 'reftests/failures/expected/needsrebaseline_with_txt-expected.html'),
+ 'content')
+ filesystem.write_text_file(
+ filesystem.join(
+ self._port.layout_tests_dir(),
+ 'reftests/failures/expected/needsrebaseline_with_txt-expected.txt'),
+ 'content')
+ filesystem.write_text_file(
+ filesystem.join(
+ self._port.layout_tests_dir(),
+ 'reftests/failures/expected/needsmanualrebaseline.html'),
+ 'content')
+ filesystem.write_text_file(
+ filesystem.join(
+ self._port.layout_tests_dir(),
+ 'reftests/failures/expected/needsmanualrebaseline-expected.html'),
+ 'content')
+ filesystem.write_text_file(
+ filesystem.join(
+ self._port.layout_tests_dir(),
+ 'reftests/failures/expected/needsmanualrebaseline_with_txt.html'),
+ 'content')
+ filesystem.write_text_file(
+ filesystem.join(
+ self._port.layout_tests_dir(),
+ 'reftests/failures/expected/needsmanualrebaseline_with_txt.html'),
+ 'content')
+ filesystem.write_text_file(
+ filesystem.join(
+ self._port.layout_tests_dir(),
+ 'reftests/failures/expected/needsmanualrebaseline_with_txt-expected.html'),
+ 'content')
+ filesystem.write_text_file(
+ filesystem.join(
+ self._port.layout_tests_dir(),
+ 'reftests/failures/expected/needsmanualrebaseline_with_txt-expected.txt'),
+ 'content')
self.parse_exp("""Bug(user) reftests/failures/expected/needsrebaseline.html [ NeedsRebaseline ]
Bug(user) reftests/failures/expected/needsrebaseline_with_txt.html [ NeedsRebaseline ]
Bug(user) reftests/failures/expected/needsmanualrebaseline.html [ NeedsManualRebaseline ]
Bug(user) reftests/failures/expected/needsmanualrebaseline_with_txt.html [ NeedsManualRebaseline ]
""", is_lint_mode=True)
self.assertFalse(True, "ParseError wasn't raised")
- except ParseError, e:
+ except ParseError as e:
warnings = """expectations:1 A reftest without text expectation cannot be marked as NeedsRebaseline/NeedsManualRebaseline reftests/failures/expected/needsrebaseline.html
expectations:3 A reftest without text expectation cannot be marked as NeedsRebaseline/NeedsManualRebaseline reftests/failures/expected/needsmanualrebaseline.html"""
self.assertEqual(str(e), warnings)
@@ -230,7 +274,7 @@ expectations:3 A reftest without text expectation cannot be marked as NeedsRebas
"Bug(user) disabled-test.html-disabled [ Failure ]\n"
"Bug(user) [ Release ] test-to-rebaseline.html [ NeedsRebaseline ]", is_lint_mode=True)
self.assertFalse(True, "ParseError wasn't raised")
- except ParseError, e:
+ except ParseError as e:
warnings = ("expectations:1 Unrecognized specifier 'foo' failures/expected/text.html\n"
"expectations:2 Path does not exist. non-existent-test.html\n"
"expectations:4 A test cannot be rebaselined for Debug/Release. test-to-rebaseline.html")
@@ -406,7 +450,8 @@ class ExpectationSyntaxTests(Base):
self.parse_exp(exp_str)
self.assert_exp('failures/expected/text.html', FAIL)
- def assert_tokenize_exp(self, line, bugs=None, specifiers=None, expectations=None, warnings=None, comment=None, name='foo.html', filename='TestExpectations'):
+ def assert_tokenize_exp(self, line, bugs=None, specifiers=None, expectations=None, warnings=None,
+ comment=None, name='foo.html', filename='TestExpectations'):
bugs = bugs or []
specifiers = specifiers or []
expectations = expectations or []
@@ -476,7 +521,7 @@ class SemanticTests(Base):
try:
self.parse_exp('crbug/1234 failures/expected/text.html [ Failure ]', is_lint_mode=True)
self.fail('should have raised an error about a bad bug identifier')
- except ParseError, exp:
+ except ParseError as exp:
self.assertEqual(len(exp.warnings), 3)
def test_missing_bugid(self):
@@ -485,7 +530,7 @@ class SemanticTests(Base):
try:
self.parse_exp('failures/expected/text.html [ Failure ]', is_lint_mode=True)
- except ParseError, exp:
+ except ParseError as exp:
self.assertEqual(exp.warnings, ['expectations:1 Test lacks BUG specifier. failures/expected/text.html'])
def test_skip_and_wontfix(self):

Powered by Google App Engine
This is Rietveld 408576698