Chromium Code Reviews| 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 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 462 | 462 |
| 463 // Successful login with the same form after block will prompt: | 463 // Successful login with the same form after block will prompt: |
| 464 blocked_form.reset(new autofill::PasswordForm(form)); | 464 blocked_form.reset(new autofill::PasswordForm(form)); |
| 465 client()->NotifyUserCouldBeAutoSignedIn(std::move(blocked_form)); | 465 client()->NotifyUserCouldBeAutoSignedIn(std::move(blocked_form)); |
| 466 client()->NotifySuccessfulLoginWithExistingPassword(form); | 466 client()->NotifySuccessfulLoginWithExistingPassword(form); |
| 467 ASSERT_TRUE(controller()->current_autosignin_prompt()); | 467 ASSERT_TRUE(controller()->current_autosignin_prompt()); |
| 468 } | 468 } |
| 469 | 469 |
| 470 // DialogBrowserTest methods for interactive dialog invocation. | 470 // DialogBrowserTest methods for interactive dialog invocation. |
| 471 void PasswordDialogViewTest::ShowDialog(const std::string& name) { | 471 void PasswordDialogViewTest::ShowDialog(const std::string& name) { |
| 472 if (name == "AutoSigninFirstRun") { | |
| 473 controller()->OnPromptEnableAutoSignin(); | |
|
tapted
2017/05/10 05:30:12
make sure there's no path that results in a messag
Patti Lor
2017/05/11 06:59:19
Looks OK, thanks for the FYI :)
| |
| 474 return; | |
| 475 } | |
| 476 | |
| 472 GURL origin("https://example.com"); | 477 GURL origin("https://example.com"); |
| 473 std::vector<std::unique_ptr<autofill::PasswordForm>> local_credentials; | 478 std::vector<std::unique_ptr<autofill::PasswordForm>> local_credentials; |
| 474 autofill::PasswordForm form; | 479 autofill::PasswordForm form; |
| 475 form.origin = origin; | 480 form.origin = origin; |
| 476 form.display_name = base::ASCIIToUTF16("Peter"); | 481 form.display_name = base::ASCIIToUTF16("Peter"); |
| 477 form.username_value = base::ASCIIToUTF16("peter@pan.test"); | 482 form.username_value = base::ASCIIToUTF16("peter@pan.test"); |
| 478 if (name == "PopupAutoSigninPrompt") { | 483 if (name == "PopupAutoSigninPrompt") { |
| 479 form.icon_url = GURL("broken url"); | 484 form.icon_url = GURL("broken url"); |
| 480 local_credentials.push_back(base::MakeUnique<autofill::PasswordForm>(form)); | 485 local_credentials.push_back(base::MakeUnique<autofill::PasswordForm>(form)); |
| 481 form.icon_url = GURL("https://google.com/icon.png"); | 486 form.icon_url = GURL("https://google.com/icon.png"); |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 497 InvokeDialog_PopupAutoSigninPrompt) { | 502 InvokeDialog_PopupAutoSigninPrompt) { |
| 498 RunDialog(); | 503 RunDialog(); |
| 499 } | 504 } |
| 500 | 505 |
| 501 IN_PROC_BROWSER_TEST_F( | 506 IN_PROC_BROWSER_TEST_F( |
| 502 PasswordDialogViewTest, | 507 PasswordDialogViewTest, |
| 503 InvokeDialog_PopupAccountChooserWithSingleCredentialClickSignIn) { | 508 InvokeDialog_PopupAccountChooserWithSingleCredentialClickSignIn) { |
| 504 RunDialog(); | 509 RunDialog(); |
| 505 } | 510 } |
| 506 | 511 |
| 512 IN_PROC_BROWSER_TEST_F(PasswordDialogViewTest, | |
| 513 InvokeDialog_AutoSigninFirstRun) { | |
| 514 RunDialog(); | |
| 515 } | |
| 516 | |
| 507 } // namespace | 517 } // namespace |
| OLD | NEW |