1#!/usr/bin/python
2#
3# Copyright 2016 The Chromium OS Authors. All rights reserved.
4# Use of this source code is governed by a BSD-style license that can be
5# found in the LICENSE file.
6
7'''Make Chrome automatically log in.'''
8
9# This sets up import paths for autotest.
10import common
11
12import argparse
13import sys
14
15from autotest_lib.client.common_lib.cros import chrome
16
17
18def main(args):
19    '''The main function.
20
21    @param args: list of string args passed to program
22    '''
23
24    parser = argparse.ArgumentParser(description=__doc__)
25    parser.add_argument('-a', '--arc', action='store_true',
26                        help='Enable ARC and wait for it to start.')
27    args = parser.parse_args(args)
28
29    # Avoid calling close() on the Chrome object; this keeps the session active.
30    chrome.Chrome(arc_mode=('enabled' if args.arc else None))
31
32
33if __name__ == '__main__':
34    sys.exit(main(sys.argv[1:]))
35