| 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 collections | 5 import collections |
| 6 | 6 |
| 7 from webkitpy.common.checkout.git_mock import MockGit | 7 from webkitpy.common.checkout.git_mock import MockGit |
| 8 from webkitpy.common.host_mock import MockHost | 8 from webkitpy.common.host_mock import MockHost |
| 9 from webkitpy.common.system.executive_mock import MockExecutive | 9 from webkitpy.common.system.executive_mock import MockExecutive |
| 10 from webkitpy.common.system.log_testing import LoggingTestCase | 10 from webkitpy.common.system.log_testing import LoggingTestCase |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 host = MockHost() | 199 host = MockHost() |
| 200 dest_path = '/mock-checkout/third_party/WebKit/LayoutTests/external/wpt' | 200 dest_path = '/mock-checkout/third_party/WebKit/LayoutTests/external/wpt' |
| 201 host.filesystem.write_text_file(dest_path + '/b-expected.txt', '') | 201 host.filesystem.write_text_file(dest_path + '/b-expected.txt', '') |
| 202 host.filesystem.write_text_file(dest_path + '/b.x-expected.txt', '') | 202 host.filesystem.write_text_file(dest_path + '/b.x-expected.txt', '') |
| 203 host.filesystem.write_text_file(dest_path + '/b.x.html', '') | 203 host.filesystem.write_text_file(dest_path + '/b.x.html', '') |
| 204 importer = TestImporter(host) | 204 importer = TestImporter(host) |
| 205 importer._delete_orphaned_baselines(dest_path) | 205 importer._delete_orphaned_baselines(dest_path) |
| 206 self.assertFalse(host.filesystem.exists(dest_path + '/b-expected.txt')) | 206 self.assertFalse(host.filesystem.exists(dest_path + '/b-expected.txt')) |
| 207 self.assertTrue(host.filesystem.exists(dest_path + '/b.x-expected.txt')) | 207 self.assertTrue(host.filesystem.exists(dest_path + '/b.x-expected.txt')) |
| 208 self.assertTrue(host.filesystem.exists(dest_path + '/b.x.html')) | 208 self.assertTrue(host.filesystem.exists(dest_path + '/b.x.html')) |
| 209 |
| 210 def test_keeps_owners_files_and_baselines(self): |
| 211 host = MockHost() |
| 212 dest_path = '/mock-checkout/third_party/WebKit/LayoutTests/external/wpt' |
| 213 host.filesystem.write_text_file(dest_path + '/foo-test.html', '') |
| 214 host.filesystem.write_text_file(dest_path + '/foo-test-expected.txt', ''
) |
| 215 host.filesystem.write_text_file(dest_path + '/OWNERS', '') |
| 216 host.filesystem.write_text_file(dest_path + '/bar/baz/OWNERS', '') |
| 217 importer = TestImporter(host) |
| 218 importer._clear_out_dest_path(dest_path) |
| 219 self.assertFalse(host.filesystem.exists(dest_path + '/foo-test.html')) |
| 220 self.assertTrue(host.filesystem.exists(dest_path + '/foo-test-expected.t
xt')) |
| 221 self.assertTrue(host.filesystem.exists(dest_path + '/OWNERS')) |
| 222 self.assertTrue(host.filesystem.exists(dest_path + '/bar/baz/OWNERS')) |
| OLD | NEW |