Modified: trunk/LayoutTests/ChangeLog (175510 => 175511)
--- trunk/LayoutTests/ChangeLog 2014-11-04 04:13:28 UTC (rev 175510)
+++ trunk/LayoutTests/ChangeLog 2014-11-04 04:57:10 UTC (rev 175511)
@@ -1,3 +1,15 @@
+2014-11-03 Shivakumar JM <shiva...@samsung.com>
+
+ Adding test for array buffer and data view POST in XMLHttpRequest async send.
+ https://bugs.webkit.org/show_bug.cgi?id=138304
+
+ Reviewed by Alexey Proskuryakov.
+
+ Adding test for array buffer and data view
+
+ * http/tests/xmlhttprequest/send-data-view-async-expected.txt: Added.
+ * http/tests/xmlhttprequest/send-data-view-async.html: Added.
+
2014-11-03 Chris Dumez <cdu...@apple.com>
Fix jquery/manipulation.html flakiness on debug builds
Added: trunk/LayoutTests/http/tests/xmlhttprequest/send-data-view-async-expected.txt (0 => 175511)
--- trunk/LayoutTests/http/tests/xmlhttprequest/send-data-view-async-expected.txt (rev 0)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/send-data-view-async-expected.txt 2014-11-04 04:57:10 UTC (rev 175511)
@@ -0,0 +1,15 @@
+Test for array buffer and data view POST in XMLHttpRequest async send.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+req.readyState = 4: responseURL = http://127.0.0.1:8000/xmlhttprequest/resources/post-echo-as-ascii.cgi
+PASS status is "200"
+PASS responseText is "0 1 2 48 49 50 128 129 130 253 254 255"
+req.readyState = 4: responseURL = http://127.0.0.1:8000/xmlhttprequest/resources/post-echo-as-ascii.cgi
+PASS status is "200"
+PASS responseText is "0 1 2 48 49 50 128 129 130 253 254 255"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/http/tests/xmlhttprequest/send-data-view-async.html (0 => 175511)
--- trunk/LayoutTests/http/tests/xmlhttprequest/send-data-view-async.html (rev 0)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/send-data-view-async.html 2014-11-04 04:57:10 UTC (rev 175511)
@@ -0,0 +1,50 @@
+<html>
+<head></head>
+<body>
+<script src=""
+<script>
+
+description('Test for array buffer and data view POST in XMLHttpRequest async send.');
+
+window.jsTestIsAsync = true;
+
+function runTest(type) {
+ return new Promise(function(resolve, reject) {
+ var req = new XMLHttpRequest();
+ req.open('POST', 'resources/post-echo-as-ascii.cgi', true);
+ req._onreadystatechange_ = function() {
+ if (req.readyState == req.DONE) {
+ debug('req.readyState = ' + req.readyState + ': responseURL = ' + req.responseURL);
+ resolve(req);
+ }
+ }
+
+ if (type == 'dataView') {
+ var array = new Uint8Array([0, 1, 2, 48, 49, 50, 128, 129, 130, 253, 254, 255]);
+ req.send(new DataView(array.buffer));
+ } else {
+ var array = new Uint8Array([0, 1, 2, 48, 49, 50, 128, 129, 130, 253, 254, 255]);
+ req.send(array);
+ }
+ });
+}
+
+runTest('dataView').then(function(req) {
+ window.status = req.status;
+ shouldBeEqualToString('status', '200');
+ responseText = req.responseText;
+ shouldBeEqualToString('responseText', '0 1 2 48 49 50 128 129 130 253 254 255');
+
+ return runTest('bufferView');
+}).then(function(req) {
+ window.status = req.status;
+ shouldBeEqualToString('status', '200');
+ responseText = req.responseText;
+ shouldBeEqualToString('responseText', '0 1 2 48 49 50 128 129 130 253 254 255');
+}).catch(function(reason) {
+ testFailed(String(reason));
+}).then(finishJSTest, finishJSTest);
+
+</script>
+</body>
+</html>