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 "chrome/test/base/chrome_render_view_test.h" | 5 #include "chrome/test/base/chrome_render_view_test.h" |
6 | 6 |
7 #include "chrome/browser/extensions/extension_function_dispatcher.h" | 7 #include "chrome/browser/extensions/extension_function_dispatcher.h" |
8 #include "chrome/common/extensions/extension.h" | 8 #include "chrome/common/extensions/extension.h" |
9 #include "chrome/common/print_messages.h" | 9 #include "chrome/common/print_messages.h" |
10 #include "chrome/common/render_messages.h" | 10 #include "chrome/common/render_messages.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 using autofill::AutofillAgent; | 44 using autofill::AutofillAgent; |
45 using autofill::PasswordAutofillManager; | 45 using autofill::PasswordAutofillManager; |
46 | 46 |
47 ChromeRenderViewTest::ChromeRenderViewTest() : extension_dispatcher_(NULL) { | 47 ChromeRenderViewTest::ChromeRenderViewTest() : extension_dispatcher_(NULL) { |
48 } | 48 } |
49 | 49 |
50 ChromeRenderViewTest::~ChromeRenderViewTest() { | 50 ChromeRenderViewTest::~ChromeRenderViewTest() { |
51 } | 51 } |
52 | 52 |
53 void ChromeRenderViewTest::SetUp() { | 53 void ChromeRenderViewTest::SetUp() { |
54 content::GetContentClient()->set_renderer(&chrome_content_renderer_client_); | 54 content::GetContentClient()->set_renderer_for_testing( |
| 55 &chrome_content_renderer_client_); |
55 extension_dispatcher_ = new ExtensionDispatcher(); | 56 extension_dispatcher_ = new ExtensionDispatcher(); |
56 chrome_content_renderer_client_.SetExtensionDispatcher(extension_dispatcher_); | 57 chrome_content_renderer_client_.SetExtensionDispatcher(extension_dispatcher_); |
57 | 58 |
58 chrome_render_thread_ = new ChromeMockRenderThread(); | 59 chrome_render_thread_ = new ChromeMockRenderThread(); |
59 render_thread_.reset(chrome_render_thread_); | 60 render_thread_.reset(chrome_render_thread_); |
60 content::RenderViewTest::SetUp(); | 61 content::RenderViewTest::SetUp(); |
61 | 62 |
62 // RenderView doesn't expose it's PasswordAutofillManager or | 63 // RenderView doesn't expose it's PasswordAutofillManager or |
63 // AutofillAgent objects, because it has no need to store them directly | 64 // AutofillAgent objects, because it has no need to store them directly |
64 // (they're stored as RenderViewObserver*). So just create another set. | 65 // (they're stored as RenderViewObserver*). So just create another set. |
65 password_autofill_ = new PasswordAutofillManager(view_); | 66 password_autofill_ = new PasswordAutofillManager(view_); |
66 autofill_agent_ = new AutofillAgent(view_, password_autofill_); | 67 autofill_agent_ = new AutofillAgent(view_, password_autofill_); |
67 } | 68 } |
68 | 69 |
69 void ChromeRenderViewTest::TearDown() { | 70 void ChromeRenderViewTest::TearDown() { |
70 content::RenderViewTest::TearDown(); | 71 content::RenderViewTest::TearDown(); |
71 | 72 |
72 extension_dispatcher_->OnRenderProcessShutdown(); | 73 extension_dispatcher_->OnRenderProcessShutdown(); |
73 extension_dispatcher_ = NULL; | 74 extension_dispatcher_ = NULL; |
74 } | 75 } |
OLD | NEW |