[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
dpranke at chromium.org
dpranke at chromium.org
Wed Dec 22 14:07:10 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 6bbb93a0dc2115e3224aed702e903e450c297d84
Author: dpranke at chromium.org <dpranke at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Oct 4 22:11:10 2010 +0000
2010-10-04 Dirk Pranke <dpranke at chromium.org>
Reviewed by Tony Chang.
Add a way for us to have test expectations that are specific to the
official builds of Google Chrome (as opposed to Chromium). This change
looks for an additional "test_expectations_chrome.txt" file in
Chromium's repository (webkit/tools/layout_tests), and uses the
concatenation of that file and the regular test_expectations.txt
file for test overrides.
https://bugs.webkit.org/show_bug.cgi?id=46854
* Scripts/webkitpy/layout_tests/port/google_chrome.py:
* Scripts/webkitpy/layout_tests/port/google_chrome_unittest.py:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69040 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 6193b54..ca8e43b 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,19 @@
+2010-10-04 Dirk Pranke <dpranke at chromium.org>
+
+ Reviewed by Tony Chang.
+
+ Add a way for us to have test expectations that are specific to the
+ official builds of Google Chrome (as opposed to Chromium). This change
+ looks for an additional "test_expectations_chrome.txt" file in
+ Chromium's repository (webkit/tools/layout_tests), and uses the
+ concatenation of that file and the regular test_expectations.txt
+ file for test overrides.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46854
+
+ * Scripts/webkitpy/layout_tests/port/google_chrome.py:
+ * Scripts/webkitpy/layout_tests/port/google_chrome_unittest.py:
+
2010-10-04 Simon Fraser <simon.fraser at apple.com>
Color tests in the list based on existing pass/fail result.
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/google_chrome.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/google_chrome.py
index bffc860..4f4c88f 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/google_chrome.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/google_chrome.py
@@ -24,6 +24,28 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+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 +63,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 +79,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 +95,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 +111,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)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/google_chrome_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/google_chrome_unittest.py
index 85e9338..fb92428 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/google_chrome_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/google_chrome_unittest.py
@@ -24,8 +24,12 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+import codecs
import os
import unittest
+
+import base_unittest
+import factory
import google_chrome
@@ -35,6 +39,7 @@ class GetGoogleChromePortTest(unittest.TestCase):
'google-chrome-mac', 'google-chrome-win')
for port in test_ports:
self._verify_baseline_path(port, port)
+ self._verify_expectations_overrides(port)
self._verify_baseline_path('google-chrome-mac', 'google-chrome-mac-leopard')
self._verify_baseline_path('google-chrome-win', 'google-chrome-win-xp')
@@ -45,3 +50,50 @@ class GetGoogleChromePortTest(unittest.TestCase):
options=None)
path = port.baseline_search_path()[0]
self.assertEqual(expected_path, os.path.split(path)[1])
+
+ def _verify_expectations_overrides(self, port_name):
+ # FIXME: make this more robust when we have the Tree() abstraction.
+ # we should be able to test for the files existing or not, and
+ # be able to control the contents better.
+
+ chromium_port = factory.get("chromium-mac")
+ chromium_overrides = chromium_port.test_expectations_overrides()
+ port = google_chrome.GetGoogleChromePort(port_name=port_name,
+ options=None)
+
+ orig_exists = os.path.exists
+ orig_open = codecs.open
+ expected_string = "// hello, world\n"
+
+ def mock_exists_chrome_not_found(path):
+ if 'test_expectations_chrome.txt' in path:
+ return False
+ return orig_exists(path)
+
+ def mock_exists_chrome_found(path):
+ if 'test_expectations_chrome.txt' in path:
+ return True
+ return orig_exists(path)
+
+ def mock_open(path, mode, encoding):
+ if 'test_expectations_chrome.txt' in path:
+ return base_unittest.NewStringIO(expected_string)
+ return orig_open(path, mode, encoding)
+
+ try:
+ os.path.exists = mock_exists_chrome_not_found
+ chrome_overrides = port.test_expectations_overrides()
+ self.assertEqual(chromium_overrides, chrome_overrides)
+
+ os.path.exists = mock_exists_chrome_found
+ codecs.open = mock_open
+ chrome_overrides = port.test_expectations_overrides()
+ self.assertEqual(chrome_overrides,
+ chromium_overrides + expected_string)
+ finally:
+ os.path.exists = orig_exists
+ codecs.open = orig_open
+
+
+if __name__ == '__main__':
+ unittest.main()
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list