Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Unified Diff: LayoutTests/http/tests/xmlhttprequest/post-arraybuffer-data-view.html

Issue 684653003: Adding layout test for ArrayBufferView Posting (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: After changing from sync to async. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/http/tests/xmlhttprequest/post-arraybuffer-data-view-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..0f3af0f1f11dff6f7fad4b0d4d7df916a5752f70
--- /dev/null
+++ b/LayoutTests/http/tests/xmlhttprequest/post-arraybuffer-data-view.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+
+<script src="/js-test-resources/js-test.js"></script>
+<script>
+description('Test for ArrayBuffer POST in XMLHttpRequest send');
+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', true);
+ xhr.onreadystatechange = function() {
+ if (xhr.readyState === 4) {
+ debug('xhr.readyState = ' + xhr.readyState + ': responseURL = ' + xhr.responseURL);
+ 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>
« no previous file with comments | « no previous file | LayoutTests/http/tests/xmlhttprequest/post-arraybuffer-data-view-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698