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 "media/cast/logging/log_deserializer.h" | 8 #include "media/cast/logging/log_deserializer.h" |
9 #include "media/cast/logging/log_serializer.h" | 9 #include "media/cast/logging/log_serializer.h" |
10 #include "media/cast/logging/logging_defines.h" | 10 #include "media/cast/logging/logging_defines.h" |
11 #include "media/cast/logging/proto/proto_utils.h" | 11 #include "media/cast/logging/proto/proto_utils.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 | 13 |
14 using media::cast::proto::AggregatedFrameEvent; | 14 using media::cast::proto::AggregatedFrameEvent; |
15 using media::cast::proto::AggregatedPacketEvent; | 15 using media::cast::proto::AggregatedPacketEvent; |
16 using media::cast::proto::BasePacketEvent; | 16 using media::cast::proto::BasePacketEvent; |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 const media::cast::CastLoggingEvent kVideoFrameEvents[] = { | 20 const media::cast::CastLoggingEvent kVideoFrameEvents[] = { |
21 media::cast::kVideoFrameCaptured, media::cast::kVideoFrameReceived, | 21 media::cast::kVideoFrameCaptured, media::cast::kVideoFrameReceived, |
22 media::cast::kVideoFrameSentToEncoder, media::cast::kVideoFrameEncoded, | 22 media::cast::kVideoFrameSentToEncoder, media::cast::kVideoFrameEncoded, |
23 media::cast::kVideoFrameDecoded, media::cast::kVideoRenderDelay}; | 23 media::cast::kVideoFrameDecoded, media::cast::kVideoRenderDelay}; |
24 | 24 |
25 const media::cast::CastLoggingEvent kVideoPacketEvents[] = { | 25 const media::cast::CastLoggingEvent kVideoPacketEvents[] = { |
26 media::cast::kPacketSentToPacer, media::cast::kPacketSentToNetwork, | 26 media::cast::kVideoPacketSentToPacer, |
27 media::cast::kVideoPacketReceived}; | 27 media::cast::kVideoPacketSentToNetwork, media::cast::kVideoPacketReceived}; |
28 | 28 |
29 // The frame event fields cycle through these numbers. | 29 // The frame event fields cycle through these numbers. |
30 const int kEncodedFrameSize[] = {512, 425, 399, 400, 237}; | 30 const int kEncodedFrameSize[] = {512, 425, 399, 400, 237}; |
31 const int kDelayMillis[] = {15, 4, 8, 42, 23, 16}; | 31 const int kDelayMillis[] = {15, 4, 8, 42, 23, 16}; |
32 } | 32 } |
33 | 33 |
34 namespace media { | 34 namespace media { |
35 namespace cast { | 35 namespace cast { |
36 | 36 |
37 class SerializeDeserializeTest : public ::testing::Test { | 37 class SerializeDeserializeTest : public ::testing::Test { |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 // Compare protos by serializing and checking the bytes. | 133 // Compare protos by serializing and checking the bytes. |
134 EXPECT_EQ(original_it->second->SerializeAsString(), | 134 EXPECT_EQ(original_it->second->SerializeAsString(), |
135 packet_it->second->SerializeAsString()); | 135 packet_it->second->SerializeAsString()); |
136 packet_event_map.erase(original_it); | 136 packet_event_map.erase(original_it); |
137 } | 137 } |
138 EXPECT_TRUE(packet_event_map.empty()); | 138 EXPECT_TRUE(packet_event_map.empty()); |
139 } | 139 } |
140 | 140 |
141 } // namespace cast | 141 } // namespace cast |
142 } // namespace media | 142 } // namespace media |
OLD | NEW |