diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /testing/web-platform/tests/XMLHttpRequest/send-blob-with-no-mime-type.html | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/web-platform/tests/XMLHttpRequest/send-blob-with-no-mime-type.html')
-rw-r--r-- | testing/web-platform/tests/XMLHttpRequest/send-blob-with-no-mime-type.html | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/testing/web-platform/tests/XMLHttpRequest/send-blob-with-no-mime-type.html b/testing/web-platform/tests/XMLHttpRequest/send-blob-with-no-mime-type.html new file mode 100644 index 000000000..98fef6592 --- /dev/null +++ b/testing/web-platform/tests/XMLHttpRequest/send-blob-with-no-mime-type.html @@ -0,0 +1,51 @@ +<!DOCTYPE html> +<html> +<head> + <link rel="help" href="https://xhr.spec.whatwg.org/#the-send()-method" data-tested-assertations="following::ol[1]/li[4] following::ol[1]/li[4]/dl[1]/dd[2]/p[3]"/> + <link rel="help" href="https://xhr.spec.whatwg.org/#the-status-attribute" data-tested-assertations="following::ol[1]/li[3]"/> + <link rel="help" href="https://xhr.spec.whatwg.org/#the-responsetype-attribute" data-tested-assertations="following::ol[1]/li[4]"/> + <link rel="help" href="https://xhr.spec.whatwg.org/#the-response-attribute" data-tested-assertations="following::a[contains(@href,'#blob-response-entity-body')]/.."/> + + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <title>XMLHttpRequest: The send() method: Blob data with no mime type</title> +</head> + +<body> + <div id="log"></div> + + <script type="text/javascript"> + var blobTests = [ + ["no mime type", new Blob(["data"])], + ["invalid mime type", new Blob(["data"], {type: "Invalid \r\n mime \r\n type"})] + ]; + + blobTests.forEach(function(item){ + test(function() { + var xhr = new XMLHttpRequest(); + xhr.open("POST", "./resources/content.py", false); + xhr.send(item[1]); + + assert_equals(xhr.getResponseHeader("X-Request-Content-Length"), "4"); + assert_equals(xhr.getResponseHeader("X-Request-Content-Type"), "NO"); + }, "Synchronous blob loading with " + item[0]); + + var atest = async_test("Asynchronous blob loading with " + item[0]); + atest.step(function() { + var xhr = new XMLHttpRequest(); + xhr.onreadystatechange = function() { + if (xhr.readyState == 4) { + atest.step(function() { + assert_equals(xhr.getResponseHeader("X-Request-Content-Length"), "4"); + assert_equals(xhr.getResponseHeader("X-Request-Content-Type"), "NO"); + }); + atest.done(); + } + } + xhr.open("POST", "./resources/content.py", true); + xhr.send(item[1]); + }); + }); + </script> +</body> +</html> |