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

Side by Side Diff: media/tools/layout_tests/layouttest_analyzer_helpers_unittest.py

Issue 9476021: Updating Layout test analyzer to add control to show issue detail or not. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 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
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import copy 6 import copy
7 from datetime import datetime 7 from datetime import datetime
8 import os 8 import os
9 import pickle 9 import pickle
10 import time 10 import time
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 expected_rev_number, expected_rev_date, 115 expected_rev_number, expected_rev_date,
116 testname, diff_map_none=False): 116 testname, diff_map_none=False):
117 current_time = datetime.strptime(current_time_str, '%Y-%m-%d-%H') 117 current_time = datetime.strptime(current_time_str, '%Y-%m-%d-%H')
118 current_time = time.mktime(current_time.timetuple()) 118 current_time = time.mktime(current_time.timetuple())
119 prev_time = datetime.strptime(prev_time_str, '%Y-%m-%d-%H') 119 prev_time = datetime.strptime(prev_time_str, '%Y-%m-%d-%H')
120 prev_time = time.mktime(prev_time.timetuple()) 120 prev_time = time.mktime(prev_time.timetuple())
121 if diff_map_none: 121 if diff_map_none:
122 diff_map = None 122 diff_map = None
123 else: 123 else:
124 diff_map = { 124 diff_map = {
125 'whole': [[], []], 125 'whole': [[], []],
126 'skip': [[(testname, 'te_info1')], []], 126 'skip': [[(testname, 'te_info1')], []],
127 'nonskip': [[], []], 127 'nonskip': [[], []],
128 } 128 }
129 (rev_str, simple_rev_str, rev_number, rev_date) = ( 129 (rev_str, simple_rev_str, rev_number, rev_date) = (
130 layouttest_analyzer_helpers.GetRevisionString(prev_time, current_time, 130 layouttest_analyzer_helpers.GetRevisionString(prev_time, current_time,
131 diff_map)) 131 diff_map))
132 self.assertEquals(rev_str, expected_rev_str) 132 self.assertEquals(rev_str, expected_rev_str)
133 self.assertEquals(simple_rev_str, expected_simple_rev_str) 133 self.assertEquals(simple_rev_str, expected_simple_rev_str)
134 self.assertEquals(rev_number, expected_rev_number) 134 self.assertEquals(rev_number, expected_rev_number)
135 self.assertEquals(rev_date, expected_rev_date) 135 self.assertEquals(rev_date, expected_rev_date)
136 136
137 def testGetRevisionString(self): 137 def testGetRevisionString(self):
138 expected_rev_str = ('<ul><a href="http://trac.webkit.org/changeset?' 138 expected_rev_str = ('<ul><a href="http://trac.webkit.org/changeset?'
139 'new=94377@trunk/LayoutTests/platform/chromium/' 139 'new=94377@trunk/LayoutTests/platform/chromium/'
140 'test_expectations.txt&old=94366@trunk/LayoutTests/' 140 'test_expectations.txt&old=94366@trunk/LayoutTests/'
141 'platform/chromium/test_expectations.txt">94366->' 141 'platform/chromium/test_expectations.txt">94366->'
142 '94377</a>\n' 142 '94377</a>\n'
143 '<li>jamesr@google.com</li>\n' 143 '<li>jamesr@google.com</li>\n'
144 '<li>2011-09-01 18:00:23</li>\n' 144 '<li>2011-09-01 18:00:23</li>\n'
145 '<ul><li>-BUGWK63878 : fast/dom/dom-constructors.html' 145 '<ul><li>-<a href="http://webkit.org/b/63878">'
146 ' = TEXT</li>\n' 146 'BUGWK63878</a> : <a href=\'http://test-results.'
147 '</ul></ul>') 147 'appspot.com/dashboards/flakiness_dashboard.html#'
148 'tests=fast/dom/dom-constructors.html\'>fast/dom/'
149 'dom-constructors.html</a> = TEXT</li>\n</ul></ul>')
148 expected_simple_rev_str = ('<a href="http://trac.webkit.org/changeset?' 150 expected_simple_rev_str = ('<a href="http://trac.webkit.org/changeset?'
149 'new=94377@trunk/LayoutTests/platform/chromium/' 151 'new=94377@trunk/LayoutTests/platform/chromium/'
150 'test_expectations.txt&old=94366@trunk/' 152 'test_expectations.txt&old=94366@trunk/'
151 'LayoutTests/platform/chromium/' 153 'LayoutTests/platform/chromium/'
152 'test_expectations.txt">94366->94377</a>,') 154 'test_expectations.txt">94366->94377</a>,')
153 self.RunTestGetRevisionString('2011-09-02-00', '2011-09-01-00', 155 self.RunTestGetRevisionString('2011-09-02-00', '2011-09-01-00',
154 expected_rev_str, expected_simple_rev_str, 156 expected_rev_str, expected_simple_rev_str,
155 94377, '2011-09-01 18:00:23', 157 94377, '2011-09-01 18:00:23',
156 'fast/dom/dom-constructors.html') 158 'fast/dom/dom-constructors.html')
157 159
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 BUGCR,72223,IMAGE PASS,media/video-frame-accurate-seek.html, 203 BUGCR,72223,IMAGE PASS,media/video-frame-accurate-seek.html,
202 BUGCR,75354,TEXT IMAGE IMAGE+TEXT,media/media-document-audio-repaint.html, 204 BUGCR,75354,TEXT IMAGE IMAGE+TEXT,media/media-document-audio-repaint.html,
203 BUGCR,73609,TEXT,http/tests/media/video-play-stall.html, 205 BUGCR,73609,TEXT,http/tests/media/video-play-stall.html,
204 BUGWK,64003,DEBUG TEXT MAC PASS,media/video-delay-load-event.html, 206 BUGWK,64003,DEBUG TEXT MAC PASS,media/video-delay-load-event.html,
205 """ 207 """
206 self.assertEquals(issues_txt, expected_issues_txt) 208 self.assertEquals(issues_txt, expected_issues_txt)
207 209
208 210
209 if __name__ == '__main__': 211 if __name__ == '__main__':
210 unittest.main() 212 unittest.main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698