| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "base/gfx/rect.h" | 7 #include "base/gfx/rect.h" |
| 8 #include "chrome/browser/renderer_host/backing_store.h" | 8 #include "chrome/browser/renderer_host/backing_store.h" |
| 9 #include "chrome/browser/tab_contents/test_web_contents.h" | 9 #include "chrome/browser/tab_contents/test_web_contents.h" |
| 10 #include "chrome/common/render_messages.h" | 10 #include "chrome/common/render_messages.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 if (delete_counter_) | 25 if (delete_counter_) |
| 26 ++*delete_counter_; | 26 ++*delete_counter_; |
| 27 | 27 |
| 28 // Since this isn't a traditional view, we have to delete it. | 28 // Since this isn't a traditional view, we have to delete it. |
| 29 delete view(); | 29 delete view(); |
| 30 } | 30 } |
| 31 | 31 |
| 32 bool TestRenderViewHost::CreateRenderView() { | 32 bool TestRenderViewHost::CreateRenderView() { |
| 33 DCHECK(!render_view_created_); | 33 DCHECK(!render_view_created_); |
| 34 render_view_created_ = true; | 34 render_view_created_ = true; |
| 35 process()->ViewCreated(); |
| 35 return true; | 36 return true; |
| 36 } | 37 } |
| 37 | 38 |
| 38 bool TestRenderViewHost::IsRenderViewLive() const { | 39 bool TestRenderViewHost::IsRenderViewLive() const { |
| 39 return render_view_created_; | 40 return render_view_created_; |
| 40 } | 41 } |
| 41 | 42 |
| 42 void TestRenderViewHost::TestOnMessageReceived(const IPC::Message& msg) { | 43 void TestRenderViewHost::TestOnMessageReceived(const IPC::Message& msg) { |
| 43 OnMessageReceived(msg); | 44 OnMessageReceived(msg); |
| 44 } | 45 } |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 contents_.reset(new TestTabContents(profile_.get(), instance)); | 108 contents_.reset(new TestTabContents(profile_.get(), instance)); |
| 108 } | 109 } |
| 109 | 110 |
| 110 void RenderViewHostTestHarness::TearDown() { | 111 void RenderViewHostTestHarness::TearDown() { |
| 111 contents_.reset(); | 112 contents_.reset(); |
| 112 | 113 |
| 113 // Make sure that we flush any messages related to TabContents destruction | 114 // Make sure that we flush any messages related to TabContents destruction |
| 114 // before we destroy the profile. | 115 // before we destroy the profile. |
| 115 MessageLoop::current()->RunAllPending(); | 116 MessageLoop::current()->RunAllPending(); |
| 116 } | 117 } |
| OLD | NEW |