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

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py

Issue 2409903002: When rebaselining testharness tests with new all-PASS results, remove the baseline. (Closed)
Patch Set: Undo docstrings that no longer apply Created 4 years, 2 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
« no previous file with comments | « third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py
index a71193b71995eeb014ca8c83fe9812ba0625c143..5ff6ce189667adf2c506637ae8a37cb54354ab57 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py
@@ -281,6 +281,39 @@ class TestRebaselineTest(BaseTestCase):
self.command._rebaseline_test("MOCK Trusty", "userscripts/another-test.html", "txt", self.WEB_PREFIX)
self.assertItemsEqual(self.tool.web.urls_fetched, [self.WEB_PREFIX + '/userscripts/another-test-actual.txt'])
+ def test_rebaseline_all_pass_testharness_result_removes_baseline(self):
+ self.tool.web.urls = {
+ ('https://storage.googleapis.com/chromium-layout-test-archives'
+ '/MOCK_Win7/results/layout-test-results/failures/unexpected'
+ '/text-actual.txt'): 'This is a testharness.js-based test.\n PASS: foo \n Harness: the test ran to completion.'
+ }
+ self._write(
+ '/test.checkout/LayoutTests/platform/test-win-win7/failures/unexpected/text-expected.txt',
+ 'original baseline')
+ oc = OutputCapture()
+ oc.capture_output()
+ self.command.execute(self.options(builder='MOCK Win7', test="failures/unexpected/text.html"), [], self.tool)
+ out, _, _ = oc.restore_output()
+ self.assertEqual('{"remove-lines": [{"test": "failures/unexpected/text.html", "builder": "MOCK Win7"}]}\n', out)
+ self.assertFalse(self.tool.filesystem.exists(
+ '/test.checkout/LayoutTests/platform/test-win-win7/failures/unexpected/text-expected.txt'))
+
+ def test_rebaseline_test_non_all_pass_testharness_result(self):
+ self.tool.web.urls = {
+ ('https://storage.googleapis.com/chromium-layout-test-archives/MOCK_Win7'
+ '/results/layout-test-results/failures/unexpected/text-actual.txt'):
+ ('This is some other baseline content, not an all-pass testharness.js result.')}
+ self._write(
+ '/test.checkout/LayoutTests/platform/test-win-win7/failures/unexpected/text-expected.txt',
+ 'original baseline')
+ oc = OutputCapture()
+ oc.capture_output()
+ self.command.execute(self.options(builder='MOCK Win7', test="failures/unexpected/text.html"), [], self.tool)
+ out, _, _ = oc.restore_output()
+ self.assertEqual('{"remove-lines": [{"test": "failures/unexpected/text.html", "builder": "MOCK Win7"}]}\n', out)
+ self.assertTrue(self.tool.filesystem.exists(
+ '/test.checkout/LayoutTests/platform/test-win-win7/failures/unexpected/text-expected.txt'))
+
def test_rebaseline_test_with_results_directory(self):
self._write("userscripts/another-test.html", "test data")
self._write(
« no previous file with comments | « third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698