summaryrefslogtreecommitdiffstats
path: root/webkit/appcache/appcache_request_handler_unittest.cc
diff options
context:
space:
mode:
authormichaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-15 20:56:47 +0000
committermichaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-15 20:56:47 +0000
commitea2a7b919337fb796c8602f1701b60d8fa2d7f42 (patch)
tree61ab4cb64a4aa0c64e94a5280a7d7f4e35062855 /webkit/appcache/appcache_request_handler_unittest.cc
parentc468f9498bcb426edb87cb803a03a63e793e8222 (diff)
downloadchromium_src-ea2a7b919337fb796c8602f1701b60d8fa2d7f42.zip
chromium_src-ea2a7b919337fb796c8602f1701b60d8fa2d7f42.tar.gz
chromium_src-ea2a7b919337fb796c8602f1701b60d8fa2d7f42.tar.bz2
Select a more appropiate appcache based on the opener or the parent or the target frame of the new document. The change determines a 'preferred manifest url' in these cases:
* <iframe> loading, we prefer the parent frame's manifest url * window.open() loading, we prefer the opener frame's manifest url * href clicking to navigate a frame in place, we prefer the manifest url of the document in the frame when the navigation starts BUG=68479 Review URL: http://codereview.chromium.org/6727006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81801 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/appcache_request_handler_unittest.cc')
-rw-r--r--webkit/appcache/appcache_request_handler_unittest.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/webkit/appcache/appcache_request_handler_unittest.cc b/webkit/appcache/appcache_request_handler_unittest.cc
index 0c41b00..c9fbe0e 100644
--- a/webkit/appcache/appcache_request_handler_unittest.cc
+++ b/webkit/appcache/appcache_request_handler_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -223,6 +223,8 @@ class AppCacheRequestHandlerTest : public testing::Test {
fallback_job = handler_->MaybeLoadFallbackForResponse(request_.get());
EXPECT_FALSE(fallback_job);
+ EXPECT_TRUE(host_->preferred_manifest_url().is_empty());
+
TestFinished();
}
@@ -264,6 +266,9 @@ class AppCacheRequestHandlerTest : public testing::Test {
fallback_job = handler_->MaybeLoadFallbackForResponse(request_.get());
EXPECT_FALSE(fallback_job);
+ EXPECT_EQ(GURL("http://blah/manifest/"),
+ host_->preferred_manifest_url());
+
TestFinished();
}
@@ -317,6 +322,9 @@ class AppCacheRequestHandlerTest : public testing::Test {
EXPECT_TRUE(host_->main_resource_was_fallback_);
EXPECT_EQ(GURL("http://blah/fallbackurl"), host_->fallback_url_);
+ EXPECT_EQ(GURL("http://blah/manifest/"),
+ host_->preferred_manifest_url());
+
TestFinished();
}
@@ -366,6 +374,7 @@ class AppCacheRequestHandlerTest : public testing::Test {
// Precondition, the host is waiting on cache selection.
scoped_refptr<AppCache> cache(MakeNewCache());
host_->pending_selected_cache_id_ = cache->cache_id();
+ host_->set_preferred_manifest_url(cache->owning_group()->manifest_url());
request_.reset(new MockURLRequest(GURL("http://blah/")));
handler_.reset(host_->CreateRequestHandler(request_.get(),