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

Side by Side Diff: chrome/browser/sync/util/user_settings_unittest.cc

Issue 3058003: Load the token from the user settings DB as a blob because it might include (Closed)
Patch Set: Bind the token with bind_blob Created 10 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
« no previous file with comments | « chrome/browser/sync/util/user_settings_posix.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 <limits> 5 #include <limits>
6 #include <string> 6 #include <string>
7 7
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/scoped_temp_dir.h" 9 #include "base/scoped_temp_dir.h"
10 #include "chrome/browser/password_manager/encryptor.h" 10 #include "chrome/browser/password_manager/encryptor.h"
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 TEST_F(UserSettingsTest, PersistNonEmptyToken) { 249 TEST_F(UserSettingsTest, PersistNonEmptyToken) {
250 ScopedTempDir temp_dir; 250 ScopedTempDir temp_dir;
251 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); 251 ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
252 UserSettings settings; 252 UserSettings settings;
253 settings.Init(temp_dir.path().AppendASCII("UserSettings.sqlite3")); 253 settings.Init(temp_dir.path().AppendASCII("UserSettings.sqlite3"));
254 #if defined(OS_MACOSX) 254 #if defined(OS_MACOSX)
255 // Need to mock the Keychain for unit tests on Mac to avoid possible 255 // Need to mock the Keychain for unit tests on Mac to avoid possible
256 // blocking UI. |SetAuthTokenForService| uses Encryptor. 256 // blocking UI. |SetAuthTokenForService| uses Encryptor.
257 Encryptor::UseMockKeychain(true); 257 Encryptor::UseMockKeychain(true);
258 #endif 258 #endif
259 settings.SetAuthTokenForService("username", "service", "012345beefbeef"); 259 settings.SetAuthTokenForService("username", "service",
260 "oonetuhasonteuhasonetuhasonetuhasonetuhasouhasonetuhasonetuhasonetuhah"
261 "oonetuhasonteuhasonetuhasonetuhasonetuhasouhasonetuhasonetuhasonetuhah"
262 "oonetuhasonteuhasonetuhasonetuhasonetuhasouhasonetuhasonetuhasonetuhah");
260 std::string username; 263 std::string username;
261 std::string token; 264 std::string token;
262 ASSERT_TRUE(settings.GetLastUserAndServiceToken("service", &username, 265 ASSERT_TRUE(settings.GetLastUserAndServiceToken("service", &username,
263 &token)); 266 &token));
264 EXPECT_EQ("012345beefbeef", token); 267 EXPECT_EQ(
268 "oonetuhasonteuhasonetuhasonetuhasonetuhasouhasonetuhasonetuhasonetuhah"
269 "oonetuhasonteuhasonetuhasonetuhasonetuhasouhasonetuhasonetuhasonetuhah"
270 "oonetuhasonteuhasonetuhasonetuhasonetuhasouhasonetuhasonetuhasonetuhah",
271 token);
265 EXPECT_EQ("username", username); 272 EXPECT_EQ("username", username);
266 } 273 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/util/user_settings_posix.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698