Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/manager_unittest.py

Issue 1827833005: Move the run() method in Manager, and make the needs_servers method private. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 class ManagerTest(unittest.TestCase): 49 class ManagerTest(unittest.TestCase):
50 50
51 def test_needs_servers(self): 51 def test_needs_servers(self):
52 def get_manager(): 52 def get_manager():
53 host = MockHost() 53 host = MockHost()
54 port = host.port_factory.get('test-mac-mac10.10') 54 port = host.port_factory.get('test-mac-mac10.10')
55 manager = Manager(port, options=MockOptions(http=True, max_locked_sh ards=1), printer=FakePrinter()) 55 manager = Manager(port, options=MockOptions(http=True, max_locked_sh ards=1), printer=FakePrinter())
56 return manager 56 return manager
57 57
58 manager = get_manager() 58 manager = get_manager()
59 self.assertFalse(manager.needs_servers(['fast/html'])) 59 self.assertFalse(manager._needs_servers(['fast/html']))
60 60
61 manager = get_manager() 61 manager = get_manager()
62 self.assertTrue(manager.needs_servers(['http/tests/misc'])) 62 self.assertTrue(manager._needs_servers(['http/tests/misc']))
63 63
64 def test_servers_started(self): 64 def test_servers_started(self):
65 def get_manager(port): 65 def get_manager(port):
66 manager = Manager(port, options=MockOptions(http=True, max_locked_sh ards=1), printer=FakePrinter()) 66 manager = Manager(port, options=MockOptions(http=True, max_locked_sh ards=1), printer=FakePrinter())
67 return manager 67 return manager
68 68
69 def start_http_server(additional_dirs, number_of_drivers): 69 def start_http_server(additional_dirs, number_of_drivers):
70 self.http_started = True 70 self.http_started = True
71 71
72 def start_websocket_server(): 72 def start_websocket_server():
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 dir_name = '/tmp/layout-test-results' + '_' + str(x) 169 dir_name = '/tmp/layout-test-results' + '_' + str(x)
170 self._make_fake_test_result(port.host, dir_name) 170 self._make_fake_test_result(port.host, dir_name)
171 manager = get_manager() 171 manager = get_manager()
172 manager._limit_archived_results_count() 172 manager._limit_archived_results_count()
173 deleted_dir_count = 0 173 deleted_dir_count = 0
174 for x in range(1, 31): 174 for x in range(1, 31):
175 dir_name = '/tmp/layout-test-results' + '_' + str(x) 175 dir_name = '/tmp/layout-test-results' + '_' + str(x)
176 if not port.host.filesystem.exists(dir_name): 176 if not port.host.filesystem.exists(dir_name):
177 deleted_dir_count = deleted_dir_count + 1 177 deleted_dir_count = deleted_dir_count + 1
178 self.assertEqual(deleted_dir_count, 5) 178 self.assertEqual(deleted_dir_count, 5)
OLDNEW
« no previous file with comments | « third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698