Bug 680816: Test

This commit is contained in:
Kyle Huey 2011-08-24 12:33:31 -04:00
parent 278b4062fd
commit 7eae96eca2

View File

@ -121,6 +121,17 @@ ab = xhr.response;
ok(ab != null, "should have a non-null arraybuffer");
arraybuffer_equals_to(ab, "hello pass\n");
// test reusing the same XHR (Bug 680816)
xhr.open("GET", 'file_XHR_binary1.bin', false);
xhr.responseType = 'arraybuffer';
xhr.send(null);
is(xhr.status, 200, "wrong status");
ab2 = xhr.response;
ok(ab2 != null, "should have a non-null arraybuffer");
ok(ab2 != ab, "arraybuffer on XHR reuse should be distinct");
arraybuffer_equals_to(ab, "hello pass\n");
arraybuffer_equals_to(ab2, "\xaa\xee\0\x03\xff\xff\xff\xff\xbb\xbb\xbb\xbb");
// with a binary file
xhr = new XMLHttpRequest();
xhr.open("GET", 'file_XHR_binary1.bin', false);