| 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 68994cc4d6f63fc973c6ec1d9f11466b48ff17b0..1db6f6390e4626954c728f853c34d51a58ae3b1d 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);
|
| };
|
|
|
| @@ -160,3 +176,8 @@ void ChromeRenderViewTest::DisableUserGestureSimulationForAutofill() {
|
| EXPECT_CALL(*(static_cast<MockAutofillAgent*>(autofill_agent_)),
|
| IsUserGesture()).WillRepeatedly(Return(false));
|
| }
|
| +
|
| +void ChromeRenderViewTest::WaitForAutofillDidAssociateFormControl() {
|
| + static_cast<MockAutofillAgent*>(autofill_agent_)
|
| + ->WaitForAutofillDidAssociateFormControl();
|
| +}
|
|
|