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

Side by Side Diff: Tools/Scripts/webkitpy/layout_tests/port/driver_unittest.py

Issue 15790007: Fix webkitpy unittests. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 7 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) 2010 Google Inc. All rights reserved. 1 # Copyright (C) 2010 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 self.assertEqual(content_block.content_type, 'image/png') 161 self.assertEqual(content_block.content_type, 'image/png')
162 self.assertEqual(content_block.content_hash, 'actual') 162 self.assertEqual(content_block.content_hash, 'actual')
163 self.assertEqual(content_block.encoding, 'base64') 163 self.assertEqual(content_block.encoding, 'base64')
164 self.assertEqual(content_block.content, 'MTIzNDU2NzgK') 164 self.assertEqual(content_block.content, 'MTIzNDU2NzgK')
165 self.assertEqual(content_block.decoded_content, '12345678\n') 165 self.assertEqual(content_block.decoded_content, '12345678\n')
166 166
167 def test_no_timeout(self): 167 def test_no_timeout(self):
168 port = TestWebKitPort() 168 port = TestWebKitPort()
169 port._config.build_directory = lambda configuration: '/mock-build' 169 port._config.build_directory = lambda configuration: '/mock-build'
170 driver = Driver(port, 0, pixel_tests=True, no_timeout=True) 170 driver = Driver(port, 0, pixel_tests=True, no_timeout=True)
171 self.assertEqual(driver.cmd_line(True, []), ['/mock-build/DumpRenderTree ', '--no-timeout', '-']) 171 self.assertEqual(driver.cmd_line(True, []), ['/mock-build/content_shell' , '--no-timeout', '--dump-render-tree', '-'])
172 172
173 def test_check_for_driver_crash(self): 173 def test_check_for_driver_crash(self):
174 port = TestWebKitPort() 174 port = TestWebKitPort()
175 driver = Driver(port, 0, pixel_tests=True) 175 driver = Driver(port, 0, pixel_tests=True)
176 176
177 class FakeServerProcess(object): 177 class FakeServerProcess(object):
178 def __init__(self, crashed): 178 def __init__(self, crashed):
179 self.crashed = crashed 179 self.crashed = crashed
180 180
181 def pid(self): 181 def pid(self):
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 last_tmpdir = port._filesystem.last_tmpdir 260 last_tmpdir = port._filesystem.last_tmpdir
261 driver._start(True, []) 261 driver._start(True, [])
262 self.assertFalse(port._filesystem.isdir(last_tmpdir)) 262 self.assertFalse(port._filesystem.isdir(last_tmpdir))
263 263
264 def test_start_actually_starts(self): 264 def test_start_actually_starts(self):
265 port = TestWebKitPort() 265 port = TestWebKitPort()
266 port._server_process_constructor = MockServerProcess 266 port._server_process_constructor = MockServerProcess
267 driver = Driver(port, 0, pixel_tests=True) 267 driver = Driver(port, 0, pixel_tests=True)
268 driver.start(True, []) 268 driver.start(True, [])
269 self.assertTrue(driver._server_process.started) 269 self.assertTrue(driver._server_process.started)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698