| OLD | NEW |
| 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2010 The Chromium OS 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 import logging, os, shutil | 5 import logging, os, shutil |
| 6 import common | 6 import common |
| 7 import constants, httpd, login | 7 import constants, httpd, login |
| 8 | 8 |
| 9 from autotest_lib.client.bin import utils | 9 from autotest_lib.client.bin import utils |
| 10 from autotest_lib.client.common_lib import error | 10 from autotest_lib.client.common_lib import error |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 # tries to connect to the X server before the .Xauthority file has been | 58 # tries to connect to the X server before the .Xauthority file has been |
| 59 # created; see http://crosbug.com/12389. | 59 # created; see http://crosbug.com/12389. |
| 60 utils.poll_for_condition( | 60 utils.poll_for_condition( |
| 61 lambda: os.path.exists(xauth_filename), | 61 lambda: os.path.exists(xauth_filename), |
| 62 utils.TimeoutError('Timed out waiting for %s.' % xauth_filename)) | 62 utils.TimeoutError('Timed out waiting for %s.' % xauth_filename)) |
| 63 | 63 |
| 64 import autox | 64 import autox |
| 65 return autox.AutoX() | 65 return autox.AutoX() |
| 66 | 66 |
| 67 | 67 |
| 68 def stop(): |
| 69 return utils.system("stop ui") |
| 70 |
| 71 |
| 72 def start(): |
| 73 return utils.system("start ui") |
| 74 |
| 75 |
| 68 class ChromeSession(object): | 76 class ChromeSession(object): |
| 69 """ | 77 """ |
| 70 A class to open a tab within the running browser process. | 78 A class to open a tab within the running browser process. |
| 71 """ | 79 """ |
| 72 | 80 |
| 73 def __init__(self, args=''): | 81 def __init__(self, args=''): |
| 74 self.start(args) | 82 self.start(args) |
| 75 | 83 |
| 76 | 84 |
| 77 def start(self, args=''): | 85 def start(self, args=''): |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 entries = http_server.get_form_entries() | 200 entries = http_server.get_form_entries() |
| 193 http_server.stop() | 201 http_server.stop() |
| 194 return entries | 202 return entries |
| 195 | 203 |
| 196 | 204 |
| 197 def get_result(self): | 205 def get_result(self): |
| 198 entries = self.get_entries() | 206 entries = self.get_entries() |
| 199 if not entries: | 207 if not entries: |
| 200 return None | 208 return None |
| 201 return entries.get('result') | 209 return entries.get('result') |
| OLD | NEW |