summaryrefslogtreecommitdiffstats
path: root/webkit/appcache/appcache_unittest.cc
diff options
context:
space:
mode:
authormichaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-19 03:12:12 +0000
committermichaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-19 03:12:12 +0000
commit0b52f1c47868cb6d7b132a15bd7c0a94df08de79 (patch)
tree7ecce97440c40f357f65672305d8597b51775faa /webkit/appcache/appcache_unittest.cc
parentc112093004963fb24639127d4a7ce3b2fdfda508 (diff)
downloadchromium_src-0b52f1c47868cb6d7b132a15bd7c0a94df08de79.zip
chromium_src-0b52f1c47868cb6d7b132a15bd7c0a94df08de79.tar.gz
chromium_src-0b52f1c47868cb6d7b132a15bd7c0a94df08de79.tar.bz2
Alter the relative priorities of network vs fallback namespaces in the appcache. If a resource url is in an appcache's network namespace and fallback namespace, the network namespace wins (with the exception of the special '*' network namespace which does not take priority over the fallback namespace.
BUG=WK49292 TEST=unit test, also a new layout test (not landed yet) Review URL: http://codereview.chromium.org/4807001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66731 0039d316-1c4b-4281-b951-d872f2087c98
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