Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1301)

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_expectations_updater.py

Issue 2755033002: Refactor WPTExpectationsUpdater.get_tests_to_rebaseline. (Closed)
Patch Set: Rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_expectations_updater.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_expectations_updater.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_expectations_updater.py
index ec019c1245ab0d172cdcce2ede4fd83f83fe46b0..a250f80465c9d1365f969ca66a448432055cdf03 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_expectations_updater.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_expectations_updater.py
@@ -419,20 +419,27 @@ class WPTExpectationsUpdater(object):
the test results dictionary. The tests to be rebaselined should
include testharness.js tests that failed due to a baseline mismatch.
"""
- test_results = copy.deepcopy(test_results)
+ new_test_results = copy.deepcopy(test_results)
tests_to_rebaseline = set()
for test_path in test_results:
- if not (self.is_js_test(test_path) and test_results.get(test_path)):
- continue
- for platform in test_results[test_path].keys():
- if test_results[test_path][platform]['actual'] not in ['CRASH', 'TIMEOUT']:
- del test_results[test_path][platform]
+ for platform, result in test_results[test_path].iteritems():
+ if self.can_rebaseline(test_path, result):
+ del new_test_results[test_path][platform]
tests_to_rebaseline.add(test_path)
- return sorted(tests_to_rebaseline), test_results
+ return sorted(tests_to_rebaseline), new_test_results
+
+ def can_rebaseline(self, test_path, result):
+ return (self.is_js_test(test_path) and
+ result['actual'] not in ('CRASH', 'TIMEOUT'))
def is_js_test(self, test_path):
"""Checks whether a given file is a testharness.js test.
+ TODO(qyearsley): This may not behave how we want it to for virtual tests.
+ TODO(qyearsley): Avoid using TestParser; maybe this should use
+ Port.test_type, or Port.reference_files to see whether it's not
+ a reference test?
+
Args:
test_path: A file path relative to the layout tests directory.
This might correspond to a deleted file or a non-test.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698