mirror of
https://github.com/servo/servo.git
synced 2025-08-15 10:25:32 +01:00
Update web-platform-tests to revision dc5cbf088edcdb266541d4e5a76149a2c6e716a0
This commit is contained in:
parent
1d40075f03
commit
079092dfea
2381 changed files with 90360 additions and 17722 deletions
|
@ -4,4 +4,4 @@ def main(request, response):
|
|||
srcmoddt = datetime.datetime.fromtimestamp(os.path.getmtime(srcpath))
|
||||
response.headers.set("Last-Modified", srcmoddt.strftime("%a, %d %b %Y %H:%M:%S GMT"))
|
||||
response.headers.set("Content-Type", "application/xml")
|
||||
return open(srcpath).read()
|
||||
return open(srcpath, "r").read()
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
import json
|
||||
|
||||
def main(request, response):
|
||||
|
||||
content = ""
|
||||
if "my-custom-header" in request.GET:
|
||||
val = request.GET.first("my-custom-header")
|
||||
response.headers.set("My-Custom-Header", val)
|
||||
|
||||
return content
|
|
@ -1,12 +1,15 @@
|
|||
import time
|
||||
|
||||
def main(request, response):
|
||||
chunk = "TEST_TRICKLE\n"
|
||||
delay = float(request.GET.first("ms", 500)) / 1E3
|
||||
count = int(request.GET.first("count", 50))
|
||||
if "specifylength" in request.GET:
|
||||
response.headers.set("Content-Length", count * len(chunk))
|
||||
time.sleep(delay)
|
||||
response.headers.set("Content-type", "text/plain")
|
||||
response.write_status_headers()
|
||||
time.sleep(delay);
|
||||
for i in xrange(count):
|
||||
response.writer.write_content("TEST_TRICKLE\n")
|
||||
response.writer.write_content(chunk)
|
||||
time.sleep(delay)
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
(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<events.length; ++i) {
|
||||
xhr.addEventListener(events[i], record_xhr_event);
|
||||
}
|
||||
if ("upload" in xhr) {
|
||||
for(var i=0; i<events.length; ++i) {
|
||||
xhr.upload.addEventListener(events[i], record_xhr_event);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
global.assert_xhr_event_order_matches = function(expected) {
|
||||
try {
|
||||
assert_array_equals(recorded_xhr_events, expected);
|
||||
} catch(e) {
|
||||
e.message += "\nRecorded events were:" + recorded_xhr_events.join(", ");
|
||||
e.message += "\nExpected events were:" + expected.join(", ");
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}(this));
|
Loading…
Add table
Add a link
Reference in a new issue