OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 IN_PROC_BROWSER_TEST_F(ProfileManagerBrowserTest, DeletePasswords) { | 420 IN_PROC_BROWSER_TEST_F(ProfileManagerBrowserTest, DeletePasswords) { |
421 Profile* profile = ProfileManager::GetActiveUserProfile(); | 421 Profile* profile = ProfileManager::GetActiveUserProfile(); |
422 ASSERT_TRUE(profile); | 422 ASSERT_TRUE(profile); |
423 | 423 |
424 autofill::PasswordForm form; | 424 autofill::PasswordForm form; |
425 form.scheme = autofill::PasswordForm::SCHEME_HTML; | 425 form.scheme = autofill::PasswordForm::SCHEME_HTML; |
426 form.origin = GURL("http://accounts.google.com/LoginAuth"); | 426 form.origin = GURL("http://accounts.google.com/LoginAuth"); |
427 form.signon_realm = "http://accounts.google.com/"; | 427 form.signon_realm = "http://accounts.google.com/"; |
428 form.username_value = base::ASCIIToUTF16("my_username"); | 428 form.username_value = base::ASCIIToUTF16("my_username"); |
429 form.password_value = base::ASCIIToUTF16("my_password"); | 429 form.password_value = base::ASCIIToUTF16("my_password"); |
430 form.ssl_valid = false; | |
431 form.preferred = true; | 430 form.preferred = true; |
432 form.blacklisted_by_user = false; | 431 form.blacklisted_by_user = false; |
433 | 432 |
434 scoped_refptr<password_manager::PasswordStore> password_store = | 433 scoped_refptr<password_manager::PasswordStore> password_store = |
435 PasswordStoreFactory::GetForProfile( | 434 PasswordStoreFactory::GetForProfile( |
436 profile, ServiceAccessType::EXPLICIT_ACCESS).get(); | 435 profile, ServiceAccessType::EXPLICIT_ACCESS).get(); |
437 ASSERT_TRUE(password_store.get()); | 436 ASSERT_TRUE(password_store.get()); |
438 | 437 |
439 password_store->AddLogin(form); | 438 password_store->AddLogin(form); |
440 PasswordStoreConsumerVerifier verify_add; | 439 PasswordStoreConsumerVerifier verify_add; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 | 491 |
493 EXPECT_FALSE(profile->HasOffTheRecordProfile()); | 492 EXPECT_FALSE(profile->HasOffTheRecordProfile()); |
494 EXPECT_FALSE(profile_manager->IsValidProfile(incognito_profile)); | 493 EXPECT_FALSE(profile_manager->IsValidProfile(incognito_profile)); |
495 EXPECT_EQ(initial_profile_count, profile_manager->GetNumberOfProfiles()); | 494 EXPECT_EQ(initial_profile_count, profile_manager->GetNumberOfProfiles()); |
496 // After destroying the incognito profile incognito preferences should be | 495 // After destroying the incognito profile incognito preferences should be |
497 // cleared so the default save path should be taken from the main profile. | 496 // cleared so the default save path should be taken from the main profile. |
498 EXPECT_FALSE(profile->GetOffTheRecordPrefs() | 497 EXPECT_FALSE(profile->GetOffTheRecordPrefs() |
499 ->GetFilePath(prefs::kSaveFileDefaultDirectory) | 498 ->GetFilePath(prefs::kSaveFileDefaultDirectory) |
500 .empty()); | 499 .empty()); |
501 } | 500 } |
OLD | NEW |