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

Side by Side Diff: scripts/master/unittests/process_log_test.py

Issue 14024008: Update GraphingPageCyclerLogProcessor to work with updated Telemetry pagecyclers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build/
Patch Set: Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « scripts/master/unittests/data/page_cycler.log ('k') | scripts/slave/process_log_utils.py » ('j') | 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) 2012 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 """ Source file for log processor testcases. 6 """ Source file for log processor testcases.
7 7
8 These tests should be run from the directory in which the script lives, so it 8 These tests should be run from the directory in which the script lives, so it
9 can find its data/ directory. 9 can find its data/ directory.
10 """ 10 """
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 graphs = ['hist1_%s' % str(p) for p in TEST_PERCENTILES] 424 graphs = ['hist1_%s' % str(p) for p in TEST_PERCENTILES]
425 for graph in graphs: 425 for graph in graphs:
426 filename = '%s-summary.dat' % graph 426 filename = '%s-summary.dat' % graph
427 self.assert_(os.path.exists(os.path.join('output_dir', filename))) 427 self.assert_(os.path.exists(os.path.join('output_dir', filename)))
428 # Since the output files are JSON-encoded, they may differ in form, but 428 # Since the output files are JSON-encoded, they may differ in form, but
429 # represent the same data. Therefore, we decode them before comparing. 429 # represent the same data. Therefore, we decode them before comparing.
430 actual = json.load(open(os.path.join('output_dir', filename))) 430 actual = json.load(open(os.path.join('output_dir', filename)))
431 expected = json.load(open(os.path.join(test_env.DATA_PATH, filename))) 431 expected = json.load(open(os.path.join(test_env.DATA_PATH, filename)))
432 self.assertEqual(expected, actual) 432 self.assertEqual(expected, actual)
433 433
434 def testPageCycler(self):
435 step = self._ConstructStep(process_log.GraphingPageCyclerLogProcessor,
436 'page_cycler.log')
437 step.commandComplete('mycommand')
438 expected = 't: 2.32k'
439 self.assertEqual(expected, step._result_text[0])
440
434 441
435 if __name__ == '__main__': 442 if __name__ == '__main__':
436 unittest.main() 443 unittest.main()
OLDNEW
« no previous file with comments | « scripts/master/unittests/data/page_cycler.log ('k') | scripts/slave/process_log_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698