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 "base/debug/leak_annotations.h" | 7 #include "base/debug/leak_annotations.h" |
8 #include "chrome/browser/chrome_content_browser_client.h" | 8 #include "chrome/browser/chrome_content_browser_client.h" |
9 #include "chrome/common/chrome_content_client.h" | 9 #include "chrome/common/chrome_content_client.h" |
10 #include "chrome/common/render_messages.h" | 10 #include "chrome/common/render_messages.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 void ChromeRenderViewTest::SetUp() { | 58 void ChromeRenderViewTest::SetUp() { |
59 ChromeUnitTestSuite::InitializeProviders(); | 59 ChromeUnitTestSuite::InitializeProviders(); |
60 ChromeUnitTestSuite::InitializeResourceBundle(); | 60 ChromeUnitTestSuite::InitializeResourceBundle(); |
61 | 61 |
62 chrome_render_thread_ = new ChromeMockRenderThread(); | 62 chrome_render_thread_ = new ChromeMockRenderThread(); |
63 render_thread_.reset(chrome_render_thread_); | 63 render_thread_.reset(chrome_render_thread_); |
64 | 64 |
65 content::RenderViewTest::SetUp(); | 65 content::RenderViewTest::SetUp(); |
66 | 66 |
67 // RenderView doesn't expose its Agent objects, because it has no need to | 67 // RenderFrame doesn't expose its Agent objects, because it has no need to |
68 // store them directly (they're stored as RenderViewObserver*). So just | 68 // store them directly (they're stored as RenderFrameObserver*). So just |
69 // create another set. | 69 // create another set. |
70 password_autofill_agent_ = new autofill::TestPasswordAutofillAgent(view_); | 70 password_autofill_agent_ = |
71 password_generation_ = new autofill::TestPasswordGenerationAgent(view_); | 71 new autofill::TestPasswordAutofillAgent(view_->GetMainRenderFrame()); |
| 72 password_generation_ = |
| 73 new autofill::TestPasswordGenerationAgent(view_->GetMainRenderFrame()); |
72 autofill_agent_ = | 74 autofill_agent_ = |
73 new AutofillAgent(view_, password_autofill_agent_, password_generation_); | 75 new AutofillAgent(view_->GetMainRenderFrame(), password_autofill_agent_, |
| 76 password_generation_); |
74 } | 77 } |
75 | 78 |
76 void ChromeRenderViewTest::TearDown() { | 79 void ChromeRenderViewTest::TearDown() { |
77 #if defined(ENABLE_EXTENSIONS) | 80 #if defined(ENABLE_EXTENSIONS) |
78 ChromeContentRendererClient* client = | 81 ChromeContentRendererClient* client = |
79 static_cast<ChromeContentRendererClient*>(content_renderer_client_.get()); | 82 static_cast<ChromeContentRendererClient*>(content_renderer_client_.get()); |
80 client->GetExtensionDispatcherForTest()->OnRenderProcessShutdown(); | 83 client->GetExtensionDispatcherForTest()->OnRenderProcessShutdown(); |
81 #endif | 84 #endif |
82 | 85 |
83 #if defined(LEAK_SANITIZER) | 86 #if defined(LEAK_SANITIZER) |
(...skipping 20 matching lines...) Expand all Loading... |
104 extension_dispatcher_delegate_.reset( | 107 extension_dispatcher_delegate_.reset( |
105 new ChromeExtensionsDispatcherDelegate()); | 108 new ChromeExtensionsDispatcherDelegate()); |
106 client->SetExtensionDispatcherForTest( | 109 client->SetExtensionDispatcherForTest( |
107 new extensions::Dispatcher(extension_dispatcher_delegate_.get())); | 110 new extensions::Dispatcher(extension_dispatcher_delegate_.get())); |
108 #endif | 111 #endif |
109 #if defined(ENABLE_SPELLCHECK) | 112 #if defined(ENABLE_SPELLCHECK) |
110 client->SetSpellcheck(new SpellCheck()); | 113 client->SetSpellcheck(new SpellCheck()); |
111 #endif | 114 #endif |
112 return client; | 115 return client; |
113 } | 116 } |
OLD | NEW |