diff --git a/tools/wptrunner/wptrunner/browsers/servodriver.py b/tools/wptrunner/wptrunner/browsers/servodriver.py index d6b5bfb354017d..17b6347f41f695 100644 --- a/tools/wptrunner/wptrunner/browsers/servodriver.py +++ b/tools/wptrunner/wptrunner/browsers/servodriver.py @@ -9,11 +9,8 @@ from tools.serve.serve import make_hosts_file from .base import (WebDriverBrowser, - ExecutorBrowser, - OutputHandler, require_arg, - get_free_port, - browser_command) + get_free_port) from .base import get_timeout_multiplier # noqa: F401 from ..executors import executor_kwargs as base_executor_kwargs from ..executors.executorservodriver import (ServoWebDriverTestharnessExecutor, # noqa: F401 @@ -64,8 +61,7 @@ def env_extras(**kwargs): def env_options(): return {"server_host": "127.0.0.1", - "testharnessreport": "testharnessreport-servodriver.js", - "supports_debugger": True} + "supports_debugger": False} def update_properties(): diff --git a/tools/wptrunner/wptrunner/executors/executorservodriver.py b/tools/wptrunner/wptrunner/executors/executorservodriver.py index 672686ccde5bc8..999d73f0a7b35e 100644 --- a/tools/wptrunner/wptrunner/executors/executorservodriver.py +++ b/tools/wptrunner/wptrunner/executors/executorservodriver.py @@ -5,15 +5,7 @@ import socket import traceback -from .base import (Protocol, - RefTestExecutor, - RefTestImplementation, - TestharnessExecutor, - TimedRunner, - strip_server) from .executorwebdriver import WebDriverProtocol, WebDriverTestharnessExecutor, WebDriverRefTestExecutor -from .protocol import BaseProtocolPart -from ..environment import wait_for_service webdriver = None ServoCommandExtensions = None @@ -65,7 +57,7 @@ def parse_pref_value(value): return value -class ServoWebDriverProtocol2(WebDriverProtocol): +class ServoWebDriverProtocol(WebDriverProtocol): def __init__(self, executor, browser, capabilities, **kwargs): do_delayed_imports() WebDriverProtocol.__init__(self, executor, browser, capabilities, **kwargs) @@ -83,13 +75,15 @@ def connect(self): class ServoWebDriverTestharnessExecutor(WebDriverTestharnessExecutor): supports_testdriver = True - protocol_cls = ServoWebDriverProtocol2 + protocol_cls = ServoWebDriverProtocol def __init__(self, logger, browser, server_config, timeout_multiplier=1, - close_after_done=True, capabilities=None, debug_info=None, + close_after_done=True, capabilities={}, debug_info=None, **kwargs): - WebDriverTestharnessExecutor.__init__(self, logger, browser, server_config, timeout_multiplier=1, - debug_info=debug_info, capabilities={}) + WebDriverTestharnessExecutor.__init__(self, logger, browser, server_config, + timeout_multiplier, capabilities=capabilities, + debug_info=debug_info, close_after_done=close_after_done, + cleanup_after_test=False) def on_environment_change(self, new_environment): self.protocol.webdriver.extension.change_prefs( @@ -99,7 +93,7 @@ def on_environment_change(self, new_environment): class ServoWebDriverRefTestExecutor(WebDriverRefTestExecutor): - protocol_cls = ServoWebDriverProtocol2 + protocol_cls = ServoWebDriverProtocol def __init__(self, logger, browser, server_config, timeout_multiplier=1, screenshot_cache=None, capabilities={}, debug_info=None, diff --git a/tools/wptrunner/wptrunner/testharnessreport-servodriver.js b/tools/wptrunner/wptrunner/testharnessreport-servodriver.js deleted file mode 100644 index 7abb24bb78ed85..00000000000000 --- a/tools/wptrunner/wptrunner/testharnessreport-servodriver.js +++ /dev/null @@ -1,88 +0,0 @@ -class MessageQueue { - constructor() { - this.item_id = 0; - this._queue = []; - } - - push(item) { - let cmd_id = this.item_id++; - item.id = cmd_id; - this._queue.push(item); - __wptrunner_process_next_event(); - return cmd_id; - } - - shift() { - return this._queue.shift(); - } -} - -window.__wptrunner_testdriver_callback = null; -window.__wptrunner_message_queue = new MessageQueue(); -window.__wptrunner_url = null; - -window.__wptrunner_process_next_event = function() { - /* This function handles the next testdriver event. The presence of - window.testdriver_callback is used as a switch; when that function - is present we are able to handle the next event and when is is not - present we must wait. Therefore to drive the event processing, this - function must be called in two circumstances: - * Every time there is a new event that we may be able to handle - * Every time we set the callback function - This function unsets the callback, so no further testdriver actions - will be run until it is reset, which wptrunner does after it has - completed handling the current action. - */ - - if (!window.__wptrunner_testdriver_callback) { - return; - } - var data = window.__wptrunner_message_queue.shift(); - if (!data) { - return; - } - - var payload = undefined; - - switch(data.type) { - case "complete": - var tests = data.tests; - var status = data.status; - - var subtest_results = tests.map(function(x) { - return [x.name, x.status, x.message, x.stack]; - }); - payload = [status.status, - status.message, - status.stack, - subtest_results]; - - clearTimeout(window.__wptrunner_timer); - break; - case "action": - payload = data; - break; - default: - return; - } - var callback = window.__wptrunner_testdriver_callback; - window.__wptrunner_testdriver_callback = null; - callback([__wptrunner_url, data.type, payload]); -}; - -(function() { - var props = {output: %(output)d, - timeout_multiplier: %(timeout_multiplier)s, - explicit_timeout: %(explicit_timeout)s, - debug: %(debug)s, - message_events: ["completion"]}; - - add_completion_callback(function(tests, harness_status) { - __wptrunner_message_queue.push({ - "type": "complete", - "tests": tests, - "status": harness_status}); - __wptrunner_process_next_event(); - }); - setup(props); -})();