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

Side by Side Diff: Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py

Issue 148153009: DOM-object leak detection at run_webkit_tests.py (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Bug fix: unit test Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Copyright (C) 2010 Google Inc. All rights reserved. 1 # Copyright (C) 2010 Google Inc. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer 10 # copyright notice, this list of conditions and the following disclaimer
(...skipping 24 matching lines...) Expand all
35 35
36 from webkitpy.layout_tests.models.test_configuration import TestConfigurationCon verter 36 from webkitpy.layout_tests.models.test_configuration import TestConfigurationCon verter
37 37
38 _log = logging.getLogger(__name__) 38 _log = logging.getLogger(__name__)
39 39
40 40
41 # Test expectation and specifier constants. 41 # Test expectation and specifier constants.
42 # 42 #
43 # FIXME: range() starts with 0 which makes if expectation checks harder 43 # FIXME: range() starts with 0 which makes if expectation checks harder
44 # as PASS is 0. 44 # as PASS is 0.
45 (PASS, FAIL, TEXT, IMAGE, IMAGE_PLUS_TEXT, AUDIO, TIMEOUT, CRASH, SKIP, WONTFIX, 45 (PASS, FAIL, TEXT, IMAGE, IMAGE_PLUS_TEXT, AUDIO, TIMEOUT, CRASH, LEAK, SKIP, WO NTFIX,
46 SLOW, REBASELINE, NEEDS_REBASELINE, NEEDS_MANUAL_REBASELINE, MISSING, FLAKY, NO W, NONE) = range(18) 46 SLOW, REBASELINE, NEEDS_REBASELINE, NEEDS_MANUAL_REBASELINE, MISSING, FLAKY, NO W, NONE) = range(19)
47 47
48 # FIXME: Perhas these two routines should be part of the Port instead? 48 # FIXME: Perhas these two routines should be part of the Port instead?
49 BASELINE_SUFFIX_LIST = ('png', 'wav', 'txt') 49 BASELINE_SUFFIX_LIST = ('png', 'wav', 'txt')
50 50
51 WEBKIT_BUG_PREFIX = 'webkit.org/b/' 51 WEBKIT_BUG_PREFIX = 'webkit.org/b/'
52 CHROMIUM_BUG_PREFIX = 'crbug.com/' 52 CHROMIUM_BUG_PREFIX = 'crbug.com/'
53 V8_BUG_PREFIX = 'code.google.com/p/v8/issues/detail?id=' 53 V8_BUG_PREFIX = 'code.google.com/p/v8/issues/detail?id='
54 NAMED_BUG_PREFIX = 'Bug(' 54 NAMED_BUG_PREFIX = 'Bug('
55 55
56 MISSING_KEYWORD = 'Missing' 56 MISSING_KEYWORD = 'Missing'
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 'Release', 215 'Release',
216 'Debug', 216 'Debug',
217 ] 217 ]
218 218
219 _configuration_tokens = dict((token, token.upper()) for token in _configurat ion_tokens_list) 219 _configuration_tokens = dict((token, token.upper()) for token in _configurat ion_tokens_list)
220 _inverted_configuration_tokens = dict((value, name) for name, value in _conf iguration_tokens.iteritems()) 220 _inverted_configuration_tokens = dict((value, name) for name, value in _conf iguration_tokens.iteritems())
221 221
222 # FIXME: Update the original specifiers list and remove this once the old sy ntax is gone. 222 # FIXME: Update the original specifiers list and remove this once the old sy ntax is gone.
223 _expectation_tokens = { 223 _expectation_tokens = {
224 'Crash': 'CRASH', 224 'Crash': 'CRASH',
225 'Leak': 'LEAK',
225 'Failure': 'FAIL', 226 'Failure': 'FAIL',
226 'ImageOnlyFailure': 'IMAGE', 227 'ImageOnlyFailure': 'IMAGE',
227 MISSING_KEYWORD: 'MISSING', 228 MISSING_KEYWORD: 'MISSING',
228 'Pass': 'PASS', 229 'Pass': 'PASS',
229 'Rebaseline': 'REBASELINE', 230 'Rebaseline': 'REBASELINE',
230 NEEDS_REBASELINE_KEYWORD: 'NEEDSREBASELINE', 231 NEEDS_REBASELINE_KEYWORD: 'NEEDSREBASELINE',
231 NEEDS_MANUAL_REBASELINE_KEYWORD: 'NEEDSMANUALREBASELINE', 232 NEEDS_MANUAL_REBASELINE_KEYWORD: 'NEEDSMANUALREBASELINE',
232 'Skip': 'SKIP', 233 'Skip': 'SKIP',
233 'Slow': 'SLOW', 234 'Slow': 'SLOW',
234 'Timeout': 'TIMEOUT', 235 'Timeout': 'TIMEOUT',
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
799 800
800 # FIXME: Update to new syntax once the old format is no longer supported. 801 # FIXME: Update to new syntax once the old format is no longer supported.
801 EXPECTATIONS = {'pass': PASS, 802 EXPECTATIONS = {'pass': PASS,
802 'audio': AUDIO, 803 'audio': AUDIO,
803 'fail': FAIL, 804 'fail': FAIL,
804 'image': IMAGE, 805 'image': IMAGE,
805 'image+text': IMAGE_PLUS_TEXT, 806 'image+text': IMAGE_PLUS_TEXT,
806 'text': TEXT, 807 'text': TEXT,
807 'timeout': TIMEOUT, 808 'timeout': TIMEOUT,
808 'crash': CRASH, 809 'crash': CRASH,
810 'leak': LEAK,
809 'missing': MISSING, 811 'missing': MISSING,
810 TestExpectationParser.SKIP_MODIFIER: SKIP, 812 TestExpectationParser.SKIP_MODIFIER: SKIP,
811 TestExpectationParser.NEEDS_REBASELINE_MODIFIER: NEEDS_REBAS ELINE, 813 TestExpectationParser.NEEDS_REBASELINE_MODIFIER: NEEDS_REBAS ELINE,
812 TestExpectationParser.NEEDS_MANUAL_REBASELINE_MODIFIER: NEED S_MANUAL_REBASELINE, 814 TestExpectationParser.NEEDS_MANUAL_REBASELINE_MODIFIER: NEED S_MANUAL_REBASELINE,
813 TestExpectationParser.WONTFIX_MODIFIER: WONTFIX, 815 TestExpectationParser.WONTFIX_MODIFIER: WONTFIX,
814 TestExpectationParser.SLOW_MODIFIER: SLOW, 816 TestExpectationParser.SLOW_MODIFIER: SLOW,
815 TestExpectationParser.REBASELINE_MODIFIER: REBASELINE, 817 TestExpectationParser.REBASELINE_MODIFIER: REBASELINE,
816 } 818 }
817 819
818 EXPECTATIONS_TO_STRING = dict((k, v) for (v, k) in EXPECTATIONS.iteritems()) 820 EXPECTATIONS_TO_STRING = dict((k, v) for (v, k) in EXPECTATIONS.iteritems())
819 821
820 # (aggregated by category, pass/fail/skip, type) 822 # (aggregated by category, pass/fail/skip, type)
821 EXPECTATION_DESCRIPTIONS = {SKIP: 'skipped', 823 EXPECTATION_DESCRIPTIONS = {SKIP: 'skipped',
822 PASS: 'passes', 824 PASS: 'passes',
823 FAIL: 'failures', 825 FAIL: 'failures',
824 IMAGE: 'image-only failures', 826 IMAGE: 'image-only failures',
825 TEXT: 'text-only failures', 827 TEXT: 'text-only failures',
826 IMAGE_PLUS_TEXT: 'image and text failures', 828 IMAGE_PLUS_TEXT: 'image and text failures',
827 AUDIO: 'audio failures', 829 AUDIO: 'audio failures',
828 CRASH: 'crashes', 830 CRASH: 'crashes',
831 LEAK: 'leaks',
829 TIMEOUT: 'timeouts', 832 TIMEOUT: 'timeouts',
830 MISSING: 'missing results'} 833 MISSING: 'missing results'}
831 834
832 NON_TEST_OUTCOME_EXPECTATIONS = (REBASELINE, SKIP, SLOW, WONTFIX) 835 NON_TEST_OUTCOME_EXPECTATIONS = (REBASELINE, SKIP, SLOW, WONTFIX)
833 836
834 BUILD_TYPES = ('debug', 'release') 837 BUILD_TYPES = ('debug', 'release')
835 838
836 TIMELINES = {TestExpectationParser.WONTFIX_MODIFIER: WONTFIX, 839 TIMELINES = {TestExpectationParser.WONTFIX_MODIFIER: WONTFIX,
837 'now': NOW} 840 'now': NOW}
838 841
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
1100 # If reconstitute_only_these is an empty list, we want to return ori ginal_string. 1103 # If reconstitute_only_these is an empty list, we want to return ori ginal_string.
1101 # So we need to compare reconstitute_only_these to None, not just ch eck if it's falsey. 1104 # So we need to compare reconstitute_only_these to None, not just ch eck if it's falsey.
1102 if reconstitute_only_these is None or expectation_line in reconstitu te_only_these: 1105 if reconstitute_only_these is None or expectation_line in reconstitu te_only_these:
1103 return expectation_line.to_string(test_configuration_converter) 1106 return expectation_line.to_string(test_configuration_converter)
1104 return expectation_line.original_string 1107 return expectation_line.original_string
1105 1108
1106 def nones_out(expectation_line): 1109 def nones_out(expectation_line):
1107 return expectation_line is not None 1110 return expectation_line is not None
1108 1111
1109 return "\n".join(filter(nones_out, map(serialize, expectation_lines))) 1112 return "\n".join(filter(nones_out, map(serialize, expectation_lines)))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698