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

Unified Diff: Tools/Scripts/webkitpy/layout_tests/port/base.py

Issue 23672051: add a script to print what type of layout test each arg is (print-layout-test-types) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: merge to head after landing print-fastest cleanup Created 7 years, 3 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
Index: Tools/Scripts/webkitpy/layout_tests/port/base.py
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/base.py b/Tools/Scripts/webkitpy/layout_tests/port/base.py
index 4637f585f04ceaa8579f81fe17c9b3dbf32a94a0..f17d9c78d8d2219253ea5aea53f17d1b462bc68e 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/base.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/base.py
@@ -640,6 +640,26 @@ class Port(object):
def is_test_file(filesystem, dirname, filename):
return Port._has_supported_extension(filesystem, filename) and not Port.is_reference_html_file(filesystem, dirname, filename)
+ ALL_TEST_TYPES = ['audio', 'harness', 'pixel', 'ref', 'text', 'unknown']
+
+ def test_type(self, test_name):
+ fs = self._filesystem
+ if fs.exists(self.expected_filename(test_name, '.png')):
+ return 'pixel'
+ if fs.exists(self.expected_filename(test_name, '.wav')):
+ return 'audio'
+ if self.reference_files(test_name):
+ return 'ref'
+ txt = self.expected_text(test_name)
+ if txt:
+ if 'layer at (0,0) size 800x600' in txt:
+ return 'pixel'
+ for line in txt.splitlines():
+ if line.startswith('FAIL') or line.startswith('TIMEOUT') or line.startswith('PASS'):
+ return 'harness'
+ return 'text'
+ return 'unknown'
+
def test_key(self, test_name):
"""Turns a test name into a list with two sublists, the natural key of the
dirname, and the natural key of the basename.
« no previous file with comments | « Tools/Scripts/print-layout-test-types ('k') | Tools/Scripts/webkitpy/layout_tests/print_layout_test_types.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698