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

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

Issue 151176: Implement Add and Update for PasswordStoreMac.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "testing/gtest/include/gtest/gtest.h" 5 #include "testing/gtest/include/gtest/gtest.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 delete result[0]; 152 delete result[0];
153 result.clear(); 153 result.clear();
154 154
155 // User changes his password. 155 // User changes his password.
156 PasswordForm form6(form5); 156 PasswordForm form6(form5);
157 form6.password_value = L"test6"; 157 form6.password_value = L"test6";
158 form6.preferred = true; 158 form6.preferred = true;
159 159
160 // We update, and check to make sure it matches the 160 // We update, and check to make sure it matches the
161 // old form, and there is only one record. 161 // old form, and there is only one record.
162 EXPECT_TRUE(db->UpdateLogin(form6)); 162 int rows_changed = 0;
163 EXPECT_TRUE(db->UpdateLogin(form6, &rows_changed));
164 EXPECT_EQ(1, rows_changed);
163 // matches 165 // matches
164 EXPECT_TRUE(db->GetLogins(form5, &result)); 166 EXPECT_TRUE(db->GetLogins(form5, &result));
165 EXPECT_EQ(1U, result.size()); 167 EXPECT_EQ(1U, result.size());
166 delete result[0]; 168 delete result[0];
167 result.clear(); 169 result.clear();
168 // Only one record. 170 // Only one record.
169 EXPECT_TRUE(db->GetAllLogins(&result, true)); 171 EXPECT_TRUE(db->GetAllLogins(&result, true));
170 EXPECT_EQ(1U, result.size()); 172 EXPECT_EQ(1U, result.size());
171 // Password element was updated. 173 // Password element was updated.
172 #if defined(OS_MACOSX) 174 #if defined(OS_MACOSX)
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 // GetLogins should give the blacklisted result. 287 // GetLogins should give the blacklisted result.
286 EXPECT_TRUE(db->GetLogins(form, &result)); 288 EXPECT_TRUE(db->GetLogins(form, &result));
287 EXPECT_EQ(1U, result.size()); 289 EXPECT_EQ(1U, result.size());
288 ClearResults(&result); 290 ClearResults(&result);
289 291
290 // So should GetAll including blacklisted. 292 // So should GetAll including blacklisted.
291 EXPECT_TRUE(db->GetAllLogins(&result, true)); 293 EXPECT_TRUE(db->GetAllLogins(&result, true));
292 EXPECT_EQ(1U, result.size()); 294 EXPECT_EQ(1U, result.size());
293 ClearResults(&result); 295 ClearResults(&result);
294 } 296 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698