Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 current_time = '11-10-10-2011' | |
|
dennis_jeffrey
2011/11/11 00:01:36
Remove this line and just inline the value where n
imasaki1
2011/11/11 00:25:52
Done.
| |
| 191 (data, issues_txt) = analyzerResultMapBase.ConvertToCSVText(current_time) | |
|
dennis_jeffrey
2011/11/11 00:01:36
no need for the parens in '(data, issues_txt)'
imasaki1
2011/11/11 00:25:52
Done.
| |
| 192 self.assertEquals(data, '11-10-10-2011,204,36,10') | |
| 193 expected_issues_txt = """\ | |
| 194 BUGWK,66310,TEXT PASS,media/media-blocked-by-beforeload.html,DEBUG TEXT PASS,\ | |
| 195 media/video-source-error.html, | |
| 196 BUGCR,86714,GPU IMAGE CRASH MAC,media/video-zoom.html,GPU IMAGE CRASH MAC,\ | |
| 197 media/video-controls-rendering.html, | |
| 198 BUGCR,74102,GPU IMAGE PASS LINUX,media/video-controls-rendering.html, | |
| 199 BUGWK,55718,TEXT IMAGE IMAGE+TEXT,media/media-document-audio-repaint.html, | |
| 200 BUGCR,78376,TIMEOUT,http/tests/media/video-play-stall-seek.html, | |
| 201 BUGCR,59415,WIN TEXT TIMEOUT PASS,media/video-loop.html, | |
| 202 BUGCR,72223,IMAGE PASS,media/video-frame-accurate-seek.html, | |
| 203 BUGCR,75354,TEXT IMAGE IMAGE+TEXT,media/media-document-audio-repaint.html, | |
| 204 BUGCR,73609,TEXT,http/tests/media/video-play-stall.html, | |
| 205 BUGWK,64003,DEBUG TEXT MAC PASS,media/video-delay-load-event.html, | |
| 206 """ | |
| 207 self.assertEquals(issues_txt, expected_issues_txt) | |
| 208 | |
| 186 | 209 |
| 187 if __name__ == '__main__': | 210 if __name__ == '__main__': |
| 188 unittest.main() | 211 unittest.main() |
| OLD | NEW |