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

Unified Diff: third_party/WebKit/Source/core/fetch/CachingCorrectnessTest.cpp

Issue 1802123002: Unify Resource loading status tracking (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/fetch/CachingCorrectnessTest.cpp
diff --git a/third_party/WebKit/Source/core/fetch/CachingCorrectnessTest.cpp b/third_party/WebKit/Source/core/fetch/CachingCorrectnessTest.cpp
index eda945112f0aba9406a2d62488b91c78ada3d630..2043e24d233d1b1a579c7fc3a783f7cd7ef0d7b1 100644
--- a/third_party/WebKit/Source/core/fetch/CachingCorrectnessTest.cpp
+++ b/third_party/WebKit/Source/core/fetch/CachingCorrectnessTest.cpp
@@ -91,6 +91,7 @@ protected:
return nullptr;
}
resource->setResponse(response);
+ resource->setStatus(Resource::Cached);
hiroshige 2016/03/18 23:21:20 If setStatus(Cached) and finish() at Line 397 etc.
Nate Chapin 2016/03/21 22:04:01 Added finish() call, but leaving setStatus() call
hiroshige 2016/03/22 18:21:33 Oh, OK. Please mention that this is a test-only ha
Nate Chapin 2016/03/22 19:51:23 Done.
memoryCache()->add(resource.get());
return resource;
@@ -103,6 +104,7 @@ protected:
RefPtrWillBeRawPtr<Resource> resource =
Resource::create(request, type);
resource->setResponse(ResourceResponse(KURL(ParsedURLString, kResourceURL), "text/html", 0, nullAtom, String()));
+ resource->setStatus(Resource::Cached);
hiroshige 2016/03/18 23:21:20 ditto.
Nate Chapin 2016/03/21 22:04:01 Done.
memoryCache()->add(resource.get());
return resource;
@@ -392,6 +394,7 @@ TEST_F(CachingCorrectnessTest, FreshWithFreshRedirect)
fresh200Response.setHTTPHeaderField(HTTPNames::Expires, kOneDayAfterOriginalRequest);
firstResource->setResponse(fresh200Response);
+ firstResource->finish();
memoryCache()->add(firstResource.get());
advanceClock(500.);
@@ -426,6 +429,7 @@ TEST_F(CachingCorrectnessTest, FreshWithStaleRedirect)
fresh200Response.setHTTPHeaderField(HTTPNames::Expires, kOneDayAfterOriginalRequest);
firstResource->setResponse(fresh200Response);
+ firstResource->finish();
memoryCache()->add(firstResource.get());
advanceClock(500.);
@@ -439,7 +443,7 @@ TEST_F(CachingCorrectnessTest, PostToSameURLTwice)
ResourceRequest request1(KURL(ParsedURLString, kResourceURL));
request1.setHTTPMethod(HTTPNames::POST);
RefPtrWillBeRawPtr<Resource> resource1 = Resource::create(ResourceRequest(request1.url()), Resource::Raw);
- resource1->setLoading(true);
+ resource1->setStatus(Resource::Pending);
memoryCache()->add(resource1.get());
ResourceRequest request2(KURL(ParsedURLString, kResourceURL));
@@ -478,6 +482,7 @@ TEST_F(CachingCorrectnessTest, 302RedirectNotImplicitlyFresh)
fresh200Response.setHTTPHeaderField(HTTPNames::Expires, kOneDayAfterOriginalRequest);
firstResource->setResponse(fresh200Response);
+ firstResource->finish();
memoryCache()->add(firstResource.get());
advanceClock(500.);
@@ -513,6 +518,7 @@ TEST_F(CachingCorrectnessTest, 302RedirectExplicitlyFreshMaxAge)
fresh200Response.setHTTPHeaderField(HTTPNames::Expires, kOneDayAfterOriginalRequest);
firstResource->setResponse(fresh200Response);
+ firstResource->finish();
memoryCache()->add(firstResource.get());
advanceClock(500.);
@@ -548,6 +554,7 @@ TEST_F(CachingCorrectnessTest, 302RedirectExplicitlyFreshExpires)
fresh200Response.setHTTPHeaderField(HTTPNames::Expires, kOneDayAfterOriginalRequest);
firstResource->setResponse(fresh200Response);
+ firstResource->finish();
memoryCache()->add(firstResource.get());
advanceClock(500.);

Powered by Google App Engine
This is Rietveld 408576698