Changeset 76982 in webkit
- Timestamp:
- Jan 28, 2011 1:34:02 PM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r76973 r76982 1 2011-01-28 Dirk Pranke <dpranke@chromium.org> 2 3 Reviewed by Tony Chang. 4 5 new-run-webkit-tests: add a "mock DRT" port implementation 6 and a separate class that emulates what we expect the 7 DumpRenderTree behavior to be. 8 9 This will eventually replace port/dryrun.py and allow us to get 10 better test coverage of the new-run-webkit-tests code as well as 11 a reference for what new-run-webkit-tests expects from DRT. 12 13 This is the first attempt at this, and it is pretty bare-boned. It 14 really only has been tested on the 'mac' port (and a little on 15 the 'chromium-mac' port. 16 17 https://bugs.webkit.org/show_bug.cgi?id=53126 18 19 * Scripts/webkitpy/common/system/filesystem_mock.py: 20 * Scripts/webkitpy/layout_tests/port/dryrun.py: 21 * Scripts/webkitpy/layout_tests/port/factory.py: 22 * Scripts/webkitpy/layout_tests/port/mock_drt.py: Added. 23 * Scripts/webkitpy/layout_tests/port/mock_drt_unittest.py: Added. 24 * Scripts/webkitpy/layout_tests/port/test.py: 25 1 26 2011-01-28 Pratik Solanki <psolanki@apple.com> 2 27 -
trunk/Tools/Scripts/webkitpy/common/system/filesystem_mock.py
r76642 r76982 217 217 218 218 def read_text_file(self, path): 219 return self.read_binary_file(path) 219 return self.read_binary_file(path).decode('utf-8') 220 220 221 221 def read_binary_file(self, path): … … 246 246 247 247 def write_text_file(self, path, contents): 248 return self.write_binary_file(path, contents )248 return self.write_binary_file(path, contents.encode('utf-8')) 249 249 250 250 def write_binary_file(self, path, contents): -
trunk/Tools/Scripts/webkitpy/layout_tests/port/dryrun.py
r72708 r76982 72 72 return getattr(self.__delegate, name) 73 73 74 def acquire_http_lock(self): 75 pass 76 77 def release_http_lock(self): 78 pass 79 74 80 def check_build(self, needs_http): 75 81 return True -
trunk/Tools/Scripts/webkitpy/layout_tests/port/factory.py
r76722 r76982 77 77 import dryrun 78 78 maker = dryrun.DryRunPort 79 elif port_to_use.startswith('mock-'): 80 import mock_drt 81 maker = mock_drt.MockDRTPort 79 82 elif port_to_use.startswith('mac'): 80 83 import mac -
trunk/Tools/Scripts/webkitpy/layout_tests/port/test.py
r76642 r76982 53 53 self.error = '' 54 54 self.timeout = False 55 self.actual_text = self.base + '-txt\n' 56 self.actual_checksum = self.base + '-checksum\n' 57 self.actual_image = self.base + '-png\n' 55 56 # The values of each field are treated as raw byte strings. They 57 # will be converted to unicode strings where appropriate using 58 # MockFileSystem.read_text_file(). 59 self.actual_text = self.base + '-txt' 60 self.actual_checksum = self.base + '-checksum' 61 62 # We add the '\x8a' for the image file to prevent the value from 63 # being treated as UTF-8 (the character is invalid) 64 self.actual_image = self.base + '\x8a' + '-png' 65 58 66 self.expected_text = self.actual_text 59 67 self.expected_checksum = self.actual_checksum … … 86 94 tests = TestList() 87 95 tests.add('failures/expected/checksum.html', 88 96 actual_checksum='checksum_fail-checksum') 89 97 tests.add('failures/expected/crash.html', crash=True) 90 98 tests.add('failures/expected/exception.html', exception=True) 91 99 tests.add('failures/expected/timeout.html', timeout=True) 92 100 tests.add('failures/expected/hang.html', hang=True) 93 tests.add('failures/expected/missing_text.html', 94 expected_text=None) 101 tests.add('failures/expected/missing_text.html', expected_text=None) 95 102 tests.add('failures/expected/image.html', 96 97 103 actual_image='image_fail-png', 104 expected_image='image-png') 98 105 tests.add('failures/expected/image_checksum.html', 99 actual_checksum='image_checksum_fail-checksum', 100 actual_image='image_checksum_fail-png') 101 tests.add('failures/expected/keyboard.html', 102 keyboard=True) 103 tests.add('failures/expected/missing_check.html', 104 expected_checksum=None) 105 tests.add('failures/expected/missing_image.html', 106 expected_image=None) 107 tests.add('failures/expected/missing_text.html', 108 expected_text=None) 106 actual_checksum='image_checksum_fail-checksum', 107 actual_image='image_checksum_fail-png') 108 tests.add('failures/expected/keyboard.html', keyboard=True) 109 tests.add('failures/expected/missing_check.html', expected_checksum=None) 110 tests.add('failures/expected/missing_image.html', expected_image=None) 111 tests.add('failures/expected/missing_text.html', expected_text=None) 109 112 tests.add('failures/expected/newlines_leading.html', 110 expected_text="\nfoo\n", 111 actual_text="foo\n") 113 expected_text="\nfoo\n", actual_text="foo\n") 112 114 tests.add('failures/expected/newlines_trailing.html', 113 expected_text="foo\n\n", 114 actual_text="foo\n") 115 expected_text="foo\n\n", actual_text="foo\n") 115 116 tests.add('failures/expected/newlines_with_excess_CR.html', 116 expected_text="foo\r\r\r\n", 117 actual_text="foo\n") 118 tests.add('failures/expected/text.html', 119 actual_text='text_fail-png') 117 expected_text="foo\r\r\r\n", actual_text="foo\n") 118 tests.add('failures/expected/text.html', actual_text='text_fail-png') 120 119 tests.add('failures/unexpected/crash.html', crash=True) 121 120 tests.add('failures/unexpected/text-image-checksum.html', 122 123 121 actual_text='text-image-checksum_fail-txt', 122 actual_checksum='text-image-checksum_fail-checksum') 124 123 tests.add('failures/unexpected/timeout.html', timeout=True) 125 124 tests.add('http/tests/passes/text.html') … … 128 127 tests.add('passes/image.html') 129 128 tests.add('passes/platform_image.html') 129 130 130 # Text output files contain "\r\n" on Windows. This may be 131 131 # helpfully filtered to "\r\r\n" by our Python/Cygwin tooling. 132 132 tests.add('passes/text.html', 133 expected_text='\nfoo\n\n', 134 actual_text='\nfoo\r\n\r\r\n') 133 expected_text='\nfoo\n\n', actual_text='\nfoo\r\n\r\r\n') 135 134 tests.add('websocket/tests/passes/text.html') 136 135 return tests … … 211 210 **kwargs) 212 211 212 def _path_to_driver(self): 213 # This routine shouldn't normally be called, but it is called by 214 # the mock_drt Driver. We return something, but make sure it's useless. 215 return 'junk' 216 213 217 def baseline_path(self): 214 218 return self._filesystem.join(self.layout_tests_dir(), 'platform', … … 225 229 diffed = actual_contents != expected_contents 226 230 if diffed and diff_filename: 227 self._filesystem.write_ text_file(diff_filename,231 self._filesystem.write_binary_file(diff_filename, 228 232 "< %s\n---\n> %s\n" % (expected_contents, actual_contents)) 229 233 return diffed … … 291 295 292 296 def cmd_line(self): 293 return [ 'None']297 return [self._port._path_to_driver()] 294 298 295 299 def poll(self):
Note: See TracChangeset
for help on using the changeset viewer.