OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // The bulk of this file is support code; sorry about that. Here's an overview | 5 // The bulk of this file is support code; sorry about that. Here's an overview |
6 // to hopefully help readers of this code: | 6 // to hopefully help readers of this code: |
7 // - RenderingHelper is charged with interacting with X11/{EGL/GLES2,GLX/GL} or | 7 // - RenderingHelper is charged with interacting with X11/{EGL/GLES2,GLX/GL} or |
8 // Win/EGL. | 8 // Win/EGL. |
9 // - ClientState is an enum for the state of the decode client used by the test. | 9 // - ClientState is an enum for the state of the decode client used by the test. |
10 // - ClientStateNotification is a barrier abstraction that allows the test code | 10 // - ClientStateNotification is a barrier abstraction that allows the test code |
(...skipping 1178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1189 // - reset_after_frame_num: see GLRenderingVDAClient ctor. | 1189 // - reset_after_frame_num: see GLRenderingVDAClient ctor. |
1190 // - delete_decoder_phase: see GLRenderingVDAClient ctor. | 1190 // - delete_decoder_phase: see GLRenderingVDAClient ctor. |
1191 // - whether to test slow rendering by delaying ReusePictureBuffer(). | 1191 // - whether to test slow rendering by delaying ReusePictureBuffer(). |
1192 // - whether the video frames are rendered as thumbnails. | 1192 // - whether the video frames are rendered as thumbnails. |
1193 class VideoDecodeAcceleratorParamTest | 1193 class VideoDecodeAcceleratorParamTest |
1194 : public VideoDecodeAcceleratorTest, | 1194 : public VideoDecodeAcceleratorTest, |
1195 public ::testing::WithParamInterface< | 1195 public ::testing::WithParamInterface< |
1196 base::Tuple<int, int, int, ResetPoint, ClientState, bool, bool> > { | 1196 base::Tuple<int, int, int, ResetPoint, ClientState, bool, bool> > { |
1197 }; | 1197 }; |
1198 | 1198 |
1199 // Helper so that gtest failures emit a more readable version of the tuple than | |
1200 // its byte representation. | |
1201 ::std::ostream& operator<<( | |
1202 ::std::ostream& os, | |
1203 const base::Tuple<int, int, int, ResetPoint, ClientState, bool, bool>& t) { | |
1204 return os << base::get<0>(t) << ", " << base::get<1>(t) << ", " | |
1205 << base::get<2>(t) << ", " << base::get<3>(t) << ", " | |
1206 << base::get<4>(t) << ", " << base::get<5>(t) << ", " | |
1207 << base::get<6>(t); | |
1208 } | |
1209 | |
1210 // Wait for |note| to report a state and if it's not |expected_state| then | 1199 // Wait for |note| to report a state and if it's not |expected_state| then |
1211 // assert |client| has deleted its decoder. | 1200 // assert |client| has deleted its decoder. |
1212 static void AssertWaitForStateOrDeleted( | 1201 static void AssertWaitForStateOrDeleted( |
1213 ClientStateNotification<ClientState>* note, | 1202 ClientStateNotification<ClientState>* note, |
1214 GLRenderingVDAClient* client, | 1203 GLRenderingVDAClient* client, |
1215 ClientState expected_state) { | 1204 ClientState expected_state) { |
1216 ClientState state = note->Wait(); | 1205 ClientState state = note->Wait(); |
1217 if (state == expected_state) return; | 1206 if (state == expected_state) return; |
1218 ASSERT_TRUE(client->decoder_deleted()) | 1207 ASSERT_TRUE(client->decoder_deleted()) |
1219 << "Decoder not deleted but Wait() returned " << state | 1208 << "Decoder not deleted but Wait() returned " << state |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1654 content::VaapiWrapper::PreSandboxInitialization(); | 1643 content::VaapiWrapper::PreSandboxInitialization(); |
1655 #endif | 1644 #endif |
1656 | 1645 |
1657 content::g_env = | 1646 content::g_env = |
1658 reinterpret_cast<content::VideoDecodeAcceleratorTestEnvironment*>( | 1647 reinterpret_cast<content::VideoDecodeAcceleratorTestEnvironment*>( |
1659 testing::AddGlobalTestEnvironment( | 1648 testing::AddGlobalTestEnvironment( |
1660 new content::VideoDecodeAcceleratorTestEnvironment())); | 1649 new content::VideoDecodeAcceleratorTestEnvironment())); |
1661 | 1650 |
1662 return RUN_ALL_TESTS(); | 1651 return RUN_ALL_TESTS(); |
1663 } | 1652 } |
OLD | NEW |