[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-1049-g2e11a8e

eric at webkit.org eric at webkit.org
Fri Jan 21 15:04:31 UTC 2011


The following commit has been merged in the debian/experimental branch:
commit 43d636fed1899a45dd8ce62feb6e5d6066e299b3
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jan 6 21:30:15 2011 +0000

    2011-01-06  Eric Seidel  <eric at webkit.org>
    
            Reviewed by Mihai Parparita.
    
            commit-queue mentions "Text diff mismatch" 4 times instead of once per failure
            https://bugs.webkit.org/show_bug.cgi?id=52002
    
            See an example of this here:
            https://bugs.webkit.org/show_bug.cgi?id=51314#c2
    
            It's due to the fact that we pass around TestFailure() instance
            objects and yet expect them to all compare to be the same.
    
            This is bad.  We should either have shared instances of these values
            or we should just pass around the class names.  There are already hacks
            in place to make TestFailure objects pass equality tests, I just added
            a __hash__ implementation so they can be used in sets as expected.
    
            * Scripts/webkitpy/common/net/layouttestresults_unittest.py:
            * Scripts/webkitpy/layout_tests/layout_package/test_failures.py:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75191 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/Tools/ChangeLog b/Tools/ChangeLog
index bced143..7577432 100644
--- a/Tools/ChangeLog
+++ b/Tools/ChangeLog
@@ -1,3 +1,24 @@
+2011-01-06  Eric Seidel  <eric at webkit.org>
+
+        Reviewed by Mihai Parparita.
+
+        commit-queue mentions "Text diff mismatch" 4 times instead of once per failure
+        https://bugs.webkit.org/show_bug.cgi?id=52002
+
+        See an example of this here:
+        https://bugs.webkit.org/show_bug.cgi?id=51314#c2
+
+        It's due to the fact that we pass around TestFailure() instance
+        objects and yet expect them to all compare to be the same.
+
+        This is bad.  We should either have shared instances of these values
+        or we should just pass around the class names.  There are already hacks
+        in place to make TestFailure objects pass equality tests, I just added
+        a __hash__ implementation so they can be used in sets as expected.
+
+        * Scripts/webkitpy/common/net/layouttestresults_unittest.py:
+        * Scripts/webkitpy/layout_tests/layout_package/test_failures.py:
+
 2011-01-06  Evan Martin  <evan at chromium.org>
 
         Reviewed by Tony Chang.
diff --git a/Tools/Scripts/webkitpy/common/net/layouttestresults_unittest.py b/Tools/Scripts/webkitpy/common/net/layouttestresults_unittest.py
index d274dbf..01b91b8 100644
--- a/Tools/Scripts/webkitpy/common/net/layouttestresults_unittest.py
+++ b/Tools/Scripts/webkitpy/common/net/layouttestresults_unittest.py
@@ -76,7 +76,7 @@ class LayoutTestResultsTest(unittest.TestCase):
         self.assertEqual(len(results.failing_tests()), 0)
 
     def test_failures_from_fail_row(self):
-        row = BeautifulSoup("<tr><td><a>test.hml</a><a>25%</a></td></tr>")
+        row = BeautifulSoup("<tr><td><a>test.hml</a></td><td><a>expected image</a></td><td><a>25%</a></td></tr>")
         test_name = unicode(row.find("a").string)
         # Even if the caller has already found the test name, findAll inside _failures_from_fail_row will see it again.
         failures = OutputCapture().assert_outputs(self, LayoutTestResults._failures_from_fail_row, [row])
diff --git a/Tools/Scripts/webkitpy/layout_tests/layout_package/test_failures.py b/Tools/Scripts/webkitpy/layout_tests/layout_package/test_failures.py
index d537d50..5dd0114 100644
--- a/Tools/Scripts/webkitpy/layout_tests/layout_package/test_failures.py
+++ b/Tools/Scripts/webkitpy/layout_tests/layout_package/test_failures.py
@@ -91,6 +91,9 @@ class TestFailure(object):
     def __ne__(self, other):
         return self.__class__.__name__ != other.__class__.__name__
 
+    def __hash__(self):
+        return hash(self.__class__.__name__)
+
     def dumps(self):
         """Returns the string/JSON representation of a TestFailure."""
         return cPickle.dumps(self)
@@ -128,9 +131,6 @@ class FailureWithType(TestFailure):
     use the standard OutputLinks.
     """
 
-    def __init__(self):
-        TestFailure.__init__(self)
-
     # Filename suffixes used by ResultHtmlOutput.
     OUT_FILENAMES = ()
 
diff --git a/Tools/Scripts/webkitpy/layout_tests/layout_package/test_failures_unittest.py b/Tools/Scripts/webkitpy/layout_tests/layout_package/test_failures_unittest.py
index 3e3528d..b2698d1 100644
--- a/Tools/Scripts/webkitpy/layout_tests/layout_package/test_failures_unittest.py
+++ b/Tools/Scripts/webkitpy/layout_tests/layout_package/test_failures_unittest.py
@@ -80,5 +80,15 @@ class Test(unittest.TestCase):
         for c in ALL_FAILURE_CLASSES:
             self.assert_loads(c)
 
+    def test_equals(self):
+        self.assertEqual(FailureCrash(), FailureCrash())
+        self.assertNotEqual(FailureCrash(), FailureTimeout())
+        crash_set = set([FailureCrash(), FailureCrash()])
+        self.assertEqual(len(crash_set), 1)
+        # The hash happens to be the name of the class, but sets still work:
+        crash_set = set([FailureCrash(), "FailureCrash"])
+        self.assertEqual(len(crash_set), 2)
+
+
 if __name__ == '__main__':
     unittest.main()

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list