[email protected] | 19cbf13 | 2013-07-10 13:10:23 | [diff] [blame] | 1 | #!/usr/bin/env python |
2 | # Copyright 2013 The Chromium Authors. All rights reserved. | ||||
3 | # Use of this source code is governed by a BSD-style license that can be | ||||
4 | # found in the LICENSE file. | ||||
5 | |||||
6 | """Simple script which asks user to manually check result of bisection. | ||||
7 | |||||
8 | Typically used as by the run-bisect-manual-test.py script. | ||||
9 | """ | ||||
10 | |||||
11 | import os | ||||
12 | import sys | ||||
13 | |||||
eakuefner | a5d5d3d6 | 2016-01-22 19:48:33 | [diff] [blame] | 14 | sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), |
15 | 'perf')) | ||||
16 | from chrome_telemetry_build import chromium_config | ||||
17 | sys.path.append(chromium_config.GetTelemetryDir()) | ||||
18 | |||||
wolenetz | 484640e | 2015-08-04 21:51:48 | [diff] [blame] | 19 | from telemetry.internal.browser import browser_finder |
20 | from telemetry.internal.browser import browser_options | ||||
[email protected] | 19cbf13 | 2013-07-10 13:10:23 | [diff] [blame] | 21 | |
22 | |||||
23 | def _StartManualTest(options): | ||||
24 | """Start browser then ask the user whether build is good or bad.""" | ||||
25 | browser_to_create = browser_finder.FindBrowser(options) | ||||
26 | print 'Starting browser: %s.' % options.browser_type | ||||
skyostil | 0d39e81 | 2014-12-30 19:27:32 | [diff] [blame] | 27 | with browser_to_create.Create(options) as _: |
[email protected] | 19cbf13 | 2013-07-10 13:10:23 | [diff] [blame] | 28 | # Loop until we get a response that we can parse. |
29 | while True: | ||||
30 | sys.stderr.write('Revision is [(g)ood/(b)ad]: ') | ||||
31 | response = raw_input() | ||||
32 | if response and response in ('g', 'b'): | ||||
33 | if response in ('g'): | ||||
[email protected] | 12a703a | 2014-07-25 19:03:11 | [diff] [blame] | 34 | print 'RESULT manual_test: manual_test= 1' |
[email protected] | 19cbf13 | 2013-07-10 13:10:23 | [diff] [blame] | 35 | else: |
[email protected] | 12a703a | 2014-07-25 19:03:11 | [diff] [blame] | 36 | print 'RESULT manual_test: manual_test= 0' |
[email protected] | 19cbf13 | 2013-07-10 13:10:23 | [diff] [blame] | 37 | break |
38 | |||||
[email protected] | 12a703a | 2014-07-25 19:03:11 | [diff] [blame] | 39 | |
[email protected] | 19cbf13 | 2013-07-10 13:10:23 | [diff] [blame] | 40 | def main(): |
41 | usage = ('%prog [options]\n' | ||||
42 | 'Starts browser with an optional url and asks user whether ' | ||||
43 | 'revision is good or bad.\n') | ||||
44 | |||||
[email protected] | 4177df53 | 2013-08-30 03:37:05 | [diff] [blame] | 45 | options = browser_options.BrowserFinderOptions() |
[email protected] | 19cbf13 | 2013-07-10 13:10:23 | [diff] [blame] | 46 | parser = options.CreateParser(usage) |
[email protected] | 12a703a | 2014-07-25 19:03:11 | [diff] [blame] | 47 | options, _ = parser.parse_args() |
[email protected] | 19cbf13 | 2013-07-10 13:10:23 | [diff] [blame] | 48 | |
49 | _StartManualTest(options) | ||||
50 | |||||
51 | |||||
52 | if __name__ == '__main__': | ||||
53 | sys.exit(main()) |