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 <tuple> | 5 #include <tuple> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 AutofillRendererTest() {} | 124 AutofillRendererTest() {} |
125 | 125 |
126 ~AutofillRendererTest() override {} | 126 ~AutofillRendererTest() override {} |
127 | 127 |
128 protected: | 128 protected: |
129 void SetUp() override { | 129 void SetUp() override { |
130 ChromeRenderViewTest::SetUp(); | 130 ChromeRenderViewTest::SetUp(); |
131 | 131 |
132 // We only use the fake driver for main frame | 132 // We only use the fake driver for main frame |
133 // because our test cases only involve the main frame. | 133 // because our test cases only involve the main frame. |
134 shell::InterfaceProvider* remote_interfaces = | 134 service_manager::InterfaceProvider* remote_interfaces = |
135 view_->GetMainRenderFrame()->GetRemoteInterfaces(); | 135 view_->GetMainRenderFrame()->GetRemoteInterfaces(); |
136 shell::InterfaceProvider::TestApi test_api(remote_interfaces); | 136 service_manager::InterfaceProvider::TestApi test_api(remote_interfaces); |
137 test_api.SetBinderForName( | 137 test_api.SetBinderForName( |
138 mojom::AutofillDriver::Name_, | 138 mojom::AutofillDriver::Name_, |
139 base::Bind(&AutofillRendererTest::BindAutofillDriver, | 139 base::Bind(&AutofillRendererTest::BindAutofillDriver, |
140 base::Unretained(this))); | 140 base::Unretained(this))); |
141 } | 141 } |
142 | 142 |
143 void BindAutofillDriver(mojo::ScopedMessagePipeHandle handle) { | 143 void BindAutofillDriver(mojo::ScopedMessagePipeHandle handle) { |
144 fake_driver_.BindRequest( | 144 fake_driver_.BindRequest( |
145 mojo::MakeRequest<mojom::AutofillDriver>(std::move(handle))); | 145 mojo::MakeRequest<mojom::AutofillDriver>(std::move(handle))); |
146 } | 146 } |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 base::RunLoop().RunUntilIdle(); | 337 base::RunLoop().RunUntilIdle(); |
338 ASSERT_FALSE(fake_driver_.called_field_change()); | 338 ASSERT_FALSE(fake_driver_.called_field_change()); |
339 | 339 |
340 // A user gesture will send a message to the browser. | 340 // A user gesture will send a message to the browser. |
341 EnableUserGestureSimulationForAutofill(); | 341 EnableUserGestureSimulationForAutofill(); |
342 SimulateUserInputChangeForElement(&full_name, "Alice"); | 342 SimulateUserInputChangeForElement(&full_name, "Alice"); |
343 ASSERT_TRUE(fake_driver_.called_field_change()); | 343 ASSERT_TRUE(fake_driver_.called_field_change()); |
344 } | 344 } |
345 | 345 |
346 } // namespace autofill | 346 } // namespace autofill |
OLD | NEW |