diff options
-rw-r--r-- | media/tools/layout_tests/README | 4 | ||||
-rw-r--r-- | media/tools/layout_tests/test_expectations.py | 9 | ||||
-rw-r--r-- | media/tools/layout_tests/test_expectations_history.py | 34 | ||||
-rwxr-xr-x | media/tools/layout_tests/test_expectations_history_unittest.py | 25 | ||||
-rw-r--r-- | webkit/tools/layout_tests/test_expectations.txt | 15 |
5 files changed, 44 insertions, 43 deletions
diff --git a/media/tools/layout_tests/README b/media/tools/layout_tests/README index c13785c..37bc77d 100644 --- a/media/tools/layout_tests/README +++ b/media/tools/layout_tests/README @@ -59,8 +59,8 @@ getting layout test names from Webkit SVN as well as test description. ** TestExpectations: A class to model the content of test expectation file for analysis. -The raw test expectation file can be found in -|DEFAULT_TEST_EXPECTATION_LOCATION|. It is necessary to parse this +The location of the test expectations file can be found in +|TEST_EXPECTATIONS_LOCATIONS|. It is necessary to parse this file and store meaningful information for the analysis (joining with existing layout tests using a test name). Instance variable |all_test_expectation_info| is used. A test name such as diff --git a/media/tools/layout_tests/test_expectations.py b/media/tools/layout_tests/test_expectations.py index d8f5948..410c724 100644 --- a/media/tools/layout_tests/test_expectations.py +++ b/media/tools/layout_tests/test_expectations.py @@ -8,11 +8,10 @@ import urllib2 from webkitpy.layout_tests.models.test_expectations import * -# Default Webkit SVN location for chromium test expectation file. +# Default location for chromium test expectation file. # TODO(imasaki): support multiple test expectations files. -DEFAULT_TEST_EXPECTATION_LOCATION = ( - 'http://svn.webkit.org/repository/webkit/trunk/' - 'LayoutTests/platform/chromium/TestExpectations') +DEFAULT_TEST_EXPECTATIONS_LOCATION = ( + 'http://src.chromium.org/blink/trunk/LayoutTests/TestExpectations') # The following is from test expectation syntax. The detail can be found in # http://www.chromium.org/developers/testing/webkit-layout-tests#TOC-Test-Expectations @@ -51,7 +50,7 @@ class TestExpectations(object): 'Platforms': ['SNOWLEOPARD', 'ANDROID'], 'TIMEOUT': True, 'PASS': True}]} """ - def __init__(self, url=DEFAULT_TEST_EXPECTATION_LOCATION): + def __init__(self, url=DEFAULT_TEST_EXPECTATIONS_LOCATION): """Read the test expectation file from the specified URL and parse it. Args: diff --git a/media/tools/layout_tests/test_expectations_history.py b/media/tools/layout_tests/test_expectations_history.py index 6dbd9e9..8030632 100644 --- a/media/tools/layout_tests/test_expectations_history.py +++ b/media/tools/layout_tests/test_expectations_history.py @@ -12,14 +12,15 @@ import sys import time import pysvn -# Default Webkit SVN location for chromium test expectation file. +TEST_EXPECTATIONS_ROOT = 'http://src.chromium.org/blink/trunk/' +# A map from earliest revision to path. # TODO(imasaki): support multiple test expectation files. -DEFAULT_TEST_EXPECTATION_LOCATION = ( - 'http://svn.webkit.org/repository/webkit/trunk/' - 'LayoutTests/platform/chromium/TestExpectations') -LEGACY_TEST_EXPECTATION_LOCATION = ( - 'http://svn.webkit.org/repository/webkit/trunk/' - 'LayoutTests/platform/chromium/test_expectations.txt') +TEST_EXPECTATIONS_LOCATIONS = { + 148348: 'LayoutTests/TestExpectations', + 119317: 'LayoutTests/platform/chromium/TestExpectations', + 0: 'LayoutTests/platform/chromium/test_expectations.txt'} +TEST_EXPECTATIONS_DEFAULT_PATH = ( + TEST_EXPECTATIONS_ROOT + TEST_EXPECTATIONS_LOCATIONS[148348]) class TestExpectationsHistory(object): """A class to represent history of the test expectation file. @@ -31,8 +32,14 @@ class TestExpectationsHistory(object): """ @staticmethod + def GetTestExpectationsPathForRevision(revision): + for i in sorted(TEST_EXPECTATIONS_LOCATIONS.keys(), reverse=True): + if revision >= i: + return TEST_EXPECTATIONS_ROOT + TEST_EXPECTATIONS_LOCATIONS[i] + + @staticmethod def GetDiffBetweenTimes(start, end, testname_list, - te_location=DEFAULT_TEST_EXPECTATION_LOCATION): + te_location=TEST_EXPECTATIONS_DEFAULT_PATH): """Get difference between time period for the specified test names. Given the time period, this method first gets the revision number. Then, @@ -87,13 +94,10 @@ class TestExpectationsHistory(object): new_rev = logs[i + 1].revision.number # Parsing the actual diff. - # test_expectations.txt was renamed to TestExpectations at r119317. - new_path = DEFAULT_TEST_EXPECTATION_LOCATION - if new_rev < 119317: - new_path = LEGACY_TEST_EXPECTATION_LOCATION - old_path = DEFAULT_TEST_EXPECTATION_LOCATION - if old_rev < 119317: - old_path = LEGACY_TEST_EXPECTATION_LOCATION + new_path = TestExpectationsHistory.GetTestExpectationsPathForRevision( + new_rev); + old_path = TestExpectationsHistory.GetTestExpectationsPathForRevision( + old_rev); text = client.diff('/tmp', url_or_path=old_path, diff --git a/media/tools/layout_tests/test_expectations_history_unittest.py b/media/tools/layout_tests/test_expectations_history_unittest.py index 4602a78..dafc980 100755 --- a/media/tools/layout_tests/test_expectations_history_unittest.py +++ b/media/tools/layout_tests/test_expectations_history_unittest.py @@ -5,7 +5,7 @@ from datetime import datetime -import time +import calendar import unittest @@ -33,11 +33,14 @@ class TestTestExpectationsHistory(unittest.TestCase): return True return False + # These tests use the following commit. + # commit 235788e3a4fc71342a5c9fefe67ce9537706ce35 + # Author: rniwa@webkit.org + # Date: Sat Aug 20 06:19:11 2011 +0000 + def testGetDiffBetweenTimes(self): - t = (2011, 8, 20, 0, 0, 0, 0, 0, 0) - ctime = time.mktime(t) - t = (2011, 8, 19, 0, 0, 0, 0, 0, 0) - ptime = time.mktime(t) + ptime = calendar.timegm((2011, 8, 20, 0, 0, 0, 0, 0, 0)) + ctime = calendar.timegm((2011, 8, 21, 0, 0, 0, 0, 0, 0)) testname = 'fast/css/getComputedStyle/computed-style-without-renderer.html' testname_list = [testname] result_list = TestExpectationsHistory.GetDiffBetweenTimes( @@ -45,10 +48,8 @@ class TestTestExpectationsHistory(unittest.TestCase): self.assertTrue(self.AssertTestName(result_list, testname)) def testGetDiffBetweenTimesOnly1Diff(self): - ptime = datetime.strptime('2011-08-19-23', '%Y-%m-%d-%H') - ptime = time.mktime(ptime.timetuple()) - ctime = datetime.strptime('2011-08-20-00', '%Y-%m-%d-%H') - ctime = time.mktime(ctime.timetuple()) + ptime = calendar.timegm((2011, 8, 20, 6, 0, 0, 0, 0, 0)) + ctime = calendar.timegm((2011, 8, 20, 7, 0, 0, 0, 0, 0)) testname = 'fast/css/getComputedStyle/computed-style-without-renderer.html' testname_list = [testname] result_list = TestExpectationsHistory.GetDiffBetweenTimes( @@ -56,10 +57,8 @@ class TestTestExpectationsHistory(unittest.TestCase): self.assertTrue(self.AssertTestName(result_list, testname)) def testGetDiffBetweenTimesOnly1DiffWithGobackSeveralDays(self): - ptime = datetime.strptime('2011-09-11-18', '%Y-%m-%d-%H') - ptime = time.mktime(ptime.timetuple()) - ctime = datetime.strptime('2011-09-11-19', '%Y-%m-%d-%H') - ctime = time.mktime(ctime.timetuple()) + ptime = calendar.timegm((2011, 9, 12, 1, 0, 0, 0, 0, 0)) + ctime = calendar.timegm((2011, 9, 12, 2, 0, 0, 0, 0, 0)) testname = 'media/video-zoom-controls.html' testname_list = [testname] result_list = TestExpectationsHistory.GetDiffBetweenTimes( diff --git a/webkit/tools/layout_tests/test_expectations.txt b/webkit/tools/layout_tests/test_expectations.txt index dc5ee63..4229c65 100644 --- a/webkit/tools/layout_tests/test_expectations.txt +++ b/webkit/tools/layout_tests/test_expectations.txt @@ -1,7 +1,7 @@ # This file should almost always be empty. Normally Chromium test expectations # are only put here temporarily, and moved to -# src/third_party/WebKit/LayoutTests/platform/chromium/TestExpectations -# where they will remain until they are rebaselined. +# src/third_party/WebKit/LayoutTests/TestExpectations where they will remain +# until they are rebaselined. # # # If you are landing a Chromium CL that would break webkit layout tests, @@ -13,10 +13,10 @@ # # 2. BEFORE landing your Chromium CL, land a WebKit CL adding those same # expected failures to -# src/third_party/WebKit/LayoutTests/platform/chromium/TestExpectations . -# If you are unable to do this yourself, please get a WebKit Committer to do -# it for you, or at least coordinate with a current WebKit Gardener to make -# sure she is aware of the pending breakages. +# src/third_party/WebKit/LayoutTests/TestExpectations . If you are unable to do +# this yourself, please get a WebKit Committer to do it for you, or at least +# coordinate with a current WebKit Gardener to make sure she is aware of the +# pending breakages. # # 3. AFTER you have landed the WebKit test_expectations CL, you can land your # Chromium CL. Be sure to include your expected failures in this file, so @@ -27,7 +27,6 @@ # Every time Chromium's "WebKit Gardener" rolls the WebKit DEPS within # Chromium, he will delete ALL expectations within this file. (By then, they # will be redundant, because you already landed those same expectations in -# src/third_party/WebKit/LayoutTests/platform/chromium/TestExpectations . -# Right?) +# src/third_party/WebKit/LayoutTests/TestExpectations . Right?) # # EVERYTHING BELOW THIS LINE WILL BE DELETED AT EVERY WEBKIT DEPS ROLL |