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

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

Issue 1827553002: Shorten single-stream VP8 HW implementation names. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: 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/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 589edb6d3e06aa2c646cfb2c75dacfd2fb7d2111..742bd76293fee276aec526496243286f6ff4b556 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
@@ -8,6 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#include <algorithm>
#include <memory>
#include <vector>
@@ -174,7 +175,10 @@ class MockVideoEncoderFactory : public VideoEncoderFactory {
return encoder;
}
- void Destroy(VideoEncoder* encoder) override { delete encoder; }
+ void Destroy(VideoEncoder* encoder) override {
+ encoders_.erase(std::remove(encoders_.begin(), encoders_.end(), encoder));
stefan-webrtc 2016/03/30 13:07:08 This looks weird to me. Why would you want to remo
pbos-webrtc 2016/03/30 13:51:29 Removed the std::remove part and wrote it myself,
+ delete encoder;
+ }
virtual ~MockVideoEncoderFactory() {}
@@ -421,6 +425,14 @@ TEST_F(TestSimulcastEncoderAdapterFake, SupportsImplementationName) {
EXPECT_EQ(0, adapter_->InitEncode(&codec_, 1, 1200));
EXPECT_STREQ("SimulcastEncoderAdapter (codec1, codec2, codec3)",
adapter_->ImplementationName());
+
+ // Single streams should not expose "SimulcastEncoderAdapter" in name.
+ adapter_->Release();
+ codec_.numberOfSimulcastStreams = 1;
+ EXPECT_EQ(0, adapter_->InitEncode(&codec_, 1, 1200));
+ adapter_->RegisterEncodeCompleteCallback(this);
+ ASSERT_EQ(1u, helper_->factory()->encoders().size());
+ EXPECT_STREQ("codec1", adapter_->ImplementationName());
}
TEST_F(TestSimulcastEncoderAdapterFake,
« 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