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 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 std::unique_ptr<content::WebContents> web_contents( | 562 std::unique_ptr<content::WebContents> web_contents( |
563 content::WebContents::Create( | 563 content::WebContents::Create( |
564 content::WebContents::CreateParams(profile()))); | 564 content::WebContents::CreateParams(profile()))); |
565 // In particular, this WebContent should not have the | 565 // In particular, this WebContent should not have the |
566 // ChromePasswordManagerClient. | 566 // ChromePasswordManagerClient. |
567 ASSERT_FALSE( | 567 ASSERT_FALSE( |
568 ChromePasswordManagerClient::FromWebContents(web_contents.get())); | 568 ChromePasswordManagerClient::FromWebContents(web_contents.get())); |
569 | 569 |
570 // This call should not crash. | 570 // This call should not crash. |
571 ChromePasswordManagerClient::BindCredentialManager( | 571 ChromePasswordManagerClient::BindCredentialManager( |
572 web_contents->GetMainFrame(), | 572 web_contents->GetMainFrame(), service_manager::BindSourceInfo(), |
573 password_manager::mojom::CredentialManagerRequest()); | 573 password_manager::mojom::CredentialManagerRequest()); |
574 } | 574 } |
575 | 575 |
576 TEST_F(ChromePasswordManagerClientTest, CanShowBubbleOnURL) { | 576 TEST_F(ChromePasswordManagerClientTest, CanShowBubbleOnURL) { |
577 struct TestCase { | 577 struct TestCase { |
578 const char* scheme; | 578 const char* scheme; |
579 bool can_show_bubble; | 579 bool can_show_bubble; |
580 } kTestCases[] = { | 580 } kTestCases[] = { |
581 {url::kHttpScheme, true}, | 581 {url::kHttpScheme, true}, |
582 {url::kHttpsScheme, true}, | 582 {url::kHttpsScheme, true}, |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 web_contents()->GetBrowserContext(), nullptr)); | 615 web_contents()->GetBrowserContext(), nullptr)); |
616 std::unique_ptr<MockChromePasswordManagerClient> client( | 616 std::unique_ptr<MockChromePasswordManagerClient> client( |
617 new MockChromePasswordManagerClient(test_web_contents.get())); | 617 new MockChromePasswordManagerClient(test_web_contents.get())); |
618 EXPECT_CALL(*client->password_protection_service(), | 618 EXPECT_CALL(*client->password_protection_service(), |
619 MaybeStartLowReputationRequest(_, _, _)) | 619 MaybeStartLowReputationRequest(_, _, _)) |
620 .Times(1); | 620 .Times(1); |
621 client->CheckSafeBrowsingReputation(GURL("http://foo.com/submit"), | 621 client->CheckSafeBrowsingReputation(GURL("http://foo.com/submit"), |
622 GURL("http://foo.com/iframe.html")); | 622 GURL("http://foo.com/iframe.html")); |
623 } | 623 } |
624 #endif | 624 #endif |
OLD | NEW |