OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "google_apis/gcm/engine/mcs_client.h" | 5 #include "google_apis/gcm/engine/mcs_client.h" |
6 | 6 |
7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
11 #include "base/test/simple_test_clock.h" | 11 #include "base/test/simple_test_clock.h" |
12 #include "components/encryptor/encryptor.h" | 12 #include "components/encryptor/os_crypt.h" |
13 #include "google_apis/gcm/base/mcs_util.h" | 13 #include "google_apis/gcm/base/mcs_util.h" |
14 #include "google_apis/gcm/engine/fake_connection_factory.h" | 14 #include "google_apis/gcm/engine/fake_connection_factory.h" |
15 #include "google_apis/gcm/engine/fake_connection_handler.h" | 15 #include "google_apis/gcm/engine/fake_connection_handler.h" |
16 #include "google_apis/gcm/engine/gcm_store_impl.h" | 16 #include "google_apis/gcm/engine/gcm_store_impl.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
18 | 18 |
19 namespace gcm { | 19 namespace gcm { |
20 | 20 |
21 namespace { | 21 namespace { |
22 | 22 |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 : run_loop_(new base::RunLoop()), | 139 : run_loop_(new base::RunLoop()), |
140 init_success_(true), | 140 init_success_(true), |
141 restored_android_id_(0), | 141 restored_android_id_(0), |
142 restored_security_token_(0), | 142 restored_security_token_(0), |
143 message_send_status_(MCSClient::SENT) { | 143 message_send_status_(MCSClient::SENT) { |
144 EXPECT_TRUE(temp_directory_.CreateUniqueTempDir()); | 144 EXPECT_TRUE(temp_directory_.CreateUniqueTempDir()); |
145 run_loop_.reset(new base::RunLoop()); | 145 run_loop_.reset(new base::RunLoop()); |
146 | 146 |
147 // On OSX, prevent the Keychain permissions popup during unit tests. | 147 // On OSX, prevent the Keychain permissions popup during unit tests. |
148 #if defined(OS_MACOSX) | 148 #if defined(OS_MACOSX) |
149 Encryptor::UseMockKeychain(true); | 149 OSCrypt::UseMockKeychain(true); |
150 #endif | 150 #endif |
151 | 151 |
152 // Advance the clock to a non-zero time. | 152 // Advance the clock to a non-zero time. |
153 clock_.Advance(base::TimeDelta::FromSeconds(1)); | 153 clock_.Advance(base::TimeDelta::FromSeconds(1)); |
154 } | 154 } |
155 | 155 |
156 MCSClientTest::~MCSClientTest() {} | 156 MCSClientTest::~MCSClientTest() {} |
157 | 157 |
158 void MCSClientTest::BuildMCSClient() { | 158 void MCSClientTest::BuildMCSClient() { |
159 gcm_store_.reset(new GCMStoreImpl(true, | 159 gcm_store_.reset(new GCMStoreImpl(true, |
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
782 | 782 |
783 LoginClient(std::vector<std::string>()); | 783 LoginClient(std::vector<std::string>()); |
784 GetFakeHandler()->ExpectOutgoingMessage(message); | 784 GetFakeHandler()->ExpectOutgoingMessage(message); |
785 GetFakeHandler()->ExpectOutgoingMessage(message2); | 785 GetFakeHandler()->ExpectOutgoingMessage(message2); |
786 PumpLoop(); | 786 PumpLoop(); |
787 } | 787 } |
788 | 788 |
789 } // namespace | 789 } // namespace |
790 | 790 |
791 } // namespace gcm | 791 } // namespace gcm |
OLD | NEW |