<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[160646] trunk/Tools</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/160646">160646</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2013-12-16 10:01:07 -0800 (Mon, 16 Dec 2013)</dd>
</dl>
<h3>Log Message</h3>
<pre>Remove mock_drt.py: parse_options() - --test-shell and --pixel-tests=<path>
https://bugs.webkit.org/show_bug.cgi?id=125780
Patch by Eva Balazsfalvi <balazsfalvi.eva@stud.u-szeged.hu> on 2013-12-16
Reviewed by Darin Adler.
* Scripts/webkitpy/port/mock_drt.py:
(main):
(parse_options):
(MockDRT.write_test_output):
* Scripts/webkitpy/port/mock_drt_unittest.py:
(MockDRTTest.assertTest):
(MockDRTTest.test_reftest_mismatch):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsScriptswebkitpyportmock_drtpy">trunk/Tools/Scripts/webkitpy/port/mock_drt.py</a></li>
<li><a href="#trunkToolsScriptswebkitpyportmock_drt_unittestpy">trunk/Tools/Scripts/webkitpy/port/mock_drt_unittest.py</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (160645 => 160646)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2013-12-16 17:58:16 UTC (rev 160645)
+++ trunk/Tools/ChangeLog        2013-12-16 18:01:07 UTC (rev 160646)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2013-12-16 Eva Balazsfalvi <balazsfalvi.eva@stud.u-szeged.hu>
+
+ Remove mock_drt.py: parse_options() - --test-shell and --pixel-tests=<path>
+ https://bugs.webkit.org/show_bug.cgi?id=125780
+
+ Reviewed by Darin Adler.
+
+ * Scripts/webkitpy/port/mock_drt.py:
+ (main):
+ (parse_options):
+ (MockDRT.write_test_output):
+ * Scripts/webkitpy/port/mock_drt_unittest.py:
+ (MockDRTTest.assertTest):
+ (MockDRTTest.test_reftest_mismatch):
+
</ins><span class="cx"> 2013-12-16 Gergo Balogh <geryxyz@inf.u-szeged.hu>
</span><span class="cx">
</span><span class="cx"> prepare-Changelog treats CSS keyframes as mismatched parentheses.
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpyportmock_drtpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/port/mock_drt.py (160645 => 160646)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/port/mock_drt.py        2013-12-16 17:58:16 UTC (rev 160645)
+++ trunk/Tools/Scripts/webkitpy/port/mock_drt.py        2013-12-16 18:01:07 UTC (rev 160646)
</span><span class="lines">@@ -132,10 +132,7 @@
</span><span class="cx"> """Run the tests."""
</span><span class="cx">
</span><span class="cx"> options, args = parse_options(argv)
</span><del>- if options.test_shell:
- drt = MockTestShell(options, args, host, stdin, stdout, stderr)
- else:
- drt = MockDRT(options, args, host, stdin, stdout, stderr)
</del><ins>+ drt = MockDRT(options, args, host, stdin, stdout, stderr)
</ins><span class="cx"> return drt.run()
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -151,18 +148,8 @@
</span><span class="cx"> platform_index = argv.index('--platform')
</span><span class="cx"> platform = argv[platform_index + 1]
</span><span class="cx">
</span><del>- pixel_tests = False
- pixel_path = None
- test_shell = '--test-shell' in argv
- if test_shell:
- for arg in argv:
- if arg.startswith('--pixel-tests'):
- pixel_tests = True
- pixel_path = arg[len('--pixel-tests='):]
- else:
- pixel_tests = '--pixel-tests' in argv
- options = optparse.Values({'test_shell': test_shell, 'platform': platform, 'pixel_tests': pixel_tests, 'pixel_path': pixel_path})
- return (options, argv)
</del><ins>+ pixel_tests = '--pixel-tests' in argv
+ return (optparse.Values({'platform': platform, 'pixel_tests': pixel_tests}), argv)
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> class MockDRT(object):
</span><span class="lines">@@ -255,42 +242,6 @@
</span><span class="cx"> self._stderr.write('#EOF\n')
</span><span class="cx"> self._stderr.flush()
</span><span class="cx">
</span><del>-
-class MockTestShell(MockDRT):
- def input_from_line(self, line):
- vals = line.strip().split()
- if len(vals) == 3:
- uri, timeout, checksum = vals
- else:
- uri, timeout = vals
- checksum = None
-
- test_name = self._driver.uri_to_test(uri)
- return DriverInput(test_name, timeout, checksum, self._options.pixel_tests)
-
- def output_for_test(self, test_input, is_reftest):
- # FIXME: This is a hack to make virtual tests work. Need something more general.
- original_test_name = test_input.test_name
- output = super(MockTestShell, self).output_for_test(test_input, is_reftest)
- test_input.test_name = original_test_name
- return output
-
- def write_test_output(self, test_input, output, is_reftest):
- self._stdout.write("#URL:%s\n" % self._driver.test_to_uri(test_input.test_name))
- if self._options.pixel_tests and output.image_hash:
- self._stdout.write("#MD5:%s\n" % output.image_hash)
- if output.image:
- self._host.filesystem.maybe_make_directory(self._host.filesystem.dirname(self._options.pixel_path))
- self._host.filesystem.write_binary_file(self._options.pixel_path, output.image)
- if output.text:
- self._stdout.write(output.text)
-
- if output.text and not output.text.endswith('\n'):
- self._stdout.write('\n')
- self._stdout.write('#EOF\n')
- self._stdout.flush()
-
-
</del><span class="cx"> if __name__ == '__main__':
</span><span class="cx"> # Note that the Mock in MockDRT refers to the fact that it is emulating a
</span><span class="cx"> # real DRT, and as such, it needs access to a real SystemHost, not a MockSystemHost.
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpyportmock_drt_unittestpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/port/mock_drt_unittest.py (160645 => 160646)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/port/mock_drt_unittest.py        2013-12-16 17:58:16 UTC (rev 160645)
+++ trunk/Tools/Scripts/webkitpy/port/mock_drt_unittest.py        2013-12-16 18:01:07 UTC (rev 160646)
</span><span class="lines">@@ -159,7 +159,7 @@
</span><span class="cx"> # We use the StringIO.buflist here instead of getvalue() because
</span><span class="cx"> # the StringIO might be a mix of unicode/ascii and 8-bit strings.
</span><span class="cx"> self.assertEqual(stdout.buflist, drt_output)
</span><del>- self.assertEqual(stderr.getvalue(), '' if options.test_shell else '#EOF\n')
</del><ins>+ self.assertEqual(stderr.getvalue(), '#EOF\n')
</ins><span class="cx">
</span><span class="cx"> def test_main(self):
</span><span class="cx"> host = MockSystemHost()
</span><span class="lines">@@ -208,60 +208,3 @@
</span><span class="cx"> def test_reftest_mismatch(self):
</span><span class="cx"> self.assertTest('passes/mismatch.html', False, expected_checksum='mock-checksum', expected_text='reference text\n')
</span><span class="cx"> self.assertTest('passes/mismatch.html', True, expected_checksum='mock-checksum', expected_text='reference text\n')
</span><del>-
-
-class MockTestShellTest(MockDRTTest):
- def extra_args(self, pixel_tests):
- if pixel_tests:
- return ['--pixel-tests=/tmp/png_result0.png']
- return []
-
- def make_drt(self, options, args, host, stdin, stdout, stderr):
- options.test_shell = True
-
- # We have to set these by hand because --platform test won't trigger
- # the Chromium code paths.
- options.pixel_path = '/tmp/png_result0.png'
- options.pixel_tests = True
-
- return mock_drt.MockTestShell(options, args, host, stdin, stdout, stderr)
-
- def input_line(self, port, test_name, checksum=None):
- url = port.create_driver(0).test_to_uri(test_name)
- if checksum:
- return url + ' 6000 ' + checksum + '\n'
- return url + ' 6000\n'
-
- def expected_output(self, port, test_name, pixel_tests, text_output, expected_checksum):
- url = port.create_driver(0).test_to_uri(test_name)
- output = ['#URL:%s\n' % url]
- if expected_checksum:
- output.append('#MD5:%s\n' % expected_checksum)
- if text_output:
- output.append(text_output)
- if not text_output.endswith('\n'):
- output.append('\n')
- output.append('#EOF\n')
- return output
-
- def test_pixeltest__fails(self):
- host = MockSystemHost()
- url = '#URL:file://'
- url = url + '%s/failures/expected/image_checksum.html' % PortFactory(host).get('test').layout_tests_dir()
- self.assertTest('failures/expected/image_checksum.html', pixel_tests=True,
- expected_checksum='image_checksum',
- drt_output=[url + '\n',
- '#MD5:image_checksum-checksum\n',
- 'image_checksum-txt',
- '\n',
- '#EOF\n'],
- host=host)
- self.assertEqual(host.filesystem.written_files,
- {'/tmp/png_result0.png': 'image_checksum\x8a-pngtEXtchecksum\x00image_checksum-checksum'})
-
- def test_test_shell_parse_options(self):
- options, args = mock_drt.parse_options(['--platform', 'chromium-mac', '--test-shell',
- '--pixel-tests=/tmp/png_result0.png'])
- self.assertTrue(options.test_shell)
- self.assertTrue(options.pixel_tests)
- self.assertEqual(options.pixel_path, '/tmp/png_result0.png')
</del></span></pre>
</div>
</div>
</body>
</html>