| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "base/memory/ptr_util.h" | 5 #include "base/memory/ptr_util.h" |
| 6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
| 7 #include "chrome/browser/password_manager/chrome_password_manager_client.h" | 7 #include "chrome/browser/password_manager/chrome_password_manager_client.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller.h" | 10 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller.h" |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 void PasswordDialogViewTest::ShowDialog(const std::string& name) { | 471 void PasswordDialogViewTest::ShowDialog(const std::string& name) { |
| 472 GURL origin("https://example.com"); | 472 GURL origin("https://example.com"); |
| 473 std::vector<std::unique_ptr<autofill::PasswordForm>> local_credentials; | 473 std::vector<std::unique_ptr<autofill::PasswordForm>> local_credentials; |
| 474 autofill::PasswordForm form; | 474 autofill::PasswordForm form; |
| 475 form.origin = origin; | 475 form.origin = origin; |
| 476 form.display_name = base::ASCIIToUTF16("Peter"); | 476 form.display_name = base::ASCIIToUTF16("Peter"); |
| 477 form.username_value = base::ASCIIToUTF16("peter@pan.test"); | 477 form.username_value = base::ASCIIToUTF16("peter@pan.test"); |
| 478 if (name == "PopupAutoSigninPrompt") { | 478 if (name == "PopupAutoSigninPrompt") { |
| 479 form.icon_url = GURL("broken url"); | 479 form.icon_url = GURL("broken url"); |
| 480 local_credentials.push_back(base::MakeUnique<autofill::PasswordForm>(form)); | 480 local_credentials.push_back(base::MakeUnique<autofill::PasswordForm>(form)); |
| 481 GURL icon_url("https://google.com/icon.png"); | 481 form.icon_url = GURL("https://google.com/icon.png"); |
| 482 form.icon_url = icon_url; | |
| 483 form.display_name = base::ASCIIToUTF16("Peter Pan"); | 482 form.display_name = base::ASCIIToUTF16("Peter Pan"); |
| 484 form.federation_origin = url::Origin(GURL("https://google.com/federation")); | 483 form.federation_origin = url::Origin(GURL("https://google.com/federation")); |
| 485 local_credentials.push_back(base::MakeUnique<autofill::PasswordForm>(form)); | 484 local_credentials.push_back(base::MakeUnique<autofill::PasswordForm>(form)); |
| 486 SetupChooseCredentials(std::move(local_credentials), origin); | 485 SetupChooseCredentials(std::move(local_credentials), origin); |
| 487 ASSERT_TRUE(controller()->current_account_chooser()); | 486 ASSERT_TRUE(controller()->current_account_chooser()); |
| 488 } else if (name == "PopupAccountChooserWithSingleCredentialClickSignIn") { | 487 } else if (name == "PopupAccountChooserWithSingleCredentialClickSignIn") { |
| 489 local_credentials.push_back(base::MakeUnique<autofill::PasswordForm>(form)); | 488 local_credentials.push_back(base::MakeUnique<autofill::PasswordForm>(form)); |
| 490 SetupChooseCredentials(std::move(local_credentials), origin); | 489 SetupChooseCredentials(std::move(local_credentials), origin); |
| 491 } else { | 490 } else { |
| 492 ADD_FAILURE() << "Unknown dialog type"; | 491 ADD_FAILURE() << "Unknown dialog type"; |
| 493 return; | 492 return; |
| 494 } | 493 } |
| 495 } | 494 } |
| 496 | 495 |
| 497 IN_PROC_BROWSER_TEST_F(PasswordDialogViewTest, | 496 IN_PROC_BROWSER_TEST_F(PasswordDialogViewTest, |
| 498 InvokeDialog_PopupAutoSigninPrompt) { | 497 InvokeDialog_PopupAutoSigninPrompt) { |
| 499 RunDialog(); | 498 RunDialog(); |
| 500 } | 499 } |
| 501 | 500 |
| 502 IN_PROC_BROWSER_TEST_F( | 501 IN_PROC_BROWSER_TEST_F( |
| 503 PasswordDialogViewTest, | 502 PasswordDialogViewTest, |
| 504 InvokeDialog_PopupAccountChooserWithSingleCredentialClickSignIn) { | 503 InvokeDialog_PopupAccountChooserWithSingleCredentialClickSignIn) { |
| 505 RunDialog(); | 504 RunDialog(); |
| 506 } | 505 } |
| 507 | 506 |
| 508 } // namespace | 507 } // namespace |
| OLD | NEW |