| Index: chrome/test/base/chrome_render_view_test.cc
|
| diff --git a/chrome/test/base/chrome_render_view_test.cc b/chrome/test/base/chrome_render_view_test.cc
|
| index d968e0c644af3aa89a7405290de1442a3f733607..4f47f69eb007c99a4b791220cd01c23e595b2ae5 100644
|
| --- a/chrome/test/base/chrome_render_view_test.cc
|
| +++ b/chrome/test/base/chrome_render_view_test.cc
|
| @@ -18,7 +18,6 @@
|
| #include "content/public/browser/native_web_keyboard_event.h"
|
| #include "content/public/common/renderer_preferences.h"
|
| #include "content/public/renderer/render_view.h"
|
| -#include "testing/gmock/include/gmock/gmock.h"
|
| #include "third_party/WebKit/public/platform/WebURLRequest.h"
|
| #include "third_party/WebKit/public/web/WebFrame.h"
|
| #include "third_party/WebKit/public/web/WebInputEvent.h"
|
| @@ -45,34 +44,6 @@
|
| using blink::WebScriptSource;
|
| using blink::WebString;
|
| using blink::WebURLRequest;
|
| -using content::RenderFrame;
|
| -using testing::NiceMock;
|
| -using testing::Return;
|
| -using testing::_;
|
| -
|
| -namespace {
|
| -
|
| -// An autofill agent that treats all typing as user gesture.
|
| -class MockAutofillAgent : public AutofillAgent {
|
| - public:
|
| - MockAutofillAgent(RenderFrame* render_frame,
|
| - PasswordAutofillAgent* password_autofill_agent,
|
| - PasswordGenerationAgent* password_generation_agent)
|
| - : AutofillAgent(render_frame,
|
| - password_autofill_agent,
|
| - password_generation_agent) {
|
| - ON_CALL(*this, IsUserGesture()).WillByDefault(Return(true));
|
| - }
|
| -
|
| - ~MockAutofillAgent() override {}
|
| -
|
| - MOCK_CONST_METHOD0(IsUserGesture, bool());
|
| -
|
| - private:
|
| - DISALLOW_COPY_AND_ASSIGN(MockAutofillAgent);
|
| -};
|
| -
|
| -} // namespace
|
|
|
| ChromeRenderViewTest::ChromeRenderViewTest()
|
| : password_autofill_agent_(NULL),
|
| @@ -100,9 +71,9 @@
|
| new autofill::TestPasswordAutofillAgent(view_->GetMainRenderFrame());
|
| password_generation_ =
|
| new autofill::TestPasswordGenerationAgent(view_->GetMainRenderFrame());
|
| - autofill_agent_ = new NiceMock<MockAutofillAgent>(view_->GetMainRenderFrame(),
|
| - password_autofill_agent_,
|
| - password_generation_);
|
| + autofill_agent_ =
|
| + new AutofillAgent(view_->GetMainRenderFrame(), password_autofill_agent_,
|
| + password_generation_);
|
| }
|
|
|
| void ChromeRenderViewTest::TearDown() {
|
| @@ -125,12 +96,12 @@
|
| }
|
|
|
| content::ContentBrowserClient*
|
| -ChromeRenderViewTest::CreateContentBrowserClient() {
|
| + ChromeRenderViewTest::CreateContentBrowserClient() {
|
| return new chrome::ChromeContentBrowserClient();
|
| }
|
|
|
| content::ContentRendererClient*
|
| -ChromeRenderViewTest::CreateContentRendererClient() {
|
| + ChromeRenderViewTest::CreateContentRendererClient() {
|
| ChromeContentRendererClient* client = new ChromeContentRendererClient();
|
| #if defined(ENABLE_EXTENSIONS)
|
| extension_dispatcher_delegate_.reset(
|
| @@ -143,13 +114,3 @@
|
| #endif
|
| return client;
|
| }
|
| -
|
| -void ChromeRenderViewTest::EnableUserGestureSimulationForAutofill() {
|
| - EXPECT_CALL(*(static_cast<MockAutofillAgent*>(autofill_agent_)),
|
| - IsUserGesture()).WillRepeatedly(Return(true));
|
| -}
|
| -
|
| -void ChromeRenderViewTest::DisableUserGestureSimulationForAutofill() {
|
| - EXPECT_CALL(*(static_cast<MockAutofillAgent*>(autofill_agent_)),
|
| - IsUserGesture()).WillRepeatedly(Return(false));
|
| -}
|
|
|