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.internal.app import possible_app 6 7 8class PossibleBrowser(possible_app.PossibleApp): 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, supports_tab_control): 15 super(PossibleBrowser, self).__init__(app_type=browser_type, 16 target_os=target_os) 17 self._supports_tab_control = supports_tab_control 18 self._credentials_path = None 19 20 def __repr__(self): 21 return 'PossibleBrowser(app_type=%s)' % self.app_type 22 23 @property 24 def browser_type(self): 25 return self.app_type 26 27 @property 28 def supports_tab_control(self): 29 return self._supports_tab_control 30 31 def _InitPlatformIfNeeded(self): 32 raise NotImplementedError() 33 34 def Create(self, finder_options): 35 raise NotImplementedError() 36 37 def SupportsOptions(self, finder_options): 38 """Tests for extension support.""" 39 raise NotImplementedError() 40 41 def IsRemote(self): 42 return False 43 44 def RunRemote(self): 45 pass 46 47 def UpdateExecutableIfNeeded(self): 48 pass 49 50 def last_modification_time(self): 51 return -1 52 53 def SetCredentialsPath(self, credentials_path): 54 self._credentials_path = credentials_path 55