| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/password_manager/chrome_password_manager_client.h" | 5 #include "chrome/browser/password_manager/chrome_password_manager_client.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 std::unique_ptr<content::WebContents> web_contents( | 569 std::unique_ptr<content::WebContents> web_contents( |
| 570 content::WebContents::Create( | 570 content::WebContents::Create( |
| 571 content::WebContents::CreateParams(profile()))); | 571 content::WebContents::CreateParams(profile()))); |
| 572 // In particular, this WebContent should not have the | 572 // In particular, this WebContent should not have the |
| 573 // ChromePasswordManagerClient. | 573 // ChromePasswordManagerClient. |
| 574 ASSERT_FALSE( | 574 ASSERT_FALSE( |
| 575 ChromePasswordManagerClient::FromWebContents(web_contents.get())); | 575 ChromePasswordManagerClient::FromWebContents(web_contents.get())); |
| 576 | 576 |
| 577 // This call should not crash. | 577 // This call should not crash. |
| 578 ChromePasswordManagerClient::BindCredentialManager( | 578 ChromePasswordManagerClient::BindCredentialManager( |
| 579 service_manager::BindSourceInfo(), | 579 password_manager::mojom::CredentialManagerAssociatedRequest(), |
| 580 password_manager::mojom::CredentialManagerRequest(), | |
| 581 web_contents->GetMainFrame()); | 580 web_contents->GetMainFrame()); |
| 582 } | 581 } |
| 583 | 582 |
| 584 TEST_F(ChromePasswordManagerClientTest, CanShowBubbleOnURL) { | 583 TEST_F(ChromePasswordManagerClientTest, CanShowBubbleOnURL) { |
| 585 struct TestCase { | 584 struct TestCase { |
| 586 const char* scheme; | 585 const char* scheme; |
| 587 bool can_show_bubble; | 586 bool can_show_bubble; |
| 588 } kTestCases[] = { | 587 } kTestCases[] = { |
| 589 {url::kHttpScheme, true}, | 588 {url::kHttpScheme, true}, |
| 590 {url::kHttpsScheme, true}, | 589 {url::kHttpsScheme, true}, |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 637 web_contents()->GetBrowserContext(), nullptr)); | 636 web_contents()->GetBrowserContext(), nullptr)); |
| 638 std::unique_ptr<MockChromePasswordManagerClient> client( | 637 std::unique_ptr<MockChromePasswordManagerClient> client( |
| 639 new MockChromePasswordManagerClient(test_web_contents.get())); | 638 new MockChromePasswordManagerClient(test_web_contents.get())); |
| 640 EXPECT_CALL(*client->password_protection_service(), | 639 EXPECT_CALL(*client->password_protection_service(), |
| 641 MaybeStartProtectedPasswordEntryRequest(_, _, _, true)) | 640 MaybeStartProtectedPasswordEntryRequest(_, _, _, true)) |
| 642 .Times(1); | 641 .Times(1); |
| 643 client->CheckProtectedPasswordEntry(std::string("saved_domain.com"), true); | 642 client->CheckProtectedPasswordEntry(std::string("saved_domain.com"), true); |
| 644 } | 643 } |
| 645 | 644 |
| 646 #endif | 645 #endif |
| OLD | NEW |