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

Side by Side Diff: trunk/src/sync/util/cryptographer_unittest.cc

Issue 198163004: Revert 257524 "Move IsStringASCII/UTF8 to base namespace." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 9 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) 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 "sync/util/cryptographer.h" 5 #include "sync/util/cryptographer.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 EXPECT_EQ(original.SerializeAsString(), decrypted.SerializeAsString()); 182 EXPECT_EQ(original.SerializeAsString(), decrypted.SerializeAsString());
183 } 183 }
184 } 184 }
185 185
186 TEST_F(CryptographerTest, Bootstrap) { 186 TEST_F(CryptographerTest, Bootstrap) {
187 KeyParams params = {"localhost", "dummy", "dummy"}; 187 KeyParams params = {"localhost", "dummy", "dummy"};
188 cryptographer_.AddKey(params); 188 cryptographer_.AddKey(params);
189 189
190 std::string token; 190 std::string token;
191 EXPECT_TRUE(cryptographer_.GetBootstrapToken(&token)); 191 EXPECT_TRUE(cryptographer_.GetBootstrapToken(&token));
192 EXPECT_TRUE(base::IsStringUTF8(token)); 192 EXPECT_TRUE(IsStringUTF8(token));
193 193
194 Cryptographer other_cryptographer(&encryptor_); 194 Cryptographer other_cryptographer(&encryptor_);
195 other_cryptographer.Bootstrap(token); 195 other_cryptographer.Bootstrap(token);
196 EXPECT_TRUE(other_cryptographer.is_ready()); 196 EXPECT_TRUE(other_cryptographer.is_ready());
197 197
198 const char secret[] = "secret"; 198 const char secret[] = "secret";
199 sync_pb::EncryptedData encrypted; 199 sync_pb::EncryptedData encrypted;
200 EXPECT_TRUE(other_cryptographer.EncryptString(secret, &encrypted)); 200 EXPECT_TRUE(other_cryptographer.EncryptString(secret, &encrypted));
201 EXPECT_TRUE(cryptographer_.CanDecryptUsingDefaultKey(encrypted)); 201 EXPECT_TRUE(cryptographer_.CanDecryptUsingDefaultKey(encrypted));
202 } 202 }
203 203
204 } // namespace syncer 204 } // namespace syncer
OLDNEW
« no previous file with comments | « trunk/src/remoting/protocol/me2me_host_authenticator_factory.cc ('k') | trunk/src/ui/base/l10n/l10n_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698