summaryrefslogtreecommitdiffstats
path: root/dom/media
diff options
context:
space:
mode:
Diffstat (limited to 'dom/media')
-rw-r--r--dom/media/MediaData.h12
-rw-r--r--dom/media/webrtc/transport/test/ice_unittest.cpp19
2 files changed, 22 insertions, 9 deletions
diff --git a/dom/media/MediaData.h b/dom/media/MediaData.h
index 4040f368ba..6b7e0ff84d 100644
--- a/dom/media/MediaData.h
+++ b/dom/media/MediaData.h
@@ -94,8 +94,16 @@ class AlignedBuffer {
}
AlignedBuffer& operator=(AlignedBuffer&& aOther) {
- this->~AlignedBuffer();
- new (this) AlignedBuffer(std::move(aOther));
+ if (&aOther == this) {
+ return *this;
+ }
+ mData = aOther.mData;
+ mLength = aOther.mLength;
+ mBuffer = std::move(aOther.mBuffer);
+ mCapacity = aOther.mCapacity;
+ aOther.mData = nullptr;
+ aOther.mLength = 0;
+ aOther.mCapacity = 0;
return *this;
}
diff --git a/dom/media/webrtc/transport/test/ice_unittest.cpp b/dom/media/webrtc/transport/test/ice_unittest.cpp
index d87fa0b0da..9931071d16 100644
--- a/dom/media/webrtc/transport/test/ice_unittest.cpp
+++ b/dom/media/webrtc/transport/test/ice_unittest.cpp
@@ -58,9 +58,9 @@ using namespace mozilla;
static unsigned int kDefaultTimeout = 7000;
-// TODO(nils@mozilla.com): This should get replaced with some non-external
-// solution like discussed in bug 860775.
-const std::string kDefaultStunServerHostname((char*)"stun.l.google.com");
+// TODO: It would be nice to have a test STUN/TURN server that can run with
+// gtest.
+const std::string kDefaultStunServerHostname((char*)"");
const std::string kBogusStunServerHostname(
(char*)"stun-server-nonexistent.invalid");
const uint16_t kDefaultStunServerPort = 19305;
@@ -1576,12 +1576,17 @@ class WebRtcIceConnectTest : public StunTest {
peer->SetMappingType(mapping_type_);
peer->SetBlockUdp(block_udp_);
} else if (setup_stun_servers) {
- std::vector<NrIceStunServer> stun_servers;
+ if (stun_server_address_.empty()) {
+ InitTestStunServer();
+ peer->UseTestStunServer();
+ } else {
+ std::vector<NrIceStunServer> stun_servers;
- stun_servers.push_back(*NrIceStunServer::Create(
- stun_server_address_, kDefaultStunServerPort, kNrIceTransportUdp));
+ stun_servers.push_back(*NrIceStunServer::Create(
+ stun_server_address_, kDefaultStunServerPort, kNrIceTransportUdp));
- peer->SetStunServers(stun_servers);
+ peer->SetStunServers(stun_servers);
+ }
}
}