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

Unified Diff: webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter_unittest.cc

Issue 1599353003: Name SimulcastEncoderApdater on InitEncode. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: unittest + implementation fix Created 4 years, 11 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/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter_unittest.cc
diff --git a/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter_unittest.cc b/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter_unittest.cc
index 1340af3e6ab03c2b9a11d207532e5505211ed9b9..684e214c1ab58d87a3603951544fb602b2bcc2fe 100644
--- a/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter_unittest.cc
+++ b/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter_unittest.cc
@@ -152,6 +152,8 @@ class MockVideoEncoder : public VideoEncoder {
supports_native_handle_ = enabled;
}
+ MOCK_CONST_METHOD0(ImplementationName, const char*());
+
private:
bool supports_native_handle_ = false;
VideoCodec codec_;
@@ -162,6 +164,10 @@ class MockVideoEncoderFactory : public VideoEncoderFactory {
public:
VideoEncoder* Create() override {
MockVideoEncoder* encoder = new MockVideoEncoder();
+ const char* encoder_name = encoder_names_.empty()
+ ? "codec_implementation_name"
+ : encoder_names_[encoders_.size()];
+ ON_CALL(*encoder, ImplementationName()).WillByDefault(Return(encoder_name));
encoders_.push_back(encoder);
return encoder;
}
@@ -171,9 +177,13 @@ class MockVideoEncoderFactory : public VideoEncoderFactory {
virtual ~MockVideoEncoderFactory() {}
const std::vector<MockVideoEncoder*>& encoders() const { return encoders_; }
+ void SetEncoderNames(const std::vector<const char*>& encoder_names) {
+ encoder_names_ = encoder_names;
+ }
private:
std::vector<MockVideoEncoder*> encoders_;
+ std::vector<const char*> encoder_names_;
};
class TestSimulcastEncoderAdapterFakeHelper {
@@ -397,6 +407,20 @@ TEST_F(TestSimulcastEncoderAdapterFake, SupportsNativeHandleForSingleStreams) {
EXPECT_FALSE(adapter_->SupportsNativeHandle());
}
+TEST_F(TestSimulcastEncoderAdapterFake, SupportsImplementationName) {
+ EXPECT_STREQ("SimulcastEncoderAdapter", adapter_->ImplementationName());
+ TestVp8Simulcast::DefaultSettings(
+ &codec_, static_cast<const int*>(kTestTemporalLayerProfile));
+ std::vector<const char*> encoder_names;
+ encoder_names.push_back("codec1");
+ encoder_names.push_back("codec2");
+ encoder_names.push_back("codec3");
+ helper_->factory()->SetEncoderNames(encoder_names);
+ EXPECT_EQ(0, adapter_->InitEncode(&codec_, 1, 1200));
+ EXPECT_STREQ("SimulcastEncoderAdapter (codec1, codec2, codec3)",
+ adapter_->ImplementationName());
+}
+
TEST_F(TestSimulcastEncoderAdapterFake,
SupportsNativeHandleDisabledForMultipleStreams) {
// TODO(pbos): Implement actual test (verify that it works) when implemented
« no previous file with comments | « webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698