| Index: third_party/WebKit/Tools/Scripts/webkitpy/common/webkit_finder_unittest.py
|
| diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/common/webkit_finder_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/common/webkit_finder_unittest.py
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..278b7ce82203b700cacfdb22fa2079d9c9072b35
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Tools/Scripts/webkitpy/common/webkit_finder_unittest.py
|
| @@ -0,0 +1,38 @@
|
| +# Copyright 2016 The Chromium Authors. All rights reserved.
|
| +# Use of this source code is governed by a BSD-style license that can be
|
| +# found in the LICENSE file.
|
| +
|
| +import unittest
|
| +
|
| +from webkitpy.common.webkit_finder import WebKitFinder
|
| +from webkitpy.common.system.filesystem_mock import MockFileSystem
|
| +
|
| +
|
| +class TestWebKitFinder(unittest.TestCase):
|
| +
|
| + # TODO(qyearsley): Add tests for other methods in WebKitFinder.
|
| + # Including tests for cases when the separator character is backslash.
|
| +
|
| + def test_layout_test_name(self):
|
| + finder = WebKitFinder(MockFileSystem())
|
| + self.assertEqual(
|
| + finder.layout_test_name('third_party/WebKit/LayoutTests/test/name.html'),
|
| + 'test/name.html')
|
| +
|
| + def test_layout_test_name_not_in_layout_tests_dir(self):
|
| + finder = WebKitFinder(MockFileSystem())
|
| + self.assertIsNone(finder.layout_test_name('some/other/path/file.html'))
|
| +
|
| + def test_webkit_base(self):
|
| + finder = WebKitFinder(MockFileSystem())
|
| + self.assertEqual(finder.webkit_base(), '/mock-checkout/third_party/WebKit')
|
| +
|
| + def test_chromium_base(self):
|
| + finder = WebKitFinder(MockFileSystem())
|
| + self.assertEqual(finder.chromium_base(), '/mock-checkout')
|
| +
|
| + def test_path_from_chromium_base(self):
|
| + finder = WebKitFinder(MockFileSystem())
|
| + self.assertEqual(
|
| + finder.path_from_chromium_base('foo', 'bar.baz'),
|
| + '/mock-checkout/foo/bar.baz')
|
|
|