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

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: Now compiles and passes tests (and uses CHECK_EQ) 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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 base::Bind(&GCMDriverTest::SendCompleted, 287 base::Bind(&GCMDriverTest::SendCompleted,
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 std::vector<std::string> sender_ids; // These are ignored on desktop.
297 driver_->Unregister(app_id, 298 driver_->Unregister(app_id,
298 base::Bind(&GCMDriverTest::UnregisterCompleted, 299 sender_ids,
299 base::Unretained(this))); 300 base::Bind(&GCMDriverTest::UnregisterCompleted,
301 base::Unretained(this)));
300 if (wait_to_finish == WAIT) 302 if (wait_to_finish == WAIT)
301 run_loop.Run(); 303 run_loop.Run();
302 } 304 }
303 305
304 void GCMDriverTest::WaitForAsyncOperation() { 306 void GCMDriverTest::WaitForAsyncOperation() {
305 base::RunLoop run_loop; 307 base::RunLoop run_loop;
306 async_operation_completed_callback_ = run_loop.QuitClosure(); 308 async_operation_completed_callback_ = run_loop.QuitClosure();
307 run_loop.Run(); 309 run_loop.Run();
308 } 310 }
309 311
(...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 1066 // After start-up, the request should still be scheduled at the expected
1065 // updated interval. 1067 // updated interval.
1066 actual_delay_seconds = 1068 actual_delay_seconds =
1067 syncer()->current_request_delay_interval().InSeconds(); 1069 syncer()->current_request_delay_interval().InSeconds();
1068 EXPECT_TRUE(CompareDelaySeconds(expected_delay_seconds, actual_delay_seconds)) 1070 EXPECT_TRUE(CompareDelaySeconds(expected_delay_seconds, actual_delay_seconds))
1069 << "expected delay: " << expected_delay_seconds 1071 << "expected delay: " << expected_delay_seconds
1070 << " actual delay: " << actual_delay_seconds; 1072 << " actual delay: " << actual_delay_seconds;
1071 } 1073 }
1072 1074
1073 } // namespace gcm 1075 } // namespace gcm
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698