Index: chrome/test/functional/chromoting/chromoting_base.py |
=================================================================== |
--- chrome/test/functional/chromoting/chromoting_base.py (revision 0) |
+++ chrome/test/functional/chromoting/chromoting_base.py (revision 0) |
@@ -0,0 +1,55 @@ |
+# Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+# Use of this source code is governed by a BSD-style license that can be |
+# found in the LICENSE file. |
+ |
+"""Common imports, setup, etc for chromoting tests.""" |
+ |
+import os |
+ |
+ |
+def _SetupPaths(): |
+ """Add chrome/test/functional to sys.path for importing pyauto_functional""" |
+ functional_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
+ os.sys.path.append(functional_dir) |
+ |
+_SetupPaths() |
+ |
+ |
+import pyauto_functional # Must come before chromoting and pyauto. |
+import pyauto |
+import chromoting |
Nirnimesh
2012/08/14 22:09:30
can this go before pyauto?
|
+ |
+ |
+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.
|
+ |
+ |
+class ChromotingBase(chromoting.ChromotingMixIn, pyauto.PyUITest): |
+ """Chromoting pyauto test base class. |
+ |
+ 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.
|
+ client_local: True if the client is on the same machines as host |
+ 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.
|
+ client: The chromoting client side |
Nirnimesh
2012/08/14 22:09:30
ditto
yihongg
2012/08/15 17:48:38
Done.
|
+ client_tab_index: The tab index to the chromoting client tab |
+ """ |
+ |
+ def __init__(self, methodName): |
+ pyauto.PyUITest.__init__(self, methodName) |
+ |
+ self.client_local = (self.remote == None) |
+ self.host = self |
+ self.client = self if self.client_local else self.remote |
+ self.client_tab_index = 2 if self.client_local else 1 |
+ |
+ def ExtraChromeFlags(self): |
+ """Add --allow-nacl-socket-api to connect chromoting successfully.""" |
+ extra_chrome_flags = ['--allow-nacl-socket-api=*',] |
+ return pyauto.PyUITest.ExtraChromeFlags(self) + extra_chrome_flags |
+ |
+ def setUp(self): |
Nirnimesh
2012/08/14 22:09:30
remove no-op
yihongg
2012/08/15 17:48:38
Done.
|
+ """Calls PyUITest setup.""" |
+ pyauto.PyUITest.setUp(self) |
+ |
+ 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.
|
+ """Calls PyUITest teardown.""" |
+ pyauto.PyUITest.tearDown(self) |
Property changes on: chrome/test/functional/chromoting/chromoting_base.py |
___________________________________________________________________ |
Added: svn:executable |
+ * |