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 <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 | 237 |
238 void GCMDriverTest::CreateDriver() { | 238 void GCMDriverTest::CreateDriver() { |
239 scoped_refptr<net::URLRequestContextGetter> request_context = | 239 scoped_refptr<net::URLRequestContextGetter> request_context = |
240 new net::TestURLRequestContextGetter(io_thread_.task_runner()); | 240 new net::TestURLRequestContextGetter(io_thread_.task_runner()); |
241 GCMClient::ChromeBuildInfo chrome_build_info; | 241 GCMClient::ChromeBuildInfo chrome_build_info; |
242 chrome_build_info.product_category_for_subtypes = "com.chrome.macosx"; | 242 chrome_build_info.product_category_for_subtypes = "com.chrome.macosx"; |
243 driver_.reset(new GCMDriverDesktop( | 243 driver_.reset(new GCMDriverDesktop( |
244 std::unique_ptr<GCMClientFactory>(new FakeGCMClientFactory( | 244 std::unique_ptr<GCMClientFactory>(new FakeGCMClientFactory( |
245 base::ThreadTaskRunnerHandle::Get(), io_thread_.task_runner())), | 245 base::ThreadTaskRunnerHandle::Get(), io_thread_.task_runner())), |
246 chrome_build_info, "http://channel.status.request.url", | 246 chrome_build_info, "http://channel.status.request.url", |
247 "user-agent-string", &prefs_, temp_dir_.path(), request_context, | 247 "user-agent-string", &prefs_, temp_dir_.GetPath(), request_context, |
248 base::ThreadTaskRunnerHandle::Get(), io_thread_.task_runner(), | 248 base::ThreadTaskRunnerHandle::Get(), io_thread_.task_runner(), |
249 message_loop_.task_runner())); | 249 message_loop_.task_runner())); |
250 | 250 |
251 gcm_app_handler_.reset(new FakeGCMAppHandler); | 251 gcm_app_handler_.reset(new FakeGCMAppHandler); |
252 gcm_connection_observer_.reset(new FakeGCMConnectionObserver); | 252 gcm_connection_observer_.reset(new FakeGCMConnectionObserver); |
253 | 253 |
254 driver_->AddConnectionObserver(gcm_connection_observer_.get()); | 254 driver_->AddConnectionObserver(gcm_connection_observer_.get()); |
255 } | 255 } |
256 | 256 |
257 void GCMDriverTest::ShutdownDriver() { | 257 void GCMDriverTest::ShutdownDriver() { |
(...skipping 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1378 PumpUILoop(); | 1378 PumpUILoop(); |
1379 EXPECT_EQ(GCMClient::UNKNOWN_ERROR, unregistration_result()); | 1379 EXPECT_EQ(GCMClient::UNKNOWN_ERROR, unregistration_result()); |
1380 | 1380 |
1381 // DeleteToken operation will be invoked after GCMClient becomes ready. | 1381 // DeleteToken operation will be invoked after GCMClient becomes ready. |
1382 GetGCMClient()->PerformDelayedStart(); | 1382 GetGCMClient()->PerformDelayedStart(); |
1383 WaitForAsyncOperation(); | 1383 WaitForAsyncOperation(); |
1384 EXPECT_EQ(GCMClient::SUCCESS, unregistration_result()); | 1384 EXPECT_EQ(GCMClient::SUCCESS, unregistration_result()); |
1385 } | 1385 } |
1386 | 1386 |
1387 } // namespace gcm | 1387 } // namespace gcm |
OLD | NEW |