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

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

Issue 312553002: Rename GCMStatsRecorder to GCMStatsRecorderImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync Created 6 years, 6 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 | Annotate | Revision Log
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"
11 #include "base/test/simple_test_tick_clock.h" 11 #include "base/test/simple_test_tick_clock.h"
12 #include "google_apis/gcm/base/mcs_util.h" 12 #include "google_apis/gcm/base/mcs_util.h"
13 #include "google_apis/gcm/engine/fake_connection_handler.h" 13 #include "google_apis/gcm/engine/fake_connection_handler.h"
14 #include "google_apis/gcm/monitoring/gcm_stats_recorder.h" 14 #include "google_apis/gcm/monitoring/fake_gcm_stats_recorder.h"
15 #include "net/base/backoff_entry.h" 15 #include "net/base/backoff_entry.h"
16 #include "net/http/http_network_session.h" 16 #include "net/http/http_network_session.h"
17 #include "testing/gtest/include/gtest/gtest.h" 17 #include "testing/gtest/include/gtest/gtest.h"
18 18
19 class Policy; 19 class Policy;
20 20
21 namespace gcm { 21 namespace gcm {
22 namespace { 22 namespace {
23 23
24 const char kMCSEndpoint[] = "http://my.server"; 24 const char kMCSEndpoint[] = "http://my.server";
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 int num_expected_attempts_; 143 int num_expected_attempts_;
144 // Whether all expected connection attempts have been fulfilled since an 144 // Whether all expected connection attempts have been fulfilled since an
145 // expectation was last set. 145 // expectation was last set.
146 bool connections_fulfilled_; 146 bool connections_fulfilled_;
147 // Whether to delay a login handshake completion or not. 147 // Whether to delay a login handshake completion or not.
148 bool delay_login_; 148 bool delay_login_;
149 // Callback to invoke when all connection attempts have been made. 149 // Callback to invoke when all connection attempts have been made.
150 base::Closure finished_callback_; 150 base::Closure finished_callback_;
151 // The current fake connection handler.. 151 // The current fake connection handler..
152 FakeConnectionHandler* fake_handler_; 152 FakeConnectionHandler* fake_handler_;
153 GCMStatsRecorder dummy_recorder_; 153 FakeGCMStatsRecorder dummy_recorder_;
154 }; 154 };
155 155
156 TestConnectionFactoryImpl::TestConnectionFactoryImpl( 156 TestConnectionFactoryImpl::TestConnectionFactoryImpl(
157 const base::Closure& finished_callback) 157 const base::Closure& finished_callback)
158 : ConnectionFactoryImpl(BuildEndpoints(), 158 : ConnectionFactoryImpl(BuildEndpoints(),
159 net::BackoffEntry::Policy(), 159 net::BackoffEntry::Policy(),
160 NULL, 160 NULL,
161 NULL, 161 NULL,
162 &dummy_recorder_), 162 &dummy_recorder_),
163 connect_result_(net::ERR_UNEXPECTED), 163 connect_result_(net::ERR_UNEXPECTED),
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 EXPECT_NE(retry_time, factory()->NextRetryAttempt()); 504 EXPECT_NE(retry_time, factory()->NextRetryAttempt());
505 retry_time = factory()->NextRetryAttempt(); 505 retry_time = factory()->NextRetryAttempt();
506 EXPECT_FALSE(retry_time.is_null()); 506 EXPECT_FALSE(retry_time.is_null());
507 EXPECT_GE((retry_time - connect_time).InMilliseconds(), 507 EXPECT_GE((retry_time - connect_time).InMilliseconds(),
508 CalculateBackoff(3)); 508 CalculateBackoff(3));
509 EXPECT_FALSE(factory()->IsEndpointReachable()); 509 EXPECT_FALSE(factory()->IsEndpointReachable());
510 } 510 }
511 511
512 } // namespace 512 } // namespace
513 } // namespace gcm 513 } // namespace gcm
OLDNEW
« no previous file with comments | « google_apis/gcm/engine/checkin_request_unittest.cc ('k') | google_apis/gcm/engine/mcs_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698