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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/withCredentials-after-send.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/withCredentials-after-send.html b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/withCredentials-after-send.html
new file mode 100644
index 0000000000000000000000000000000000000000..f7bfd989ff49fe9b00a14135466a961cbcf75779
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/withCredentials-after-send.html
@@ -0,0 +1,41 @@
+<!doctype html>
+<html>
+<head>
+<title>XMLHttpRequest: setting withCredentials while sending data</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+</head>
+<body>
+<script>
+var testAsync = async_test("Setting withCredentials, post-send() (async)");
+testAsync.step(() => {
+ var xhr = new XMLHttpRequest();
+ xhr.open("POST", "resources/delay.php?iteration=1&delay=1000");
+ xhr.onloadstart = testAsync.step_func(() => {
+ assert_equals(xhr.readyState, XMLHttpRequest.OPENED);
+ assert_throws('InvalidStateError', () => { xhr.withCredentials = true });
+ });
+ xhr.onloadend = testAsync.step_func(() => {
+ assert_equals(xhr.readyState, XMLHttpRequest.DONE);
+ testAsync.done();
+ });
+ xhr.send();
+ testAsync.done();
yhirano 2016/11/14 06:45:22 Not needed?
sof 2016/11/14 07:47:04 Yes, unintentionally crept in.
+});
+
+var testSync = async_test("Setting withCredentials, post-send() (sync)");
+testSync.step(() => {
+ var xhr = new XMLHttpRequest();
+ xhr.open("POST", "resources/delay.php?iteration=1&delay=1000", false);
+ xhr.onprogress = testSync.step_func(() => {
+ assert_throws('InvalidStateError', () => { xhr.withCredentials = true });
+ });
+ xhr.onloadend = testSync.step_func(() => {
+ assert_equals(xhr.readyState, XMLHttpRequest.DONE);
+ testSync.done();
+ });
+ xhr.send();
+});
+</script>
+</body>
+</html>
« 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