Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(308)

Side by Side Diff: chrome/browser/password_manager/chrome_password_manager_client_unittest.cc

Issue 2947413002: Restrict CM API interface request and message dispatch. (Closed)
Patch Set: Address nit from clamy@. Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698