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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/withCredentials-after-send.html

Issue 2496933002: XMLHttpRequest: implement "send() flag" tracking and updating per spec. (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!doctype html>
2 <html>
3 <head>
4 <title>XMLHttpRequest: setting withCredentials while sending data</title>
5 <script src="../resources/testharness.js"></script>
6 <script src="../resources/testharnessreport.js"></script>
7 </head>
8 <body>
9 <script>
10 var testAsync = async_test("Setting withCredentials, post-send() (async)");
11 testAsync.step(() => {
12 var xhr = new XMLHttpRequest();
13 xhr.open("POST", "resources/delay.php?iteration=1&delay=1000");
14 xhr.onloadstart = testAsync.step_func(() => {
15 assert_equals(xhr.readyState, XMLHttpRequest.OPENED);
16 assert_throws('InvalidStateError', () => { xhr.withCredentials = true }) ;
17 });
18 xhr.onloadend = testAsync.step_func(() => {
19 assert_equals(xhr.readyState, XMLHttpRequest.DONE);
20 testAsync.done();
21 });
22 xhr.send();
23 testAsync.done();
yhirano 2016/11/14 06:45:22 Not needed?
sof 2016/11/14 07:47:04 Yes, unintentionally crept in.
24 });
25
26 var testSync = async_test("Setting withCredentials, post-send() (sync)");
27 testSync.step(() => {
28 var xhr = new XMLHttpRequest();
29 xhr.open("POST", "resources/delay.php?iteration=1&delay=1000", false);
30 xhr.onprogress = testSync.step_func(() => {
31 assert_throws('InvalidStateError', () => { xhr.withCredentials = true }) ;
32 });
33 xhr.onloadend = testSync.step_func(() => {
34 assert_equals(xhr.readyState, XMLHttpRequest.DONE);
35 testSync.done();
36 });
37 xhr.send();
38 });
39 </script>
40 </body>
41 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698