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

Unified Diff: media/tools/layout_tests/trend_graph_unittest.py

Issue 7693018: Intial checkin of layout test analyzer. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Modified based on CR comments. Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/tools/layout_tests/trend_graph.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/tools/layout_tests/trend_graph_unittest.py
diff --git a/media/tools/layout_tests/trend_graph_unittest.py b/media/tools/layout_tests/trend_graph_unittest.py
new file mode 100644
index 0000000000000000000000000000000000000000..3d35a613caa24eb98ec3702a6b7bd2f281d92be4
--- /dev/null
+++ b/media/tools/layout_tests/trend_graph_unittest.py
@@ -0,0 +1,35 @@
+#!/usr/bin/python
+# Copyright (c) 2011 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import os
+import shutil
+import unittest
+
+from trend_graph import TrendGraph
+
+
+class TestTrendGraph(unittest.TestCase):
+
+ def testUpdate(self):
+ test_graph_file_backup_path = os.path.join('test_data', 'graph.html.bak')
+ test_graph_file_path = os.path.join('test_data', 'graph.html')
+ shutil.copyfile(test_graph_file_backup_path, test_graph_file_path)
+ trend_graph = TrendGraph(test_graph_file_path)
+ data_map = {}
+ data_map['whole'] = (str(1), 'undefined', 'undefined')
+ data_map['skip'] = (str(2), 'undefined', 'undefined')
+ data_map['nonskip'] = (str(3), 'undefined', 'undefined')
+ data_map['passingrate'] = (str(4), 'undefined', 'undefined')
+
+ trend_graph.Update('2008,1,1,13,45,00', data_map)
+ # Assert the result graph from the file.
+ f = open(test_graph_file_path)
+ lines2 = f.readlines()
+ f.close()
+ lineCount = 0
+ for line in lines2:
+ if '2008,1,1,13,45,00' in line:
+ lineCount += 1
+ self.assertEqual(lineCount, 2)
« 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