| 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
|
|
|