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

Unified Diff: content/child/web_url_loader_impl_unittest.cc

Issue 1910343006: Enable setting deferral state on ResourceDispatcher at request start (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 8 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 | « content/child/web_url_loader_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/web_url_loader_impl_unittest.cc
diff --git a/content/child/web_url_loader_impl_unittest.cc b/content/child/web_url_loader_impl_unittest.cc
index 531ee5124c0a57f7e29cfff43925534af108c94c..ac54c49a11b23248e8e4137301446f528d768966 100644
--- a/content/child/web_url_loader_impl_unittest.cc
+++ b/content/child/web_url_loader_impl_unittest.cc
@@ -59,7 +59,8 @@ class TestResourceDispatcher : public ResourceDispatcher {
public:
TestResourceDispatcher() :
ResourceDispatcher(nullptr, nullptr),
- canceled_(false) {
+ canceled_(false),
+ defers_loading_(false) {
}
~TestResourceDispatcher() override {}
@@ -88,9 +89,15 @@ class TestResourceDispatcher : public ResourceDispatcher {
const GURL& url() { return url_; }
const GURL& stream_url() { return stream_url_; }
+ void SetDefersLoading(int request_id, bool value) override {
+ defers_loading_ = value;
+ }
+ bool defers_loading() const { return defers_loading_; }
+
private:
std::unique_ptr<RequestPeer> peer_;
bool canceled_;
+ bool defers_loading_;
GURL url_;
GURL stream_url_;
@@ -500,6 +507,13 @@ TEST_F(WebURLLoaderImplTest, DataURLDefersLoading) {
EXPECT_EQ("", client()->error().domain.utf8());
}
+TEST_F(WebURLLoaderImplTest, DefersLoadingBeforeStart) {
+ client()->loader()->setDefersLoading(true);
+ EXPECT_FALSE(dispatcher()->defers_loading());
+ DoStartAsyncRequest();
+ EXPECT_TRUE(dispatcher()->defers_loading());
+}
+
// FTP integration tests. These are focused more on safe deletion than correct
// parsing of FTP responses.
« no previous file with comments | « content/child/web_url_loader_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698