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 "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
104 | 104 |
105 void ChromeRenderViewTest::SetUp() { | 105 void ChromeRenderViewTest::SetUp() { |
106 ChromeUnitTestSuite::InitializeProviders(); | 106 ChromeUnitTestSuite::InitializeProviders(); |
107 ChromeUnitTestSuite::InitializeResourceBundle(); | 107 ChromeUnitTestSuite::InitializeResourceBundle(); |
108 | 108 |
109 chrome_render_thread_ = new ChromeMockRenderThread(); | 109 chrome_render_thread_ = new ChromeMockRenderThread(); |
110 render_thread_.reset(chrome_render_thread_); | 110 render_thread_.reset(chrome_render_thread_); |
111 | 111 |
112 content::RenderViewTest::SetUp(); | 112 content::RenderViewTest::SetUp(); |
113 | 113 |
114 RegisterMainFrameRemoteInterfaces(); | |
leonhsl(Using Gerrit)
2016/08/19 10:13:38
Because bellowing password_autofill_agent_ constru
| |
115 | |
114 // RenderFrame doesn't expose its Agent objects, because it has no need to | 116 // RenderFrame doesn't expose its Agent objects, because it has no need to |
115 // store them directly (they're stored as RenderFrameObserver*). So just | 117 // store them directly (they're stored as RenderFrameObserver*). So just |
116 // create another set. | 118 // create another set. |
117 password_autofill_agent_ = | 119 password_autofill_agent_ = |
118 new autofill::TestPasswordAutofillAgent(view_->GetMainRenderFrame()); | 120 new autofill::TestPasswordAutofillAgent(view_->GetMainRenderFrame()); |
119 password_generation_ = | 121 password_generation_ = |
120 new autofill::TestPasswordGenerationAgent(view_->GetMainRenderFrame(), | 122 new autofill::TestPasswordGenerationAgent(view_->GetMainRenderFrame(), |
121 password_autofill_agent_); | 123 password_autofill_agent_); |
122 autofill_agent_ = new NiceMock<MockAutofillAgent>(view_->GetMainRenderFrame(), | 124 autofill_agent_ = new NiceMock<MockAutofillAgent>(view_->GetMainRenderFrame(), |
123 password_autofill_agent_, | 125 password_autofill_agent_, |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
178 | 180 |
179 void ChromeRenderViewTest::DisableUserGestureSimulationForAutofill() { | 181 void ChromeRenderViewTest::DisableUserGestureSimulationForAutofill() { |
180 EXPECT_CALL(*(static_cast<MockAutofillAgent*>(autofill_agent_)), | 182 EXPECT_CALL(*(static_cast<MockAutofillAgent*>(autofill_agent_)), |
181 IsUserGesture()).WillRepeatedly(Return(false)); | 183 IsUserGesture()).WillRepeatedly(Return(false)); |
182 } | 184 } |
183 | 185 |
184 void ChromeRenderViewTest::WaitForAutofillDidAssociateFormControl() { | 186 void ChromeRenderViewTest::WaitForAutofillDidAssociateFormControl() { |
185 static_cast<MockAutofillAgent*>(autofill_agent_) | 187 static_cast<MockAutofillAgent*>(autofill_agent_) |
186 ->WaitForAutofillDidAssociateFormControl(); | 188 ->WaitForAutofillDidAssociateFormControl(); |
187 } | 189 } |
OLD | NEW |