blob: 4a7deec034a3fb8ec036fa56a8861c15594c1b7f [file] [log] [blame]
Hallvord Reiar M. Steen52df3f92013-06-19 11:59:421<!doctype html>
2<html>
3 <head>
4 <title>XMLHttpRequest: send() - non-empty data argument and GET/HEAD - async, no upload events should fire</title>
5 <script src="/resources/testharness.js"></script>
6 <script src="/resources/testharnessreport.js"></script>
Philip Jägenstedtca616262017-10-31 22:57:307 <link rel="help" href="https://xhr.spec.whatwg.org/#the-send()-method" data-tested-assertations="following::OL[1]/LI[3] following::OL[1]/LI[7] following::OL[1]/LI[8]" />
Hallvord Reiar M. Steen52df3f92013-06-19 11:59:428
9 </head>
10 <body>
11 <div id="log"></div>
12 <script>
13 function request(method) {
14 var test = async_test( document.title + " (" + method + ")")
15 var events=[]
16 var logEvt = function (e) {
17 events.push(e.type)
18 }
19 var client = new XMLHttpRequest()
James Graham234a6722013-09-17 17:54:3820 client.open(method, "resources/content.py")
Hallvord Reiar M. Steen52df3f92013-06-19 11:59:4221 client.upload.addEventListener('progress', logEvt)
22 client.upload.addEventListener('loadend', logEvt)
23 client.upload.addEventListener('loadstart', logEvt)
24 client.addEventListener('loadend', function(){
25 test.step(function(){
Thomas Wisniewski38195a42016-08-01 14:14:2126 assert_equals(client.getResponseHeader("x-request-content-length"), "NO")
Hallvord Reiar M. Steen52df3f92013-06-19 11:59:4227 assert_equals(client.getResponseHeader("x-request-method"), method)
28 assert_equals(client.responseText, "")
29 assert_array_equals(events, [])
30 test.done()
Hallvord Reiar M. Steen4e96dac2013-07-03 12:42:1031 })
Hallvord Reiar M. Steen52df3f92013-06-19 11:59:4232 })
33 client.send("TEST")
34 }
35 request("GET")
36 request("HEAD")
37 </script>
38 </body>
39</html>