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 """Unit tests for telemetry.py. | 6 """Unit tests for telemetry.py. |
7 | 7 |
8 This is a basic check that telemetry.py forms commands properly. | 8 This is a basic check that telemetry.py forms commands properly. |
9 | 9 |
10 """ | 10 """ |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 '"step_name": "sunspider", "test_name": "sunspider", ' + | 72 '"step_name": "sunspider", "test_name": "sunspider", ' + |
73 '"target_platform": "linux2", "target_os": "android", ' + | 73 '"target_platform": "linux2", "target_os": "android", ' + |
74 '"show_perf_results": true}\' ' + | 74 '"show_perf_results": true}\' ' + |
75 '\'src/build/android/test_runner.py\' \'perf\' \'-v\' ' + | 75 '\'src/build/android/test_runner.py\' \'perf\' \'-v\' ' + |
76 '\'--release\' ' + | 76 '\'--release\' ' + |
77 '\'--single-step\' ' + | 77 '\'--single-step\' ' + |
78 '\'--\' ' + | 78 '\'--\' ' + |
79 '\'src/tools/perf/run_benchmark\' \'-v\' ' + | 79 '\'src/tools/perf/run_benchmark\' \'-v\' ' + |
80 '\'--output-format=buildbot\' ' + | 80 '\'--output-format=buildbot\' ' + |
81 '\'--report-root-metrics\' ' + | 81 '\'--report-root-metrics\' ' + |
82 '\'--browser=android-chromium-testshell\' \'sunspider\'' | 82 '\'--browser=android-chrome-shell\' \'sunspider\'' |
83 ]) | 83 ]) |
84 | 84 |
85 self.assertEqual(expectedText, self.capture.text) | 85 self.assertEqual(expectedText, self.capture.text) |
86 | 86 |
87 def testExtraArg(self): | 87 def testExtraArg(self): |
88 fp = self._GetDefaultFactoryProperties() | 88 fp = self._GetDefaultFactoryProperties() |
89 fp['extra_args'] = ['--profile-dir=fake_dir'] | 89 fp['extra_args'] = ['--profile-dir=fake_dir'] |
90 | 90 |
91 cmd = [self.telemetry, '--print-cmd', | 91 cmd = [self.telemetry, '--print-cmd', |
92 '--factory-properties=%s' % json.dumps(fp)] | 92 '--factory-properties=%s' % json.dumps(fp)] |
(...skipping 15 matching lines...) Expand all Loading... |
108 '"target_platform": "linux2", "target_os": "android", ' + | 108 '"target_platform": "linux2", "target_os": "android", ' + |
109 '"show_perf_results": true}\' ' + | 109 '"show_perf_results": true}\' ' + |
110 '\'src/build/android/test_runner.py\' \'perf\' \'-v\' ' + | 110 '\'src/build/android/test_runner.py\' \'perf\' \'-v\' ' + |
111 '\'--release\' ' + | 111 '\'--release\' ' + |
112 '\'--single-step\' ' + | 112 '\'--single-step\' ' + |
113 '\'--\' ' + | 113 '\'--\' ' + |
114 '\'src/tools/perf/run_benchmark\' \'-v\' ' + | 114 '\'src/tools/perf/run_benchmark\' \'-v\' ' + |
115 '\'--output-format=buildbot\' ' + | 115 '\'--output-format=buildbot\' ' + |
116 '\'--report-root-metrics\' ' + | 116 '\'--report-root-metrics\' ' + |
117 '\'--profile-dir=fake_dir\' '+ | 117 '\'--profile-dir=fake_dir\' '+ |
118 '\'--browser=android-chromium-testshell\' \'sunspider\'' | 118 '\'--browser=android-chrome-shell\' \'sunspider\'' |
119 ]) | 119 ]) |
120 | 120 |
121 self.assertEqual(expectedText, self.capture.text) | 121 self.assertEqual(expectedText, self.capture.text) |
122 | 122 |
123 if __name__ == '__main__': | 123 if __name__ == '__main__': |
124 unittest.main() | 124 unittest.main() |
OLD | NEW |