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

Side by Side Diff: Tools/Scripts/webkitpy/layout_tests/servers/apache_http_unittest.py

Issue 546133003: Reformat webkitpy.layout_tests w/ format-webkitpy. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 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 (C) 2012 Google Inc. All rights reserved. 1 # Copyright (C) 2012 Google Inc. 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 are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer 10 # copyright notice, this list of conditions and the following disclaimer
(...skipping 21 matching lines...) Expand all
32 32
33 from webkitpy.common.system.executive_mock import MockExecutive 33 from webkitpy.common.system.executive_mock import MockExecutive
34 from webkitpy.common.system.outputcapture import OutputCapture 34 from webkitpy.common.system.outputcapture import OutputCapture
35 from webkitpy.common.host_mock import MockHost 35 from webkitpy.common.host_mock import MockHost
36 from webkitpy.layout_tests.port import test 36 from webkitpy.layout_tests.port import test
37 from webkitpy.layout_tests.servers.apache_http import ApacheHTTP 37 from webkitpy.layout_tests.servers.apache_http import ApacheHTTP
38 from webkitpy.layout_tests.servers.server_base import ServerError 38 from webkitpy.layout_tests.servers.server_base import ServerError
39 39
40 40
41 class TestApacheHTTP(unittest.TestCase): 41 class TestApacheHTTP(unittest.TestCase):
42
42 def test_start_cmd(self): 43 def test_start_cmd(self):
43 # Fails on win - see https://bugs.webkit.org/show_bug.cgi?id=84726 44 # Fails on win - see https://bugs.webkit.org/show_bug.cgi?id=84726
44 if sys.platform in ('cygwin', 'win32'): 45 if sys.platform in ('cygwin', 'win32'):
45 return 46 return
46 47
47 def fake_pid(_): 48 def fake_pid(_):
48 host.filesystem.write_text_file('/tmp/WebKit/httpd.pid', '42') 49 host.filesystem.write_text_file('/tmp/WebKit/httpd.pid', '42')
49 return True 50 return True
50 51
51 host = MockHost() 52 host = MockHost()
52 host.executive = MockExecutive(should_log=True) 53 host.executive = MockExecutive(should_log=True)
53 test_port = test.TestPort(host) 54 test_port = test.TestPort(host)
54 host.filesystem.write_text_file(test_port.path_to_apache_config_file(), '') 55 host.filesystem.write_text_file(test_port.path_to_apache_config_file(), '')
55 56
56 server = ApacheHTTP(test_port, "/mock/output_dir", additional_dirs=[], n umber_of_servers=4) 57 server = ApacheHTTP(test_port, '/mock/output_dir', additional_dirs=[], n umber_of_servers=4)
57 server._check_that_all_ports_are_available = lambda: True 58 server._check_that_all_ports_are_available = lambda: True
58 server._is_server_running_on_all_ports = lambda: True 59 server._is_server_running_on_all_ports = lambda: True
59 server._wait_for_action = fake_pid 60 server._wait_for_action = fake_pid
60 oc = OutputCapture() 61 oc = OutputCapture()
61 try: 62 try:
62 oc.capture_output() 63 oc.capture_output()
63 server.start() 64 server.start()
64 server.stop() 65 server.stop()
65 finally: 66 finally:
66 _, _, logs = oc.restore_output() 67 _, _, logs = oc.restore_output()
67 self.assertIn("StartServers 4", logs) 68 self.assertIn('StartServers 4', logs)
68 self.assertIn("MinSpareServers 4", logs) 69 self.assertIn('MinSpareServers 4', logs)
69 self.assertIn("MaxSpareServers 4", logs) 70 self.assertIn('MaxSpareServers 4', logs)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698