Commit ac19f67f authored by Alex Ilin's avatar Alex Ilin Committed by Commit Bot

[gaia] Reset the config state between GoogleAPIKeysTests

GoogleAPIKeysTest.OverrideAllKeysUsingConfig reads the config info into
the GaiaConfig singleton. The state of this singleton must be reset
after the test to not affect other tests running within the same
process.

Fixed: 1123464
Change-Id: I3f2603153c30b87905f071a76eb20412a75c8ae5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2390749Reviewed-by: default avatarMihai Sardarescu <msarda@chromium.org>
Commit-Queue: Alex Ilin <alexilin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804708}
parent fed38f9e
...@@ -641,8 +641,8 @@ namespace override_all_keys_config { ...@@ -641,8 +641,8 @@ namespace override_all_keys_config {
TEST_F(GoogleAPIKeysTest, OverrideAllKeysUsingConfig) { TEST_F(GoogleAPIKeysTest, OverrideAllKeysUsingConfig) {
namespace testcase = override_all_keys_config::google_apis; namespace testcase = override_all_keys_config::google_apis;
base::test::ScopedCommandLine command_line; auto command_line = std::make_unique<base::test::ScopedCommandLine>();
command_line.GetProcessCommandLine()->AppendSwitchPath( command_line->GetProcessCommandLine()->AppendSwitchPath(
"gaia-config", GetTestFilePath("api_keys.json")); "gaia-config", GetTestFilePath("api_keys.json"));
GaiaConfig::ResetInstanceForTesting(); GaiaConfig::ResetInstanceForTesting();
...@@ -666,6 +666,11 @@ TEST_F(GoogleAPIKeysTest, OverrideAllKeysUsingConfig) { ...@@ -666,6 +666,11 @@ TEST_F(GoogleAPIKeysTest, OverrideAllKeysUsingConfig) {
testcase::GetOAuth2ClientID(testcase::CLIENT_REMOTING_HOST)); testcase::GetOAuth2ClientID(testcase::CLIENT_REMOTING_HOST));
EXPECT_EQ("config-SECRET_REMOTING_HOST", EXPECT_EQ("config-SECRET_REMOTING_HOST",
testcase::GetOAuth2ClientSecret(testcase::CLIENT_REMOTING_HOST)); testcase::GetOAuth2ClientSecret(testcase::CLIENT_REMOTING_HOST));
// It's important to reset the global config state for other tests running in
// the same process.
command_line.reset();
GaiaConfig::ResetInstanceForTesting();
} }
#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_APPLE) #endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_APPLE)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment