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

Side by Side Diff: media/tools/layout_tests/trend_graph_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: Modification based on CR comments. 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
« no previous file with comments | « media/tools/layout_tests/trend_graph.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 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 os 6 import os
7 import shutil 7 import shutil
8 import unittest 8 import unittest
9 9
10 from trend_graph import TrendGraph 10 from trend_graph import TrendGraph
11 11
12 12
13 class TestTrendGraph(unittest.TestCase): 13 class TestTrendGraph(unittest.TestCase):
14 14
15 def testUpdate(self): 15 def testUpdate(self):
16 test_graph_file_backup_path = os.path.join('test_data', 'graph.html.bak') 16 test_graph_file_backup_path = os.path.join('test_data', 'graph.html.bak')
17 test_graph_file_path = os.path.join('test_data', 'graph.html') 17 test_graph_file_path = os.path.join('test_data', 'graph.html')
18 shutil.copyfile(test_graph_file_backup_path, test_graph_file_path) 18 shutil.copyfile(test_graph_file_backup_path, test_graph_file_path)
19 trend_graph = TrendGraph(test_graph_file_path) 19 trend_graph = TrendGraph(test_graph_file_path)
20 data_map = {} 20 data_map = {}
21 data_map['whole'] = (['test1'], 'undefined', 'undefined') 21 data_map['whole'] = (['test1'], 'undefined', 'undefined')
22 data_map['skip'] = (['test1', 'test2'], 'undefined', 'undefined') 22 data_map['skip'] = (['test1', 'test2'], 'undefined', 'undefined')
23 data_map['nonskip'] = (['test1', 'test2', 'test3'], 'undefined', 23 data_map['nonskip'] = (['test1', 'test2', 'test3'], 'undefined',
24 'undefined') 24 'undefined')
25 data_map['passingrate'] = (str(4), 'undefined', 'undefined') 25 data_map['passingrate'] = (str(4), 'undefined', 'undefined')
26 26
27 trend_graph.Update('2008,1,1,13,45,00', data_map) 27 trend_graph.Update('2008,1,1,13,45,00', data_map)
28 # Assert the result graph from the file. 28 # Assert the result graph from the file.
29 f = open(test_graph_file_path) 29 f = open(test_graph_file_path)
30 lines2 = f.readlines() 30 lines2 = f.readlines()
31 f.close() 31 f.close()
32 lineCount = 0 32 line_count = 0
33 for line in lines2: 33 for line in lines2:
34 if '2008,0,1,13,45,00' in line: 34 if '2008,0,1,13,45,00' in line:
35 lineCount += 1 35 line_count += 1
36 self.assertEqual(lineCount, 2) 36 self.assertEqual(line_count, 2)
37 37
38 38
39 if __name__ == '__main__': 39 if __name__ == '__main__':
40 unittest.main() 40 unittest.main()
OLDNEW
« no previous file with comments | « media/tools/layout_tests/trend_graph.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698