Chromium Code Reviews| 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 // Tests PPB_MediaStreamAudioTrack interface. | 5 // Tests PPB_MediaStreamAudioTrack interface. |
| 6 | 6 |
| 7 #include "ppapi/tests/test_media_stream_audio_track.h" | 7 #include "ppapi/tests/test_media_stream_audio_track.h" |
| 8 | 8 |
| 9 #include "ppapi/c/private/ppb_testing_private.h" | 9 #include "ppapi/c/private/ppb_testing_private.h" |
| 10 #include "ppapi/cpp/audio_buffer.h" | 10 #include "ppapi/cpp/audio_buffer.h" |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 197 std::string TestMediaStreamAudioTrack::TestConfigure() { | 197 std::string TestMediaStreamAudioTrack::TestConfigure() { |
| 198 // Create a track. | 198 // Create a track. |
| 199 instance_->EvalScript(kJSCode); | 199 instance_->EvalScript(kJSCode); |
| 200 event_.Wait(); | 200 event_.Wait(); |
| 201 event_.Reset(); | 201 event_.Reset(); |
| 202 | 202 |
| 203 ASSERT_FALSE(audio_track_.is_null()); | 203 ASSERT_FALSE(audio_track_.is_null()); |
| 204 ASSERT_FALSE(audio_track_.HasEnded()); | 204 ASSERT_FALSE(audio_track_.HasEnded()); |
| 205 ASSERT_FALSE(audio_track_.GetId().empty()); | 205 ASSERT_FALSE(audio_track_.GetId().empty()); |
| 206 | 206 |
| 207 // Do nothing. | |
|
teravest
2014/07/31 20:54:55
What's this comment for?
Anand Mistry (off Chromium)
2014/07/31 23:54:48
Expanded.
| |
| 208 { | |
| 209 int32_t attrib_list[] = { | |
| 210 PP_MEDIASTREAMAUDIOTRACK_ATTRIB_NONE, | |
| 211 }; | |
| 212 ASSERT_SUBTEST_SUCCESS(CheckConfigure(attrib_list, PP_OK)); | |
| 213 } | |
| 214 | |
| 207 // Configure number of buffers. | 215 // Configure number of buffers. |
| 208 struct { | 216 struct { |
| 209 int32_t buffers; | 217 int32_t buffers; |
| 210 int32_t expect_result; | 218 int32_t expect_result; |
| 211 } buffers[] = { | 219 } buffers[] = { |
| 212 { 8, PP_OK }, | 220 { 8, PP_OK }, |
| 213 { 100, PP_OK }, | 221 { 100, PP_OK }, |
| 214 { kMaxNumberOfBuffers, PP_OK }, | 222 { kMaxNumberOfBuffers, PP_OK }, |
| 215 { -1, PP_ERROR_BADARGUMENT }, | 223 { -1, PP_ERROR_BADARGUMENT }, |
| 216 { kMaxNumberOfBuffers + 1, PP_OK }, // Clipped to max value. | 224 { kMaxNumberOfBuffers + 1, PP_OK }, // Clipped to max value. |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 286 ASSERT_EQ(PP_ERROR_INPROGRESS, cc_configure.result()); | 294 ASSERT_EQ(PP_ERROR_INPROGRESS, cc_configure.result()); |
| 287 audio_track_.RecycleBuffer(buffer); | 295 audio_track_.RecycleBuffer(buffer); |
| 288 } | 296 } |
| 289 | 297 |
| 290 // Close the track. | 298 // Close the track. |
| 291 audio_track_.Close(); | 299 audio_track_.Close(); |
| 292 ASSERT_TRUE(audio_track_.HasEnded()); | 300 ASSERT_TRUE(audio_track_.HasEnded()); |
| 293 audio_track_ = pp::MediaStreamAudioTrack(); | 301 audio_track_ = pp::MediaStreamAudioTrack(); |
| 294 PASS(); | 302 PASS(); |
| 295 } | 303 } |
| OLD | NEW |