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

Side by Side Diff: webrtc/media/engine/webrtcvideoencoderfactory_unittest.cc

Issue 2639423006: Clear out cached codecs when calculating new codec lists. (Closed)
Patch Set: Format cl. Created 3 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 unified diff | Download patch
« no previous file with comments | « webrtc/media/engine/webrtcvideoencoderfactory.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 #include "webrtc/media/engine/webrtcvideoencoderfactory.h"
12
13 #include "webrtc/test/gtest.h"
14
15 class WebRtcVideoEncoderFactoryForTest
16 : public cricket::WebRtcVideoEncoderFactory {
17 public:
18 WebRtcVideoEncoderFactoryForTest() {
19 codecs_.push_back(VideoCodec(webrtc::kVideoCodecH264, "H264"));
20 codecs_.push_back(VideoCodec(webrtc::kVideoCodecVP8, "VP8"));
21 }
22
23 const std::vector<VideoCodec>& codecs() const override { return codecs_; }
24
25 void DestroyVideoEncoder(webrtc::VideoEncoder* encoder) override {}
26
27 std::vector<VideoCodec> codecs_;
28 };
29
30 TEST(WebRtcVideoEncoderFactoryTest, TestMultipleCallsToSupportedCodecs) {
31 WebRtcVideoEncoderFactoryForTest factory;
32 EXPECT_EQ(2u, factory.supported_codecs().size());
33 EXPECT_EQ("H264", factory.supported_codecs()[0].name);
34 EXPECT_EQ("VP8", factory.supported_codecs()[1].name);
35
36 // The codec list doesn't grow when called repeatedly.
37 EXPECT_EQ(2u, factory.supported_codecs().size());
38 }
OLDNEW
« no previous file with comments | « webrtc/media/engine/webrtcvideoencoderfactory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698