From 0b6210cd37b68b94252cb798598b12974a20e1c1 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 21 May 2024 22:56:19 +0200 Subject: Adding upstream version 5.28.2+dfsg1+~cs23.11.12.3. Signed-off-by: Daniel Baumann --- .../xhr/resources/xmlhttprequest-event-order.js | 83 ++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 test/wpt/tests/xhr/resources/xmlhttprequest-event-order.js (limited to 'test/wpt/tests/xhr/resources/xmlhttprequest-event-order.js') diff --git a/test/wpt/tests/xhr/resources/xmlhttprequest-event-order.js b/test/wpt/tests/xhr/resources/xmlhttprequest-event-order.js new file mode 100644 index 0000000..b6bb6cd --- /dev/null +++ b/test/wpt/tests/xhr/resources/xmlhttprequest-event-order.js @@ -0,0 +1,83 @@ +(function(global) { + var recorded_xhr_events = []; + + function record_xhr_event(e) { + var prefix = e.target instanceof XMLHttpRequestUpload ? "upload." : ""; + recorded_xhr_events.push((prefix || "") + e.type + "(" + e.loaded + "," + e.total + "," + e.lengthComputable + ")"); + } + + global.prepare_xhr_for_event_order_test = function(xhr) { + xhr.addEventListener("readystatechange", function(e) { + recorded_xhr_events.push(xhr.readyState); + }); + var events = ["loadstart", "progress", "abort", "timeout", "error", "load", "loadend"]; + for(var i=0; i