| OLD | NEW |
| (Empty) |
| 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 | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 import unittest | |
| 6 | |
| 7 from webkitpy.common.webkit_finder import WebKitFinder | |
| 8 from webkitpy.common.system.filesystem_mock import MockFileSystem | |
| 9 | |
| 10 | |
| 11 class TestWebKitFinder(unittest.TestCase): | |
| 12 | |
| 13 # TODO(qyearsley): Add tests for other methods in WebKitFinder. | |
| 14 # Including tests for cases when the separator character is backslash. | |
| 15 | |
| 16 def test_layout_test_name(self): | |
| 17 finder = WebKitFinder(MockFileSystem()) | |
| 18 self.assertEqual( | |
| 19 finder.layout_test_name('third_party/WebKit/LayoutTests/test/name.ht
ml'), | |
| 20 'test/name.html') | |
| 21 | |
| 22 def test_layout_test_name_not_in_layout_tests_dir(self): | |
| 23 finder = WebKitFinder(MockFileSystem()) | |
| 24 self.assertIsNone(finder.layout_test_name('some/other/path/file.html')) | |
| 25 | |
| 26 def test_webkit_base(self): | |
| 27 finder = WebKitFinder(MockFileSystem()) | |
| 28 self.assertEqual(finder.webkit_base(), '/mock-checkout/third_party/WebKi
t') | |
| 29 | |
| 30 def test_chromium_base(self): | |
| 31 finder = WebKitFinder(MockFileSystem()) | |
| 32 self.assertEqual(finder.chromium_base(), '/mock-checkout') | |
| 33 | |
| 34 def test_path_from_chromium_base(self): | |
| 35 finder = WebKitFinder(MockFileSystem()) | |
| 36 self.assertEqual( | |
| 37 finder.path_from_chromium_base('foo', 'bar.baz'), | |
| 38 '/mock-checkout/foo/bar.baz') | |
| OLD | NEW |