| OLD | NEW |
| 1 # Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import codecs | 5 import codecs |
| 6 import os | 6 import os |
| 7 import tempfile | 7 import tempfile |
| 8 import unittest | 8 import unittest |
| 9 | 9 |
| 10 from perf_insights import corpus_driver_cmdline | 10 from perf_insights import corpus_driver_cmdline |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 mode='w', suffix='.html', delete=False) | 29 mode='w', suffix='.html', delete=False) |
| 30 raw_tmpfile.close() | 30 raw_tmpfile.close() |
| 31 try: | 31 try: |
| 32 project = perf_insights_project.PerfInsightsProject() | 32 project = perf_insights_project.PerfInsightsProject() |
| 33 with codecs.open(raw_tmpfile.name, 'w', encoding='utf-8') as tmpfile: | 33 with codecs.open(raw_tmpfile.name, 'w', encoding='utf-8') as tmpfile: |
| 34 corpus_driver = corpus_driver_cmdline.GetCorpusDriver( | 34 corpus_driver = corpus_driver_cmdline.GetCorpusDriver( |
| 35 None, TestArgs(project.perf_insights_test_data_path)) | 35 None, TestArgs(project.perf_insights_test_data_path)) |
| 36 res = pi_report_to_html.PiReportToHTML( | 36 res = pi_report_to_html.PiReportToHTML( |
| 37 tmpfile, corpus_driver, | 37 tmpfile, corpus_driver, |
| 38 project.GetAbsPathFromHRef( | 38 project.GetAbsPathFromHRef( |
| 39 '/perf_insights/ui/reports/weather_report.html'), | 39 '/perf_insights/ui/reports/startup_report.html'), |
| 40 corpus_query.CorpusQuery.FromString('MAX_TRACE_HANDLES=2'), | 40 corpus_query.CorpusQuery.FromString('MAX_TRACE_HANDLES=2'), |
| 41 quiet=True) | 41 quiet=True) |
| 42 self.assertEquals(res, 0) | 42 self.assertEquals(res, 0) |
| 43 finally: | 43 finally: |
| 44 os.remove(raw_tmpfile.name) | 44 os.remove(raw_tmpfile.name) |
| OLD | NEW |