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

Unified Diff: net/quic/chromium/mock_network_change_notifier.h

Issue 2811183003: Change Cronet's "disable_ipv6" to "disable_ipv6_on_wifi" (Closed)
Patch Set: more comments Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/dns/mapped_host_resolver.cc ('k') | net/quic/chromium/mock_network_change_notifier.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/chromium/mock_network_change_notifier.h
diff --git a/net/quic/chromium/mock_network_change_notifier.h b/net/quic/chromium/mock_network_change_notifier.h
deleted file mode 100644
index 7a4511c92ab3aad831a65b3b2e0680219c127f18..0000000000000000000000000000000000000000
--- a/net/quic/chromium/mock_network_change_notifier.h
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef NET_QUIC_CHROMIUM_MOCK_NETWORK_CHANGE_NOTIFIER_H_
-#define NET_QUIC_CHROMIUM_MOCK_NETWORK_CHANGE_NOTIFIER_H_
-
-#include "net/base/network_change_notifier.h"
-
-namespace net {
-namespace test {
-
-class MockNetworkChangeNotifier : public NetworkChangeNotifier {
- public:
- MockNetworkChangeNotifier();
- ~MockNetworkChangeNotifier() override;
-
- ConnectionType GetCurrentConnectionType() const override;
-
- void ForceNetworkHandlesSupported();
-
- bool AreNetworkHandlesCurrentlySupported() const override;
-
- void SetConnectionType(ConnectionType connection_type) {
- connection_type_ = connection_type;
- }
-
- void SetConnectedNetworksList(const NetworkList& network_list);
-
- void GetCurrentConnectedNetworks(NetworkList* network_list) const override;
-
- // Delivers a MADE_DEFAULT notification to observers.
- void NotifyNetworkMadeDefault(NetworkChangeNotifier::NetworkHandle network);
-
- // Queues a MADE_DEFAULT notification to be delivered to observers
- // but does not spin the message loop to actually deliver it.
- void QueueNetworkMadeDefault(NetworkChangeNotifier::NetworkHandle network);
-
- // Delivers a DISCONNECTED notification to observers.
- void NotifyNetworkDisconnected(NetworkChangeNotifier::NetworkHandle network);
-
- // Queues a DISCONNECTED notification to be delivered to observers
- // but does not spin the message loop to actually deliver it.
- void QueueNetworkDisconnected(NetworkChangeNotifier::NetworkHandle network);
-
- // Delivers a CONNECTED notification to observers.
- void NotifyNetworkConnected(NetworkChangeNotifier::NetworkHandle network);
-
- private:
- bool force_network_handles_supported_;
- ConnectionType connection_type_;
- NetworkChangeNotifier::NetworkList connected_networks_;
-};
-
-// Class to replace existing NetworkChangeNotifier singleton with a
-// MockNetworkChangeNotifier for a test. To use, simply create a
-// ScopedMockNetworkChangeNotifier object in the test.
-class ScopedMockNetworkChangeNotifier {
- public:
- ScopedMockNetworkChangeNotifier();
- ~ScopedMockNetworkChangeNotifier();
-
- MockNetworkChangeNotifier* mock_network_change_notifier();
-
- private:
- std::unique_ptr<NetworkChangeNotifier::DisableForTest>
- disable_network_change_notifier_for_tests_;
- std::unique_ptr<MockNetworkChangeNotifier> mock_network_change_notifier_;
-};
-
-} // namespace test
-} // namespace net
-
-#endif // NET_QUIC_CHROMIUM_MOCK_NETWORK_CHANGE_NOTIFIER_H_
« no previous file with comments | « net/dns/mapped_host_resolver.cc ('k') | net/quic/chromium/mock_network_change_notifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698