#include "components/gcm_driver/crypto/gcm_key_store.h"
#include <memory>
#include <string>
#include "base/base64url.h"
#include "base/containers/span.h"
#include "base/files/scoped_temp_dir.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
#include "base/run_loop.h"
#include "base/test/gtest_util.h"
#include "base/test/task_environment.h"
#include "components/gcm_driver/crypto/p256_key_util.h"
#include "components/leveldb_proto/public/proto_database.h"
#include "crypto/random.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace gcm {
namespace {
ECPrivateKeyUniquePtr;
EncryptDataVectorUniquePtr;
EntryVectorType;
const char kFakeAppId[] = …;
const char kSecondFakeAppId[] = …;
const char kFakeAuthorizedEntity[] = …;
const char kSecondFakeAuthorizedEntity[] = …;
const char kPrivateEncrypted[] = …;
const char kPrivateDecrypted[] = …;
const char kPublicKey[] = …;
const size_t kAuthSecretBytes = …;
}
class GCMKeyStoreTest : public ::testing::Test { … };
TEST_F(GCMKeyStoreTest, EmptyByDefault) { … }
TEST_F(GCMKeyStoreTest, CreateAndGetKeys) { … }
TEST_F(GCMKeyStoreTest, GetKeysFallback) { … }
TEST_F(GCMKeyStoreTest, KeysPersistenceBetweenInstances) { … }
TEST_F(GCMKeyStoreTest, CreateAndRemoveKeys) { … }
TEST_F(GCMKeyStoreTest, CreateGetAndRemoveKeysSynchronously) { … }
TEST_F(GCMKeyStoreTest, RemoveKeysWildcardAuthorizedEntity) { … }
TEST_F(GCMKeyStoreTest, GetKeysMultipleAppIds) { … }
TEST_F(GCMKeyStoreTest, SuccessiveCallsBeforeInitialization) { … }
TEST_F(GCMKeyStoreTest, CannotShareAppIdFromGCMToInstanceID) { … }
TEST_F(GCMKeyStoreTest, CannotShareAppIdFromInstanceIDToGCM) { … }
TEST_F(GCMKeyStoreTest, TestUpgradePathForKeyStorageDeprecation) { … }
}