OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/renderer_host/test/test_render_view_host.h" | 5 #include "chrome/browser/renderer_host/test/test_render_view_host.h" |
6 | 6 |
7 #include "chrome/browser/browser_url_handler.h" | 7 #include "chrome/browser/browser_url_handler.h" |
8 #include "chrome/browser/renderer_host/site_instance.h" | 8 #include "chrome/browser/renderer_host/site_instance.h" |
9 #include "chrome/browser/renderer_host/test/test_backing_store.h" | 9 #include "chrome/browser/renderer_host/test/test_backing_store.h" |
10 #include "chrome/browser/tab_contents/navigation_controller.h" | 10 #include "chrome/browser/tab_contents/navigation_controller.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 DCHECK(!render_view_created_); | 63 DCHECK(!render_view_created_); |
64 render_view_created_ = true; | 64 render_view_created_ = true; |
65 process()->ViewCreated(); | 65 process()->ViewCreated(); |
66 return true; | 66 return true; |
67 } | 67 } |
68 | 68 |
69 bool TestRenderViewHost::IsRenderViewLive() const { | 69 bool TestRenderViewHost::IsRenderViewLive() const { |
70 return render_view_created_; | 70 return render_view_created_; |
71 } | 71 } |
72 | 72 |
73 void TestRenderViewHost::TestOnMessageReceived(const IPC::Message& msg) { | 73 bool TestRenderViewHost::TestOnMessageReceived(const IPC::Message& msg) { |
74 OnMessageReceived(msg); | 74 return OnMessageReceived(msg); |
75 } | 75 } |
76 | 76 |
77 void TestRenderViewHost::SendNavigate(int page_id, const GURL& url) { | 77 void TestRenderViewHost::SendNavigate(int page_id, const GURL& url) { |
78 SendNavigateWithTransition(page_id, url, PageTransition::LINK); | 78 SendNavigateWithTransition(page_id, url, PageTransition::LINK); |
79 } | 79 } |
80 | 80 |
81 void TestRenderViewHost::SendNavigateWithTransition( | 81 void TestRenderViewHost::SendNavigateWithTransition( |
82 int page_id, const GURL& url, PageTransition::Type transition) { | 82 int page_id, const GURL& url, PageTransition::Type transition) { |
83 ViewHostMsg_FrameNavigate_Params params; | 83 ViewHostMsg_FrameNavigate_Params params; |
84 | 84 |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 contents_.reset(); | 298 contents_.reset(); |
299 | 299 |
300 // Make sure that we flush any messages related to TabContents destruction | 300 // Make sure that we flush any messages related to TabContents destruction |
301 // before we destroy the profile. | 301 // before we destroy the profile. |
302 MessageLoop::current()->RunAllPending(); | 302 MessageLoop::current()->RunAllPending(); |
303 | 303 |
304 // Release the profile on the UI thread. | 304 // Release the profile on the UI thread. |
305 message_loop_.DeleteSoon(FROM_HERE, profile_.release()); | 305 message_loop_.DeleteSoon(FROM_HERE, profile_.release()); |
306 message_loop_.RunAllPending(); | 306 message_loop_.RunAllPending(); |
307 } | 307 } |
OLD | NEW |