| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
| 10 #include "net/base/io_buffer.h" | 11 #include "net/base/io_buffer.h" |
| 11 #include "remoting/proto/video.pb.h" | 12 #include "remoting/proto/video.pb.h" |
| 12 #include "remoting/protocol/fake_session.h" | 13 #include "remoting/protocol/fake_session.h" |
| 13 #include "remoting/protocol/rtp_utils.h" | 14 #include "remoting/protocol/rtp_utils.h" |
| 14 #include "remoting/protocol/rtp_video_reader.h" | 15 #include "remoting/protocol/rtp_video_reader.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 16 | 17 |
| 17 using net::IOBuffer; | 18 using net::IOBuffer; |
| 18 using std::vector; | 19 using std::vector; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 Reset(); | 59 Reset(); |
| 59 InitData(100); | 60 InitData(100); |
| 60 } | 61 } |
| 61 | 62 |
| 62 virtual void TearDown() { | 63 virtual void TearDown() { |
| 63 message_loop_.RunAllPending(); | 64 message_loop_.RunAllPending(); |
| 64 } | 65 } |
| 65 | 66 |
| 66 void Reset() { | 67 void Reset() { |
| 67 session_.reset(new FakeSession()); | 68 session_.reset(new FakeSession()); |
| 68 reader_.reset(new RtpVideoReader()); | 69 reader_.reset(new RtpVideoReader( |
| 70 base::MessageLoopProxy::CreateForCurrentThread())); |
| 69 reader_->Init(session_.get(), this, | 71 reader_->Init(session_.get(), this, |
| 70 base::Bind(&RtpVideoReaderTest::OnReaderInitialized, | 72 base::Bind(&RtpVideoReaderTest::OnReaderInitialized, |
| 71 base::Unretained(this))); | 73 base::Unretained(this))); |
| 72 received_packets_.clear(); | 74 received_packets_.clear(); |
| 73 } | 75 } |
| 74 | 76 |
| 75 void OnReaderInitialized(bool success) { | 77 void OnReaderInitialized(bool success) { |
| 76 ASSERT_TRUE(success); | 78 ASSERT_TRUE(success); |
| 77 } | 79 } |
| 78 | 80 |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 | 370 |
| 369 ExpectedPacket expected[] = { | 371 ExpectedPacket expected[] = { |
| 370 { 123, VideoPacket::FIRST_PACKET | VideoPacket::LAST_PACKET, 0, 30 }, | 372 { 123, VideoPacket::FIRST_PACKET | VideoPacket::LAST_PACKET, 0, 30 }, |
| 371 { 223, VideoPacket::FIRST_PACKET | VideoPacket::LAST_PACKET, 40, 50 }, | 373 { 223, VideoPacket::FIRST_PACKET | VideoPacket::LAST_PACKET, 40, 50 }, |
| 372 }; | 374 }; |
| 373 CheckResults(expected, arraysize(expected)); | 375 CheckResults(expected, arraysize(expected)); |
| 374 } | 376 } |
| 375 | 377 |
| 376 } // namespace protocol | 378 } // namespace protocol |
| 377 } // namespace remoting | 379 } // namespace remoting |
| OLD | NEW |