1 // Copyright 2016 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef GOOGLE_APIS_GOOGLE_API_KEYS_UNITTEST_H_
6 #define GOOGLE_APIS_GOOGLE_API_KEYS_UNITTEST_H_
11 #include "base/environment.h"
12 #include "google_apis/google_api_keys.h"
13 #include "testing/gtest/include/gtest/gtest.h"
15 struct EnvironmentCache {
16 EnvironmentCache() : variable_name(nullptr), was_set(false) {}
18 const char* variable_name;
23 class GoogleAPIKeysTest : public testing::Test {
26 ~GoogleAPIKeysTest() override;
27 void SetUp() override;
28 void TearDown() override;
31 std::unique_ptr<base::Environment> env_;
33 // Why 3? It is for GOOGLE_API_KEY, GOOGLE_DEFAULT_CLIENT_ID and
34 // GOOGLE_DEFAULT_CLIENT_SECRET.
36 // Why 2 times CLIENT_NUM_ITEMS? This is the number of different
37 // clients in the OAuth2Client enumeration, and for each of these we
38 // have both an ID and a secret.
39 EnvironmentCache env_cache_[3 + 2 * google_apis::CLIENT_NUM_ITEMS];
42 #endif // GOOGLE_APIS_GOOGLE_API_KEYS_UNITTEST_H_