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

Side by Side Diff: content/browser/web_contents/test_web_contents.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/web_contents/test_web_contents.h" 5 #include "content/browser/web_contents/test_web_contents.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "content/browser/browser_url_handler_impl.h" 9 #include "content/browser/browser_url_handler_impl.h"
10 #include "content/browser/renderer_host/render_view_host_impl.h" 10 #include "content/browser/renderer_host/render_view_host_impl.h"
11 #include "content/browser/renderer_host/test_render_view_host.h" 11 #include "content/browser/renderer_host/test_render_view_host.h"
12 #include "content/browser/site_instance_impl.h" 12 #include "content/browser/site_instance_impl.h"
13 #include "content/browser/web_contents/navigation_entry_impl.h" 13 #include "content/browser/web_contents/navigation_entry_impl.h"
14 #include "content/common/view_messages.h" 14 #include "content/common/view_messages.h"
15 #include "content/public/browser/notification_registrar.h" 15 #include "content/public/browser/notification_registrar.h"
16 #include "content/public/browser/notification_source.h" 16 #include "content/public/browser/notification_source.h"
17 #include "content/public/browser/notification_types.h" 17 #include "content/public/browser/notification_types.h"
18 #include "content/public/common/page_transition_types.h" 18 #include "content/public/common/page_transition_types.h"
19 #include "content/public/test/mock_render_process_host.h" 19 #include "content/public/test/mock_render_process_host.h"
20 #include "webkit/forms/password_form.h" 20 #include "webkit/forms/password_form.h"
21 #include "webkit/glue/webkit_glue.h" 21 #include "webkit/glue/webkit_glue.h"
22 22
23 namespace content { 23 namespace content {
24 24
25 TestWebContents::TestWebContents(BrowserContext* browser_context, 25 TestWebContents::TestWebContents(BrowserContext* browser_context)
26 SiteInstance* instance) 26 : WebContentsImpl(browser_context, NULL),
27 : WebContentsImpl(browser_context, instance, MSG_ROUTING_NONE, NULL, NULL,
28 NULL),
29 transition_cross_site(false), 27 transition_cross_site(false),
30 delegate_view_override_(NULL), 28 delegate_view_override_(NULL),
31 expect_set_history_length_and_prune_(false), 29 expect_set_history_length_and_prune_(false),
32 expect_set_history_length_and_prune_site_instance_(NULL), 30 expect_set_history_length_and_prune_site_instance_(NULL),
33 expect_set_history_length_and_prune_history_length_(0), 31 expect_set_history_length_and_prune_history_length_(0),
34 expect_set_history_length_and_prune_min_page_id_(-1) { 32 expect_set_history_length_and_prune_min_page_id_(-1) {
35 } 33 }
36 34
35 TestWebContents* TestWebContents::Create(BrowserContext* browser_context,
36 SiteInstance* instance) {
37 TestWebContents* test_web_contents = new TestWebContents(browser_context);
38 test_web_contents->Init(browser_context, instance, MSG_ROUTING_NONE, NULL);
39 return test_web_contents;
40 }
41
37 TestWebContents::~TestWebContents() { 42 TestWebContents::~TestWebContents() {
38 } 43 }
39 44
40 RenderViewHost* TestWebContents::GetPendingRenderViewHost() const { 45 RenderViewHost* TestWebContents::GetPendingRenderViewHost() const {
41 return render_manager_.pending_render_view_host_; 46 return render_manager_.pending_render_view_host_;
42 } 47 }
43 48
44 TestRenderViewHost* TestWebContents::pending_test_rvh() const { 49 TestRenderViewHost* TestWebContents::pending_test_rvh() const {
45 return static_cast<TestRenderViewHost*>(GetPendingRenderViewHost()); 50 return static_cast<TestRenderViewHost*>(GetPendingRenderViewHost());
46 } 51 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 static_cast<RenderViewHostImpl*>( 97 static_cast<RenderViewHostImpl*>(
93 render_view_host)->CreateRenderView(string16(), 98 render_view_host)->CreateRenderView(string16(),
94 opener_route_id, 99 opener_route_id,
95 -1, 100 -1,
96 std::string(), 101 std::string(),
97 -1); 102 -1);
98 return true; 103 return true;
99 } 104 }
100 105
101 WebContents* TestWebContents::Clone() { 106 WebContents* TestWebContents::Clone() {
102 WebContentsImpl* contents = new TestWebContents( 107 WebContentsImpl* contents =
103 GetBrowserContext(), 108 Create(GetBrowserContext(), SiteInstance::Create(GetBrowserContext()));
104 SiteInstance::Create(GetBrowserContext())); 109 contents->GetController().CopyStateFrom(controller_);
105 contents->GetControllerImpl().CopyStateFrom(controller_);
106 return contents; 110 return contents;
107 } 111 }
108 112
109 void TestWebContents::NavigateAndCommit(const GURL& url) { 113 void TestWebContents::NavigateAndCommit(const GURL& url) {
110 GetController().LoadURL( 114 GetController().LoadURL(
111 url, Referrer(), PAGE_TRANSITION_LINK, std::string()); 115 url, Referrer(), PAGE_TRANSITION_LINK, std::string());
112 GURL loaded_url(url); 116 GURL loaded_url(url);
113 bool reverse_on_redirect = false; 117 bool reverse_on_redirect = false;
114 BrowserURLHandlerImpl::GetInstance()->RewriteURLIfNecessary( 118 BrowserURLHandlerImpl::GetInstance()->RewriteURLIfNecessary(
115 &loaded_url, GetBrowserContext(), &reverse_on_redirect); 119 &loaded_url, GetBrowserContext(), &reverse_on_redirect);
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 } 222 }
219 223
220 void TestWebContents::ShowCreatedWidget(int route_id, 224 void TestWebContents::ShowCreatedWidget(int route_id,
221 const gfx::Rect& initial_pos) { 225 const gfx::Rect& initial_pos) {
222 } 226 }
223 227
224 void TestWebContents::ShowCreatedFullscreenWidget(int route_id) { 228 void TestWebContents::ShowCreatedFullscreenWidget(int route_id) {
225 } 229 }
226 230
227 } // namespace content 231 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/test_web_contents.h ('k') | content/browser/web_contents/web_contents_delegate_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698