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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 | 6 |
7 #include "chrome/browser/password_manager/chrome_password_manager_client.h" | 7 #include "chrome/browser/password_manager/chrome_password_manager_client.h" |
8 | 8 |
9 #include "chrome/common/chrome_version_info.h" | 9 #include "chrome/common/chrome_version_info.h" |
10 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 10 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 | 52 |
53 testing::StrictMock<MockLogReceiver> receiver_; | 53 testing::StrictMock<MockLogReceiver> receiver_; |
54 }; | 54 }; |
55 | 55 |
56 ChromePasswordManagerClientTest::ChromePasswordManagerClientTest() | 56 ChromePasswordManagerClientTest::ChromePasswordManagerClientTest() |
57 : service_(NULL) { | 57 : service_(NULL) { |
58 } | 58 } |
59 | 59 |
60 void ChromePasswordManagerClientTest::SetUp() { | 60 void ChromePasswordManagerClientTest::SetUp() { |
61 ChromeRenderViewHostTestHarness::SetUp(); | 61 ChromeRenderViewHostTestHarness::SetUp(); |
62 ChromePasswordManagerClient::CreateForWebContentsWithAutofillManagerDelegate( | 62 ChromePasswordManagerClient::CreateForWebContentsWithAutofillClient( |
63 web_contents(), NULL); | 63 web_contents(), NULL); |
64 service_ = password_manager::PasswordManagerInternalsServiceFactory:: | 64 service_ = password_manager::PasswordManagerInternalsServiceFactory:: |
65 GetForBrowserContext(profile()); | 65 GetForBrowserContext(profile()); |
66 ASSERT_TRUE(service_); | 66 ASSERT_TRUE(service_); |
67 } | 67 } |
68 | 68 |
69 ChromePasswordManagerClient* ChromePasswordManagerClientTest::GetClient() { | 69 ChromePasswordManagerClient* ChromePasswordManagerClientTest::GetClient() { |
70 return ChromePasswordManagerClient::FromWebContents(web_contents()); | 70 return ChromePasswordManagerClient::FromWebContents(web_contents()); |
71 } | 71 } |
72 | 72 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 ChromePasswordManagerClient* client = GetClient(); | 156 ChromePasswordManagerClient* client = GetClient(); |
157 service_->RegisterReceiver(&receiver_); | 157 service_->RegisterReceiver(&receiver_); |
158 EXPECT_TRUE(client->IsLoggingActive()); | 158 EXPECT_TRUE(client->IsLoggingActive()); |
159 | 159 |
160 EXPECT_CALL(receiver_, LogSavePasswordProgress(kTestText)).Times(1); | 160 EXPECT_CALL(receiver_, LogSavePasswordProgress(kTestText)).Times(1); |
161 client->LogSavePasswordProgress(kTestText); | 161 client->LogSavePasswordProgress(kTestText); |
162 | 162 |
163 service_->UnregisterReceiver(&receiver_); | 163 service_->UnregisterReceiver(&receiver_); |
164 EXPECT_FALSE(client->IsLoggingActive()); | 164 EXPECT_FALSE(client->IsLoggingActive()); |
165 } | 165 } |
OLD | NEW |