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

Side by Side Diff: google_apis/gcm/engine/connection_factory_impl_unittest.cc

Issue 1390513002: Remove base::MessageLoop::{Quit,QuitClosure} functions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Split into small CLs Created 5 years, 2 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "google_apis/gcm/engine/connection_factory_impl.h" 5 #include "google_apis/gcm/engine/connection_factory_impl.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 EXPECT_FALSE(initial_backoff.is_null()); 427 EXPECT_FALSE(initial_backoff.is_null());
428 428
429 factory()->SetDelayLogin(true); 429 factory()->SetDelayLogin(true);
430 factory()->SetConnectResult(net::OK); 430 factory()->SetConnectResult(net::OK);
431 factory()->OnNetworkChanged(net::NetworkChangeNotifier::CONNECTION_WIFI); 431 factory()->OnNetworkChanged(net::NetworkChangeNotifier::CONNECTION_WIFI);
432 WaitForConnections(); 432 WaitForConnections();
433 EXPECT_FALSE(factory()->IsEndpointReachable()); 433 EXPECT_FALSE(factory()->IsEndpointReachable());
434 434
435 // Pump the loop, to ensure the pending backoff retry has no effect. 435 // Pump the loop, to ensure the pending backoff retry has no effect.
436 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( 436 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
437 FROM_HERE, 437 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure(),
438 base::MessageLoop::QuitClosure(),
439 base::TimeDelta::FromMilliseconds(1)); 438 base::TimeDelta::FromMilliseconds(1));
440 WaitForConnections(); 439 WaitForConnections();
441 } 440 }
442 441
443 // Fail after successful connection via signal reset. 442 // Fail after successful connection via signal reset.
444 TEST_F(ConnectionFactoryImplTest, FailViaSignalReset) { 443 TEST_F(ConnectionFactoryImplTest, FailViaSignalReset) {
445 factory()->SetConnectResult(net::OK); 444 factory()->SetConnectResult(net::OK);
446 factory()->Connect(); 445 factory()->Connect();
447 EXPECT_TRUE(factory()->NextRetryAttempt().is_null()); 446 EXPECT_TRUE(factory()->NextRetryAttempt().is_null());
448 447
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 // Now trigger force a re-connection. 563 // Now trigger force a re-connection.
565 factory()->SetConnectResult(net::OK); 564 factory()->SetConnectResult(net::OK);
566 factory()->Connect(); 565 factory()->Connect();
567 WaitForConnections(); 566 WaitForConnections();
568 567
569 // Re-connection should succeed. 568 // Re-connection should succeed.
570 EXPECT_TRUE(factory()->IsEndpointReachable()); 569 EXPECT_TRUE(factory()->IsEndpointReachable());
571 } 570 }
572 571
573 } // namespace gcm 572 } // namespace gcm
OLDNEW
« no previous file with comments | « cloud_print/service/win/cloud_print_service_config.cc ('k') | gpu/tools/compositor_model_bench/compositor_model_bench.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698