| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "chrome/test/base/chrome_render_view_test.h" | 10 #include "chrome/test/base/chrome_render_view_test.h" |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 public: | 180 public: |
| 181 FormAutocompleteTest() {} | 181 FormAutocompleteTest() {} |
| 182 ~FormAutocompleteTest() override {} | 182 ~FormAutocompleteTest() override {} |
| 183 | 183 |
| 184 protected: | 184 protected: |
| 185 void SetUp() override { | 185 void SetUp() override { |
| 186 ChromeRenderViewTest::SetUp(); | 186 ChromeRenderViewTest::SetUp(); |
| 187 | 187 |
| 188 // We only use the fake driver for main frame | 188 // We only use the fake driver for main frame |
| 189 // because our test cases only involve the main frame. | 189 // because our test cases only involve the main frame. |
| 190 shell::InterfaceProvider* remote_interfaces = | 190 service_manager::InterfaceProvider* remote_interfaces = |
| 191 view_->GetMainRenderFrame()->GetRemoteInterfaces(); | 191 view_->GetMainRenderFrame()->GetRemoteInterfaces(); |
| 192 shell::InterfaceProvider::TestApi test_api(remote_interfaces); | 192 service_manager::InterfaceProvider::TestApi test_api(remote_interfaces); |
| 193 test_api.SetBinderForName( | 193 test_api.SetBinderForName( |
| 194 mojom::AutofillDriver::Name_, | 194 mojom::AutofillDriver::Name_, |
| 195 base::Bind(&FormAutocompleteTest::BindAutofillDriver, | 195 base::Bind(&FormAutocompleteTest::BindAutofillDriver, |
| 196 base::Unretained(this))); | 196 base::Unretained(this))); |
| 197 } | 197 } |
| 198 | 198 |
| 199 void BindAutofillDriver(mojo::ScopedMessagePipeHandle handle) { | 199 void BindAutofillDriver(mojo::ScopedMessagePipeHandle handle) { |
| 200 fake_driver_.BindRequest( | 200 fake_driver_.BindRequest( |
| 201 mojo::MakeRequest<mojom::AutofillDriver>(std::move(handle))); | 201 mojo::MakeRequest<mojom::AutofillDriver>(std::move(handle))); |
| 202 } | 202 } |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 649 | 649 |
| 650 // Submit the form. | 650 // Submit the form. |
| 651 ExecuteJavaScriptForTests("document.getElementById('myForm').submit();"); | 651 ExecuteJavaScriptForTests("document.getElementById('myForm').submit();"); |
| 652 ProcessPendingMessages(); | 652 ProcessPendingMessages(); |
| 653 | 653 |
| 654 VerifyReceivedRendererMessages(fake_driver_, "Rick", "Deckard", | 654 VerifyReceivedRendererMessages(fake_driver_, "Rick", "Deckard", |
| 655 true /* expect_submitted_message */); | 655 true /* expect_submitted_message */); |
| 656 } | 656 } |
| 657 | 657 |
| 658 } // namespace autofill | 658 } // namespace autofill |
| OLD | NEW |