1 # Copyright (c) 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.
5 """Common imports, setup, etc for chromoting tests."""
11 """Add chrome/test/functional to sys.path for importing pyauto_functional"""
12 functional_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
13 os.sys.path.append(functional_dir)
18 import pyauto_functional # Must come before chromoting and pyauto.
19 from pyauto_functional import Main
24 class ChromotingBase(chromotinglib.ChromotingMixIn, pyauto.PyUITest):
25 """Chromoting pyauto test base class.
27 The following member variables can be used in the child classes:
28 client_local: True if the client is on the same machines as host
29 host: The chromoting host side, instance of ChromotingBase
30 client: The chromoting client side, intance of ChromotingBase
31 client_tab_index: The tab index to the chromoting client tab
33 def __init__(self, methodName):
34 pyauto.PyUITest.__init__(self, methodName)
36 self.client_local = (self.remote == None)
38 self.client = self if self.client_local else self.remote
39 self.client_tab_index = 2 if self.client_local else 1
41 def ExtraChromeFlags(self):
42 """Add extra flags for chromoting testing
44 Add --allow-nacl-socket-api to connect chromoting successfully.
45 Add --allow-legacy-extension-manifests so that chrome can load
46 chromoting webapp in v1 format.
48 extra_chrome_flags = [
49 '--allow-nacl-socket-api=*',
50 '--allow-legacy-extension-manifests'
52 return pyauto.PyUITest.ExtraChromeFlags(self) + extra_chrome_flags