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

Side by Side Diff: webrtc/base/helpers_unittest.cc

Issue 1413983004: Reland of Adding the ability to create an RtpSender without a track. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixing merge issue. Created 5 years, 1 month 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/base/helpers.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
1 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 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 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 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 25 matching lines...) Expand all
36 36
37 TEST_F(RandomTest, TestCreateRandomString) { 37 TEST_F(RandomTest, TestCreateRandomString) {
38 std::string random = CreateRandomString(256); 38 std::string random = CreateRandomString(256);
39 EXPECT_EQ(256U, random.size()); 39 EXPECT_EQ(256U, random.size());
40 std::string random2; 40 std::string random2;
41 EXPECT_TRUE(CreateRandomString(256, &random2)); 41 EXPECT_TRUE(CreateRandomString(256, &random2));
42 EXPECT_NE(random, random2); 42 EXPECT_NE(random, random2);
43 EXPECT_EQ(256U, random2.size()); 43 EXPECT_EQ(256U, random2.size());
44 } 44 }
45 45
46 TEST_F(RandomTest, TestCreateRandomUuid) {
47 std::string random = CreateRandomUuid();
48 EXPECT_EQ(36U, random.size());
49 }
50
46 TEST_F(RandomTest, TestCreateRandomForTest) { 51 TEST_F(RandomTest, TestCreateRandomForTest) {
47 // Make sure we get the output we expect. 52 // Make sure we get the output we expect.
48 SetRandomTestMode(true); 53 SetRandomTestMode(true);
49 EXPECT_EQ(2154761789U, CreateRandomId()); 54 EXPECT_EQ(2154761789U, CreateRandomId());
50 EXPECT_EQ("h0ISP4S5SJKH/9EY", CreateRandomString(16)); 55 EXPECT_EQ("h0ISP4S5SJKH/9EY", CreateRandomString(16));
56 EXPECT_EQ("41706e92-cdd3-46d9-a22d-8ff1737ffb11", CreateRandomUuid());
51 57
52 // Reset and make sure we get the same output. 58 // Reset and make sure we get the same output.
53 SetRandomTestMode(true); 59 SetRandomTestMode(true);
54 EXPECT_EQ(2154761789U, CreateRandomId()); 60 EXPECT_EQ(2154761789U, CreateRandomId());
55 EXPECT_EQ("h0ISP4S5SJKH/9EY", CreateRandomString(16)); 61 EXPECT_EQ("h0ISP4S5SJKH/9EY", CreateRandomString(16));
62 EXPECT_EQ("41706e92-cdd3-46d9-a22d-8ff1737ffb11", CreateRandomUuid());
56 63
57 // Test different character sets. 64 // Test different character sets.
58 SetRandomTestMode(true); 65 SetRandomTestMode(true);
59 std::string str; 66 std::string str;
60 EXPECT_TRUE(CreateRandomString(16, "a", &str)); 67 EXPECT_TRUE(CreateRandomString(16, "a", &str));
61 EXPECT_EQ("aaaaaaaaaaaaaaaa", str); 68 EXPECT_EQ("aaaaaaaaaaaaaaaa", str);
62 EXPECT_TRUE(CreateRandomString(16, "abc", &str)); 69 EXPECT_TRUE(CreateRandomString(16, "abc", &str));
63 EXPECT_EQ("acbccaaaabbaacbb", str); 70 EXPECT_EQ("acbccaaaabbaacbb", str);
64 71
65 // Turn off test mode for other tests. 72 // Turn off test mode for other tests.
66 SetRandomTestMode(false); 73 SetRandomTestMode(false);
67 } 74 }
68 75
69 } // namespace rtc 76 } // namespace rtc
OLDNEW
« no previous file with comments | « webrtc/base/helpers.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698