OLD | NEW |
| (Empty) |
1 # Copyright (C) 2014 Google Inc. All rights reserved. | |
2 # | |
3 # Redistribution and use in source and binary forms, with or without | |
4 # modification, are permitted provided that the following conditions are | |
5 # met: | |
6 # | |
7 # * Redistributions of source code must retain the above copyright | |
8 # notice, this list of conditions and the following disclaimer. | |
9 # * Redistributions in binary form must reproduce the above | |
10 # copyright notice, this list of conditions and the following disclaimer | |
11 # in the documentation and/or other materials provided with the | |
12 # distribution. | |
13 # * Neither the name of Google Inc. nor the names of its | |
14 # contributors may be used to endorse or promote products derived from | |
15 # this software without specific prior written permission. | |
16 # | |
17 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
18 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
19 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
20 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
21 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
22 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
28 | |
29 import webkitpy.thirdparty.unittest2 as unittest | |
30 | |
31 from webkitpy.common.system import executive_mock | |
32 from webkitpy.common.system.systemhost_mock import MockSystemHost | |
33 from webkitpy.tool.mocktool import MockOptions | |
34 | |
35 from webkitpy.layout_tests.port import browser_test | |
36 from webkitpy.layout_tests.port import port_testcase | |
37 from webkitpy.layout_tests.port import browser_test_driver | |
38 | |
39 | |
40 class BrowserTestLinuxTest(port_testcase.PortTestCase): | |
41 port_name = 'linux' | |
42 port_maker = browser_test.BrowserTestLinuxPort | |
43 | |
44 def test_driver_name_option(self): | |
45 self.assertTrue(self.make_port(options=MockOptions(driver_name='browser_
tests'))._path_to_driver().endswith('browser_tests')) | |
46 | |
47 def test_layout_tests_dir(self): | |
48 self.assertTrue(self.make_port().layout_tests_dir().endswith('chrome/tes
t/data/printing/layout_tests/tests')) | |
49 | |
50 def test_driver_type(self): | |
51 self.assertTrue(isinstance(self.make_port(options=MockOptions(driver_nam
e='browser_tests')).create_driver(1), browser_test_driver.BrowserTestDriver)) | |
52 | |
53 | |
54 class BrowserTestWinTest(port_testcase.PortTestCase): | |
55 port_name = 'win' | |
56 port_maker = browser_test.BrowserTestWinPort | |
57 os_name = 'win' | |
58 os_version = 'xp' | |
59 | |
60 def test_driver_name_option(self): | |
61 self.assertTrue(self.make_port(options=MockOptions(driver_name='browser_
tests'))._path_to_driver().endswith('browser_tests.exe')) | |
62 | |
63 def test_layout_tests_dir(self): | |
64 self.assertTrue(self.make_port().layout_tests_dir().endswith('chrome/tes
t/data/printing/layout_tests/tests')) | |
65 | |
66 def test_driver_type(self): | |
67 self.assertTrue(isinstance(self.make_port(options=MockOptions(driver_nam
e='browser_tests')).create_driver(1), browser_test_driver.BrowserTestDriver)) | |
68 | |
69 | |
70 class BrowserTestMacTest(port_testcase.PortTestCase): | |
71 os_name = 'mac' | |
72 os_version = 'snowleopard' | |
73 port_name = 'mac' | |
74 port_maker = browser_test.BrowserTestMacPort | |
75 | |
76 def test_driver_name_option(self): | |
77 self.assertTrue(self.make_port(options=MockOptions(driver_name='browser_
tests'))._path_to_driver().endswith('browser_tests')) | |
78 | |
79 def test_layout_tests_dir(self): | |
80 self.assertTrue(self.make_port().layout_tests_dir().endswith('chrome/tes
t/data/printing/layout_tests/tests')) | |
81 | |
82 def test_driver_type(self): | |
83 self.assertTrue(isinstance(self.make_port(options=MockOptions(driver_nam
e='browser_tests')).create_driver(1), browser_test_driver.BrowserTestDriver)) | |
84 | |
85 def test_driver_path(self): | |
86 test_port = self.make_port(options=MockOptions(driver_name='browser_test
s')) | |
87 self.assertFalse('.app/Contents/MacOS' in test_port._path_to_driver()) | |
OLD | NEW |