diff options
Diffstat (limited to 'dom')
-rw-r--r-- | dom/base/Navigator.cpp | 3 | ||||
-rw-r--r-- | dom/media/MediaData.h | 12 | ||||
-rw-r--r-- | dom/media/webrtc/transport/test/ice_unittest.cpp | 19 | ||||
-rw-r--r-- | dom/security/featurepolicy/test/mochitest/mochitest.ini | 1 | ||||
-rw-r--r-- | dom/security/featurepolicy/test/mochitest/test_initial_aboutblank.html | 26 |
5 files changed, 52 insertions, 9 deletions
diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp index 151d992d6f..c4636f6d8b 100644 --- a/dom/base/Navigator.cpp +++ b/dom/base/Navigator.cpp @@ -167,6 +167,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Navigator) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mVRServiceTest) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSharePromise) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mXRSystem) + NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mClipboard) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END void Navigator::Invalidate() { @@ -246,6 +247,8 @@ void Navigator::Invalidate() { } mSharePromise = nullptr; + + mClipboard = nullptr; } void Navigator::GetUserAgent(nsAString& aUserAgent, CallerType aCallerType, 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); + } } } diff --git a/dom/security/featurepolicy/test/mochitest/mochitest.ini b/dom/security/featurepolicy/test/mochitest/mochitest.ini index 3c1850cc2e..22250e3303 100644 --- a/dom/security/featurepolicy/test/mochitest/mochitest.ini +++ b/dom/security/featurepolicy/test/mochitest/mochitest.ini @@ -9,3 +9,4 @@ support-files = [test_parser.html] fail-if = xorigin [test_featureList.html] +[test_initial_aboutblank.html] diff --git a/dom/security/featurepolicy/test/mochitest/test_initial_aboutblank.html b/dom/security/featurepolicy/test/mochitest/test_initial_aboutblank.html new file mode 100644 index 0000000000..79d1bfd4c4 --- /dev/null +++ b/dom/security/featurepolicy/test/mochitest/test_initial_aboutblank.html @@ -0,0 +1,26 @@ +<!DOCTYPE HTML> +<html> +<head> + <title>Test feature policy - Initial about:blank</title> + <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> +</head> +<body> +<iframe name="parentIframe" allow="fullscreen 'none'" srcdoc=" + <iframe name='regular'></iframe> + <iframe name='transient'></iframe> + <script>transient.stop()</script> +"></iframe> + +<script type="text/javascript"> +add_task(function testAboutBlank() { + isDeeply(frames[0].transient.document.featurePolicy.allowedFeatures(), + frames[0].document.featurePolicy.allowedFeatures(), + "check allowed feature list for initial about:blank"); + isDeeply(frames[0].regular.document.featurePolicy.allowedFeatures(), + frames[0].document.featurePolicy.allowedFeatures(), + "check allowed feature list for real load about:blank"); +}); +</script> +</body> +</html> |