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

Side by Side Diff: scripts/slave/unittests/telemetry_test.py

Issue 15291003: Android / Telemetry: use android-chromium-testshell instead of content-shell. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build/
Patch Set: Created 7 years, 6 months 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 | Annotate | Revision Log
« no previous file with comments | « scripts/slave/telemetry.py ('k') | 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 #!/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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 '\'%s\' ' % sys.executable + 80 '\'%s\' ' % sys.executable +
81 '\'%s\' \'--run-python-script\' \'--target\' \'Release\' ' % runtest + 81 '\'%s\' \'--run-python-script\' \'--target\' \'Release\' ' % runtest +
82 '\'--build-dir\' \'src/build\' \'--no-xvfb\' ' + 82 '\'--build-dir\' \'src/build\' \'--no-xvfb\' ' +
83 '\'--factory-properties=' + 83 '\'--factory-properties=' +
84 '{"page_set": "sunspider.json", "target": "Release", ' + 84 '{"page_set": "sunspider.json", "target": "Release", ' +
85 '"build_dir": "src/build", "perf_id": "android-gn", ' + 85 '"build_dir": "src/build", "perf_id": "android-gn", ' +
86 '"step_name": "sunspider", "test_name": "sunspider", ' + 86 '"step_name": "sunspider", "test_name": "sunspider", ' +
87 '"target_platform": "linux2", "target_os": "android", ' + 87 '"target_platform": "linux2", "target_os": "android", ' +
88 '"show_perf_results": true}\' ' + 88 '"show_perf_results": true}\' ' +
89 '\'src/tools/perf/run_measurement\' \'-v\' ' + 89 '\'src/tools/perf/run_measurement\' \'-v\' ' +
90 '\'--browser=android-content-shell\' \'sunspider\' ' + 90 '\'--browser=android-chromium-testshell\' \'sunspider\' ' +
91 '\'src/tools/perf/page_sets/sunspider.json\'' 91 '\'src/tools/perf/page_sets/sunspider.json\''
92 ]) 92 ])
93 93
94 self.assertEqual(expectedText, self.capture.text) 94 self.assertEqual(expectedText, self.capture.text)
95 95
96 def testPageRepeat(self): 96 def testPageRepeat(self):
97 fp = self._GetDefaultFactoryProperties() 97 fp = self._GetDefaultFactoryProperties()
98 fp['page_repeat'] = 20 98 fp['page_repeat'] = 20
99 99
100 cmd = [self.telemetry, '--print-cmd', 100 cmd = [self.telemetry, '--print-cmd',
(...skipping 11 matching lines...) Expand all
112 '\'--build-dir\' \'src/build\' \'--no-xvfb\' ' + 112 '\'--build-dir\' \'src/build\' \'--no-xvfb\' ' +
113 '\'--factory-properties=' + 113 '\'--factory-properties=' +
114 '{"page_set": "sunspider.json", "target": "Release", ' + 114 '{"page_set": "sunspider.json", "target": "Release", ' +
115 '"build_dir": "src/build", "perf_id": "android-gn", ' + 115 '"build_dir": "src/build", "perf_id": "android-gn", ' +
116 '"step_name": "sunspider", "test_name": "sunspider", ' + 116 '"step_name": "sunspider", "test_name": "sunspider", ' +
117 '"page_repeat": 20, '+ 117 '"page_repeat": 20, '+
118 '"target_platform": "linux2", "target_os": "android", ' + 118 '"target_platform": "linux2", "target_os": "android", ' +
119 '"show_perf_results": true}\' ' + 119 '"show_perf_results": true}\' ' +
120 '\'src/tools/perf/run_measurement\' \'-v\' ' + 120 '\'src/tools/perf/run_measurement\' \'-v\' ' +
121 '\'--page-repeat=20\' '+ 121 '\'--page-repeat=20\' '+
122 '\'--browser=android-content-shell\' \'sunspider\' ' + 122 '\'--browser=android-chromium-testshell\' \'sunspider\' ' +
123 '\'src/tools/perf/page_sets/sunspider.json\'' 123 '\'src/tools/perf/page_sets/sunspider.json\''
124 ]) 124 ])
125 125
126 self.assertEqual(expectedText, self.capture.text) 126 self.assertEqual(expectedText, self.capture.text)
127 127
128 def testPageRepeatMozJS(self): 128 def testPageRepeatMozJS(self):
129 fp = self._GetDefaultFactoryProperties() 129 fp = self._GetDefaultFactoryProperties()
130 fp['page_repeat'] = 20 130 fp['page_repeat'] = 20
131 fp['page_set'] = 'moz.json' 131 fp['page_set'] = 'moz.json'
132 fp['target_os'] = 'mac' 132 fp['target_os'] = 'mac'
133 133
134 cmd = [self.telemetry, '--print-cmd', 134 cmd = [self.telemetry, '--print-cmd',
135 '--factory-properties=%s' % json.dumps(fp)] 135 '--factory-properties=%s' % json.dumps(fp)]
136 136
137 ret = runScript(cmd, filter_obj=self.capture, print_cmd=False) 137 ret = runScript(cmd, filter_obj=self.capture, print_cmd=False)
138 self.assertEqual(ret, 0) 138 self.assertEqual(ret, 0)
139 139
140 capture_text = self.capture.text 140 capture_text = self.capture.text
141 self.assertEqual(len(capture_text), 4) 141 self.assertEqual(len(capture_text), 4)
142 for line in capture_text: 142 for line in capture_text:
143 self.assertEqual(line.count('moz.json'), 2) 143 self.assertEqual(line.count('moz.json'), 2)
144 144
145 if __name__ == '__main__': 145 if __name__ == '__main__':
146 unittest.main() 146 unittest.main()
OLDNEW
« no previous file with comments | « scripts/slave/telemetry.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698