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

Side by Side Diff: components/password_manager/core/browser/password_store_unittest.cc

Issue 1730313004: Remove PasswordStore::AuthorizationPromptPolicy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 (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 // The passwords in the tests below are all empty because PasswordStoreDefault 5 // The passwords in the tests below are all empty because PasswordStoreDefault
6 // does not store the actual passwords on OS X (they are stored in the Keychain 6 // does not store the actual passwords on OS X (they are stored in the Keychain
7 // instead). We could special-case it, but it is easier to just have empty 7 // instead). We could special-case it, but it is easier to just have empty
8 // passwords. This will not be needed anymore if crbug.com/466638 is fixed. 8 // passwords. This will not be needed anymore if crbug.com/466638 is fixed.
9 9
10 #include <stddef.h> 10 #include <stddef.h>
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 .RetiresOnSaturation(); 208 .RetiresOnSaturation();
209 EXPECT_CALL(consumer, 209 EXPECT_CALL(consumer,
210 OnGetPasswordStoreResultsConstRef( 210 OnGetPasswordStoreResultsConstRef(
211 UnorderedPasswordFormElementsAre(accounts_google_expected))) 211 UnorderedPasswordFormElementsAre(accounts_google_expected)))
212 .RetiresOnSaturation(); 212 .RetiresOnSaturation();
213 EXPECT_CALL(consumer, 213 EXPECT_CALL(consumer,
214 OnGetPasswordStoreResultsConstRef( 214 OnGetPasswordStoreResultsConstRef(
215 UnorderedPasswordFormElementsAre(bar_example_expected))) 215 UnorderedPasswordFormElementsAre(bar_example_expected)))
216 .RetiresOnSaturation(); 216 .RetiresOnSaturation();
217 217
218 store->GetLogins(www_google, PasswordStore::ALLOW_PROMPT, &consumer); 218 store->GetLogins(www_google, &consumer);
219 store->GetLogins(accounts_google, PasswordStore::ALLOW_PROMPT, &consumer); 219 store->GetLogins(accounts_google, &consumer);
220 store->GetLogins(bar_example, PasswordStore::ALLOW_PROMPT, &consumer); 220 store->GetLogins(bar_example, &consumer);
221 221
222 base::MessageLoop::current()->RunUntilIdle(); 222 base::MessageLoop::current()->RunUntilIdle();
223 223
224 store->ShutdownOnUIThread(); 224 store->ShutdownOnUIThread();
225 base::MessageLoop::current()->RunUntilIdle(); 225 base::MessageLoop::current()->RunUntilIdle();
226 } 226 }
227 227
228 TEST_F(PasswordStoreTest, StartSyncFlare) { 228 TEST_F(PasswordStoreTest, StartSyncFlare) {
229 scoped_refptr<PasswordStoreDefault> store(new PasswordStoreDefault( 229 scoped_refptr<PasswordStoreDefault> store(new PasswordStoreDefault(
230 base::ThreadTaskRunnerHandle::Get(), base::ThreadTaskRunnerHandle::Get(), 230 base::ThreadTaskRunnerHandle::Get(), base::ThreadTaskRunnerHandle::Get(),
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 result->is_public_suffix_match = true; 450 result->is_public_suffix_match = true;
451 } 451 }
452 452
453 std::vector<std::string> no_affiliated_android_realms; 453 std::vector<std::string> no_affiliated_android_realms;
454 mock_helper->ExpectCallToGetAffiliatedAndroidRealms( 454 mock_helper->ExpectCallToGetAffiliatedAndroidRealms(
455 observed_form, no_affiliated_android_realms); 455 observed_form, no_affiliated_android_realms);
456 456
457 EXPECT_CALL(mock_consumer, 457 EXPECT_CALL(mock_consumer,
458 OnGetPasswordStoreResultsConstRef( 458 OnGetPasswordStoreResultsConstRef(
459 UnorderedPasswordFormElementsAre(expected_results.get()))); 459 UnorderedPasswordFormElementsAre(expected_results.get())));
460 store->GetLogins(observed_form, PasswordStore::ALLOW_PROMPT, &mock_consumer); 460 store->GetLogins(observed_form, &mock_consumer);
461 store->ShutdownOnUIThread(); 461 store->ShutdownOnUIThread();
462 base::MessageLoop::current()->RunUntilIdle(); 462 base::MessageLoop::current()->RunUntilIdle();
463 } 463 }
464 464
465 // There are 3 Android applications affiliated with the realm of the observed 465 // There are 3 Android applications affiliated with the realm of the observed
466 // form, with the PasswordStore having credentials for two of these (even two 466 // form, with the PasswordStore having credentials for two of these (even two
467 // credentials for one). GetLoginsWithAffiliations() should return the exact, 467 // credentials for one). GetLoginsWithAffiliations() should return the exact,
468 // and PSL matching credentials, and the credentials for these two Android 468 // and PSL matching credentials, and the credentials for these two Android
469 // applications, but not for the unaffiliated Android application. 469 // applications, but not for the unaffiliated Android application.
470 TEST_F(PasswordStoreTest, GetLoginsWithAffiliations) { 470 TEST_F(PasswordStoreTest, GetLoginsWithAffiliations) {
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 affiliated_android_realms.push_back(kTestAndroidRealm1); 568 affiliated_android_realms.push_back(kTestAndroidRealm1);
569 affiliated_android_realms.push_back(kTestAndroidRealm2); 569 affiliated_android_realms.push_back(kTestAndroidRealm2);
570 affiliated_android_realms.push_back(kTestAndroidRealm3); 570 affiliated_android_realms.push_back(kTestAndroidRealm3);
571 mock_helper->ExpectCallToGetAffiliatedAndroidRealms( 571 mock_helper->ExpectCallToGetAffiliatedAndroidRealms(
572 observed_form, affiliated_android_realms); 572 observed_form, affiliated_android_realms);
573 573
574 EXPECT_CALL(mock_consumer, 574 EXPECT_CALL(mock_consumer,
575 OnGetPasswordStoreResultsConstRef( 575 OnGetPasswordStoreResultsConstRef(
576 UnorderedPasswordFormElementsAre(expected_results.get()))); 576 UnorderedPasswordFormElementsAre(expected_results.get())));
577 577
578 store->GetLogins(observed_form, PasswordStore::ALLOW_PROMPT, &mock_consumer); 578 store->GetLogins(observed_form, &mock_consumer);
579 store->ShutdownOnUIThread(); 579 store->ShutdownOnUIThread();
580 base::MessageLoop::current()->RunUntilIdle(); 580 base::MessageLoop::current()->RunUntilIdle();
581 } 581 }
582 582
583 // This test must use passwords, which are not stored on Mac, therefore the test 583 // This test must use passwords, which are not stored on Mac, therefore the test
584 // is disabled on Mac. This should not be a huge issue as functionality in the 584 // is disabled on Mac. This should not be a huge issue as functionality in the
585 // platform-independent base class is tested. See also the file-level comment. 585 // platform-independent base class is tested. See also the file-level comment.
586 #if defined(OS_MACOSX) 586 #if defined(OS_MACOSX)
587 #define MAYBE_UpdatePasswordsStoredForAffiliatedWebsites \ 587 #define MAYBE_UpdatePasswordsStoredForAffiliatedWebsites \
588 DISABLED_UpdatePasswordsStoredForAffiliatedWebsites 588 DISABLED_UpdatePasswordsStoredForAffiliatedWebsites
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
793 OnGetPasswordStoreResultsConstRef(UnorderedPasswordFormElementsAre( 793 OnGetPasswordStoreResultsConstRef(UnorderedPasswordFormElementsAre(
794 expected_credentials_after_update.get()))); 794 expected_credentials_after_update.get())));
795 store->GetAutofillableLogins(&mock_consumer); 795 store->GetAutofillableLogins(&mock_consumer);
796 store->ShutdownOnUIThread(); 796 store->ShutdownOnUIThread();
797 base::MessageLoop::current()->RunUntilIdle(); 797 base::MessageLoop::current()->RunUntilIdle();
798 } 798 }
799 } 799 }
800 } 800 }
801 801
802 } // namespace password_manager 802 } // namespace password_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698