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    parser.add_argument('-d', '--dont_override_profile', action='store_true',
28                        help='Keep files from previous sessions.')
29    args = parser.parse_args(args)
30
31    # Avoid calling close() on the Chrome object; this keeps the session active.
32    chrome.Chrome(
33        arc_mode=('enabled' if args.arc else None),
34        dont_override_profile=args.dont_override_profile)
35
36
37if __name__ == '__main__':
38    sys.exit(main(sys.argv[1:]))
39