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

Side by Side Diff: components/offline_pages/background/network_quality_provider_stub.h

Issue 2489443002: Move all components/offline_pages/ files into component/offline_pages/core (Closed)
Patch Set: rebase Created 4 years 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_OFFLINE_PAGES_BACKGROUND_NETWORK_QUALITY_PROVIDER_STUB_H_
6 #define COMPONENTS_OFFLINE_PAGES_BACKGROUND_NETWORK_QUALITY_PROVIDER_STUB_H_
7
8 #include "base/supports_user_data.h"
9 #include "net/nqe/effective_connection_type.h"
10 #include "net/nqe/network_quality_estimator.h"
11
12 namespace offline_pages {
13
14 // Test class stubbing out the functionality of NQE::NetworkQualityProvider.
15 // It is only used for test support.
16 class NetworkQualityProviderStub
17 : public net::NetworkQualityEstimator::NetworkQualityProvider,
18 public base::SupportsUserData::Data {
19 public:
20 NetworkQualityProviderStub();
21 ~NetworkQualityProviderStub() override;
22
23 static NetworkQualityProviderStub* GetUserData(
24 base::SupportsUserData* supports_user_data);
25 static void SetUserData(base::SupportsUserData* supports_user_data,
26 NetworkQualityProviderStub* stub);
27
28 net::EffectiveConnectionType GetEffectiveConnectionType() const override;
29
30 void AddEffectiveConnectionTypeObserver(
31 net::NetworkQualityEstimator::EffectiveConnectionTypeObserver* observer)
32 override;
33
34 void RemoveEffectiveConnectionTypeObserver(
35 net::NetworkQualityEstimator::EffectiveConnectionTypeObserver* observer)
36 override;
37
38 void SetEffectiveConnectionTypeForTest(net::EffectiveConnectionType type) {
39 connection_type_ = type;
40 }
41
42 private:
43 net::EffectiveConnectionType connection_type_;
44 };
45
46 } // namespace offline_pages
47
48 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_NETWORK_QUALITY_PROVIDER_STUB_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698