OLD | NEW |
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/test/test_render_view_host.h" | 5 #include "content/test/test_render_view_host.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" | 8 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" |
9 #include "content/browser/dom_storage/session_storage_namespace_impl.h" | 9 #include "content/browser/dom_storage/session_storage_namespace_impl.h" |
10 #include "content/browser/site_instance_impl.h" | 10 #include "content/browser/site_instance_impl.h" |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 delegate, | 203 delegate, |
204 widget_delegate, | 204 widget_delegate, |
205 routing_id, | 205 routing_id, |
206 main_frame_routing_id, | 206 main_frame_routing_id, |
207 swapped_out, | 207 swapped_out, |
208 false /* hidden */), | 208 false /* hidden */), |
209 render_view_created_(false), | 209 render_view_created_(false), |
210 delete_counter_(NULL), | 210 delete_counter_(NULL), |
211 simulate_fetch_via_proxy_(false), | 211 simulate_fetch_via_proxy_(false), |
212 simulate_history_list_was_cleared_(false), | 212 simulate_history_list_was_cleared_(false), |
213 contents_mime_type_("text/html"), | |
214 opener_route_id_(MSG_ROUTING_NONE), | 213 opener_route_id_(MSG_ROUTING_NONE), |
215 main_render_frame_host_(NULL) { | 214 main_render_frame_host_(NULL) { |
216 // TestRenderWidgetHostView installs itself into this->view_ in its | 215 // TestRenderWidgetHostView installs itself into this->view_ in its |
217 // constructor, and deletes itself when TestRenderWidgetHostView::Destroy() is | 216 // constructor, and deletes itself when TestRenderWidgetHostView::Destroy() is |
218 // called. | 217 // called. |
219 new TestRenderWidgetHostView(this); | 218 new TestRenderWidgetHostView(this); |
220 } | 219 } |
221 | 220 |
222 TestRenderViewHost::~TestRenderViewHost() { | 221 TestRenderViewHost::~TestRenderViewHost() { |
223 if (delete_counter_) | 222 if (delete_counter_) |
(...skipping 13 matching lines...) Expand all Loading... |
237 } | 236 } |
238 | 237 |
239 bool TestRenderViewHost::IsRenderViewLive() const { | 238 bool TestRenderViewHost::IsRenderViewLive() const { |
240 return render_view_created_; | 239 return render_view_created_; |
241 } | 240 } |
242 | 241 |
243 bool TestRenderViewHost::IsFullscreen() const { | 242 bool TestRenderViewHost::IsFullscreen() const { |
244 return RenderViewHostImpl::IsFullscreen(); | 243 return RenderViewHostImpl::IsFullscreen(); |
245 } | 244 } |
246 | 245 |
247 void TestRenderViewHost::SendNavigate(int page_id, const GURL& url) { | |
248 main_render_frame_host_->SendNavigate(page_id, url); | |
249 } | |
250 | |
251 void TestRenderViewHost::SendFailedNavigate(int page_id, const GURL& url) { | |
252 main_render_frame_host_->SendFailedNavigate(page_id, url); | |
253 } | |
254 | |
255 void TestRenderViewHost::SendNavigateWithTransition( | |
256 int page_id, | |
257 const GURL& url, | |
258 ui::PageTransition transition) { | |
259 main_render_frame_host_->SendNavigateWithTransition(page_id, url, transition); | |
260 } | |
261 | |
262 void TestRenderViewHost::SendNavigateWithOriginalRequestURL( | 246 void TestRenderViewHost::SendNavigateWithOriginalRequestURL( |
263 int page_id, | 247 int page_id, |
264 const GURL& url, | 248 const GURL& url, |
265 const GURL& original_request_url) { | 249 const GURL& original_request_url) { |
266 main_render_frame_host_->SendNavigateWithOriginalRequestURL( | 250 main_render_frame_host_->SendNavigateWithOriginalRequestURL( |
267 page_id, url, original_request_url); | 251 page_id, url, original_request_url); |
268 } | 252 } |
269 | 253 |
270 void TestRenderViewHost::SendNavigateWithFile( | 254 void TestRenderViewHost::SendNavigateWithFile( |
271 int page_id, | 255 int page_id, |
(...skipping 22 matching lines...) Expand all Loading... |
294 ui::PageTransition transition, | 278 ui::PageTransition transition, |
295 const GURL& original_request_url, | 279 const GURL& original_request_url, |
296 int response_code, | 280 int response_code, |
297 const base::FilePath* file_path_for_history_item) { | 281 const base::FilePath* file_path_for_history_item) { |
298 | 282 |
299 main_render_frame_host_->SendNavigateWithParameters( | 283 main_render_frame_host_->SendNavigateWithParameters( |
300 page_id, url, transition, original_request_url, response_code, | 284 page_id, url, transition, original_request_url, response_code, |
301 file_path_for_history_item, std::vector<GURL>()); | 285 file_path_for_history_item, std::vector<GURL>()); |
302 } | 286 } |
303 | 287 |
304 void TestRenderViewHost::SetContentsMimeType(const std::string& mime_type) { | |
305 contents_mime_type_ = mime_type; | |
306 main_render_frame_host_->set_contents_mime_type(mime_type); | |
307 } | |
308 | 288 |
309 void TestRenderViewHost::SimulateWasHidden() { | 289 void TestRenderViewHost::SimulateWasHidden() { |
310 WasHidden(); | 290 WasHidden(); |
311 } | 291 } |
312 | 292 |
313 void TestRenderViewHost::SimulateWasShown() { | 293 void TestRenderViewHost::SimulateWasShown() { |
314 WasShown(ui::LatencyInfo()); | 294 WasShown(ui::LatencyInfo()); |
315 } | 295 } |
316 | 296 |
317 void TestRenderViewHost::TestOnStartDragging( | 297 void TestRenderViewHost::TestOnStartDragging( |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 | 347 |
368 TestRenderFrameHost* RenderViewHostImplTestHarness::main_test_rfh() { | 348 TestRenderFrameHost* RenderViewHostImplTestHarness::main_test_rfh() { |
369 return contents()->GetMainFrame(); | 349 return contents()->GetMainFrame(); |
370 } | 350 } |
371 | 351 |
372 TestWebContents* RenderViewHostImplTestHarness::contents() { | 352 TestWebContents* RenderViewHostImplTestHarness::contents() { |
373 return static_cast<TestWebContents*>(web_contents()); | 353 return static_cast<TestWebContents*>(web_contents()); |
374 } | 354 } |
375 | 355 |
376 } // namespace content | 356 } // namespace content |
OLD | NEW |