| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 void WaitForAutofillDidAssociateFormControl() { | 72 void WaitForAutofillDidAssociateFormControl() { |
| 73 DCHECK(run_loop_ == nullptr); | 73 DCHECK(run_loop_ == nullptr); |
| 74 run_loop_.reset(new base::RunLoop); | 74 run_loop_.reset(new base::RunLoop); |
| 75 run_loop_->Run(); | 75 run_loop_->Run(); |
| 76 run_loop_.reset(); | 76 run_loop_.reset(); |
| 77 } | 77 } |
| 78 | 78 |
| 79 MOCK_CONST_METHOD0(IsUserGesture, bool()); | 79 MOCK_CONST_METHOD0(IsUserGesture, bool()); |
| 80 | 80 |
| 81 private: | 81 private: |
| 82 void didAssociateFormControls( | 82 void didAssociateFormControlsDynamically() override { |
| 83 const blink::WebVector<blink::WebNode>& nodes) override { | 83 AutofillAgent::didAssociateFormControlsDynamically(); |
| 84 AutofillAgent::didAssociateFormControls(nodes); | |
| 85 if (run_loop_) | 84 if (run_loop_) |
| 86 run_loop_->Quit(); | 85 run_loop_->Quit(); |
| 87 } | 86 } |
| 88 | 87 |
| 89 std::unique_ptr<base::RunLoop> run_loop_; | 88 std::unique_ptr<base::RunLoop> run_loop_; |
| 90 | 89 |
| 91 DISALLOW_COPY_AND_ASSIGN(MockAutofillAgent); | 90 DISALLOW_COPY_AND_ASSIGN(MockAutofillAgent); |
| 92 }; | 91 }; |
| 93 | 92 |
| 94 } // namespace | 93 } // namespace |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 | 178 |
| 180 void ChromeRenderViewTest::DisableUserGestureSimulationForAutofill() { | 179 void ChromeRenderViewTest::DisableUserGestureSimulationForAutofill() { |
| 181 EXPECT_CALL(*(static_cast<MockAutofillAgent*>(autofill_agent_)), | 180 EXPECT_CALL(*(static_cast<MockAutofillAgent*>(autofill_agent_)), |
| 182 IsUserGesture()).WillRepeatedly(Return(false)); | 181 IsUserGesture()).WillRepeatedly(Return(false)); |
| 183 } | 182 } |
| 184 | 183 |
| 185 void ChromeRenderViewTest::WaitForAutofillDidAssociateFormControl() { | 184 void ChromeRenderViewTest::WaitForAutofillDidAssociateFormControl() { |
| 186 static_cast<MockAutofillAgent*>(autofill_agent_) | 185 static_cast<MockAutofillAgent*>(autofill_agent_) |
| 187 ->WaitForAutofillDidAssociateFormControl(); | 186 ->WaitForAutofillDidAssociateFormControl(); |
| 188 } | 187 } |
| OLD | NEW |