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

Unified Diff: content/browser/service_worker/service_worker_cache_unittest.cc

Issue 649203005: [ServiceWorkerCache] Put should replace an existing entry to meet spec. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@staticize
Patch Set: Created 6 years, 2 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/browser/service_worker/service_worker_cache.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/service_worker/service_worker_cache_unittest.cc
diff --git a/content/browser/service_worker/service_worker_cache_unittest.cc b/content/browser/service_worker/service_worker_cache_unittest.cc
index b1cd1d93b6b6bb4207a0f154fef1782faef026c1..e7176b24a52c31d8030cb60e5033dd51fadb4faf 100644
--- a/content/browser/service_worker/service_worker_cache_unittest.cc
+++ b/content/browser/service_worker/service_worker_cache_unittest.cc
@@ -328,6 +328,23 @@ TEST_F(ServiceWorkerCacheTest, PutBodyDropBlobRef) {
EXPECT_EQ(ServiceWorkerCache::ErrorTypeOK, callback_error_);
}
+TEST_P(ServiceWorkerCacheTestP, PutReplace) {
+ EXPECT_TRUE(Put(body_request_, body_response_));
+ EXPECT_TRUE(Match(body_request_));
+ EXPECT_STREQ("http://example.com/body.html",
+ callback_response_->url.spec().c_str());
+
+ EXPECT_TRUE(Put(no_body_request_, no_body_response_));
+ EXPECT_TRUE(Match(no_body_request_));
+ EXPECT_STREQ("http://example.com/no_body.html",
+ callback_response_->url.spec().c_str());
+
+ EXPECT_TRUE(Put(body_request_, body_response_));
+ EXPECT_TRUE(Match(body_request_));
+ EXPECT_STREQ("http://example.com/body.html",
+ callback_response_->url.spec().c_str());
falken 2014/10/27 04:09:45 I'm a bit confused how this tests the new behavior
jkarlin 2014/10/27 12:15:28 Done. Thank you for catching this!
+}
+
TEST_P(ServiceWorkerCacheTestP, MatchNoBody) {
EXPECT_TRUE(Put(no_body_request_, no_body_response_));
EXPECT_TRUE(Match(no_body_request_));
« no previous file with comments | « content/browser/service_worker/service_worker_cache.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698