| OLD | NEW |
| 1 # Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 1 # Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions | 4 # modification, are permitted provided that the following conditions |
| 5 # are met: | 5 # are met: |
| 6 # | 6 # |
| 7 # 1. Redistributions of source code must retain the above | 7 # 1. Redistributions of source code must retain the above |
| 8 # copyright notice, this list of conditions and the following | 8 # copyright notice, this list of conditions and the following |
| 9 # disclaimer. | 9 # disclaimer. |
| 10 # 2. Redistributions in binary form must reproduce the above | 10 # 2. Redistributions in binary form must reproduce the above |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 self.assertEqual( | 117 self.assertEqual( |
| 118 host.filesystem.executable_files, | 118 host.filesystem.executable_files, |
| 119 set(['/mock-checkout/third_party/WebKit/LayoutTests/external/blink/w
3c/dir/has_shebang.txt'])) | 119 set(['/mock-checkout/third_party/WebKit/LayoutTests/external/blink/w
3c/dir/has_shebang.txt'])) |
| 120 | 120 |
| 121 def test_ref_test_with_ref_is_copied(self): | 121 def test_ref_test_with_ref_is_copied(self): |
| 122 host = MockHost() | 122 host = MockHost() |
| 123 host.filesystem = MockFileSystem(files={ | 123 host.filesystem = MockFileSystem(files={ |
| 124 '/blink/w3c/dir1/my-ref-test.html': '<html><head><link rel="match" h
ref="ref-file.html" />test</head></html>', | 124 '/blink/w3c/dir1/my-ref-test.html': '<html><head><link rel="match" h
ref="ref-file.html" />test</head></html>', |
| 125 '/blink/w3c/dir1/ref-file.html': '<html><head>test</head></html>', | 125 '/blink/w3c/dir1/ref-file.html': '<html><head>test</head></html>', |
| 126 '/mock-checkout/third_party/WebKit/LayoutTests/W3CImportExpectations
': '', | 126 '/mock-checkout/third_party/WebKit/LayoutTests/W3CImportExpectations
': '', |
| 127 '/mock-checkout/third_party/WebKit/Source/core/css/CSSProperties.in'
: '', | |
| 128 }) | 127 }) |
| 129 copier = TestCopier(host, FAKE_SOURCE_REPO_DIR) | 128 copier = TestCopier(host, FAKE_SOURCE_REPO_DIR) |
| 130 copier.find_importable_tests() | 129 copier.find_importable_tests() |
| 131 self.assertEqual( | 130 self.assertEqual( |
| 132 copier.import_list, | 131 copier.import_list, |
| 133 [ | 132 [ |
| 134 { | 133 { |
| 135 'copy_list': [ | 134 'copy_list': [ |
| 136 {'src': '/blink/w3c/dir1/ref-file.html', 'dest': 'ref-fi
le.html'}, | 135 {'src': '/blink/w3c/dir1/ref-file.html', 'dest': 'ref-fi
le.html'}, |
| 137 {'src': '/blink/w3c/dir1/ref-file.html', 'dest': 'my-ref
-test-expected.html', 'reference_support_info': {}}, | 136 {'src': '/blink/w3c/dir1/ref-file.html', 'dest': 'my-ref
-test-expected.html', 'reference_support_info': {}}, |
| 138 {'src': '/blink/w3c/dir1/my-ref-test.html', 'dest': 'my-
ref-test.html'} | 137 {'src': '/blink/w3c/dir1/my-ref-test.html', 'dest': 'my-
ref-test.html'} |
| 139 ], | 138 ], |
| 140 'dirname': '/blink/w3c/dir1', | 139 'dirname': '/blink/w3c/dir1', |
| 141 'jstests': 0, | 140 'jstests': 0, |
| 142 'reftests': 1, | 141 'reftests': 1, |
| 143 'total_tests': 1 | 142 'total_tests': 1 |
| 144 } | 143 } |
| 145 ]) | 144 ]) |
| 146 | 145 |
| 147 def test_ref_test_without_ref_is_skipped(self): | 146 def test_ref_test_without_ref_is_skipped(self): |
| 148 host = MockHost() | 147 host = MockHost() |
| 149 host.filesystem = MockFileSystem(files={ | 148 host.filesystem = MockFileSystem(files={ |
| 150 '/blink/w3c/dir1/my-ref-test.html': '<html><head><link rel="match" h
ref="not-here.html" /></head></html>', | 149 '/blink/w3c/dir1/my-ref-test.html': '<html><head><link rel="match" h
ref="not-here.html" /></head></html>', |
| 151 '/mock-checkout/third_party/WebKit/LayoutTests/W3CImportExpectations
': '', | 150 '/mock-checkout/third_party/WebKit/LayoutTests/W3CImportExpectations
': '', |
| 152 '/mock-checkout/third_party/WebKit/Source/core/css/CSSProperties.in'
: '', | |
| 153 }) | 151 }) |
| 154 copier = TestCopier(host, FAKE_SOURCE_REPO_DIR) | 152 copier = TestCopier(host, FAKE_SOURCE_REPO_DIR) |
| 155 copier.find_importable_tests() | 153 copier.find_importable_tests() |
| 156 self.assertEqual(copier.import_list, []) | 154 self.assertEqual(copier.import_list, []) |
| 157 | 155 |
| 158 def test_should_try_to_convert_positive_cases(self): | 156 def test_should_try_to_convert_positive_cases(self): |
| 159 self.assertTrue(TestCopier.should_try_to_convert({}, 'foo.css', 'LayoutT
ests/external/csswg-test/x')) | 157 self.assertTrue(TestCopier.should_try_to_convert({}, 'foo.css', 'LayoutT
ests/external/csswg-test/x')) |
| 160 self.assertTrue(TestCopier.should_try_to_convert({}, 'foo.htm', 'LayoutT
ests/external/csswg-test/x')) | 158 self.assertTrue(TestCopier.should_try_to_convert({}, 'foo.htm', 'LayoutT
ests/external/csswg-test/x')) |
| 161 self.assertTrue(TestCopier.should_try_to_convert({}, 'foo.html', 'Layout
Tests/external/csswg-test/x')) | 159 self.assertTrue(TestCopier.should_try_to_convert({}, 'foo.html', 'Layout
Tests/external/csswg-test/x')) |
| 162 self.assertTrue(TestCopier.should_try_to_convert({}, 'foo.xht', 'LayoutT
ests/external/csswg-test/x')) | 160 self.assertTrue(TestCopier.should_try_to_convert({}, 'foo.xht', 'LayoutT
ests/external/csswg-test/x')) |
| 163 self.assertTrue(TestCopier.should_try_to_convert({}, 'foo.xhtml', 'Layou
tTests/external/csswg-test/x')) | 161 self.assertTrue(TestCopier.should_try_to_convert({}, 'foo.xhtml', 'Layou
tTests/external/csswg-test/x')) |
| 164 | 162 |
| 165 def test_should_not_try_to_convert_js_test(self): | 163 def test_should_not_try_to_convert_js_test(self): |
| 166 self.assertFalse(TestCopier.should_try_to_convert({'is_jstest': True}, '
foo.html', 'LayoutTests/external/csswg-test/x')) | 164 self.assertFalse(TestCopier.should_try_to_convert({'is_jstest': True}, '
foo.html', 'LayoutTests/external/csswg-test/x')) |
| 167 | 165 |
| 168 def test_should_not_try_to_convert_test_in_wpt(self): | 166 def test_should_not_try_to_convert_test_in_wpt(self): |
| 169 self.assertFalse(TestCopier.should_try_to_convert({}, 'foo.html', 'Layou
tTests/external/wpt/foo')) | 167 self.assertFalse(TestCopier.should_try_to_convert({}, 'foo.html', 'Layou
tTests/external/wpt/foo')) |
| 170 | 168 |
| 171 def test_should_not_try_to_convert_other_file_types(self): | 169 def test_should_not_try_to_convert_other_file_types(self): |
| 172 self.assertFalse(TestCopier.should_try_to_convert({}, 'foo.bar', 'Layout
Tests/external/csswg-test/x')) | 170 self.assertFalse(TestCopier.should_try_to_convert({}, 'foo.bar', 'Layout
Tests/external/csswg-test/x')) |
| 173 self.assertFalse(TestCopier.should_try_to_convert({}, 'foo.js', 'LayoutT
ests/external/csswg-test/x')) | 171 self.assertFalse(TestCopier.should_try_to_convert({}, 'foo.js', 'LayoutT
ests/external/csswg-test/x')) |
| 174 self.assertFalse(TestCopier.should_try_to_convert({}, 'foo.md', 'LayoutT
ests/external/csswg-test/x')) | 172 self.assertFalse(TestCopier.should_try_to_convert({}, 'foo.md', 'LayoutT
ests/external/csswg-test/x')) |
| 175 self.assertFalse(TestCopier.should_try_to_convert({}, 'foo.png', 'Layout
Tests/external/csswg-test/x')) | 173 self.assertFalse(TestCopier.should_try_to_convert({}, 'foo.png', 'Layout
Tests/external/csswg-test/x')) |
| 176 self.assertFalse(TestCopier.should_try_to_convert({}, 'foo.svg', 'Layout
Tests/external/csswg-test/x')) | 174 self.assertFalse(TestCopier.should_try_to_convert({}, 'foo.svg', 'Layout
Tests/external/csswg-test/x')) |
| 177 self.assertFalse(TestCopier.should_try_to_convert({}, 'foo.svgz', 'Layou
tTests/external/csswg-test/x')) | 175 self.assertFalse(TestCopier.should_try_to_convert({}, 'foo.svgz', 'Layou
tTests/external/csswg-test/x')) |
| OLD | NEW |