OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/gcm_driver/gcm_driver_desktop.h" | 5 #include "components/gcm_driver/gcm_driver_desktop.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 return async_operation_completed_callback_; | 149 return async_operation_completed_callback_; |
150 } | 150 } |
151 void set_async_operation_completed_callback(const base::Closure& callback) { | 151 void set_async_operation_completed_callback(const base::Closure& callback) { |
152 async_operation_completed_callback_ = callback; | 152 async_operation_completed_callback_ = callback; |
153 } | 153 } |
154 | 154 |
155 private: | 155 private: |
156 base::ScopedTempDir temp_dir_; | 156 base::ScopedTempDir temp_dir_; |
157 TestingPrefServiceSimple prefs_; | 157 TestingPrefServiceSimple prefs_; |
158 scoped_refptr<base::TestSimpleTaskRunner> task_runner_; | 158 scoped_refptr<base::TestSimpleTaskRunner> task_runner_; |
159 base::MessageLoopForUI message_loop_; | |
160 base::Thread io_thread_; | 159 base::Thread io_thread_; |
161 base::FieldTrialList field_trial_list_; | 160 base::FieldTrialList field_trial_list_; |
162 scoped_ptr<GCMDriverDesktop> driver_; | 161 scoped_ptr<GCMDriverDesktop> driver_; |
163 scoped_ptr<FakeGCMAppHandler> gcm_app_handler_; | 162 scoped_ptr<FakeGCMAppHandler> gcm_app_handler_; |
164 scoped_ptr<FakeGCMConnectionObserver> gcm_connection_observer_; | 163 scoped_ptr<FakeGCMConnectionObserver> gcm_connection_observer_; |
165 | 164 |
166 base::Closure async_operation_completed_callback_; | 165 base::Closure async_operation_completed_callback_; |
167 | 166 |
168 std::string registration_id_; | 167 std::string registration_id_; |
169 GCMClient::Result registration_result_; | 168 GCMClient::Result registration_result_; |
(...skipping 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1283 PumpUILoop(); | 1282 PumpUILoop(); |
1284 EXPECT_EQ(GCMClient::UNKNOWN_ERROR, unregistration_result()); | 1283 EXPECT_EQ(GCMClient::UNKNOWN_ERROR, unregistration_result()); |
1285 | 1284 |
1286 // DeleteToken operation will be invoked after GCMClient becomes ready. | 1285 // DeleteToken operation will be invoked after GCMClient becomes ready. |
1287 GetGCMClient()->PerformDelayedStart(); | 1286 GetGCMClient()->PerformDelayedStart(); |
1288 WaitForAsyncOperation(); | 1287 WaitForAsyncOperation(); |
1289 EXPECT_EQ(GCMClient::SUCCESS, unregistration_result()); | 1288 EXPECT_EQ(GCMClient::SUCCESS, unregistration_result()); |
1290 } | 1289 } |
1291 | 1290 |
1292 } // namespace gcm | 1291 } // namespace gcm |
OLD | NEW |