View | Details | Raw Unified | Return to bug 88824
Collapse All | Expand All

(-)a/Tools/ChangeLog (+25 lines)
Lines 1-3 Link Here
1
2012-06-11  Dirk Pranke  <dpranke@chromium.org>
2
3
        nrwt: remove the 'google-chrome' port code
4
        https://bugs.webkit.org/show_bug.cgi?id=88824
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        NRWT now supports passing additional baseline directories
9
        and expectations files on the command line, so there's no need
10
        to support the concept of a 'google-chrome' port directly.
11
12
        * Scripts/webkitpy/layout_tests/port/base.py:
13
        (Port.path_to_test_expectations_file):
14
        * Scripts/webkitpy/layout_tests/port/builders.py:
15
        * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
16
        (ChromiumMacPort.__init__):
17
        * Scripts/webkitpy/layout_tests/port/chromium_win.py:
18
        (ChromiumWinPort.__init__):
19
        * Scripts/webkitpy/layout_tests/port/factory.py:
20
        (PortFactory):
21
        * Scripts/webkitpy/layout_tests/port/factory_unittest.py:
22
        (FactoryTest.test_win):
23
        * Scripts/webkitpy/layout_tests/port/google_chrome.py: Removed.
24
        * Scripts/webkitpy/layout_tests/port/google_chrome_unittest.py: Removed.
25
1
2012-06-11  David Dorwin  <ddorwin@chromium.org>
26
2012-06-11  David Dorwin  <ddorwin@chromium.org>
2
27
3
        [chromium] Provide access to the WebPlugin created by the helper plugin widget
28
        [chromium] Provide access to the WebPlugin created by the helper plugin widget
(-)a/Tools/Scripts/webkitpy/layout_tests/port/base.py (-1 / +1 lines)
Lines 691-697 class Port(object): Link Here
691
691
692
        # test_expectations are always in mac/ not mac-leopard/ by convention, hence we use port_name instead of name().
692
        # test_expectations are always in mac/ not mac-leopard/ by convention, hence we use port_name instead of name().
693
        port_name = self.port_name
693
        port_name = self.port_name
694
        if port_name.startswith('chromium') or port_name.startswith('google-chrome'):
694
        if port_name.startswith('chromium'):
695
            port_name = 'chromium'
695
            port_name = 'chromium'
696
696
697
        baseline_path = self._webkit_baseline_path(port_name)
697
        baseline_path = self._webkit_baseline_path(port_name)
(-)a/Tools/Scripts/webkitpy/layout_tests/port/builders.py (-2 lines)
Lines 79-86 _fuzzy_matches = { Link Here
79
79
80
80
81
_ports_without_builders = [
81
_ports_without_builders = [
82
    "google-chrome-linux32",
83
    "google-chrome-linux64",
84
    "qt-mac",
82
    "qt-mac",
85
    "qt-win",
83
    "qt-win",
86
    "qt-wk2",
84
    "qt-wk2",
(-)a/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac.py (-4 / +1 lines)
Lines 78-87 class ChromiumMacPort(chromium.ChromiumPort): Link Here
78
78
79
    def __init__(self, host, port_name, **kwargs):
79
    def __init__(self, host, port_name, **kwargs):
80
        chromium.ChromiumPort.__init__(self, host, port_name, **kwargs)
80
        chromium.ChromiumPort.__init__(self, host, port_name, **kwargs)
81
81
        self._version = port_name[port_name.index('chromium-mac-') + len('chromium-mac-'):]
82
        # We're a little generic here because this code is reused by the
83
        # 'google-chrome' port as well as the 'mock-' and 'dryrun-' ports.
84
        self._version = port_name[port_name.index('-mac-') + len('-mac-'):]
85
        assert self._version in self.SUPPORTED_OS_VERSIONS
82
        assert self._version in self.SUPPORTED_OS_VERSIONS
86
83
87
    def baseline_search_path(self):
84
    def baseline_search_path(self):
(-)a/Tools/Scripts/webkitpy/layout_tests/port/chromium_win.py (-4 / +1 lines)
Lines 81-90 class ChromiumWinPort(chromium.ChromiumPort): Link Here
81
81
82
    def __init__(self, host, port_name, **kwargs):
82
    def __init__(self, host, port_name, **kwargs):
83
        chromium.ChromiumPort.__init__(self, host, port_name, **kwargs)
83
        chromium.ChromiumPort.__init__(self, host, port_name, **kwargs)
84
84
        self._version = port_name[port_name.index('chromium-win-') + len('chromium-win-'):]
85
        # We're a little generic here because this code is reused by the
86
        # 'google-chrome' port as well as the 'mock-' and 'dryrun-' ports.
87
        self._version = port_name[port_name.index('-win-') + len('-win-'):]
88
        assert self._version in self.SUPPORTED_VERSIONS, "%s is not in %s" % (self._version, self.SUPPORTED_VERSIONS)
85
        assert self._version in self.SUPPORTED_VERSIONS, "%s is not in %s" % (self._version, self.SUPPORTED_VERSIONS)
89
86
90
    def setup_environ_for_server(self, server_name=None):
87
    def setup_environ_for_server(self, server_name=None):
(-)a/Tools/Scripts/webkitpy/layout_tests/port/factory.py (-4 lines)
Lines 69-78 class PortFactory(object): Link Here
69
        'chromium_mac.ChromiumMacPort',
69
        'chromium_mac.ChromiumMacPort',
70
        'chromium_win.ChromiumWinPort',
70
        'chromium_win.ChromiumWinPort',
71
        'efl.EflPort',
71
        'efl.EflPort',
72
        'google_chrome.GoogleChromeLinux32Port',
73
        'google_chrome.GoogleChromeLinux64Port',
74
        'google_chrome.GoogleChromeMacPort',
75
        'google_chrome.GoogleChromeWinPort',
76
        'gtk.GtkPort',
72
        'gtk.GtkPort',
77
        'mac.MacPort',
73
        'mac.MacPort',
78
        'mock_drt.MockDRTPort',
74
        'mock_drt.MockDRTPort',
(-)a/Tools/Scripts/webkitpy/layout_tests/port/factory_unittest.py (-21 lines)
Lines 35-41 from webkitpy.layout_tests.port import chromium_linux Link Here
35
from webkitpy.layout_tests.port import chromium_mac
35
from webkitpy.layout_tests.port import chromium_mac
36
from webkitpy.layout_tests.port import chromium_win
36
from webkitpy.layout_tests.port import chromium_win
37
from webkitpy.layout_tests.port import factory
37
from webkitpy.layout_tests.port import factory
38
from webkitpy.layout_tests.port import google_chrome
39
from webkitpy.layout_tests.port import gtk
38
from webkitpy.layout_tests.port import gtk
40
from webkitpy.layout_tests.port import mac
39
from webkitpy.layout_tests.port import mac
41
from webkitpy.layout_tests.port import qt
40
from webkitpy.layout_tests.port import qt
Lines 69-94 class FactoryTest(unittest.TestCase): Link Here
69
        self.assert_port(port_name=None, os_name='win', os_version='xp', cls=win.WinPort)
68
        self.assert_port(port_name=None, os_name='win', os_version='xp', cls=win.WinPort)
70
        self.assert_port(port_name=None, os_name='win', os_version='xp', options=self.webkit_options, cls=win.WinPort)
69
        self.assert_port(port_name=None, os_name='win', os_version='xp', options=self.webkit_options, cls=win.WinPort)
71
70
72
    def test_google_chrome(self):
73
        self.assert_port(port_name='google-chrome-linux32',
74
                         cls=google_chrome.GoogleChromeLinux32Port)
75
        self.assert_port(port_name='google-chrome-linux64', os_name='linux', os_version='lucid',
76
                         cls=google_chrome.GoogleChromeLinux64Port)
77
        self.assert_port(port_name='google-chrome-linux64',
78
                         cls=google_chrome.GoogleChromeLinux64Port)
79
        self.assert_port(port_name='google-chrome-win-xp',
80
                         cls=google_chrome.GoogleChromeWinPort)
81
        self.assert_port(port_name='google-chrome-win', os_name='win', os_version='xp',
82
                         cls=google_chrome.GoogleChromeWinPort)
83
        self.assert_port(port_name='google-chrome-win-xp', os_name='win', os_version='xp',
84
                         cls=google_chrome.GoogleChromeWinPort)
85
        self.assert_port(port_name='google-chrome-mac', os_name='mac', os_version='leopard',
86
                         cls=google_chrome.GoogleChromeMacPort)
87
        self.assert_port(port_name='google-chrome-mac-leopard', os_name='mac', os_version='leopard',
88
                         cls=google_chrome.GoogleChromeMacPort)
89
        self.assert_port(port_name='google-chrome-mac-leopard',
90
                         cls=google_chrome.GoogleChromeMacPort)
91
92
    def test_gtk(self):
71
    def test_gtk(self):
93
        self.assert_port(port_name='gtk', cls=gtk.GtkPort)
72
        self.assert_port(port_name='gtk', cls=gtk.GtkPort)
94
73
(-)a/Tools/Scripts/webkitpy/layout_tests/port/google_chrome.py (-120 lines)
Lines 1-120 Link Here
1
#!/usr/bin/env python
2
# Copyright (C) 2010 Google Inc. All rights reserved.
3
#
4
# Redistribution and use in source and binary forms, with or without
5
# modification, are permitted provided that the following conditions are
6
# met:
7
#
8
#     * Redistributions of source code must retain the above copyright
9
# notice, this list of conditions and the following disclaimer.
10
#     * Redistributions in binary form must reproduce the above
11
# copyright notice, this list of conditions and the following disclaimer
12
# in the documentation and/or other materials provided with the
13
# distribution.
14
15
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
27
import chromium_linux
28
import chromium_mac
29
import chromium_win
30
31
32
def _test_expectations_overrides(port, super):
33
    # The chrome ports use the regular overrides plus anything in the
34
    # official test_expectations as well. Hopefully we don't get collisions.
35
    chromium_overrides = super.test_expectations_overrides(port)
36
37
    # FIXME: It used to be that AssertionError would get raised by
38
    # path_from_chromium_base() if we weren't in a Chromium checkout, but
39
    # this changed in r60427. This should probably be changed back.
40
    overrides_path = port.path_from_chromium_base('webkit', 'tools',
41
            'layout_tests', 'test_expectations_chrome.txt')
42
    if not port._filesystem.exists(overrides_path):
43
        return chromium_overrides
44
45
    chromium_overrides = chromium_overrides or ''
46
    return chromium_overrides + port._filesystem.read_text_file(overrides_path)
47
48
49
class GoogleChromeLinux32Port(chromium_linux.ChromiumLinuxPort):
50
    port_name = 'google-chrome-linux32'
51
52
    # FIXME: Make google-chrome-XXX work as a port name.
53
    @classmethod
54
    def determine_full_port_name(cls, host, options, port_name):
55
        return 'chromium-linux-x86'
56
57
    def baseline_search_path(self):
58
        paths = chromium_linux.ChromiumLinuxPort.baseline_search_path(self)
59
        paths.insert(0, self._webkit_baseline_path('google-chrome-linux32'))
60
        return paths
61
62
    def test_expectations_overrides(self):
63
        return _test_expectations_overrides(self, chromium_linux.ChromiumLinuxPort)
64
65
    def architecture(self):
66
        return 'x86'
67
68
69
class GoogleChromeLinux64Port(chromium_linux.ChromiumLinuxPort):
70
    port_name = 'google-chrome-linux64'
71
72
    # FIXME: Make google-chrome-XXX work as a port name.
73
    @classmethod
74
    def determine_full_port_name(cls, host, options, port_name):
75
        return 'chromium-linux-x86_64'
76
77
    def baseline_search_path(self):
78
        paths = chromium_linux.ChromiumLinuxPort.baseline_search_path(self)
79
        paths.insert(0, self._webkit_baseline_path('google-chrome-linux64'))
80
        return paths
81
82
    def test_expectations_overrides(self):
83
        return _test_expectations_overrides(self, chromium_linux.ChromiumLinuxPort)
84
85
    def architecture(self):
86
        return 'x86_64'
87
88
89
class GoogleChromeMacPort(chromium_mac.ChromiumMacPort):
90
    port_name = 'google-chrome-mac'
91
92
    # FIXME: Make google-chrome-XXX work as a port name.
93
    @classmethod
94
    def determine_full_port_name(cls, host, options, port_name):
95
        return 'chromium-mac-snowleopard'
96
97
    def baseline_search_path(self):
98
        paths = chromium_mac.ChromiumMacPort.baseline_search_path(self)
99
        paths.insert(0, self._webkit_baseline_path('google-chrome-mac'))
100
        return paths
101
102
    def test_expectations_overrides(self):
103
        return _test_expectations_overrides(self, chromium_mac.ChromiumMacPort)
104
105
106
class GoogleChromeWinPort(chromium_win.ChromiumWinPort):
107
    port_name = 'google-chrome-win'
108
109
    # FIXME: Make google-chrome-XXX work as a port name.
110
    @classmethod
111
    def determine_full_port_name(cls, host, options, port_name):
112
        return 'chromium-win-win7'
113
114
    def baseline_search_path(self):
115
        paths = chromium_win.ChromiumWinPort.baseline_search_path(self)
116
        paths.insert(0, self._webkit_baseline_path('google-chrome-win'))
117
        return paths
118
119
    def test_expectations_overrides(self):
120
        return _test_expectations_overrides(self, chromium_win.ChromiumWinPort)
(-)a/Tools/Scripts/webkitpy/layout_tests/port/google_chrome_unittest.py (-77 lines)
Lines 1-77 Link Here
1
#!/usr/bin/env python
2
# Copyright (C) 2010 Google Inc. All rights reserved.
3
#
4
# Redistribution and use in source and binary forms, with or without
5
# modification, are permitted provided that the following conditions are
6
# met:
7
#
8
#     * Redistributions of source code must retain the above copyright
9
# notice, this list of conditions and the following disclaimer.
10
#     * Redistributions in binary form must reproduce the above
11
# copyright notice, this list of conditions and the following disclaimer
12
# in the documentation and/or other materials provided with the
13
# distribution.
14
15
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
27
import unittest
28
29
from webkitpy.common.system.systemhost_mock import MockSystemHost
30
from webkitpy.layout_tests.port.factory import PortFactory
31
32
33
class TestGoogleChromePort(unittest.TestCase):
34
    def _verify_baseline_search_path_startswith(self, port_name, expected_platform_dirs):
35
        port = PortFactory(MockSystemHost()).get(port_name=port_name)
36
        actual_platform_dirs = [port._filesystem.basename(path) for path in port.baseline_search_path()]
37
        self.assertEqual(expected_platform_dirs, actual_platform_dirs[0:len(expected_platform_dirs)])
38
39
    def _verify_expectations_overrides(self, port_name):
40
        host = MockSystemHost()
41
        chromium_port = PortFactory(host).get("chromium-mac-leopard")
42
        chromium_base = chromium_port.path_from_chromium_base()
43
        port = PortFactory(host).get(port_name=port_name, options=None)
44
45
        expected_chromium_overrides = '// chromium overrides\n'
46
        expected_chrome_overrides = '// chrome overrides\n'
47
        chromium_path = host.filesystem.join(chromium_base, 'webkit', 'tools', 'layout_tests', 'test_expectations.txt')
48
        chrome_path = host.filesystem.join(chromium_base, 'webkit', 'tools', 'layout_tests', 'test_expectations_chrome.txt')
49
50
        host.filesystem.files[chromium_path] = expected_chromium_overrides
51
        host.filesystem.files[chrome_path] = None
52
        actual_chrome_overrides = port.test_expectations_overrides()
53
        self.assertEqual(expected_chromium_overrides, actual_chrome_overrides)
54
55
        host.filesystem.files[chrome_path] = expected_chrome_overrides
56
        actual_chrome_overrides = port.test_expectations_overrides()
57
        self.assertEqual(actual_chrome_overrides, expected_chromium_overrides + expected_chrome_overrides)
58
59
    def test_get_google_chrome_port(self):
60
        self._verify_baseline_search_path_startswith('google-chrome-linux32', ['google-chrome-linux32', 'chromium-linux-x86'])
61
        self._verify_baseline_search_path_startswith('google-chrome-linux64', ['google-chrome-linux64', 'chromium-linux'])
62
        self._verify_baseline_search_path_startswith('google-chrome-mac', ['google-chrome-mac', 'chromium-mac-snowleopard'])
63
        self._verify_baseline_search_path_startswith('google-chrome-win', ['google-chrome-win', 'chromium-win'])
64
65
        self._verify_expectations_overrides('google-chrome-mac')
66
        self._verify_expectations_overrides('google-chrome-win')
67
        self._verify_expectations_overrides('google-chrome-linux32')
68
        self._verify_expectations_overrides('google-chrome-linux64')
69
70
    def test_path_to_expectations(self):
71
        port_factory = PortFactory(MockSystemHost())
72
        for port_name in ('google-chrome-linux32', 'google-chrome-linux64', 'google-chrome-mac', 'google-chrome-win'):
73
            self.assertTrue(port_factory.get(port_name).path_to_test_expectations_file().endswith('platform/chromium/TestExpectations'))
74
75
76
if __name__ == '__main__':
77
    unittest.main()

Return to bug 88824