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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "media/base/android/media_codec_bridge.h" | 10 #include "media/base/android/media_codec_bridge.h" |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 EXPECT_FALSE(GetMediaDecoderJob(true)); | 198 EXPECT_FALSE(GetMediaDecoderJob(true)); |
199 EXPECT_FALSE(GetMediaDecoderJob(false)); | 199 EXPECT_FALSE(GetMediaDecoderJob(false)); |
200 } | 200 } |
201 | 201 |
202 // Upon the next successful decode callback, post a task to call Release() | 202 // Upon the next successful decode callback, post a task to call Release() |
203 // on the |player_|. TEST_F's do not have access to the private player | 203 // on the |player_|. TEST_F's do not have access to the private player |
204 // members, hence this helper method. | 204 // members, hence this helper method. |
205 // Prevent usage creep of MSP::set_decode_callback_for_testing() by | 205 // Prevent usage creep of MSP::set_decode_callback_for_testing() by |
206 // only using it for the ReleaseWithOnPrefetchDoneAlreadyPosted test. | 206 // only using it for the ReleaseWithOnPrefetchDoneAlreadyPosted test. |
207 void OnNextTestDecodeCallbackPostTaskToReleasePlayer() { | 207 void OnNextTestDecodeCallbackPostTaskToReleasePlayer() { |
208 player_.set_decode_callback_for_testing(media::BindToLoop( | 208 DCHECK_EQ(&message_loop_, base::MessageLoop::current()); |
209 message_loop_.message_loop_proxy(), | 209 player_.set_decode_callback_for_testing(media::BindToCurrentLoop( |
210 base::Bind( | 210 base::Bind( |
211 &MediaSourcePlayerTest::ReleaseWithPendingPrefetchDoneVerification, | 211 &MediaSourcePlayerTest::ReleaseWithPendingPrefetchDoneVerification, |
212 base::Unretained(this)))); | 212 base::Unretained(this)))); |
213 } | 213 } |
214 | 214 |
215 // Asynch test callback posted upon decode completion to verify that a pending | 215 // Asynch test callback posted upon decode completion to verify that a pending |
216 // prefetch done event is cleared across |player_|'s Release(). This helps | 216 // prefetch done event is cleared across |player_|'s Release(). This helps |
217 // ensure the ReleaseWithOnPrefetchDoneAlreadyPosted test scenario is met. | 217 // ensure the ReleaseWithOnPrefetchDoneAlreadyPosted test scenario is met. |
218 void ReleaseWithPendingPrefetchDoneVerification() { | 218 void ReleaseWithPendingPrefetchDoneVerification() { |
219 EXPECT_TRUE(player_.IsEventPending(player_.PREFETCH_DONE_EVENT_PENDING)); | 219 EXPECT_TRUE(player_.IsEventPending(player_.PREFETCH_DONE_EVENT_PENDING)); |
(...skipping 1843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2063 | 2063 |
2064 std::vector<std::string> codec_avc(1, "avc1"); | 2064 std::vector<std::string> codec_avc(1, "avc1"); |
2065 EXPECT_FALSE(IsTypeSupported(invalid_uuid, kL3, kVideoMp4, codec_avc)); | 2065 EXPECT_FALSE(IsTypeSupported(invalid_uuid, kL3, kVideoMp4, codec_avc)); |
2066 EXPECT_FALSE(IsTypeSupported(invalid_uuid, kL1, kVideoMp4, codec_avc)); | 2066 EXPECT_FALSE(IsTypeSupported(invalid_uuid, kL1, kVideoMp4, codec_avc)); |
2067 } | 2067 } |
2068 | 2068 |
2069 // TODO(xhwang): Are these IsTypeSupported tests device specific? | 2069 // TODO(xhwang): Are these IsTypeSupported tests device specific? |
2070 // TODO(xhwang): Add more IsTypeSupported tests. | 2070 // TODO(xhwang): Add more IsTypeSupported tests. |
2071 | 2071 |
2072 } // namespace media | 2072 } // namespace media |
OLD | NEW |