• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2012 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
5from telemetry.core import platform
6
7
8class PossibleBrowser(object):
9  """A browser that can be controlled.
10
11  Call Create() to launch the browser and begin manipulating it..
12  """
13
14  def __init__(self, browser_type, target_os, finder_options):
15    self._browser_type = browser_type
16    self._target_os = target_os
17    self._finder_options = finder_options
18    self._platform = None
19
20  def __repr__(self):
21    return 'PossibleBrowser(browser_type=%s)' % self.browser_type
22
23  @property
24  def browser_type(self):
25    return self._browser_type
26
27  @property
28  def target_os(self):
29    """Target OS, the browser will run on."""
30    return self._target_os
31
32  @property
33  def finder_options(self):
34    return self._finder_options
35
36  @property
37  def platform(self):
38    if not self._platform:
39      self._platform = platform.Platform(self._platform_backend)
40    return self._platform
41
42  def Create(self):
43    raise NotImplementedError()
44
45  def SupportsOptions(self, finder_options):
46    """Tests for extension support."""
47    raise NotImplementedError()
48
49  def last_modification_time(self):
50    return -1
51