mirror of
https://github.com/servo/servo.git
synced 2025-08-18 11:55:39 +01:00
Update web-platform-tests to revision 3a8328470d53c4501e31cec2775c4d33821c2275
This commit is contained in:
parent
f92f0809f8
commit
40c0b971f1
32 changed files with 530 additions and 238 deletions
|
@ -22,7 +22,7 @@ from tools.wpt import markdown
|
|||
from tools import localpaths
|
||||
|
||||
logger = None
|
||||
run, write_inconsistent, write_results = None, None, None
|
||||
stability_run, write_inconsistent, write_results = None, None, None
|
||||
wptrunner = None
|
||||
|
||||
def setup_logging():
|
||||
|
@ -37,8 +37,9 @@ def setup_logging():
|
|||
|
||||
|
||||
def do_delayed_imports():
|
||||
global run, write_inconsistent, write_results, wptrunner
|
||||
from tools.wpt.stability import run, write_inconsistent, write_results
|
||||
global stability_run, write_inconsistent, write_results, wptrunner
|
||||
from tools.wpt.stability import run as stability_run
|
||||
from tools.wpt.stability import write_inconsistent, write_results
|
||||
from wptrunner import wptrunner
|
||||
|
||||
|
||||
|
@ -254,12 +255,9 @@ def main():
|
|||
|
||||
|
||||
def run(venv, wpt_args, **kwargs):
|
||||
global logger
|
||||
|
||||
do_delayed_imports()
|
||||
|
||||
retcode = 0
|
||||
parser = get_parser()
|
||||
|
||||
wpt_args = create_parser().parse_args(wpt_args)
|
||||
|
||||
|
@ -335,7 +333,7 @@ def run(venv, wpt_args, **kwargs):
|
|||
|
||||
|
||||
wpt_logger = wptrunner.logger
|
||||
iterations, results, inconsistent = run(venv, wpt_logger, **wpt_kwargs)
|
||||
iterations, results, inconsistent = stability_run(venv, wpt_logger, **wpt_kwargs)
|
||||
|
||||
if results:
|
||||
if inconsistent:
|
||||
|
@ -353,16 +351,17 @@ def run(venv, wpt_args, **kwargs):
|
|||
status="failed" if inconsistent else "passed")
|
||||
else:
|
||||
logger.info("No tests run.")
|
||||
# Be conservative and only return errors when we know for sure tests are changed.
|
||||
if tests_changed:
|
||||
retcode = 3
|
||||
|
||||
return retcode
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
retcode = main()
|
||||
sys.exit(main())
|
||||
except Exception:
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
sys.exit(1)
|
||||
else:
|
||||
sys.exit(retcode)
|
||||
|
|
|
@ -118,7 +118,7 @@ class MarionetteTestharnessProtocolPart(TestharnessProtocolPart):
|
|||
|
||||
def load_runner(self, url_protocol):
|
||||
# Check if we previously had a test window open, and if we did make sure it's closed
|
||||
self.marionette.execute_script("if (window.wrappedJSObject.win) {window.wrappedJSObject.win.close()}")
|
||||
self.marionette.execute_script("if (window.win) {window.win.close()}")
|
||||
url = urlparse.urljoin(self.parent.executor.server_url(url_protocol),
|
||||
"/testharness_runner.html")
|
||||
self.logger.debug("Loading %s" % url)
|
||||
|
@ -519,7 +519,7 @@ class MarionetteTestharnessExecutor(TestharnessExecutor):
|
|||
return (test.result_cls(*data), [])
|
||||
|
||||
def do_testharness(self, protocol, url, timeout):
|
||||
protocol.base.execute_script("if (window.wrappedJSObject.win) {window.wrappedJSObject.win.close()}")
|
||||
protocol.base.execute_script("if (window.win) {window.win.close()}")
|
||||
parent_window = protocol.testharness.close_old_windows(protocol)
|
||||
|
||||
if timeout is not None:
|
||||
|
|
|
@ -1,24 +1,24 @@
|
|||
window.wrappedJSObject.timeout_multiplier = %(timeout_multiplier)d;
|
||||
window.wrappedJSObject.explicit_timeout = %(explicit_timeout)d;
|
||||
window.timeout_multiplier = %(timeout_multiplier)d;
|
||||
window.explicit_timeout = %(explicit_timeout)d;
|
||||
|
||||
window.wrappedJSObject.message_queue = [];
|
||||
window.message_queue = [];
|
||||
|
||||
window.wrappedJSObject.setMessageListener = function(func) {
|
||||
window.wrappedJSObject.current_listener = func;
|
||||
window.wrappedJSObject.addEventListener(
|
||||
window.setMessageListener = function(func) {
|
||||
window.current_listener = func;
|
||||
window.addEventListener(
|
||||
"message",
|
||||
func,
|
||||
false
|
||||
);
|
||||
};
|
||||
|
||||
window.wrappedJSObject.setMessageListener(function(event) {
|
||||
window.wrappedJSObject.message_queue.push(event);
|
||||
window.setMessageListener(function(event) {
|
||||
window.message_queue.push(event);
|
||||
});
|
||||
|
||||
window.wrappedJSObject.win = window.wrappedJSObject.open("%(abs_url)s", "%(window_id)s");
|
||||
window.win = window.open("%(abs_url)s", "%(window_id)s");
|
||||
|
||||
window.wrappedJSObject.timer = setTimeout(function() {
|
||||
window.wrappedJSObject.win.timeout();
|
||||
window.wrappedJSObject.win.close();
|
||||
window.timer = setTimeout(function() {
|
||||
window.win.timeout();
|
||||
window.win.close();
|
||||
}, %(timeout)s);
|
||||
|
|
|
@ -17,12 +17,12 @@ function process_event(event) {
|
|||
status.message,
|
||||
status.stack,
|
||||
subtest_results];
|
||||
clearTimeout(window.wrappedJSObject.timer);
|
||||
clearTimeout(window.timer);
|
||||
break;
|
||||
|
||||
case "action":
|
||||
window.wrappedJSObject.setMessageListener(function(event) {
|
||||
window.wrappedJSObject.message_queue.push(event);
|
||||
window.setMessageListener(function(event) {
|
||||
window.message_queue.push(event);
|
||||
});
|
||||
payload = data;
|
||||
break;
|
||||
|
@ -33,14 +33,14 @@ function process_event(event) {
|
|||
callback(["%(url)s", data.type, payload]);
|
||||
}
|
||||
|
||||
window.wrappedJSObject.removeEventListener("message", window.wrappedJSObject.current_listener);
|
||||
if (window.wrappedJSObject.message_queue.length) {
|
||||
var next = window.wrappedJSObject.message_queue.shift();
|
||||
window.removeEventListener("message", window.current_listener);
|
||||
if (window.message_queue.length) {
|
||||
var next = window.message_queue.shift();
|
||||
process_event(next);
|
||||
} else {
|
||||
window.wrappedJSObject.addEventListener(
|
||||
window.addEventListener(
|
||||
"message", function f(event) {
|
||||
window.wrappedJSObject.removeEventListener("message", f);
|
||||
window.removeEventListener("message", f);
|
||||
process_event(event);
|
||||
}, false);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue