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

Side by Side Diff: remoting/protocol/rtp_video_reader_unittest.cc

Issue 8116021: Switch remoting/protocol to new callbacks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 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 | Annotate | Revision Log
« no previous file with comments | « remoting/protocol/rtp_video_reader.cc ('k') | remoting/protocol/rtp_video_writer.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 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <vector> 5 #include <vector>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/message_loop_proxy.h" 9 #include "base/message_loop_proxy.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
11 #include "net/base/io_buffer.h" 11 #include "net/base/io_buffer.h"
12 #include "remoting/proto/video.pb.h" 12 #include "remoting/proto/video.pb.h"
13 #include "remoting/protocol/fake_session.h" 13 #include "remoting/protocol/fake_session.h"
14 #include "remoting/protocol/rtp_utils.h" 14 #include "remoting/protocol/rtp_utils.h"
15 #include "remoting/protocol/rtp_video_reader.h" 15 #include "remoting/protocol/rtp_video_reader.h"
16 #include "testing/gtest/include/gtest/gtest.h" 16 #include "testing/gtest/include/gtest/gtest.h"
17 17
18 using net::IOBuffer; 18 using net::IOBuffer;
19 using std::vector; 19 using std::vector;
20 20
21 namespace remoting { 21 namespace remoting {
22 namespace protocol { 22 namespace protocol {
23 23
24 class RtpVideoReaderTest : public testing::Test, 24 class RtpVideoReaderTest : public testing::Test,
25 public VideoStub { 25 public VideoStub {
26 public: 26 public:
27 // VideoStub interface. 27 // VideoStub interface.
28 virtual void ProcessVideoPacket(const VideoPacket* video_packet, 28 virtual void ProcessVideoPacket(const VideoPacket* video_packet,
29 Task* done) { 29 const base::Closure& done) {
30 received_packets_.push_back(VideoPacket()); 30 received_packets_.push_back(VideoPacket());
31 received_packets_.back() = *video_packet; 31 received_packets_.back() = *video_packet;
32 done->Run(); 32 done.Run();
33 delete done;
34 } 33 }
35 34
36 virtual int GetPendingPackets() { 35 virtual int GetPendingPackets() {
37 return 0; 36 return 0;
38 } 37 }
39 38
40 protected: 39 protected:
41 struct FragmentInfo { 40 struct FragmentInfo {
42 int sequence_number; 41 int sequence_number;
43 int timestamp; 42 int timestamp;
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 369
371 ExpectedPacket expected[] = { 370 ExpectedPacket expected[] = {
372 { 123, VideoPacket::FIRST_PACKET | VideoPacket::LAST_PACKET, 0, 30 }, 371 { 123, VideoPacket::FIRST_PACKET | VideoPacket::LAST_PACKET, 0, 30 },
373 { 223, VideoPacket::FIRST_PACKET | VideoPacket::LAST_PACKET, 40, 50 }, 372 { 223, VideoPacket::FIRST_PACKET | VideoPacket::LAST_PACKET, 40, 50 },
374 }; 373 };
375 CheckResults(expected, arraysize(expected)); 374 CheckResults(expected, arraysize(expected));
376 } 375 }
377 376
378 } // namespace protocol 377 } // namespace protocol
379 } // namespace remoting 378 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/rtp_video_reader.cc ('k') | remoting/protocol/rtp_video_writer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698