Chromium Code Reviews| Index: LayoutTests/http/tests/xmlhttprequest/post-arraybuffer-data-view.html |
| diff --git a/LayoutTests/http/tests/xmlhttprequest/post-arraybuffer-data-view.html b/LayoutTests/http/tests/xmlhttprequest/post-arraybuffer-data-view.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..3aaf3e60503b19aa6abc17d9c36e22815a527ba7 |
| --- /dev/null |
| +++ b/LayoutTests/http/tests/xmlhttprequest/post-arraybuffer-data-view.html |
| @@ -0,0 +1,32 @@ |
| +<html> |
| +<head></head> |
| +<body> |
|
tyoshino (SeeGerritForStatus)
2014/10/29 04:41:07
ok to omit them. instead add DOCTYPE please.
http
Paritosh Kumar
2014/10/29 05:08:24
Done.
|
| + |
| +<script src="/js-test-resources/js-test.js"></script> |
| +<script> |
| +description('Test for ArrayBuffer Post in XMLHttpRequest send'); |
|
tyoshino (SeeGerritForStatus)
2014/10/29 04:41:07
POST
Paritosh Kumar
2014/10/29 05:08:24
Done.
|
| +window.jsTestIsAsync = true; |
| + |
| +new Promise(function(resolve, reject) { |
| + var array = new Uint8Array([0, 1, 2, 25, 45, 58, 255]); |
| + var xhr = new XMLHttpRequest; |
| + xhr.open("POST", "resources/post-echo-as-ascii.cgi", false); |
|
tyoshino (SeeGerritForStatus)
2014/10/29 04:41:07
we're moving toward deprecating sync XHR.
https://
Paritosh Kumar
2014/10/29 05:08:24
Done.
|
| + xhr.onreadystatechange = function() { |
| + debug('xhr.readyState = ' + xhr.readyState + ': responseURL = ' + xhr.responseURL); |
|
tyoshino (SeeGerritForStatus)
2014/10/29 04:41:07
if we switch to async xhr, this can be source of f
Paritosh Kumar
2014/10/29 05:08:24
Yes, this results in failure so shifting it in if-
|
| + if (xhr.readyState === 4) { |
| + resolve(xhr); |
| + } |
| + } |
| + xhr.send(new DataView(array.buffer)); |
| +}).then(function(xhr) { |
| + window.status = xhr.status; |
| + shouldBeEqualToString('status', '200'); |
| + responseText = xhr.responseText; |
| + shouldBeEqualToString('responseText', '0 1 2 25 45 58 255'); |
| +}).catch(function(reason) { |
| + testFailed(String(reason)); |
| +}).then(finishJSTest, finishJSTest); |
| + |
| +</script> |
| +</body> |
| +</html> |