blob: f8e031d7380049631536806b197f5c16ec278a64 [file] [log] [blame]
# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
from autotest_lib.client.bin import test, utils
from autotest_lib.client.common_lib import error
from autotest_lib.client.cros import cros_ui, cros_ui_test, httpd
class desktopui_ChromeSemiAuto(cros_ui_test.UITest):
version = 1
def initialize(self, creds='$default'):
self._test_url = 'http://localhost:8000/interaction.html'
# TODO(seano): Use ephemeral port.
self._testServer = httpd.HTTPListener(8000, docroot=self.bindir)
super(desktopui_ChromeSemiAuto, self).initialize(creds)
def cleanup(self):
super(desktopui_ChromeSemiAuto, self).cleanup()
def run_once(self, timeout=60):
latch = self._testServer.add_wait_url('/interaction/test')
# Temporarily increment pyauto timeout
pyauto_timeout_changer = self.pyauto.ActionTimeoutChanger(
self.pyauto, timeout * 1000)
del pyauto_timeout_changer
if not latch.is_set():
raise error.TestFail('Timeout.')
result = self._testServer.get_form_entries()['result']'result = ' + result)
if result != 'pass':
raise error.TestFail('User indicated test failure.')