| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import unittest | 5 import unittest |
| 6 | 6 |
| 7 from webkitpy.common.webkit_finder import WebKitFinder | 7 from webkitpy.common.path_finder import PathFinder |
| 8 from webkitpy.common.system.filesystem_mock import MockFileSystem | 8 from webkitpy.common.system.filesystem_mock import MockFileSystem |
| 9 | 9 |
| 10 | 10 |
| 11 class TestWebKitFinder(unittest.TestCase): | 11 class TestPathFinder(unittest.TestCase): |
| 12 | 12 |
| 13 # TODO(qyearsley): Add tests for other methods in WebKitFinder. | 13 # TODO(qyearsley): Add tests for other methods in PathFinder. |
| 14 # Including tests for cases when the separator character is backslash. | 14 # Including tests for cases when the separator character is backslash. |
| 15 | 15 |
| 16 def test_layout_test_name(self): | 16 def test_layout_test_name(self): |
| 17 finder = WebKitFinder(MockFileSystem()) | 17 finder = PathFinder(MockFileSystem()) |
| 18 self.assertEqual( | 18 self.assertEqual( |
| 19 finder.layout_test_name('third_party/WebKit/LayoutTests/test/name.ht
ml'), | 19 finder.layout_test_name('third_party/WebKit/LayoutTests/test/name.ht
ml'), |
| 20 'test/name.html') | 20 'test/name.html') |
| 21 | 21 |
| 22 def test_layout_test_name_not_in_layout_tests_dir(self): | 22 def test_layout_test_name_not_in_layout_tests_dir(self): |
| 23 finder = WebKitFinder(MockFileSystem()) | 23 finder = PathFinder(MockFileSystem()) |
| 24 self.assertIsNone(finder.layout_test_name('some/other/path/file.html')) | 24 self.assertIsNone(finder.layout_test_name('some/other/path/file.html')) |
| 25 | 25 |
| 26 # pylint: disable=protected-access | 26 # pylint: disable=protected-access |
| 27 def test_webkit_base(self): | 27 def test_webkit_base(self): |
| 28 finder = WebKitFinder(MockFileSystem()) | 28 finder = PathFinder(MockFileSystem()) |
| 29 self.assertEqual(finder._webkit_base(), '/mock-checkout/third_party/WebK
it') | 29 self.assertEqual(finder._webkit_base(), '/mock-checkout/third_party/WebK
it') |
| 30 | 30 |
| 31 def test_chromium_base(self): | 31 def test_chromium_base(self): |
| 32 finder = WebKitFinder(MockFileSystem()) | 32 finder = PathFinder(MockFileSystem()) |
| 33 self.assertEqual(finder.chromium_base(), '/mock-checkout') | 33 self.assertEqual(finder.chromium_base(), '/mock-checkout') |
| 34 | 34 |
| 35 def test_path_from_chromium_base(self): | 35 def test_path_from_chromium_base(self): |
| 36 finder = WebKitFinder(MockFileSystem()) | 36 finder = PathFinder(MockFileSystem()) |
| 37 self.assertEqual( | 37 self.assertEqual( |
| 38 finder.path_from_chromium_base('foo', 'bar.baz'), | 38 finder.path_from_chromium_base('foo', 'bar.baz'), |
| 39 '/mock-checkout/foo/bar.baz') | 39 '/mock-checkout/foo/bar.baz') |
| OLD | NEW |