OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """TestEnvironment classes. | 5 """TestEnvironment classes. |
6 | 6 |
7 These classes abstract away the various setups needed to run the WebDriver java | 7 These classes abstract away the various setups needed to run the WebDriver java |
8 tests in various environments. | 8 tests in various environments. |
9 """ | 9 """ |
10 | 10 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 | 91 |
92 # override | 92 # override |
93 def GlobalSetUp(self): | 93 def GlobalSetUp(self): |
94 os.putenv('TEST_HTTP_PORT', str(ANDROID_TEST_HTTP_PORT)) | 94 os.putenv('TEST_HTTP_PORT', str(ANDROID_TEST_HTTP_PORT)) |
95 os.putenv('TEST_HTTPS_PORT', str(ANDROID_TEST_HTTPS_PORT)) | 95 os.putenv('TEST_HTTPS_PORT', str(ANDROID_TEST_HTTPS_PORT)) |
96 self._adb = android_commands.AndroidCommands() | 96 self._adb = android_commands.AndroidCommands() |
97 self._forwarder = forwarder.Forwarder(self._adb, 'Debug') | 97 self._forwarder = forwarder.Forwarder(self._adb, 'Debug') |
98 self._forwarder.Run( | 98 self._forwarder.Run( |
99 [(ANDROID_TEST_HTTP_PORT, ANDROID_TEST_HTTP_PORT), | 99 [(ANDROID_TEST_HTTP_PORT, ANDROID_TEST_HTTP_PORT), |
100 (ANDROID_TEST_HTTPS_PORT, ANDROID_TEST_HTTPS_PORT)], | 100 (ANDROID_TEST_HTTPS_PORT, ANDROID_TEST_HTTPS_PORT)], |
101 valgrind_tools.BaseTool(), '127.0.0.1') | 101 valgrind_tools.BaseTool()) |
102 | 102 |
103 # override | 103 # override |
104 def GlobalTearDown(self): | 104 def GlobalTearDown(self): |
105 if self._adb is not None: | 105 if self._adb is not None: |
106 forwarder.Forwarder.KillDevice(self._adb, valgrind_tools.BaseTool()) | 106 forwarder.Forwarder.KillDevice(self._adb, valgrind_tools.BaseTool()) |
107 if self._forwarder is not None: | 107 if self._forwarder is not None: |
108 self._forwarder.Close() | 108 self._forwarder.Close() |
109 | 109 |
110 # override | 110 # override |
111 def GetOS(self): | 111 def GetOS(self): |
112 return 'android' | 112 return 'android' |
OLD | NEW |