Index: webrtc/media/engine/webrtcvideoengine_unittest.cc |
diff --git a/webrtc/media/engine/webrtcvideoengine_unittest.cc b/webrtc/media/engine/webrtcvideoengine_unittest.cc |
index 9d4c809f4de6bd6ae04eee2f1c320600b52e1ab1..51f6e9c656d748bd0b6246059a6219f2a61475a5 100644 |
--- a/webrtc/media/engine/webrtcvideoengine_unittest.cc |
+++ b/webrtc/media/engine/webrtcvideoengine_unittest.cc |
@@ -819,12 +819,12 @@ TEST_F(WebRtcVideoEngineTest, ReportSupportedExternalCodecs) { |
std::vector<cricket::VideoCodec> codecs(engine_.codecs()); |
ASSERT_GE(codecs.size(), 2u); |
- cricket::VideoCodec internal_codec = codecs.front(); |
- cricket::VideoCodec external_codec = codecs.back(); |
+ cricket::VideoCodec external_codec = codecs[0]; |
+ cricket::VideoCodec internal_codec = codecs[1]; |
- // The external codec will appear last in the vector. |
- EXPECT_EQ("VP8", internal_codec.name); |
+ // The external codec will appear first in the vector. |
EXPECT_EQ("FakeExternalCodec", external_codec.name); |
+ EXPECT_EQ("VP8", internal_codec.name); |
} |
// Test that an external codec that was added after the engine was initialized |
@@ -836,15 +836,15 @@ TEST_F(WebRtcVideoEngineTest, ReportSupportedExternalCodecsWithAddedCodec) { |
engine_.SetExternalEncoderFactory(&encoder_factory); |
engine_.Init(); |
- // The first external codec will appear last in the vector. |
+ // The first external codec will appear first in the vector. |
std::vector<cricket::VideoCodec> codecs_before(engine_.codecs()); |
- EXPECT_EQ("FakeExternalCodec1", codecs_before.back().name); |
+ EXPECT_EQ("FakeExternalCodec1", codecs_before.front().name); |
// Add second codec. |
encoder_factory.AddSupportedVideoCodecType("FakeExternalCodec2"); |
std::vector<cricket::VideoCodec> codecs_after(engine_.codecs()); |
EXPECT_EQ(codecs_before.size() + 1, codecs_after.size()); |
- EXPECT_EQ("FakeExternalCodec2", codecs_after.back().name); |
+ EXPECT_EQ("FakeExternalCodec2", codecs_after[1].name); |
} |
TEST_F(WebRtcVideoEngineTest, RegisterExternalDecodersIfSupported) { |
@@ -1066,6 +1066,11 @@ class WebRtcVideoChannelTest : public WebRtcVideoEngineTest { |
ASSERT_TRUE(channel_->SetSendParameters(send_parameters_)); |
} |
+ void TearDown() override { |
+ channel_ = nullptr; |
+ fake_call_ = nullptr; |
+ } |
+ |
protected: |
FakeVideoSendStream* AddSendStream() { |
return AddSendStream(StreamParams::CreateLegacy(++last_ssrc_)); |
@@ -1975,6 +1980,8 @@ class Vp9SettingsTest : public WebRtcVideoChannelTest { |
// Remove references to encoder_factory_ since this will be destroyed |
// before channel_ and engine_. |
ASSERT_TRUE(channel_->SetSendParameters(send_parameters_)); |
+ |
+ WebRtcVideoChannelTest::TearDown(); |
} |
cricket::FakeWebRtcVideoEncoderFactory encoder_factory_; |