| OLD | NEW |
| 1 # Copyright (C) 2010 Google Inc. All rights reserved. | 1 # Copyright (C) 2010 Google Inc. All rights reserved. |
| 2 # Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Sze
ged | 2 # Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Sze
ged |
| 3 # | 3 # |
| 4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
| 5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
| 6 # met: | 6 # met: |
| 7 # | 7 # |
| 8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
| 9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
| 10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 dir_name = '/tmp/layout-test-results' + '_' + str(x) | 171 dir_name = '/tmp/layout-test-results' + '_' + str(x) |
| 172 self._make_fake_test_result(port.host, dir_name) | 172 self._make_fake_test_result(port.host, dir_name) |
| 173 manager = get_manager() | 173 manager = get_manager() |
| 174 manager._limit_archived_results_count() | 174 manager._limit_archived_results_count() |
| 175 deleted_dir_count = 0 | 175 deleted_dir_count = 0 |
| 176 for x in range(1, 31): | 176 for x in range(1, 31): |
| 177 dir_name = '/tmp/layout-test-results' + '_' + str(x) | 177 dir_name = '/tmp/layout-test-results' + '_' + str(x) |
| 178 if not port.host.filesystem.exists(dir_name): | 178 if not port.host.filesystem.exists(dir_name): |
| 179 deleted_dir_count = deleted_dir_count + 1 | 179 deleted_dir_count = deleted_dir_count + 1 |
| 180 self.assertEqual(deleted_dir_count, 5) | 180 self.assertEqual(deleted_dir_count, 5) |
| 181 | |
| 182 # Tests for protected methods - pylint: disable=protected-access | |
| 183 | |
| 184 def test_ensure_manifest_copies_new_manifest(self): | |
| 185 host = MockHost() | |
| 186 port = host.port_factory.get() | |
| 187 | |
| 188 manifest_path = '/mock-checkout/third_party/WebKit/LayoutTests/external/
wpt/MANIFEST.json' | |
| 189 self.assertFalse(port.host.filesystem.exists(manifest_path)) | |
| 190 manager = Manager(port, options=optparse.Values({'max_locked_shards': 1}
), printer=FakePrinter()) | |
| 191 manager._ensure_manifest() | |
| 192 self.assertTrue(port.host.filesystem.exists(manifest_path)) | |
| 193 | |
| 194 webkit_base = '/mock-checkout/third_party/WebKit' | |
| 195 self.assertEqual( | |
| 196 port.host.executive.calls, | |
| 197 [ | |
| 198 [ | |
| 199 'python', | |
| 200 webkit_base + '/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/ma
nifest', | |
| 201 '--work', | |
| 202 '--tests-root', | |
| 203 webkit_base + '/LayoutTests/external/wpt', | |
| 204 ] | |
| 205 ] | |
| 206 ) | |
| 207 | |
| 208 def test_ensure_manifest_updates_manifest_if_it_exists(self): | |
| 209 host = MockHost() | |
| 210 port = host.port_factory.get('test-mac-mac10.10') | |
| 211 manifest_path = '/mock-checkout/third_party/WebKit/LayoutTests/external/
wpt/MANIFEST.json' | |
| 212 | |
| 213 host.filesystem.write_binary_file(manifest_path, '{}') | |
| 214 self.assertTrue(port.host.filesystem.exists(manifest_path)) | |
| 215 | |
| 216 manager = Manager(port, options=optparse.Values({'max_locked_shards': 1}
), printer=FakePrinter()) | |
| 217 manager._ensure_manifest() | |
| 218 self.assertTrue(port.host.filesystem.exists(manifest_path)) | |
| 219 | |
| 220 webkit_base = '/mock-checkout/third_party/WebKit' | |
| 221 self.assertEqual( | |
| 222 port.host.executive.calls, | |
| 223 [ | |
| 224 [ | |
| 225 'python', | |
| 226 webkit_base + '/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/ma
nifest', | |
| 227 '--work', | |
| 228 '--tests-root', | |
| 229 webkit_base + '/LayoutTests/external/wpt', | |
| 230 ] | |
| 231 ] | |
| 232 ) | |
| OLD | NEW |