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

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

Issue 8469017: Support CSV output format for analyzer results. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: add blankline. Created 9 years, 1 month 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 #!/usr/bin/python 1 #!/usr/bin/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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 layouttest_analyzer_helpers.ReplaceLineInFile( 176 layouttest_analyzer_helpers.ReplaceLineInFile(
177 file_path, 'Bye', 'Hello') 177 file_path, 'Bye', 'Hello')
178 f = open(file_path, 'r') 178 f = open(file_path, 'r')
179 self.assertEquals(f.readline(), 'Goodbye') 179 self.assertEquals(f.readline(), 'Goodbye')
180 f.close() 180 f.close()
181 181
182 def testFindLatestResultWithNoData(self): 182 def testFindLatestResultWithNoData(self):
183 self.assertFalse( 183 self.assertFalse(
184 layouttest_analyzer_helpers.FindLatestResult('test_data')) 184 layouttest_analyzer_helpers.FindLatestResult('test_data'))
185 185
186 def testConvertToCSVText(self):
187 file_path = os.path.join('test_data', 'base')
188 analyzerResultMapBase = (
189 layouttest_analyzer_helpers.AnalyzerResultMap.Load(file_path))
190 data, issues_txt = analyzerResultMapBase.ConvertToCSVText('11-10-10-2011')
191 self.assertEquals(data, '11-10-10-2011,204,36,10')
192 expected_issues_txt = """\
193 BUGWK,66310,TEXT PASS,media/media-blocked-by-beforeload.html,DEBUG TEXT PASS,\
194 media/video-source-error.html,
195 BUGCR,86714,GPU IMAGE CRASH MAC,media/video-zoom.html,GPU IMAGE CRASH MAC,\
196 media/video-controls-rendering.html,
197 BUGCR,74102,GPU IMAGE PASS LINUX,media/video-controls-rendering.html,
198 BUGWK,55718,TEXT IMAGE IMAGE+TEXT,media/media-document-audio-repaint.html,
199 BUGCR,78376,TIMEOUT,http/tests/media/video-play-stall-seek.html,
200 BUGCR,59415,WIN TEXT TIMEOUT PASS,media/video-loop.html,
201 BUGCR,72223,IMAGE PASS,media/video-frame-accurate-seek.html,
202 BUGCR,75354,TEXT IMAGE IMAGE+TEXT,media/media-document-audio-repaint.html,
203 BUGCR,73609,TEXT,http/tests/media/video-play-stall.html,
204 BUGWK,64003,DEBUG TEXT MAC PASS,media/video-delay-load-event.html,
205 """
206 self.assertEquals(issues_txt, expected_issues_txt)
207
186 208
187 if __name__ == '__main__': 209 if __name__ == '__main__':
188 unittest.main() 210 unittest.main()
OLDNEW
« no previous file with comments | « media/tools/layout_tests/layouttest_analyzer_helpers.py ('k') | media/tools/layout_tests/layouttest_analyzer_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698