| 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 44964164c1ae9b1e2aacfc660c0d4cbb46fb5690..acd14925db7b0ca5d8f042363f605f40ac8dc98b 100644
|
| --- a/chrome/test/base/chrome_render_view_test.cc
|
| +++ b/chrome/test/base/chrome_render_view_test.cc
|
| @@ -69,9 +69,25 @@ class MockAutofillAgent : public AutofillAgent {
|
|
|
| ~MockAutofillAgent() override {}
|
|
|
| + void WaitForAutofillDidAssociateFormControl() {
|
| + DCHECK(run_loop_ == nullptr);
|
| + run_loop_.reset(new base::RunLoop);
|
| + run_loop_->Run();
|
| + run_loop_.reset();
|
| + }
|
| +
|
| MOCK_CONST_METHOD0(IsUserGesture, bool());
|
|
|
| private:
|
| + void didAssociateFormControls(
|
| + const blink::WebVector<blink::WebNode>& nodes) override {
|
| + AutofillAgent::didAssociateFormControls(nodes);
|
| + if (run_loop_)
|
| + run_loop_->Quit();
|
| + }
|
| +
|
| + std::unique_ptr<base::RunLoop> run_loop_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(MockAutofillAgent);
|
| };
|
|
|
| @@ -165,3 +181,8 @@ void ChromeRenderViewTest::DisableUserGestureSimulationForAutofill() {
|
| EXPECT_CALL(*(static_cast<MockAutofillAgent*>(autofill_agent_)),
|
| IsUserGesture()).WillRepeatedly(Return(false));
|
| }
|
| +
|
| +void ChromeRenderViewTest::WaitForAutofillDidAssociateFormControl() {
|
| + static_cast<MockAutofillAgent*>(autofill_agent_)
|
| + ->WaitForAutofillDidAssociateFormControl();
|
| +}
|
|
|