Chromium Code Reviews
|
| OLD | NEW |
|---|---|
| (Empty) | |
| 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. | |
| 4 | |
| 5 """Common imports, setup, etc for chromoting tests.""" | |
| 6 | |
| 7 import os | |
| 8 | |
| 9 | |
| 10 def _SetupPaths(): | |
| 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) | |
| 14 | |
| 15 _SetupPaths() | |
| 16 | |
| 17 | |
| 18 import pyauto_functional # Must come before chromoting and pyauto. | |
| 19 import pyauto | |
| 20 import chromoting | |
|
Nirnimesh
2012/08/14 22:09:30
can this go before pyauto?
| |
| 21 | |
| 22 | |
| 23 from pyauto_functional import Main | |
|
Nirnimesh
2012/08/14 22:09:30
move this near import pyauto_functional
yihongg
2012/08/15 17:48:38
Done.
| |
| 24 | |
| 25 | |
| 26 class ChromotingBase(chromoting.ChromotingMixIn, pyauto.PyUITest): | |
| 27 """Chromoting pyauto test base class. | |
| 28 | |
| 29 Instance variable: | |
|
Nirnimesh
2012/08/14 22:09:30
Replace with: The following member vars can be use
yihongg
2012/08/15 17:48:38
Done.
| |
| 30 client_local: True if the client is on the same machines as host | |
| 31 host: The chromoting host side | |
|
Nirnimesh
2012/08/14 22:09:30
append: , and instance of XYZ
yihongg
2012/08/15 17:48:38
Done.
| |
| 32 client: The chromoting client side | |
|
Nirnimesh
2012/08/14 22:09:30
ditto
yihongg
2012/08/15 17:48:38
Done.
| |
| 33 client_tab_index: The tab index to the chromoting client tab | |
| 34 """ | |
| 35 | |
| 36 def __init__(self, methodName): | |
| 37 pyauto.PyUITest.__init__(self, methodName) | |
| 38 | |
| 39 self.client_local = (self.remote == None) | |
| 40 self.host = self | |
| 41 self.client = self if self.client_local else self.remote | |
| 42 self.client_tab_index = 2 if self.client_local else 1 | |
| 43 | |
| 44 def ExtraChromeFlags(self): | |
| 45 """Add --allow-nacl-socket-api to connect chromoting successfully.""" | |
| 46 extra_chrome_flags = ['--allow-nacl-socket-api=*',] | |
| 47 return pyauto.PyUITest.ExtraChromeFlags(self) + extra_chrome_flags | |
| 48 | |
| 49 def setUp(self): | |
|
Nirnimesh
2012/08/14 22:09:30
remove no-op
yihongg
2012/08/15 17:48:38
Done.
| |
| 50 """Calls PyUITest setup.""" | |
| 51 pyauto.PyUITest.setUp(self) | |
| 52 | |
| 53 def tearDown(self): | |
|
Nirnimesh
2012/08/14 22:09:30
remove no-op.
The parent's tearDown() will get cal
yihongg
2012/08/15 17:48:38
Done.
| |
| 54 """Calls PyUITest teardown.""" | |
| 55 pyauto.PyUITest.tearDown(self) | |
| OLD | NEW |