- add sources.
[platform/framework/web/crosswalk.git] / src / tools / telemetry / telemetry / core / backends / chrome / chrome_browser_options.py
1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 from telemetry.core import browser_options
6 from telemetry.core.backends.chrome import cros_interface
7
8
9 def CreateChromeBrowserOptions(br_options):
10   browser_type = br_options.browser_type
11
12   # Unit tests.
13   if not browser_type:
14     return br_options
15
16   if (cros_interface.IsRunningOnCrosDevice() or
17       browser_type.startswith('cros')):
18     return CrosBrowserOptions(br_options)
19
20   return br_options
21
22
23 class ChromeBrowserOptions(browser_options.BrowserOptions):
24   """Chrome-specific browser options."""
25
26   def __init__(self, br_options):
27     super(ChromeBrowserOptions, self).__init__()
28     # Copy to self.
29     self.__dict__.update(br_options.__dict__)
30
31
32 class CrosBrowserOptions(ChromeBrowserOptions):
33   """ChromeOS-specific browser options."""
34
35   def __init__(self, br_options):
36     super(CrosBrowserOptions, self).__init__(br_options)
37     # Create a browser with oobe property.
38     self.create_browser_with_oobe = False
39     self.auto_login = True