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

Side by Side Diff: components/offline_pages/background/request_coordinator_unittest.cc

Issue 2450433003: Adding observer functionality to UINetworkQualityService (Closed)
Patch Set: nits Created 4 years, 1 month 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/offline_pages/background/request_coordinator.h" 5 #include "components/offline_pages/background/request_coordinator.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 : public net::NetworkQualityEstimator::NetworkQualityProvider { 153 : public net::NetworkQualityEstimator::NetworkQualityProvider {
154 public: 154 public:
155 NetworkQualityEstimatorStub() 155 NetworkQualityEstimatorStub()
156 : connection_type_( 156 : connection_type_(
157 net::EffectiveConnectionType::EFFECTIVE_CONNECTION_TYPE_3G) {} 157 net::EffectiveConnectionType::EFFECTIVE_CONNECTION_TYPE_3G) {}
158 158
159 net::EffectiveConnectionType GetEffectiveConnectionType() const override { 159 net::EffectiveConnectionType GetEffectiveConnectionType() const override {
160 return connection_type_; 160 return connection_type_;
161 } 161 }
162 162
163 void AddEffectiveConnectionTypeObserver(
164 net::NetworkQualityEstimator::EffectiveConnectionTypeObserver* observer)
165 override {}
166
167 void RemoveEffectiveConnectionTypeObserver(
168 net::NetworkQualityEstimator::EffectiveConnectionTypeObserver* observer)
169 override {}
170
163 void SetEffectiveConnectionTypeForTest(net::EffectiveConnectionType type) { 171 void SetEffectiveConnectionTypeForTest(net::EffectiveConnectionType type) {
164 connection_type_ = type; 172 connection_type_ = type;
165 } 173 }
166 174
167 private: 175 private:
168 net::EffectiveConnectionType connection_type_; 176 net::EffectiveConnectionType connection_type_;
169 }; 177 };
170 178
171 class ObserverStub : public RequestCoordinator::Observer { 179 class ObserverStub : public RequestCoordinator::Observer {
172 public: 180 public:
(...skipping 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after
1360 // Now whether processing triggered immediately depends on whether test 1368 // Now whether processing triggered immediately depends on whether test
1361 // is run on svelte device or not. 1369 // is run on svelte device or not.
1362 if (base::SysInfo::IsLowEndDevice()) { 1370 if (base::SysInfo::IsLowEndDevice()) {
1363 EXPECT_FALSE(is_busy()); 1371 EXPECT_FALSE(is_busy());
1364 } else { 1372 } else {
1365 EXPECT_TRUE(is_busy()); 1373 EXPECT_TRUE(is_busy());
1366 } 1374 }
1367 } 1375 }
1368 1376
1369 } // namespace offline_pages 1377 } // namespace offline_pages
OLDNEW
« no previous file with comments | « chrome/browser/net/nqe/ui_network_quality_estimator_service_browsertest.cc ('k') | net/nqe/network_quality_estimator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698