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" |
11 #include "media/cast/logging/logging_defines.h" | 11 #include "media/cast/logging/logging_defines.h" |
12 #include "media/cast/logging/proto/proto_utils.h" | 12 #include "media/cast/logging/proto/proto_utils.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
14 | 14 |
15 using media::cast::proto::AggregatedFrameEvent; | 15 using media::cast::proto::AggregatedFrameEvent; |
16 using media::cast::proto::AggregatedPacketEvent; | 16 using media::cast::proto::AggregatedPacketEvent; |
17 using media::cast::proto::BasePacketEvent; | 17 using media::cast::proto::BasePacketEvent; |
18 using media::cast::proto::LogMetadata; | 18 using media::cast::proto::LogMetadata; |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 const media::cast::CastLoggingEvent kVideoFrameEvents[] = { | 22 const media::cast::CastLoggingEvent kVideoFrameEvents[] = { |
23 media::cast::kVideoFrameCaptured, media::cast::kVideoFrameReceived, | 23 media::cast::kVideoFrameCaptured, media::cast::kVideoFrameReceived, |
24 media::cast::kVideoFrameSentToEncoder, media::cast::kVideoFrameEncoded, | 24 media::cast::kVideoFrameSentToEncoder, media::cast::kVideoFrameEncoded, |
25 media::cast::kVideoFrameDecoded, media::cast::kVideoRenderDelay}; | 25 media::cast::kVideoFrameDecoded, media::cast::kVideoRenderDelay}; |
26 | 26 |
27 const media::cast::CastLoggingEvent kVideoPacketEvents[] = { | 27 const media::cast::CastLoggingEvent kVideoPacketEvents[] = { |
28 media::cast::kVideoPacketSentToPacer, | |
29 media::cast::kVideoPacketSentToNetwork, media::cast::kVideoPacketReceived}; | 28 media::cast::kVideoPacketSentToNetwork, media::cast::kVideoPacketReceived}; |
30 | 29 |
31 // The frame event fields cycle through these numbers. | 30 // The frame event fields cycle through these numbers. |
32 const int kEncodedFrameSize[] = {512, 425, 399, 400, 237}; | 31 const int kEncodedFrameSize[] = {512, 425, 399, 400, 237}; |
33 const int kDelayMillis[] = {15, 4, 8, 42, 23, 16}; | 32 const int kDelayMillis[] = {15, 4, 8, 42, 23, 16}; |
34 | 33 |
35 const int kMaxSerializedBytes = 10000; | 34 const int kMaxSerializedBytes = 10000; |
36 } | 35 } |
37 | 36 |
38 namespace media { | 37 namespace media { |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 compressed, | 204 compressed, |
206 100, | 205 100, |
207 serialized_.get(), | 206 serialized_.get(), |
208 &output_bytes_); | 207 &output_bytes_); |
209 EXPECT_FALSE(success); | 208 EXPECT_FALSE(success); |
210 EXPECT_EQ(0, output_bytes_); | 209 EXPECT_EQ(0, output_bytes_); |
211 } | 210 } |
212 | 211 |
213 } // namespace cast | 212 } // namespace cast |
214 } // namespace media | 213 } // namespace media |
OLD | NEW |