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

Side by Side Diff: webrtc/config_unittest.cc

Issue 2761143002: Support encrypted RTP extensions (RFC 6904) (Closed)
Patch Set: More updates + support for adding/changing encrypted extensions. Created 3 years, 8 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
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/config.h"
12
13 #include <vector>
14
15 #include "webrtc/base/gunit.h"
16
17 using webrtc::RtpExtension;
18
19 static const char kExtensionUri1[] = "extension-uri1";
20 static const char kExtensionUri2[] = "extension-uri2";
21
22 static const RtpExtension kExtension1(kExtensionUri1, 1);
23 static const RtpExtension kExtension1Encrypted(kExtensionUri1, 10, true);
24 static const RtpExtension kExtension2(kExtensionUri2, 2);
25
26 class ConfigTest : public testing::Test {
27 protected:
28 static std::vector<RtpExtension> MakeVector(const RtpExtension& extension) {
Taylor Brandstetter 2017/04/01 00:28:59 nit: Would it be possible to use the vector constr
joachim 2017/04/17 10:46:09 Done.
29 std::vector<RtpExtension> vec;
30 vec.push_back(extension);
31 return vec;
32 }
33 };
34
35 TEST_F(ConfigTest, TestRtpExtension_FilterDuplicateNonEncrypted) {
Taylor Brandstetter 2017/04/01 00:28:59 nit: I'd change this to "TEST(RtpExtensionTest, Fi
joachim 2017/04/17 10:46:09 Done.
36 std::vector<RtpExtension> extensions;
37 std::vector<RtpExtension> filtered;
38
39 extensions.push_back(kExtension1);
40 extensions.push_back(kExtension1Encrypted);
41 filtered = RtpExtension::FilterDuplicateNonEncrypted(extensions);
42 EXPECT_EQ(1u, filtered.size());
43 EXPECT_EQ(MakeVector(kExtension1Encrypted), filtered);
44
45 extensions.clear();
46 extensions.push_back(kExtension1Encrypted);
47 extensions.push_back(kExtension1);
48 filtered = RtpExtension::FilterDuplicateNonEncrypted(extensions);
49 EXPECT_EQ(1u, filtered.size());
50 EXPECT_EQ(MakeVector(kExtension1Encrypted), filtered);
51
52 extensions.clear();
53 extensions.push_back(kExtension1);
54 extensions.push_back(kExtension2);
55 filtered = RtpExtension::FilterDuplicateNonEncrypted(extensions);
56 EXPECT_EQ(2u, filtered.size());
57 EXPECT_EQ(extensions, filtered);
58 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698