| Index: media/tools/layout_tests/layouttests_unittest.py
|
| diff --git a/media/tools/layout_tests/layouttests_unittest.py b/media/tools/layout_tests/layouttests_unittest.py
|
| new file mode 100755
|
| index 0000000000000000000000000000000000000000..655fe3baca7f1660b6ed17376a22d0d98c349283
|
| --- /dev/null
|
| +++ b/media/tools/layout_tests/layouttests_unittest.py
|
| @@ -0,0 +1,40 @@
|
| +#!/usr/bin/python
|
| +# Copyright (c) 2011 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 os
|
| +import unittest
|
| +
|
| +from layouttests import LayoutTests
|
| +from test_expectations import TestExpectations
|
| +
|
| +
|
| +class TestLayoutTests(unittest.TestCase):
|
| + """A class for unittest for layouttests class."""
|
| +
|
| + def testJoinWithTestExpectation(self):
|
| + layouttests = LayoutTests(csv_file_path=os.path.join('testname',
|
| + 'media.csv'))
|
| + test_expectations = TestExpectations()
|
| + test_info_map = layouttests.JoinWithTestExpectation(test_expectations)
|
| +
|
| + def testGetTestDescriptionsFromSVN(self):
|
| + desc1 = LayoutTests.GetTestDescriptionFromSVN(
|
| + 'media/track/track-webvtt-tc004-magicheader.html')
|
| + self.assertEquals(desc1,
|
| + ('Tests that the magic file header "WEBVTT" leads to the'
|
| + ' file properly recognized as a WebVTT file.'),
|
| + 'Test description is wrong')
|
| + desc2 = LayoutTests.GetTestDescriptionFromSVN('jquery/data.html')
|
| + self.assertEquals(desc2, 'UNKNOWN', 'Test description is wrong')
|
| +
|
| + def testGetParentDirectoryList(self):
|
| + l = ['hoge1/hoge2/hoge3.html', 'hoge1/x.html', 'hoge1/hoge2/hoge4.html']
|
| + expected_result = ['hoge1/', 'hoge1/hoge2/']
|
| + assertEquals(LayoutTests.GetParentDirectoryList(l),
|
| + expected_result)
|
| +
|
| +
|
| +if __name__ == '__main__':
|
| + unittest.main()
|
|
|