summaryrefslogtreecommitdiffstats
path: root/webkit/appcache/appcache_storage_unittest.cc
diff options
context:
space:
mode:
authormichaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-13 01:45:09 +0000
committermichaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-13 01:45:09 +0000
commitd144b0590e00629570c3f729b1d0baf048dc1d45 (patch)
treed25a1d6c65206140be31495625fb2895f7cebaf0 /webkit/appcache/appcache_storage_unittest.cc
parentfd9c35f41bcab4966a5db8d24de812b1e9f87967 (diff)
downloadchromium_src-d144b0590e00629570c3f729b1d0baf048dc1d45.zip
chromium_src-d144b0590e00629570c3f729b1d0baf048dc1d45.tar.gz
chromium_src-d144b0590e00629570c3f729b1d0baf048dc1d45.tar.bz2
Add some unimplemented methods from my last CL.
TEST=yes, appcache_storage_unittest.cc BUG=none Review URL: http://codereview.chromium.org/266042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28772 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/appcache_storage_unittest.cc')
-rw-r--r--webkit/appcache/appcache_storage_unittest.cc30
1 files changed, 30 insertions, 0 deletions
diff --git a/webkit/appcache/appcache_storage_unittest.cc b/webkit/appcache/appcache_storage_unittest.cc
index f5f9e06..6e06265 100644
--- a/webkit/appcache/appcache_storage_unittest.cc
+++ b/webkit/appcache/appcache_storage_unittest.cc
@@ -6,6 +6,7 @@
#include "webkit/appcache/appcache.h"
#include "webkit/appcache/appcache_group.h"
#include "webkit/appcache/appcache_storage.h"
+#include "webkit/appcache/appcache_response.h"
#include "webkit/appcache/mock_appcache_service.h"
namespace appcache {
@@ -16,8 +17,14 @@ class AppCacheStorageTest : public testing::Test {
TEST(AppCacheStorageTest, AddRemoveCache) {
MockAppCacheService service;
scoped_refptr<AppCache> cache = new AppCache(&service, 111);
+
+ EXPECT_EQ(cache.get(),
+ service.storage()->working_set()->GetCache(111));
+
service.storage()->working_set()->RemoveCache(cache);
+ EXPECT_TRUE(!service.storage()->working_set()->GetCache(111));
+
// Removing non-existing cache from service should not fail.
MockAppCacheService dummy;
dummy.storage()->working_set()->RemoveCache(cache);
@@ -27,11 +34,34 @@ TEST(AppCacheStorageTest, AddRemoveGroup) {
MockAppCacheService service;
scoped_refptr<AppCacheGroup> group =
new AppCacheGroup(&service, GURL::EmptyGURL());
+
+ EXPECT_EQ(group.get(),
+ service.storage()->working_set()->GetGroup(GURL::EmptyGURL()));
+
service.storage()->working_set()->RemoveGroup(group);
+ EXPECT_TRUE(!service.storage()->working_set()->GetGroup(GURL::EmptyGURL()));
+
// Removing non-existing group from service should not fail.
MockAppCacheService dummy;
dummy.storage()->working_set()->RemoveGroup(group);
}
+TEST(AppCacheStorageTest, AddRemoveResponseInfo) {
+ MockAppCacheService service;
+ scoped_refptr<AppCacheResponseInfo> info =
+ new AppCacheResponseInfo(&service, 111, new net::HttpResponseInfo);
+
+ EXPECT_EQ(info.get(),
+ service.storage()->working_set()->GetResponseInfo(111));
+
+ service.storage()->working_set()->RemoveResponseInfo(info);
+
+ EXPECT_TRUE(!service.storage()->working_set()->GetResponseInfo(111));
+
+ // Removing non-existing info from service should not fail.
+ MockAppCacheService dummy;
+ dummy.storage()->working_set()->RemoveResponseInfo(info);
+}
+
} // namespace appcache