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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 return !driver_->app_handlers().empty(); | 231 return !driver_->app_handlers().empty(); |
232 } | 232 } |
233 | 233 |
234 FakeGCMClient* GCMDriverTest::GetGCMClient() { | 234 FakeGCMClient* GCMDriverTest::GetGCMClient() { |
235 return static_cast<FakeGCMClient*>(driver_->GetGCMClientForTesting()); | 235 return static_cast<FakeGCMClient*>(driver_->GetGCMClientForTesting()); |
236 } | 236 } |
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; |
| 242 chrome_build_info.product_category_for_subtypes = "com.chrome.macosx"; |
241 driver_.reset(new GCMDriverDesktop( | 243 driver_.reset(new GCMDriverDesktop( |
242 std::unique_ptr<GCMClientFactory>(new FakeGCMClientFactory( | 244 std::unique_ptr<GCMClientFactory>(new FakeGCMClientFactory( |
243 base::ThreadTaskRunnerHandle::Get(), io_thread_.task_runner())), | 245 base::ThreadTaskRunnerHandle::Get(), io_thread_.task_runner())), |
244 GCMClient::ChromeBuildInfo(), "http://channel.status.request.url", | 246 chrome_build_info, "http://channel.status.request.url", |
245 "user-agent-string", &prefs_, temp_dir_.path(), request_context, | 247 "user-agent-string", &prefs_, temp_dir_.path(), request_context, |
246 base::ThreadTaskRunnerHandle::Get(), io_thread_.task_runner(), | 248 base::ThreadTaskRunnerHandle::Get(), io_thread_.task_runner(), |
247 message_loop_.task_runner())); | 249 message_loop_.task_runner())); |
248 | 250 |
249 gcm_app_handler_.reset(new FakeGCMAppHandler); | 251 gcm_app_handler_.reset(new FakeGCMAppHandler); |
250 gcm_connection_observer_.reset(new FakeGCMConnectionObserver); | 252 gcm_connection_observer_.reset(new FakeGCMConnectionObserver); |
251 | 253 |
252 driver_->AddConnectionObserver(gcm_connection_observer_.get()); | 254 driver_->AddConnectionObserver(gcm_connection_observer_.get()); |
253 } | 255 } |
254 | 256 |
(...skipping 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1376 PumpUILoop(); | 1378 PumpUILoop(); |
1377 EXPECT_EQ(GCMClient::UNKNOWN_ERROR, unregistration_result()); | 1379 EXPECT_EQ(GCMClient::UNKNOWN_ERROR, unregistration_result()); |
1378 | 1380 |
1379 // DeleteToken operation will be invoked after GCMClient becomes ready. | 1381 // DeleteToken operation will be invoked after GCMClient becomes ready. |
1380 GetGCMClient()->PerformDelayedStart(); | 1382 GetGCMClient()->PerformDelayedStart(); |
1381 WaitForAsyncOperation(); | 1383 WaitForAsyncOperation(); |
1382 EXPECT_EQ(GCMClient::SUCCESS, unregistration_result()); | 1384 EXPECT_EQ(GCMClient::SUCCESS, unregistration_result()); |
1383 } | 1385 } |
1384 | 1386 |
1385 } // namespace gcm | 1387 } // namespace gcm |
OLD | NEW |