Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(408)

Side by Side Diff: components/gcm_driver/gcm_driver_desktop_unittest.cc

Issue 914693002: Push API: Fix unsubscribing from GCM on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address peter & jianli's review comments Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 base::Unretained(this))); 288 base::Unretained(this)));
289 if (wait_to_finish == WAIT) 289 if (wait_to_finish == WAIT)
290 run_loop.Run(); 290 run_loop.Run();
291 } 291 }
292 292
293 void GCMDriverTest::Unregister(const std::string& app_id, 293 void GCMDriverTest::Unregister(const std::string& app_id,
294 WaitToFinish wait_to_finish) { 294 WaitToFinish wait_to_finish) {
295 base::RunLoop run_loop; 295 base::RunLoop run_loop;
296 async_operation_completed_callback_ = run_loop.QuitClosure(); 296 async_operation_completed_callback_ = run_loop.QuitClosure();
297 driver_->Unregister(app_id, 297 driver_->Unregister(app_id,
298 base::Bind(&GCMDriverTest::UnregisterCompleted, 298 base::Bind(&GCMDriverTest::UnregisterCompleted,
299 base::Unretained(this))); 299 base::Unretained(this)));
300 if (wait_to_finish == WAIT) 300 if (wait_to_finish == WAIT)
301 run_loop.Run(); 301 run_loop.Run();
302 } 302 }
303 303
304 void GCMDriverTest::WaitForAsyncOperation() { 304 void GCMDriverTest::WaitForAsyncOperation() {
305 base::RunLoop run_loop; 305 base::RunLoop run_loop;
306 async_operation_completed_callback_ = run_loop.QuitClosure(); 306 async_operation_completed_callback_ = run_loop.QuitClosure();
307 run_loop.Run(); 307 run_loop.Run();
308 } 308 }
309 309
(...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after
1064 // After start-up, the request should still be scheduled at the expected 1064 // After start-up, the request should still be scheduled at the expected
1065 // updated interval. 1065 // updated interval.
1066 actual_delay_seconds = 1066 actual_delay_seconds =
1067 syncer()->current_request_delay_interval().InSeconds(); 1067 syncer()->current_request_delay_interval().InSeconds();
1068 EXPECT_TRUE(CompareDelaySeconds(expected_delay_seconds, actual_delay_seconds)) 1068 EXPECT_TRUE(CompareDelaySeconds(expected_delay_seconds, actual_delay_seconds))
1069 << "expected delay: " << expected_delay_seconds 1069 << "expected delay: " << expected_delay_seconds
1070 << " actual delay: " << actual_delay_seconds; 1070 << " actual delay: " << actual_delay_seconds;
1071 } 1071 }
1072 1072
1073 } // namespace gcm 1073 } // namespace gcm
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698