| 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 <string> | 5 #include <string> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
| 10 #include "remoting/proto/video.pb.h" | 10 #include "remoting/proto/video.pb.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 EXPECT_EQ(expected[i].last, packet.header().marker); | 100 EXPECT_EQ(expected[i].last, packet.header().marker); |
| 101 EXPECT_EQ(expected[i].fragmentation_info, | 101 EXPECT_EQ(expected[i].fragmentation_info, |
| 102 packet.vp8_descriptor().fragmentation_info); | 102 packet.vp8_descriptor().fragmentation_info); |
| 103 EXPECT_TRUE(CompareData(packet.payload(), &*data_.begin() + pos, | 103 EXPECT_TRUE(CompareData(packet.payload(), &*data_.begin() + pos, |
| 104 packet.payload().total_bytes())); | 104 packet.payload().total_bytes())); |
| 105 pos += packet.payload().total_bytes(); | 105 pos += packet.payload().total_bytes(); |
| 106 } | 106 } |
| 107 EXPECT_EQ(pos, static_cast<int>(data_.size())); | 107 EXPECT_EQ(pos, static_cast<int>(data_.size())); |
| 108 } | 108 } |
| 109 | 109 |
| 110 MessageLoop message_loop_; |
| 111 |
| 110 scoped_refptr<FakeSession> session_; | 112 scoped_refptr<FakeSession> session_; |
| 111 RtpVideoWriter writer_; | 113 RtpVideoWriter writer_; |
| 112 | 114 |
| 113 MessageLoop message_loop_; | |
| 114 vector<char> data_; | 115 vector<char> data_; |
| 115 VideoPacket* packet_; | 116 VideoPacket* packet_; |
| 116 }; | 117 }; |
| 117 | 118 |
| 118 TEST_F(RtpVideoWriterTest, NotFragmented_FirstPacket) { | 119 TEST_F(RtpVideoWriterTest, NotFragmented_FirstPacket) { |
| 119 InitPacket(1024, true, false); | 120 InitPacket(1024, true, false); |
| 120 writer_.ProcessVideoPacket(packet_, new DeleteTask<VideoPacket>(packet_)); | 121 writer_.ProcessVideoPacket(packet_, new DeleteTask<VideoPacket>(packet_)); |
| 121 message_loop_.RunAllPending(); | 122 message_loop_.RunAllPending(); |
| 122 | 123 |
| 123 ExpectedPacket expected[] = { | 124 ExpectedPacket expected[] = { |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 ExpectedPacket expected[] = { | 170 ExpectedPacket expected[] = { |
| 170 { true, Vp8Descriptor::FIRST_FRAGMENT, false }, | 171 { true, Vp8Descriptor::FIRST_FRAGMENT, false }, |
| 171 { false, Vp8Descriptor::MIDDLE_FRAGMENT, false }, | 172 { false, Vp8Descriptor::MIDDLE_FRAGMENT, false }, |
| 172 { false, Vp8Descriptor::LAST_FRAGMENT, true }, | 173 { false, Vp8Descriptor::LAST_FRAGMENT, true }, |
| 173 }; | 174 }; |
| 174 VerifyResult(expected, arraysize(expected)); | 175 VerifyResult(expected, arraysize(expected)); |
| 175 } | 176 } |
| 176 | 177 |
| 177 } // namespace protocol | 178 } // namespace protocol |
| 178 } // namespace remoting | 179 } // namespace remoting |
| OLD | NEW |