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

Side by Side Diff: talk/app/webrtc/sctputils_unittest.cc

Issue 1403633005: Revert of Moving MediaStreamSignaling logic into PeerConnection. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 2 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 | « talk/app/webrtc/sctputils.cc ('k') | talk/app/webrtc/statscollector.h » ('j') | 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 * libjingle 2 * libjingle
3 * Copyright 2013 Google Inc. 3 * Copyright 2013 Google Inc
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation 11 * this list of conditions and the following disclaimer in the documentation
12 * and/or other materials provided with the distribution. 12 * and/or other materials provided with the distribution.
13 * 3. The name of the author may not be used to endorse or promote products 13 * 3. The name of the author may not be used to endorse or promote products
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 rtc::Buffer packet; 152 rtc::Buffer packet;
153 webrtc::WriteDataChannelOpenAckMessage(&packet); 153 webrtc::WriteDataChannelOpenAckMessage(&packet);
154 154
155 uint8_t message_type; 155 uint8_t message_type;
156 rtc::ByteBuffer buffer(packet.data(), packet.length()); 156 rtc::ByteBuffer buffer(packet.data(), packet.length());
157 ASSERT_TRUE(buffer.ReadUInt8(&message_type)); 157 ASSERT_TRUE(buffer.ReadUInt8(&message_type));
158 EXPECT_EQ(0x02, message_type); 158 EXPECT_EQ(0x02, message_type);
159 159
160 EXPECT_TRUE(webrtc::ParseDataChannelOpenAckMessage(packet)); 160 EXPECT_TRUE(webrtc::ParseDataChannelOpenAckMessage(packet));
161 } 161 }
162
163 TEST_F(SctpUtilsTest, TestIsOpenMessage) {
164 rtc::ByteBuffer open;
165 open.WriteUInt8(0x03);
166 EXPECT_TRUE(webrtc::IsOpenMessage(open));
167
168 rtc::ByteBuffer openAck;
169 openAck.WriteUInt8(0x02);
170 EXPECT_FALSE(webrtc::IsOpenMessage(open));
171
172 rtc::ByteBuffer invalid;
173 openAck.WriteUInt8(0x01);
174 EXPECT_FALSE(webrtc::IsOpenMessage(invalid));
175
176 rtc::ByteBuffer empty;
177 EXPECT_FALSE(webrtc::IsOpenMessage(empty));
178 }
OLDNEW
« no previous file with comments | « talk/app/webrtc/sctputils.cc ('k') | talk/app/webrtc/statscollector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698