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

Unified Diff: chrome/browser/sync/credential_cache_win_unittest.cc

Issue 10656033: [sync] Automatic bootstrapping of Sync on Win 8 from cached credentials (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: "" Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/credential_cache_win_unittest.cc
diff --git a/chrome/browser/sync/credential_cache_win_unittest.cc b/chrome/browser/sync/credential_cache_win_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..3308b2d495aeddfe51ebe9aff8e7e86ebdf9e513
--- /dev/null
+++ b/chrome/browser/sync/credential_cache_win_unittest.cc
@@ -0,0 +1,45 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/sync/credential_cache_win.h"
+
+#include "base/memory/ref_counted.h"
+#include "base/path_service.h"
+#include "base/scoped_temp_dir.h"
+#include "base/values.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+#include <string>
+
+namespace csync {
+namespace {
+
+TEST(CredentialCacheTest, TestPackAndUnpack) {
+ // Pack a sample credential string.
+ std::string original = "sample_credential";
+ base::StringValue* packed = CredentialCache::PackCredential(original);
+
+ // Unpack the result and make sure it matches the original.
+ std::string unpacked;
+ CredentialCache::UnpackCredential(packed, &unpacked);
+ ASSERT_EQ(original, unpacked);
+}
+/*
+TEST(SyncCredentialCacheTest, TestWriteAndRead) {
+ // Create sample SyncCredentialCache objects for auth and encryption tokens.
+ scoped_refptr<SyncCredentialCache> auth_tokens =
+ new SyncCredentialCache();
+ auth_tokens->authenticated_username = "sample_authenticated_username";
+ auth_tokens->sid = "sample_sid";
+ auth_tokens->lsid = "sample_lsid";
+ scoped_refptr<SyncCredentialCache> encryption_token =
+ new SyncCredentialCache();
+ encryption_token->encryption_bootstrap_token =
+ "sample_encryption_bootstrap_token";
+
+ // TODO(rsimha): Finish this test.
+}
+*/
+} // namespace
+} // namespace csync

Powered by Google App Engine
This is Rietveld 408576698