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

Side by Side Diff: google_apis/google_api_keys_unittest.h

Issue 2224473002: Add support for loading API keys from Info.plist on iOS and macOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix nits Created 4 years, 4 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
« no previous file with comments | « google_apis/google_api_keys_mac_unittest.mm ('k') | google_apis/google_api_keys_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef GOOGLE_APIS_GOOGLE_API_KEYS_UNITTEST_H_
6 #define GOOGLE_APIS_GOOGLE_API_KEYS_UNITTEST_H_
7
8 #include <memory>
9 #include <string>
10
11 #include "base/environment.h"
12 #include "google_apis/google_api_keys.h"
13 #include "testing/gtest/include/gtest/gtest.h"
14
15 struct EnvironmentCache {
16 EnvironmentCache() : variable_name(nullptr), was_set(false) {}
17
18 const char* variable_name;
19 bool was_set;
20 std::string value;
21 };
22
23 class GoogleAPIKeysTest : public testing::Test {
24 public:
25 GoogleAPIKeysTest();
26 ~GoogleAPIKeysTest() override;
27 void SetUp() override;
28 void TearDown() override;
29
30 private:
31 std::unique_ptr<base::Environment> env_;
32
33 // Why 3? It is for GOOGLE_API_KEY, GOOGLE_DEFAULT_CLIENT_ID and
34 // GOOGLE_DEFAULT_CLIENT_SECRET.
35 //
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];
40 };
41
42 #endif // GOOGLE_APIS_GOOGLE_API_KEYS_UNITTEST_H_
OLDNEW
« no previous file with comments | « google_apis/google_api_keys_mac_unittest.mm ('k') | google_apis/google_api_keys_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698