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

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer_unittest.py

Issue 2021743002: Move _baseline_name to test_result_writer.py. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 6 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/controllers/test_result_writer_unittest.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer_unittest.py
index f8b89c365f50afa5503cb6d2e75b1a42d93ef6c1..0edf238a9d5fc0f76c0e5274d3fb931490122d66 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer_unittest.py
@@ -29,7 +29,9 @@
import optparse
import unittest
+from webkitpy.common.system.filesystem_mock import MockFileSystem
from webkitpy.common.system.systemhost_mock import MockSystemHost
+from webkitpy.layout_tests.controllers.test_result_writer import baseline_name
from webkitpy.layout_tests.controllers.test_result_writer import write_test_result
from webkitpy.layout_tests.port.driver import DriverOutput
from webkitpy.layout_tests.port.test import TestPort
@@ -76,3 +78,9 @@ class TestResultWriterTests(unittest.TestCase):
failure.reference_filename = 'notfound.html'
written_files = self.run_test(failures=[failure], files={})
self.assertEqual(written_files, {})
+
+ def test_baseline_name(self):
+ fs = MockFileSystem()
+ self.assertEqual(baseline_name(fs, 'x/y/foo.html', 'txt'), 'x/y/foo-expected.txt')
+ self.assertEqual(baseline_name(fs, 'foo.html', 'txt'), 'foo-expected.txt')
+ self.assertEqual(baseline_name(fs, 'foo', 'txt'), 'foo-expected.txt')

Powered by Google App Engine
This is Rietveld 408576698