summaryrefslogtreecommitdiffstats
path: root/webkit/appcache/appcache_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/appcache/appcache_unittest.cc')
-rw-r--r--webkit/appcache/appcache_unittest.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/webkit/appcache/appcache_unittest.cc b/webkit/appcache/appcache_unittest.cc
index bdeaa53..5e1de6b 100644
--- a/webkit/appcache/appcache_unittest.cc
+++ b/webkit/appcache/appcache_unittest.cc
@@ -129,6 +129,8 @@ TEST(AppCacheTest, FindResponseForRequest) {
"http://blah/online_namespace/explicit");
const GURL kFallbackTestUrl1("http://blah/fallback_namespace/1");
const GURL kFallbackTestUrl2("http://blah/fallback_namespace/longer2");
+ const GURL kOnlineNamespaceWithinFallback(
+ "http://blah/fallback_namespace/1/online");
const int64 kFallbackResponseId1 = 1;
const int64 kFallbackResponseId2 = 2;
@@ -138,6 +140,8 @@ TEST(AppCacheTest, FindResponseForRequest) {
Manifest manifest;
manifest.online_whitelist_namespaces.push_back(kOnlineNamespaceUrl);
+ manifest.online_whitelist_namespaces.push_back(
+ kOnlineNamespaceWithinFallback);
manifest.fallback_namespaces.push_back(
FallbackNamespace(kFallbackNamespaceUrl1, kFallbackEntryUrl1));
manifest.fallback_namespaces.push_back(
@@ -232,6 +236,25 @@ TEST(AppCacheTest, FindResponseForRequest) {
EXPECT_EQ(kFallbackEntryUrl2,
cache->GetFallbackEntryUrl(fallback_namespace));
EXPECT_FALSE(network_namespace);
+
+ fallback_entry = AppCacheEntry(); // reset
+
+ found = cache->FindResponseForRequest(kOnlineNamespaceWithinFallback,
+ &entry, &fallback_entry, &fallback_namespace, &network_namespace);
+ EXPECT_TRUE(found);
+ EXPECT_FALSE(entry.has_response_id());
+ EXPECT_FALSE(fallback_entry.has_response_id());
+ EXPECT_TRUE(network_namespace);
+
+ fallback_entry = AppCacheEntry(); // reset
+
+ found = cache->FindResponseForRequest(
+ kOnlineNamespaceWithinFallback.Resolve("online_resource"),
+ &entry, &fallback_entry, &fallback_namespace, &network_namespace);
+ EXPECT_TRUE(found);
+ EXPECT_FALSE(entry.has_response_id());
+ EXPECT_FALSE(fallback_entry.has_response_id());
+ EXPECT_TRUE(network_namespace);
}
} // namespace appacache