OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 TestNetworkQualityEstimator() | 144 TestNetworkQualityEstimator() |
145 : NetworkQualityEstimator(scoped_ptr<net::ExternalEstimateProvider>(), | 145 : NetworkQualityEstimator(scoped_ptr<net::ExternalEstimateProvider>(), |
146 std::map<std::string, std::string>()), | 146 std::map<std::string, std::string>()), |
147 watcher_count_(0) {} | 147 watcher_count_(0) {} |
148 | 148 |
149 ~TestNetworkQualityEstimator() override {} | 149 ~TestNetworkQualityEstimator() override {} |
150 | 150 |
151 scoped_ptr<SocketPerformanceWatcher> CreateSocketPerformanceWatcher( | 151 scoped_ptr<SocketPerformanceWatcher> CreateSocketPerformanceWatcher( |
152 const Protocol protocol) override { | 152 const Protocol protocol) override { |
153 if (protocol != PROTOCOL_QUIC) { | 153 if (protocol != PROTOCOL_QUIC) { |
154 NOTIMPLEMENTED(); | 154 return nullptr; |
155 } | 155 } |
156 ++watcher_count_; | 156 ++watcher_count_; |
157 return NetworkQualityEstimator::CreateSocketPerformanceWatcher(protocol); | 157 return NetworkQualityEstimator::CreateSocketPerformanceWatcher(protocol); |
158 } | 158 } |
159 | 159 |
160 size_t watcher_count() const { return watcher_count_; } | 160 size_t watcher_count() const { return watcher_count_; } |
161 | 161 |
162 private: | 162 private: |
163 size_t watcher_count_; | 163 size_t watcher_count_; |
164 DISALLOW_COPY_AND_ASSIGN(TestNetworkQualityEstimator); | 164 DISALLOW_COPY_AND_ASSIGN(TestNetworkQualityEstimator); |
(...skipping 2182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2347 scoped_ptr<HttpNetworkTransaction> trans( | 2347 scoped_ptr<HttpNetworkTransaction> trans( |
2348 new HttpNetworkTransaction(DEFAULT_PRIORITY, session_.get())); | 2348 new HttpNetworkTransaction(DEFAULT_PRIORITY, session_.get())); |
2349 TestCompletionCallback callback; | 2349 TestCompletionCallback callback; |
2350 int rv = trans->Start(&request_, callback.callback(), net_log_.bound()); | 2350 int rv = trans->Start(&request_, callback.callback(), net_log_.bound()); |
2351 EXPECT_EQ(ERR_IO_PENDING, rv); | 2351 EXPECT_EQ(ERR_IO_PENDING, rv); |
2352 EXPECT_NE(OK, callback.WaitForResult()); | 2352 EXPECT_NE(OK, callback.WaitForResult()); |
2353 } | 2353 } |
2354 | 2354 |
2355 } // namespace test | 2355 } // namespace test |
2356 } // namespace net | 2356 } // namespace net |
OLD | NEW |