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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 FakeGCMClient* GCMDriverTest::GetGCMClient() { | 225 FakeGCMClient* GCMDriverTest::GetGCMClient() { |
226 return static_cast<FakeGCMClient*>(driver_->GetGCMClientForTesting()); | 226 return static_cast<FakeGCMClient*>(driver_->GetGCMClientForTesting()); |
227 } | 227 } |
228 | 228 |
229 void GCMDriverTest::CreateDriver( | 229 void GCMDriverTest::CreateDriver( |
230 FakeGCMClient::StartMode gcm_client_start_mode) { | 230 FakeGCMClient::StartMode gcm_client_start_mode) { |
231 scoped_refptr<net::URLRequestContextGetter> request_context = | 231 scoped_refptr<net::URLRequestContextGetter> request_context = |
232 new net::TestURLRequestContextGetter(io_thread_.message_loop_proxy()); | 232 new net::TestURLRequestContextGetter(io_thread_.message_loop_proxy()); |
233 // TODO(johnme): Need equivalent test coverage of GCMDriverAndroid. | 233 // TODO(johnme): Need equivalent test coverage of GCMDriverAndroid. |
234 driver_.reset(new GCMDriverDesktop( | 234 driver_.reset(new GCMDriverDesktop( |
235 scoped_ptr<GCMClientFactory>(new FakeGCMClientFactory( | 235 scoped_ptr<GCMClientFactory>( |
236 gcm_client_start_mode, | 236 new FakeGCMClientFactory(gcm_client_start_mode, |
237 base::MessageLoopProxy::current(), | 237 base::MessageLoopProxy::current(), |
238 io_thread_.message_loop_proxy())).Pass(), | 238 io_thread_.message_loop_proxy())).Pass(), |
239 GCMClient::ChromeBuildInfo(), | 239 GCMClient::ChromeBuildInfo(), |
| 240 "http://channel.status.request.url", |
| 241 "user-agent-string", |
240 &prefs_, | 242 &prefs_, |
241 temp_dir_.path(), | 243 temp_dir_.path(), |
242 request_context, | 244 request_context, |
243 base::MessageLoopProxy::current(), | 245 base::MessageLoopProxy::current(), |
244 io_thread_.message_loop_proxy(), | 246 io_thread_.message_loop_proxy(), |
245 task_runner_)); | 247 task_runner_)); |
246 | 248 |
247 gcm_app_handler_.reset(new FakeGCMAppHandler); | 249 gcm_app_handler_.reset(new FakeGCMAppHandler); |
248 gcm_connection_observer_.reset(new FakeGCMConnectionObserver); | 250 gcm_connection_observer_.reset(new FakeGCMConnectionObserver); |
249 | 251 |
(...skipping 969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1219 // After start-up, the request should still be scheduled at the expected | 1221 // After start-up, the request should still be scheduled at the expected |
1220 // updated interval. | 1222 // updated interval. |
1221 actual_delay_seconds = | 1223 actual_delay_seconds = |
1222 syncer()->current_request_delay_interval().InSeconds(); | 1224 syncer()->current_request_delay_interval().InSeconds(); |
1223 EXPECT_TRUE(CompareDelaySeconds(expected_delay_seconds, actual_delay_seconds)) | 1225 EXPECT_TRUE(CompareDelaySeconds(expected_delay_seconds, actual_delay_seconds)) |
1224 << "expected delay: " << expected_delay_seconds | 1226 << "expected delay: " << expected_delay_seconds |
1225 << " actual delay: " << actual_delay_seconds; | 1227 << " actual delay: " << actual_delay_seconds; |
1226 } | 1228 } |
1227 | 1229 |
1228 } // namespace gcm | 1230 } // namespace gcm |
OLD | NEW |