gecko-dev/testing/web-platform/tests/XMLHttpRequest/getallresponseheaders-statu...

39 строки
1.3 KiB
HTML
Исходник Обычный вид История

<!DOCTYPE html>
<html>
<head>
<title>XMLHttpRequest: getAllResponseHeaders() excludes status</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Bug 1097230 - Update web-platform-tests to revision 9840b559b10e05f659932a835c11832db9e01c42, a=testonly --HG-- rename : testing/web-platform/meta/websockets/interfaces/WebSocket/events/011.html.ini => testing/web-platform/meta/IndexedDB/idbcursor_update_index5.htm.ini rename : testing/web-platform/meta/websockets/interfaces/WebSocket/events/011.html.ini => testing/web-platform/meta/IndexedDB/idbindex_get7.htm.ini rename : testing/web-platform/meta/websockets/interfaces/WebSocket/events/011.html.ini => testing/web-platform/meta/IndexedDB/idbindex_openCursor2.htm.ini rename : testing/web-platform/meta/websockets/interfaces/WebSocket/events/011.html.ini => testing/web-platform/meta/IndexedDB/idbindex_openKeyCursor3.htm.ini rename : testing/web-platform/moz.build => testing/web-platform/mozilla/tests/placeholder rename : testing/web-platform/moz.build => testing/web-platform/outbound/tests/placeholder rename : testing/web-platform/tests/dom/nodes/Document-createProcessingInstruction-literal-1.xhtml => testing/web-platform/tests/dom/nodes/ProcessingInstruction-literal-1.xhtml rename : testing/web-platform/tests/dom/nodes/Document-createProcessingInstruction-literal-2.xhtml => testing/web-platform/tests/dom/nodes/ProcessingInstruction-literal-2.xhtml rename : testing/web-platform/tests/pointerevents/pointerevent_lostpointercapture_for_disconnected_node.html => testing/web-platform/tests/pointerevents/pointerevent_lostpointercapture_for_disconnected_node-manual.html rename : testing/web-platform/tests/pointerevents/pointerevent_pointerleave_after_pointercancel_touch.html => testing/web-platform/tests/pointerevents/pointerevent_pointerleave_after_pointercancel_touch-manual.html rename : testing/web-platform/tests/pointerevents/pointerevent_pointerleave_after_pointerup_nohover.html => testing/web-platform/tests/pointerevents/pointerevent_pointerleave_after_pointerup_nohover-manual.html rename : testing/web-platform/tests/pointerevents/pointerevent_pointerout_after_pointercancel_touch.html => testing/web-platform/tests/pointerevents/pointerevent_pointerout_after_pointercancel_touch-manual.html rename : testing/web-platform/tests/pointerevents/pointerevent_pointerout_after_pointerup_nohover.html => testing/web-platform/tests/pointerevents/pointerevent_pointerout_after_pointerup_nohover-manual.html rename : testing/web-platform/tests/pointerevents/pointerevent_pointerout_pen.html => testing/web-platform/tests/pointerevents/pointerevent_pointerout_pen-manual.html rename : testing/web-platform/tests/pointerevents/pointerevent_setpointercapture_disconnected.html => testing/web-platform/tests/pointerevents/pointerevent_setpointercapture_disconnected-manual.html rename : testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/second-argument-null.html => testing/web-platform/tests/workers/interfaces/DedicatedWorkerGlobalScope/postMessage/second-argument-undefined.html extra : rebase_source : 1fb6206eb45537037d28bebf5bc9de02791c4a17
2014-11-20 19:30:01 +03:00
<link rel="help" href="https://xhr.spec.whatwg.org/#dom-xmlhttprequest-getallresponseheaders" data-tested-assertations="/following::OL[1]/LI[1] /following::OL[1]/LI[3]" />
</head>
<body>
<div id="log"></div>
<script>
var test = async_test()
test.step(function() {
var client = new XMLHttpRequest()
Bug 1183628 - Update web-platform-tests to revision 593fd27931d7e9d573d2796fe10df9fff778d56f, a=testonly --HG-- rename : testing/web-platform/tests/FileAPI/progress.html => testing/web-platform/tests/FileAPI/progress-manual.html rename : testing/web-platform/tests/html/semantics/scripting-1/the-template-element/testcommon.js => testing/web-platform/tests/html/resources/common.js rename : testing/web-platform/tests/webstorage/iframe/event_body_handler.html => testing/web-platform/tests/webstorage/resources/event_body_handler.html rename : testing/web-platform/tests/webstorage/iframe/event_setattribute_handler.html => testing/web-platform/tests/webstorage/resources/event_setattribute_handler.html rename : testing/web-platform/tests/webstorage/iframe/local_change_item_iframe.html => testing/web-platform/tests/webstorage/resources/local_change_item_iframe.html rename : testing/web-platform/tests/webstorage/iframe/local_set_item_clear_iframe.html => testing/web-platform/tests/webstorage/resources/local_set_item_clear_iframe.html rename : testing/web-platform/tests/webstorage/iframe/local_set_item_iframe.html => testing/web-platform/tests/webstorage/resources/local_set_item_iframe.html rename : testing/web-platform/tests/webstorage/iframe/local_set_item_remove_iframe.html => testing/web-platform/tests/webstorage/resources/local_set_item_remove_iframe.html rename : testing/web-platform/tests/webstorage/iframe/session_change_item_iframe.html => testing/web-platform/tests/webstorage/resources/session_change_item_iframe.html rename : testing/web-platform/tests/webstorage/iframe/session_set_item_clear_iframe.html => testing/web-platform/tests/webstorage/resources/session_set_item_clear_iframe.html rename : testing/web-platform/tests/webstorage/iframe/session_set_item_iframe.html => testing/web-platform/tests/webstorage/resources/session_set_item_iframe.html rename : testing/web-platform/tests/webstorage/iframe/session_set_item_remove_iframe.html => testing/web-platform/tests/webstorage/resources/session_set_item_remove_iframe.html
2015-07-10 12:26:29 +03:00
var headersUnsent = client.getAllResponseHeaders();
test.step(function() {
assert_equals(headersUnsent, "")
});
client.onreadystatechange = function() {
test.step(function() {
var headers = client.getAllResponseHeaders().toLowerCase()
if(client.readyState == 1) {
assert_equals(headers, "")
}
if(client.readyState > 1) {
assert_false(headers.indexOf("200 ok") != -1)
assert_false(headers.indexOf("http/1.") != -1)
}
if(client.readyState == 4)
test.done()
})
}
client.open("GET", "resources/headers.py")
client.send(null)
})
</script>
</body>
</html>