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

Unified Diff: webrtc/p2p/base/faketransportcontroller.h

Issue 1803063004: Reset the BWE when the network changes (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Removed changes in call dir and leave that in a separate CL. Created 4 years, 9 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 | « webrtc/p2p/base/dtlstransportchannel.cc ('k') | webrtc/p2p/base/p2ptransportchannel.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/faketransportcontroller.h
diff --git a/webrtc/p2p/base/faketransportcontroller.h b/webrtc/p2p/base/faketransportcontroller.h
index d5fbec4e39c59abed0353618882584364a2e1b2e..a267f209670bf6dc67a1e4859215e491574f22df 100644
--- a/webrtc/p2p/base/faketransportcontroller.h
+++ b/webrtc/p2p/base/faketransportcontroller.h
@@ -15,6 +15,7 @@
#include <string>
#include <vector>
+#include "webrtc/p2p/base/candidatepairinterface.h"
#include "webrtc/p2p/base/transport.h"
#include "webrtc/p2p/base/transportchannel.h"
#include "webrtc/p2p/base/transportcontroller.h"
@@ -452,6 +453,24 @@ class FakeTransport : public Transport {
rtc::SSLProtocolVersion ssl_max_version_ = rtc::SSL_PROTOCOL_DTLS_12;
};
+// Fake candidate pair class, which can be passed to BaseChannel for testing
+// purposes.
+class FakeCandidatePair : public CandidatePairInterface {
+ public:
+ FakeCandidatePair(const Candidate& local_candidate,
+ const Candidate& remote_candidate)
+ : local_candidate_(local_candidate),
+ remote_candidate_(remote_candidate) {}
+ const Candidate& local_candidate() const override { return local_candidate_; }
+ const Candidate& remote_candidate() const override {
+ return remote_candidate_;
+ }
+
+ private:
+ Candidate local_candidate_;
+ Candidate remote_candidate_;
+};
+
// Fake TransportController class, which can be passed into a BaseChannel object
// for test purposes. Can be connected to other FakeTransportControllers via
// Connect().
@@ -503,6 +522,18 @@ class FakeTransportController : public TransportController {
component);
}
+ FakeCandidatePair* CreateFakeCandidatePair(
+ const rtc::SocketAddress& local_address,
+ int16_t local_network_id,
+ const rtc::SocketAddress& remote_address,
+ int16_t remote_network_id) {
+ Candidate local_candidate(0, "udp", local_address, 0u, "", "", "local", 0,
+ "foundation", local_network_id, 0);
+ Candidate remote_candidate(0, "udp", remote_address, 0u, "", "", "local", 0,
+ "foundation", remote_network_id, 0);
+ return new FakeCandidatePair(local_candidate, remote_candidate);
+ }
+
void set_fail_channel_creation(bool fail_channel_creation) {
fail_create_channel_ = fail_channel_creation;
}
« no previous file with comments | « webrtc/p2p/base/dtlstransportchannel.cc ('k') | webrtc/p2p/base/p2ptransportchannel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698