OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
7 #include "base/test/simple_test_tick_clock.h" | 7 #include "base/test/simple_test_tick_clock.h" |
8 #include "base/time/tick_clock.h" | 8 #include "base/time/tick_clock.h" |
9 #include "media/cast/cast_config.h" | 9 #include "media/cast/cast_config.h" |
10 #include "media/cast/cast_defines.h" | 10 #include "media/cast/cast_defines.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 EncodedVideoFrame encoded_frame; | 69 EncodedVideoFrame encoded_frame; |
70 base::TimeTicks render_time; | 70 base::TimeTicks render_time; |
71 encoded_frame.codec = kVp8; | 71 encoded_frame.codec = kVp8; |
72 EXPECT_DEATH( | 72 EXPECT_DEATH( |
73 decoder_->DecodeVideoFrame( | 73 decoder_->DecodeVideoFrame( |
74 &encoded_frame, render_time, | 74 &encoded_frame, render_time, |
75 base::Bind(&DecodeTestFrameCallback::DecodeComplete, test_callback_)), | 75 base::Bind(&DecodeTestFrameCallback::DecodeComplete, test_callback_)), |
76 "Empty frame"); | 76 "Empty frame"); |
77 } | 77 } |
78 | 78 |
79 // TODO(pwestin): EXPECT_DEATH tests can not pass valgrind. | |
80 TEST_F(VideoDecoderTest, DISABLED_InvalidCodec) { | |
81 EncodedVideoFrame encoded_frame; | |
82 base::TimeTicks render_time; | |
83 encoded_frame.data.assign(kFrameSize, 0); | |
84 encoded_frame.codec = kExternalVideo; | |
85 EXPECT_DEATH( | |
86 decoder_->DecodeVideoFrame(&encoded_frame, render_time, base::Bind( | |
87 &DecodeTestFrameCallback::DecodeComplete, test_callback_)), | |
88 "Invalid codec"); | |
89 } | |
90 | |
91 // TODO(pwestin): Test decoding a real frame. | 79 // TODO(pwestin): Test decoding a real frame. |
92 | 80 |
93 } // namespace cast | 81 } // namespace cast |
94 } // namespace media | 82 } // namespace media |
OLD | NEW |