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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/sync/profile_sync_service_factory.h" | 10 #include "chrome/browser/sync/profile_sync_service_factory.h" |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 | 221 |
222 service_->UnregisterReceiver(&receiver_); | 222 service_->UnregisterReceiver(&receiver_); |
223 EXPECT_FALSE(client->IsLoggingActive()); | 223 EXPECT_FALSE(client->IsLoggingActive()); |
224 } | 224 } |
225 | 225 |
226 TEST_F(ChromePasswordManagerClientTest, | 226 TEST_F(ChromePasswordManagerClientTest, |
227 ShouldAskUserToSubmitURLDefaultBehaviour) { | 227 ShouldAskUserToSubmitURLDefaultBehaviour) { |
228 ChromePasswordManagerClient* client = GetClient(); | 228 ChromePasswordManagerClient* client = GetClient(); |
229 // TODO(melandory) Since "Ask user to submit URL" functionality is currently | 229 // TODO(melandory) Since "Ask user to submit URL" functionality is currently |
230 // in development, so the user should not be asked to submit a URL. | 230 // in development, so the user should not be asked to submit a URL. |
231 EXPECT_FALSE(client->ShouldAskUserToSubmitURL()); | 231 EXPECT_FALSE(client->ShouldAskUserToSubmitURL(GURL("https://hostname.com/"))); |
| 232 } |
| 233 |
| 234 TEST_F(ChromePasswordManagerClientTest, ShouldAskUserToSubmitURLEmptyURL) { |
| 235 ChromePasswordManagerClient* client = GetClient(); |
| 236 EXPECT_FALSE(client->ShouldAskUserToSubmitURL(GURL::EmptyGURL())); |
232 } | 237 } |
233 | 238 |
234 TEST_F(ChromePasswordManagerClientTest, ShouldFilterAutofillResult_Reauth) { | 239 TEST_F(ChromePasswordManagerClientTest, ShouldFilterAutofillResult_Reauth) { |
235 // Make client disallow only reauth requests. | 240 // Make client disallow only reauth requests. |
236 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 241 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
237 command_line->AppendSwitch( | 242 command_line->AppendSwitch( |
238 password_manager::switches::kDisallowAutofillSyncCredentialForReauth); | 243 password_manager::switches::kDisallowAutofillSyncCredentialForReauth); |
239 scoped_ptr<TestChromePasswordManagerClient> client( | 244 scoped_ptr<TestChromePasswordManagerClient> client( |
240 new TestChromePasswordManagerClient(web_contents())); | 245 new TestChromePasswordManagerClient(web_contents())); |
241 autofill::PasswordForm form; | 246 autofill::PasswordForm form; |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 | 394 |
390 // Again, without a custom passphrase. | 395 // Again, without a custom passphrase. |
391 EXPECT_CALL(*mock_sync_service, IsUsingSecondaryPassphrase()) | 396 EXPECT_CALL(*mock_sync_service, IsUsingSecondaryPassphrase()) |
392 .WillRepeatedly(Return(false)); | 397 .WillRepeatedly(Return(false)); |
393 | 398 |
394 EXPECT_FALSE( | 399 EXPECT_FALSE( |
395 client->IsPasswordSyncEnabled(password_manager::ONLY_CUSTOM_PASSPHRASE)); | 400 client->IsPasswordSyncEnabled(password_manager::ONLY_CUSTOM_PASSPHRASE)); |
396 EXPECT_FALSE(client->IsPasswordSyncEnabled( | 401 EXPECT_FALSE(client->IsPasswordSyncEnabled( |
397 password_manager::WITHOUT_CUSTOM_PASSPHRASE)); | 402 password_manager::WITHOUT_CUSTOM_PASSPHRASE)); |
398 } | 403 } |
OLD | NEW |