summaryrefslogtreecommitdiff
path: root/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-06-25 13:35:59 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-06-25 13:35:59 +0200
commit79ad030d505ccf79cf10aa9f8189ca3e2f61f6f4 (patch)
tree0287b1a69d84492c901e8bc820e635e7133809a0 /Tools/Scripts/webkitpy/tool/commands/queries_unittest.py
parent682ab87480e7757346802ce7f54cfdbdfeb2339e (diff)
downloadqtwebkit-79ad030d505ccf79cf10aa9f8189ca3e2f61f6f4.tar.gz
Imported WebKit commit c4b613825abd39ac739a47d7b4410468fcef66dc (http://svn.webkit.org/repository/webkit/trunk@121147)
New snapshot that includes Win32 debug build fix (use SVGAllInOne)
Diffstat (limited to 'Tools/Scripts/webkitpy/tool/commands/queries_unittest.py')
-rw-r--r--Tools/Scripts/webkitpy/tool/commands/queries_unittest.py42
1 files changed, 39 insertions, 3 deletions
diff --git a/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py b/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py
index 877d8c40a..a86154b78 100644
--- a/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py
+++ b/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py
@@ -32,6 +32,7 @@ from webkitpy.common.system.outputcapture import OutputCapture
from webkitpy.common.net.bugzilla import Bugzilla
from webkitpy.common.system.outputcapture import OutputCapture
from webkitpy.thirdparty.mock import Mock
+from webkitpy.layout_tests.port.test import TestPort
from webkitpy.tool.commands.commandtest import CommandsTest
from webkitpy.tool.commands.queries import *
from webkitpy.tool.mocktool import MockTool, MockOptions
@@ -107,10 +108,11 @@ class FailureReasonTest(unittest.TestCase):
class PrintExpectationsTest(unittest.TestCase):
- def run_test(self, tests, expected_stdout, **args):
- options = MockOptions(all=False, csv=False, full=False, platform='test-win-xp',
+ def run_test(self, tests, expected_stdout, platform='test-win-xp', **args):
+ options = MockOptions(all=False, csv=False, full=False, platform=platform,
include_keyword=[], exclude_keyword=[]).update(**args)
tool = MockTool()
+ tool.port_factory.all_port_names = lambda: TestPort.ALL_BASELINE_VARIANTS
command = PrintExpectations()
command.bind_to_tool(tool)
@@ -128,6 +130,21 @@ class PrintExpectationsTest(unittest.TestCase):
'failures/expected/image.html = IMAGE\n'
'failures/expected/text.html = TEXT\n'))
+ def test_multiple(self):
+ self.run_test(['failures/expected/text.html', 'failures/expected/image.html'],
+ ('// For test-win-vista\n'
+ 'failures/expected/image.html = IMAGE\n'
+ 'failures/expected/text.html = TEXT\n'
+ '\n'
+ '// For test-win-win7\n'
+ 'failures/expected/image.html = IMAGE\n'
+ 'failures/expected/text.html = TEXT\n'
+ '\n'
+ '// For test-win-xp\n'
+ 'failures/expected/image.html = IMAGE\n'
+ 'failures/expected/text.html = TEXT\n'),
+ platform='test-win-*')
+
def test_full(self):
self.run_test(['failures/expected/text.html', 'failures/expected/image.html'],
('// For test-win-xp\n'
@@ -160,7 +177,7 @@ class PrintBaselinesTest(unittest.TestCase):
self.tool = MockTool()
self.test_port = self.tool.port_factory.get('test-win-xp')
self.tool.port_factory.get = lambda port_name=None: self.test_port
- self.tool.port_factory.all_port_names = lambda: ['test-win-xp']
+ self.tool.port_factory.all_port_names = lambda: TestPort.ALL_BASELINE_VARIANTS
def tearDown(self):
if self.oc:
@@ -186,6 +203,25 @@ class PrintBaselinesTest(unittest.TestCase):
'passes/text-expected.png\n'
'passes/text-expected.txt\n'))
+ def test_multiple(self):
+ command = PrintBaselines()
+ command.bind_to_tool(self.tool)
+ self.capture_output()
+ command.execute(MockOptions(all=False, include_virtual_tests=False, csv=False, platform='test-win-*'), ['passes/text.html'], self.tool)
+ stdout, _, _ = self.restore_output()
+ self.assertEquals(stdout,
+ ('// For test-win-vista\n'
+ 'passes/text-expected.png\n'
+ 'passes/text-expected.txt\n'
+ '\n'
+ '// For test-win-win7\n'
+ 'passes/text-expected.png\n'
+ 'passes/text-expected.txt\n'
+ '\n'
+ '// For test-win-xp\n'
+ 'passes/text-expected.png\n'
+ 'passes/text-expected.txt\n'))
+
def test_csv(self):
command = PrintBaselines()
command.bind_to_tool(self.tool)