| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 using autofill::AutofillAgent; | 45 using autofill::AutofillAgent; |
| 46 using autofill::PasswordAutofillAgent; | 46 using autofill::PasswordAutofillAgent; |
| 47 | 47 |
| 48 ChromeRenderViewTest::ChromeRenderViewTest() : extension_dispatcher_(NULL) { | 48 ChromeRenderViewTest::ChromeRenderViewTest() : extension_dispatcher_(NULL) { |
| 49 } | 49 } |
| 50 | 50 |
| 51 ChromeRenderViewTest::~ChromeRenderViewTest() { | 51 ChromeRenderViewTest::~ChromeRenderViewTest() { |
| 52 } | 52 } |
| 53 | 53 |
| 54 void ChromeRenderViewTest::SetUp() { | 54 void ChromeRenderViewTest::SetUp() { |
| 55 content::GetContentClient()->set_renderer_for_testing( | 55 content::SetRendererClientForTesting(&chrome_content_renderer_client_); |
| 56 &chrome_content_renderer_client_); | |
| 57 extension_dispatcher_ = new extensions::Dispatcher(); | 56 extension_dispatcher_ = new extensions::Dispatcher(); |
| 58 chrome_content_renderer_client_.SetExtensionDispatcher(extension_dispatcher_); | 57 chrome_content_renderer_client_.SetExtensionDispatcher(extension_dispatcher_); |
| 59 chrome_content_renderer_client_.SetSpellcheck(new SpellCheck()); | 58 chrome_content_renderer_client_.SetSpellcheck(new SpellCheck()); |
| 60 | 59 |
| 61 chrome_render_thread_ = new ChromeMockRenderThread(); | 60 chrome_render_thread_ = new ChromeMockRenderThread(); |
| 62 render_thread_.reset(chrome_render_thread_); | 61 render_thread_.reset(chrome_render_thread_); |
| 63 content::RenderViewTest::SetUp(); | 62 content::RenderViewTest::SetUp(); |
| 64 | 63 |
| 65 // RenderView doesn't expose it's PasswordAutofillAgent or | 64 // RenderView doesn't expose it's PasswordAutofillAgent or |
| 66 // AutofillAgent objects, because it has no need to store them directly | 65 // AutofillAgent objects, because it has no need to store them directly |
| 67 // (they're stored as RenderViewObserver*). So just create another set. | 66 // (they're stored as RenderViewObserver*). So just create another set. |
| 68 password_autofill_ = new PasswordAutofillAgent(view_); | 67 password_autofill_ = new PasswordAutofillAgent(view_); |
| 69 autofill_agent_ = new AutofillAgent(view_, password_autofill_); | 68 autofill_agent_ = new AutofillAgent(view_, password_autofill_); |
| 70 } | 69 } |
| 71 | 70 |
| 72 void ChromeRenderViewTest::TearDown() { | 71 void ChromeRenderViewTest::TearDown() { |
| 73 content::RenderViewTest::TearDown(); | 72 content::RenderViewTest::TearDown(); |
| 74 | 73 |
| 75 extension_dispatcher_->OnRenderProcessShutdown(); | 74 extension_dispatcher_->OnRenderProcessShutdown(); |
| 76 extension_dispatcher_ = NULL; | 75 extension_dispatcher_ = NULL; |
| 77 } | 76 } |
| OLD | NEW |