| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // Joint LogSerializer and LogDeserializer testing to make sure they stay in | 5 // Joint LogSerializer and LogDeserializer testing to make sure they stay in |
| 6 // sync. | 6 // sync. |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "media/cast/logging/log_deserializer.h" | 9 #include "media/cast/logging/log_deserializer.h" |
| 10 #include "media/cast/logging/log_serializer.h" | 10 #include "media/cast/logging/log_serializer.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 } | 36 } |
| 37 | 37 |
| 38 namespace media { | 38 namespace media { |
| 39 namespace cast { | 39 namespace cast { |
| 40 | 40 |
| 41 class SerializeDeserializeTest : public ::testing::Test { | 41 class SerializeDeserializeTest : public ::testing::Test { |
| 42 protected: | 42 protected: |
| 43 SerializeDeserializeTest() | 43 SerializeDeserializeTest() |
| 44 : serialized_(new char[kMaxSerializedBytes]), output_bytes_(0) {} | 44 : serialized_(new char[kMaxSerializedBytes]), output_bytes_(0) {} |
| 45 | 45 |
| 46 virtual ~SerializeDeserializeTest() {} | 46 ~SerializeDeserializeTest() override {} |
| 47 | 47 |
| 48 void Init() { | 48 void Init() { |
| 49 metadata_.set_first_rtp_timestamp(12345678 * 90); | 49 metadata_.set_first_rtp_timestamp(12345678 * 90); |
| 50 metadata_.set_is_audio(false); | 50 metadata_.set_is_audio(false); |
| 51 metadata_.set_num_frame_events(10); | 51 metadata_.set_num_frame_events(10); |
| 52 metadata_.set_num_packet_events(10); | 52 metadata_.set_num_packet_events(10); |
| 53 | 53 |
| 54 int64 event_time_ms = 0; | 54 int64 event_time_ms = 0; |
| 55 // Insert frame and packet events with RTP timestamps 0, 90, 180, ... | 55 // Insert frame and packet events with RTP timestamps 0, 90, 180, ... |
| 56 for (int i = 0; i < metadata_.num_frame_events(); i++) { | 56 for (int i = 0; i < metadata_.num_frame_events(); i++) { |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 compressed, | 205 compressed, |
| 206 100, | 206 100, |
| 207 serialized_.get(), | 207 serialized_.get(), |
| 208 &output_bytes_); | 208 &output_bytes_); |
| 209 EXPECT_FALSE(success); | 209 EXPECT_FALSE(success); |
| 210 EXPECT_EQ(0, output_bytes_); | 210 EXPECT_EQ(0, output_bytes_); |
| 211 } | 211 } |
| 212 | 212 |
| 213 } // namespace cast | 213 } // namespace cast |
| 214 } // namespace media | 214 } // namespace media |
| OLD | NEW |