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

Side by Side Diff: build/android/pylib/chrome_test_server_spawner.py

Issue 12659003: Cleanup test server instance after running each a test in gtest test runner (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Just cleanup test server instance Created 7 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 | Annotate | Revision Log
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 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 """A "Test Server Spawner" that handles killing/stopping per-test test servers. 5 """A "Test Server Spawner" that handles killing/stopping per-test test servers.
6 6
7 It's used to accept requests from the device to spawn and kill instances of the 7 It's used to accept requests from the device to spawn and kill instances of the
8 chrome test server on the host. 8 chrome test server on the host.
9 """ 9 """
10 10
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 logging.info('Starting test server spawner') 396 logging.info('Starting test server spawner')
397 self.server.serve_forever() 397 self.server.serve_forever()
398 398
399 def Start(self): 399 def Start(self):
400 listener_thread = threading.Thread(target=self._Listen) 400 listener_thread = threading.Thread(target=self._Listen)
401 listener_thread.setDaemon(True) 401 listener_thread.setDaemon(True)
402 listener_thread.start() 402 listener_thread.start()
403 time.sleep(1) 403 time.sleep(1)
404 404
405 def Stop(self): 405 def Stop(self):
406 self.CleanupTestServer()
407 self.server.shutdown()
408
409 def CleanupTestServer(self):
frankf 2013/03/08 19:59:52 Could you also add dosctrings for all the methods
nilesh 2013/03/08 23:37:52 Renamed and added doc.
406 if self.server.test_server_instance: 410 if self.server.test_server_instance:
407 self.server.test_server_instance.Stop() 411 self.server.test_server_instance.Stop()
408 self.server.shutdown() 412 self.server.test_server_instance = None
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698