| OLD | NEW |
| 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 Loading... |
| 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() |
| OLD | NEW |