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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 '\'adb\' \'wait-for-device\'', | 78 '\'adb\' \'wait-for-device\'', |
79 '\'%s\' ' % sys.executable + | 79 '\'%s\' ' % sys.executable + |
80 '\'%s\' \'--run-python-script\' \'--target\' \'Release\' ' % runtest + | 80 '\'%s\' \'--run-python-script\' \'--target\' \'Release\' ' % runtest + |
81 '\'--build-dir\' \'src/build\' \'--no-xvfb\' ' + | 81 '\'--build-dir\' \'src/build\' \'--no-xvfb\' ' + |
82 '\'--factory-properties=' + | 82 '\'--factory-properties=' + |
83 '{"target": "Release", ' + | 83 '{"target": "Release", ' + |
84 '"build_dir": "src/build", "perf_id": "android-gn", ' + | 84 '"build_dir": "src/build", "perf_id": "android-gn", ' + |
85 '"step_name": "sunspider", "test_name": "sunspider", ' + | 85 '"step_name": "sunspider", "test_name": "sunspider", ' + |
86 '"target_platform": "linux2", "target_os": "android", ' + | 86 '"target_platform": "linux2", "target_os": "android", ' + |
87 '"show_perf_results": true}\' ' + | 87 '"show_perf_results": true}\' ' + |
| 88 '\'src/build/android/test_runner.py\' \'perf\' \'-vvv\' ' + |
| 89 '\'--single-step\' ' + |
88 '\'src/tools/perf/run_benchmark\' \'-v\' ' + | 90 '\'src/tools/perf/run_benchmark\' \'-v\' ' + |
89 '\'--output-format=buildbot\' ' + | 91 '\'--output-format=buildbot\' ' + |
90 '\'--browser=android-chromium-testshell\' \'sunspider\'' | 92 '\'--browser=android-chromium-testshell\' \'sunspider\'' |
91 ]) | 93 ]) |
92 | 94 |
93 self.assertEqual(expectedText, self.capture.text) | 95 self.assertEqual(expectedText, self.capture.text) |
94 | 96 |
95 def testExtraArg(self): | 97 def testExtraArg(self): |
96 fp = self._GetDefaultFactoryProperties() | 98 fp = self._GetDefaultFactoryProperties() |
97 fp['extra_args'] = ['--profile-dir=fake_dir'] | 99 fp['extra_args'] = ['--profile-dir=fake_dir'] |
(...skipping 11 matching lines...) Expand all Loading... |
109 '\'%s\' ' % sys.executable + | 111 '\'%s\' ' % sys.executable + |
110 '\'%s\' \'--run-python-script\' \'--target\' \'Release\' ' % runtest + | 112 '\'%s\' \'--run-python-script\' \'--target\' \'Release\' ' % runtest + |
111 '\'--build-dir\' \'src/build\' \'--no-xvfb\' ' + | 113 '\'--build-dir\' \'src/build\' \'--no-xvfb\' ' + |
112 '\'--factory-properties=' + | 114 '\'--factory-properties=' + |
113 '{"target": "Release", "build_dir": "src/build", ' + | 115 '{"target": "Release", "build_dir": "src/build", ' + |
114 '"extra_args": ["--profile-dir=fake_dir"], ' + | 116 '"extra_args": ["--profile-dir=fake_dir"], ' + |
115 '"perf_id": "android-gn", ' + | 117 '"perf_id": "android-gn", ' + |
116 '"step_name": "sunspider", "test_name": "sunspider", ' + | 118 '"step_name": "sunspider", "test_name": "sunspider", ' + |
117 '"target_platform": "linux2", "target_os": "android", ' + | 119 '"target_platform": "linux2", "target_os": "android", ' + |
118 '"show_perf_results": true}\' ' + | 120 '"show_perf_results": true}\' ' + |
| 121 '\'src/build/android/test_runner.py\' \'perf\' \'-vvv\' ' + |
| 122 '\'--single-step\' ' + |
119 '\'src/tools/perf/run_benchmark\' \'-v\' ' + | 123 '\'src/tools/perf/run_benchmark\' \'-v\' ' + |
120 '\'--output-format=buildbot\' ' + | 124 '\'--output-format=buildbot\' ' + |
121 '\'--profile-dir=fake_dir\' '+ | 125 '\'--profile-dir=fake_dir\' '+ |
122 '\'--browser=android-chromium-testshell\' \'sunspider\'' | 126 '\'--browser=android-chromium-testshell\' \'sunspider\'' |
123 ]) | 127 ]) |
124 | 128 |
125 self.assertEqual(expectedText, self.capture.text) | 129 self.assertEqual(expectedText, self.capture.text) |
126 | 130 |
127 if __name__ == '__main__': | 131 if __name__ == '__main__': |
128 unittest.main() | 132 unittest.main() |
OLD | NEW |