blob: 325980c458f5f6adea3a6b9245cc8daf2475202c [file] [log] [blame]
[email protected]19cbf132013-07-10 13:10:231#!/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
8Typically used as by the run-bisect-manual-test.py script.
9"""
10
11import os
12import sys
13
14sys.path.append(os.path.join(os.path.dirname(__file__), 'telemetry'))
15from telemetry.core import browser_finder
16from telemetry.core import browser_options
17
18
19def _StartManualTest(options):
20 """Start browser then ask the user whether build is good or bad."""
21 browser_to_create = browser_finder.FindBrowser(options)
22 print 'Starting browser: %s.' % options.browser_type
skyostil0d39e812014-12-30 19:27:3223 with browser_to_create.Create(options) as _:
[email protected]19cbf132013-07-10 13:10:2324 # Loop until we get a response that we can parse.
25 while True:
26 sys.stderr.write('Revision is [(g)ood/(b)ad]: ')
27 response = raw_input()
28 if response and response in ('g', 'b'):
29 if response in ('g'):
[email protected]12a703a2014-07-25 19:03:1130 print 'RESULT manual_test: manual_test= 1'
[email protected]19cbf132013-07-10 13:10:2331 else:
[email protected]12a703a2014-07-25 19:03:1132 print 'RESULT manual_test: manual_test= 0'
[email protected]19cbf132013-07-10 13:10:2333 break
34
[email protected]12a703a2014-07-25 19:03:1135
[email protected]19cbf132013-07-10 13:10:2336def main():
37 usage = ('%prog [options]\n'
38 'Starts browser with an optional url and asks user whether '
39 'revision is good or bad.\n')
40
[email protected]4177df532013-08-30 03:37:0541 options = browser_options.BrowserFinderOptions()
[email protected]19cbf132013-07-10 13:10:2342 parser = options.CreateParser(usage)
[email protected]12a703a2014-07-25 19:03:1143 options, _ = parser.parse_args()
[email protected]19cbf132013-07-10 13:10:2344
45 _StartManualTest(options)
46
47
48if __name__ == '__main__':
49 sys.exit(main())