diff options
Diffstat (limited to 'WebKitTools/Scripts/webkitpy/layout_tests/port/google_chrome.py')
-rw-r--r-- | WebKitTools/Scripts/webkitpy/layout_tests/port/google_chrome.py | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/google_chrome.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/google_chrome.py index bffc860..8d94bb5 100644 --- a/WebKitTools/Scripts/webkitpy/layout_tests/port/google_chrome.py +++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/google_chrome.py @@ -24,6 +24,30 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +from __future__ import with_statement + +import codecs +import os + + +def _test_expectations_overrides(port, super): + # The chrome ports use the regular overrides plus anything in the + # official test_expectations as well. Hopefully we don't get collisions. + chromium_overrides = super.test_expectations_overrides(port) + + # FIXME: It used to be that AssertionError would get raised by + # path_from_chromium_base() if we weren't in a Chromium checkout, but + # this changed in r60427. This should probably be changed back. + overrides_path = port.path_from_chromium_base('webkit', 'tools', + 'layout_tests', 'test_expectations_chrome.txt') + if not os.path.exists(overrides_path): + return chromium_overrides + + with codecs.open(overrides_path, "r", "utf-8") as file: + if chromium_overrides: + return chromium_overrides + file.read() + else: + return file.read() def GetGoogleChromePort(**kwargs): """Some tests have slightly different results when compiled as Google @@ -41,6 +65,11 @@ def GetGoogleChromePort(**kwargs): paths.insert(0, self._webkit_baseline_path( 'google-chrome-linux32')) return paths + + def test_expectations_overrides(self): + return _test_expectations_overrides(self, + chromium_linux.ChromiumLinuxPort) + return GoogleChromeLinux32Port(**kwargs) elif port_name == 'google-chrome-linux64': import chromium_linux @@ -52,6 +81,11 @@ def GetGoogleChromePort(**kwargs): paths.insert(0, self._webkit_baseline_path( 'google-chrome-linux64')) return paths + + def test_expectations_overrides(self): + return _test_expectations_overrides(self, + chromium_linux.ChromiumLinuxPort) + return GoogleChromeLinux64Port(**kwargs) elif port_name.startswith('google-chrome-mac'): import chromium_mac @@ -63,6 +97,11 @@ def GetGoogleChromePort(**kwargs): paths.insert(0, self._webkit_baseline_path( 'google-chrome-mac')) return paths + + def test_expectations_overrides(self): + return _test_expectations_overrides(self, + chromium_mac.ChromiumMacPort) + return GoogleChromeMacPort(**kwargs) elif port_name.startswith('google-chrome-win'): import chromium_win @@ -74,5 +113,10 @@ def GetGoogleChromePort(**kwargs): paths.insert(0, self._webkit_baseline_path( 'google-chrome-win')) return paths + + def test_expectations_overrides(self): + return _test_expectations_overrides(self, + chromium_win.ChromiumWinPort) + return GoogleChromeWinPort(**kwargs) raise NotImplementedError('unsupported port: %s' % port_name) |