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

Unified Diff: third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp

Issue 2250203003: Sync XHR on Worker should not crash when response arrives immediately (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fetch-data-loader-for-bytes-consumer
Patch Set: Created 4 years, 4 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
Index: third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp
diff --git a/third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp b/third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp
index 668a0045422d59985e70709ccdd6ad402927f4a9..61e33fb8e169fcea1fe307f60ef450877af6cbcf 100644
--- a/third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp
+++ b/third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp
@@ -853,6 +853,26 @@ TEST_P(ThreadableLoaderTest, ClearInDidFailRedirectCheck)
serveRequests();
}
+// This test case checks blink doesn't crash even when the response arrives
+// synchronously.
+TEST_P(ThreadableLoaderTest, GetResponseSynchronously)
+{
+ InSequence s;
+ EXPECT_CALL(checkpoint(), Call(1));
+ createLoader(UseAccessControl);
+ callCheckpoint(1);
+
+ EXPECT_CALL(*client(), didFailAccessControlCheck(_));
+ EXPECT_CALL(checkpoint(), Call(2));
+
+ // Currently didFailAccessControlCheck is dispatched synchronously. This
+ // test is not saying that didFailAccessControlCheck should be dispatched
+ // synchronously, but is saying that even when a response is served
+ // synchronously it should not lead to a crash.
+ startLoader(KURL(KURL(), "about:blank"));
+ callCheckpoint(2);
+}
+
} // namespace
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698