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

Unified Diff: content/browser/renderer_host/test_render_view_host.cc

Issue 10831116: Move SessionStorageNamespace entirely into NavigationController and support StoragePartitions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merged ToT Created 8 years, 4 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
Index: content/browser/renderer_host/test_render_view_host.cc
diff --git a/content/browser/renderer_host/test_render_view_host.cc b/content/browser/renderer_host/test_render_view_host.cc
index 7274ba6d7835d3fe565cf49ea1cb5c92aa90c54f..53564b3249f49e6cc72cf6a74d4b533f49383e0e 100644
--- a/content/browser/renderer_host/test_render_view_host.cc
+++ b/content/browser/renderer_host/test_render_view_host.cc
@@ -3,11 +3,14 @@
// found in the LICENSE file.
#include "content/browser/renderer_host/test_backing_store.h"
+#include "content/browser/dom_storage/dom_storage_context_impl.h"
+#include "content/browser/dom_storage/session_storage_namespace_impl.h"
#include "content/browser/renderer_host/test_render_view_host.h"
#include "content/browser/site_instance_impl.h"
#include "content/browser/web_contents/navigation_controller_impl.h"
#include "content/browser/web_contents/test_web_contents.h"
#include "content/common/view_messages.h"
+#include "content/public/browser/browser_context.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/common/content_client.h"
#include "ui/gfx/rect.h"
@@ -21,6 +24,21 @@ using webkit::forms::PasswordForm;
namespace content {
+namespace {
+// Normally this is done by the NavigationController, but we'll fake it out
+// here for testing.
+SessionStorageNamespaceImpl* CreateSessionStorageNamespace(
+ SiteInstance* instance) {
+ RenderProcessHost* process_host = instance->GetProcess();
+ DOMStorageContext* dom_storage_context =
+ BrowserContext::GetDOMStorageContext(process_host->GetBrowserContext(),
+ process_host->GetID());
+ return new SessionStorageNamespaceImpl(
+ static_cast<DOMStorageContextImpl*>(dom_storage_context));
+}
+} // namespace
+
+
void InitNavigateParams(ViewHostMsg_FrameNavigate_Params* params,
int page_id,
const GURL& url,
@@ -235,7 +253,7 @@ TestRenderViewHost::TestRenderViewHost(
widget_delegate,
routing_id,
swapped_out,
- NULL),
+ CreateSessionStorageNamespace(instance)),
render_view_created_(false),
delete_counter_(NULL),
simulate_fetch_via_proxy_(false),
« no previous file with comments | « content/browser/renderer_host/render_view_host_unittest.cc ('k') | content/browser/site_instance_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698