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

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

Issue 2421383003: Add operator==(const GURL&, const StringPiece&) to gurl.h (Closed)
Patch Set: Created 4 years, 2 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 #include "chrome/browser/password_manager/password_store_mac.h" 5 #include "chrome/browser/password_manager/password_store_mac.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 1780 matching lines...) Expand 10 before | Expand all | Expand 10 after
1791 EXPECT_CALL(observer, OnLoginsChanged(GetAddChangeList(*form_google))); 1791 EXPECT_CALL(observer, OnLoginsChanged(GetAddChangeList(*form_google)));
1792 observer.WaitAndVerify(this); 1792 observer.WaitAndVerify(this);
1793 1793
1794 ScopedVector<autofill::PasswordForm> forms; 1794 ScopedVector<autofill::PasswordForm> forms;
1795 EXPECT_TRUE(login_db()->GetAutoSignInLogins(&forms)); 1795 EXPECT_TRUE(login_db()->GetAutoSignInLogins(&forms));
1796 EXPECT_EQ(2u, forms.size()); 1796 EXPECT_EQ(2u, forms.size());
1797 EXPECT_FALSE(forms[0]->skip_zero_click); 1797 EXPECT_FALSE(forms[0]->skip_zero_click);
1798 EXPECT_FALSE(forms[1]->skip_zero_click); 1798 EXPECT_FALSE(forms[1]->skip_zero_click);
1799 1799
1800 store()->DisableAutoSignInForOrigins( 1800 store()->DisableAutoSignInForOrigins(
1801 base::Bind(&GURL::operator==, base::Unretained(&form_google->origin)), 1801 base::Bind(static_cast<bool (*)(const GURL&, const GURL&)>(operator==),
1802 base::Closure()); 1802 form_google->origin),
1803 base::Closure());
1803 FinishAsyncProcessing(); 1804 FinishAsyncProcessing();
1804 1805
1805 EXPECT_TRUE(login_db()->GetAutoSignInLogins(&forms)); 1806 EXPECT_TRUE(login_db()->GetAutoSignInLogins(&forms));
1806 EXPECT_EQ(1u, forms.size()); 1807 EXPECT_EQ(1u, forms.size());
1807 EXPECT_EQ(form_facebook->origin, forms[0]->origin); 1808 EXPECT_EQ(form_facebook->origin, forms[0]->origin);
1808 } 1809 }
1809 1810
1810 TEST_F(PasswordStoreMacTest, TestRemoveLoginsMultiProfile) { 1811 TEST_F(PasswordStoreMacTest, TestRemoveLoginsMultiProfile) {
1811 // Make sure that RemoveLoginsCreatedBetween does affect only the correct 1812 // Make sure that RemoveLoginsCreatedBetween does affect only the correct
1812 // profile. 1813 // profile.
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
2109 EXPECT_EQ(2u, passwords.size()); 2110 EXPECT_EQ(2u, passwords.size());
2110 2111
2111 // Delete everyhting but only the Chrome-owned item should be affected. 2112 // Delete everyhting but only the Chrome-owned item should be affected.
2112 PasswordStoreMac::CleanUpKeychain(keychain(), passwords); 2113 PasswordStoreMac::CleanUpKeychain(keychain(), passwords);
2113 passwords = password_manager_util::ConvertScopedVector( 2114 passwords = password_manager_util::ConvertScopedVector(
2114 keychain_adapter.GetAllPasswordFormPasswords()); 2115 keychain_adapter.GetAllPasswordFormPasswords());
2115 ASSERT_EQ(1u, passwords.size()); 2116 ASSERT_EQ(1u, passwords.size());
2116 EXPECT_EQ("http://some.domain.com/", passwords[0]->signon_realm); 2117 EXPECT_EQ("http://some.domain.com/", passwords[0]->signon_realm);
2117 EXPECT_EQ(ASCIIToUTF16("sekrit"), passwords[0]->password_value); 2118 EXPECT_EQ(ASCIIToUTF16("sekrit"), passwords[0]->password_value);
2118 } 2119 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698