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

Side by Side Diff: tools/perf/scripts_smoke_unittest.py

Issue 1477793002: [tools/perf] Add smoke test cover for record_wpr list command (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 | « no previous file | 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 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 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 json 5 import json
6 import os 6 import os
7 import subprocess 7 import subprocess
8 import sys 8 import sys
9 import tempfile 9 import tempfile
10 import unittest 10 import unittest
(...skipping 30 matching lines...) Expand all
41 return_code, stdout = self.RunPerfScript('run_benchmark list') 41 return_code, stdout = self.RunPerfScript('run_benchmark list')
42 self.assertIn('Pass --browser to list benchmarks', stdout) 42 self.assertIn('Pass --browser to list benchmarks', stdout)
43 self.assertIn('dummy_benchmark.stable_benchmark_1', stdout) 43 self.assertIn('dummy_benchmark.stable_benchmark_1', stdout)
44 self.assertEquals(return_code, 0) 44 self.assertEquals(return_code, 0)
45 45
46 def testRunRecordWprHelp(self): 46 def testRunRecordWprHelp(self):
47 return_code, stdout = self.RunPerfScript('record_wpr') 47 return_code, stdout = self.RunPerfScript('record_wpr')
48 self.assertIn('optional arguments:', stdout) 48 self.assertIn('optional arguments:', stdout)
49 self.assertEquals(return_code, 0) 49 self.assertEquals(return_code, 0)
50 50
51 def testRunRecordWprList(self):
52 return_code, stdout = self.RunPerfScript('record_wpr --list-benchmarks')
53 self.assertIn('kraken', stdout)
54 self.assertEquals(return_code, 0)
55
51 def testRunBenchmarkListJSONListsOutBenchmarks(self): 56 def testRunBenchmarkListJSONListsOutBenchmarks(self):
52 tmp_file = tempfile.NamedTemporaryFile(delete=False) 57 tmp_file = tempfile.NamedTemporaryFile(delete=False)
53 tmp_file_name = tmp_file.name 58 tmp_file_name = tmp_file.name
54 tmp_file.close() 59 tmp_file.close()
55 try: 60 try:
56 return_code, _ = self.RunPerfScript( 61 return_code, _ = self.RunPerfScript(
57 'run_benchmark list --json-output %s' % tmp_file_name) 62 'run_benchmark list --json-output %s' % tmp_file_name)
58 self.assertEquals(return_code, 0) 63 self.assertEquals(return_code, 0)
59 with open(tmp_file_name, 'r') as f: 64 with open(tmp_file_name, 'r') as f:
60 benchmark_data = json.load(f) 65 benchmark_data = json.load(f)
61 self.assertIn('dummy_benchmark.stable_benchmark_1', 66 self.assertIn('dummy_benchmark.stable_benchmark_1',
62 benchmark_data['steps']) 67 benchmark_data['steps'])
63 finally: 68 finally:
64 os.remove(tmp_file_name) 69 os.remove(tmp_file_name)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698