4 https://bugzilla.mozilla.org/show_bug.cgi?id=422537
7 <title>Test for bug
422537</title>
8 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
9 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css" />
13 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=422537">Mozilla Bug
422537</a>
15 <div id=
"content" style=
"display: none">
19 <script class=
"testbody" type=
"text/javascript">
21 /** Test for Bug
422537 **/
22 var isupports_string = SpecialPowers.Cc[
"@mozilla.org/supports-string;1"]
23 .createInstance(SpecialPowers.Ci.nsISupportsString);
24 isupports_string.data =
"foo";
26 const url =
"http://mochi.test:8888";
34 var xhr = new XMLHttpRequest();
35 xhr.open(
"POST", url, true);
36 if (i == isupports_string)
37 SpecialPowers.wrap(xhr).send(i);
40 var chan = SpecialPowers.wrap(xhr).channel;
41 if (!SpecialPowers.call_Instanceof(chan, SpecialPowers.Ci.nsIUploadChannel))
42 throw
"Must be an upload channel";
43 var stream = chan.uploadStream;
44 if (!stream || !SpecialPowers.call_Instanceof(stream, SpecialPowers.Ci.nsISeekableStream))
45 throw
"Stream must be seekable";
46 // the following is a no-op, but should not throw an exception
47 stream.seek(SpecialPowers.Ci.nsISeekableStream.NS_SEEK_CUR,
0);
50 ok(true,
"xhr is seekable");