From 0693d516148b470f308a8daf442fd2efa69959bd Mon Sep 17 00:00:00 2001
From: "bcwhite@chromium.org"
 <bcwhite@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Date: Wed, 12 Feb 2014 00:20:17 +0000
Subject: Enable encrypted cookies on Mac OSX.

Encrypted cookies have been enabled on Windows and Linux for some time but Mac needed to be done separately because tests will hang unless the Encryptor is first told to use the mock keychain.

BUG=313323

Review URL: https://codereview.chromium.org/135183021

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@250568 0039d316-1c4b-4281-b951-d872f2087c98
---
 google_apis/gcm/gcm_client_impl_unittest.cc | 5 +++++
 1 file changed, 5 insertions(+)

(limited to 'google_apis')

diff --git a/google_apis/gcm/gcm_client_impl_unittest.cc b/google_apis/gcm/gcm_client_impl_unittest.cc
index 5afb3b9..3f482f4 100644
--- a/google_apis/gcm/gcm_client_impl_unittest.cc
+++ b/google_apis/gcm/gcm_client_impl_unittest.cc
@@ -8,6 +8,7 @@
 #include "base/message_loop/message_loop.h"
 #include "base/run_loop.h"
 #include "base/test/simple_test_clock.h"
+#include "components/webdata/encryptor/encryptor.h"
 #include "google_apis/gcm/base/mcs_message.h"
 #include "google_apis/gcm/base/mcs_util.h"
 #include "google_apis/gcm/engine/fake_connection_factory.h"
@@ -289,6 +290,10 @@ void GCMClientImplTest::InitializeGCMClient() {
                           temp_directory_.path(),
                           message_loop_.message_loop_proxy(),
                           url_request_context_getter_);
+#if defined(OS_MACOSX)
+  // On OSX, prevent the Keychain permissions popup during unit tests.
+  Encryptor::UseMockKeychain(true);  // Must be after Initialize.
+#endif
   // Ensuring that mcs_client is using the same gcm_store as gcm_client.
   mcs_client()->set_gcm_store(gcm_client_->gcm_store_.get());
   PumpLoopUntilIdle();
-- 
cgit v1.1