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

Unified Diff: google_apis/gcm/engine/mcs_client_unittest.cc

Issue 232113004: [GCM] Removing the mock-keychain related bool from GCMStore constructor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disabling the command line switches on other platforms than OS X Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « google_apis/gcm/engine/gcm_store_impl_unittest.cc ('k') | google_apis/gcm/gcm_client_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/gcm/engine/mcs_client_unittest.cc
diff --git a/google_apis/gcm/engine/mcs_client_unittest.cc b/google_apis/gcm/engine/mcs_client_unittest.cc
index 5983ddd747ec41a82575874611151c1afb09df60..b3e2f0d4e8db2b0b9d56e71b6b53c490ab642052 100644
--- a/google_apis/gcm/engine/mcs_client_unittest.cc
+++ b/google_apis/gcm/engine/mcs_client_unittest.cc
@@ -4,12 +4,13 @@
#include "google_apis/gcm/engine/mcs_client.h"
+#include "base/command_line.h"
#include "base/files/scoped_temp_dir.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/test/simple_test_clock.h"
-#include "components/os_crypt/os_crypt.h"
+#include "components/os_crypt/os_crypt_switches.h"
#include "google_apis/gcm/base/mcs_util.h"
#include "google_apis/gcm/engine/fake_connection_factory.h"
#include "google_apis/gcm/engine/fake_connection_handler.h"
@@ -84,6 +85,8 @@ class MCSClientTest : public testing::Test {
MCSClientTest();
virtual ~MCSClientTest();
+ virtual void SetUp() OVERRIDE;
+
void BuildMCSClient();
void InitializeClient();
void StoreCredentials();
@@ -144,20 +147,22 @@ MCSClientTest::MCSClientTest()
EXPECT_TRUE(temp_directory_.CreateUniqueTempDir());
run_loop_.reset(new base::RunLoop());
- // On OSX, prevent the Keychain permissions popup during unit tests.
-#if defined(OS_MACOSX)
- OSCrypt::UseMockKeychain(true);
-#endif
-
// Advance the clock to a non-zero time.
clock_.Advance(base::TimeDelta::FromSeconds(1));
}
MCSClientTest::~MCSClientTest() {}
+void MCSClientTest::SetUp() {
+ testing::Test::SetUp();
+#if defined(OS_MACOSX)
+ base::CommandLine::ForCurrentProcess()->AppendSwitch(
+ os_crypt::switches::kUseMockKeychain);
+#endif // OS_MACOSX
+}
+
void MCSClientTest::BuildMCSClient() {
- gcm_store_.reset(new GCMStoreImpl(true,
- temp_directory_.path(),
+ gcm_store_.reset(new GCMStoreImpl(temp_directory_.path(),
message_loop_.message_loop_proxy()));
mcs_client_.reset(new TestMCSClient(&clock_,
&connection_factory_,
« no previous file with comments | « google_apis/gcm/engine/gcm_store_impl_unittest.cc ('k') | google_apis/gcm/gcm_client_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698