OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) | 30 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) |
31 #define MAYBE_StartPlayingAudioFileWithoutError \ | 31 #define MAYBE_StartPlayingAudioFileWithoutError \ |
32 DISABLED_StartPlayingAudioFileWithoutError | 32 DISABLED_StartPlayingAudioFileWithoutError |
33 #else | 33 #else |
34 #define MAYBE_StartPlayingAudioFileWithoutError \ | 34 #define MAYBE_StartPlayingAudioFileWithoutError \ |
35 StartPlayingAudioFileWithoutError | 35 StartPlayingAudioFileWithoutError |
36 #endif | 36 #endif |
37 TEST_F(MediaFileTest, MAYBE_StartPlayingAudioFileWithoutError) { | 37 TEST_F(MediaFileTest, MAYBE_StartPlayingAudioFileWithoutError) { |
38 // TODO(leozwang): Use hard coded filename here, we want to | 38 // TODO(leozwang): Use hard coded filename here, we want to |
39 // loop through all audio files in future | 39 // loop through all audio files in future |
40 const std::string audio_file = webrtc::test::ProjectRootPath() + | 40 const std::string audio_file = |
41 "data/voice_engine/audio_tiny48.wav"; | 41 webrtc::test::ResourcePath("voice_engine/audio_tiny48", "wav"); |
42 ASSERT_EQ(0, media_file_->StartPlayingAudioFile( | 42 ASSERT_EQ(0, media_file_->StartPlayingAudioFile( |
43 audio_file.c_str(), | 43 audio_file.c_str(), |
44 0, | 44 0, |
45 false, | 45 false, |
46 webrtc::kFileFormatWavFile)); | 46 webrtc::kFileFormatWavFile)); |
47 | 47 |
48 ASSERT_EQ(true, media_file_->IsPlaying()); | 48 ASSERT_EQ(true, media_file_->IsPlaying()); |
49 | 49 |
50 webrtc::SleepMs(1); | 50 webrtc::SleepMs(1); |
51 | 51 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 uint8_t header[kHeaderSize]; | 97 uint8_t header[kHeaderSize]; |
98 ASSERT_EQ(1u, fread(header, kHeaderSize, 1, f)); | 98 ASSERT_EQ(1u, fread(header, kHeaderSize, 1, f)); |
99 EXPECT_EQ(0, memcmp(kExpectedHeader, header, kHeaderSize)); | 99 EXPECT_EQ(0, memcmp(kExpectedHeader, header, kHeaderSize)); |
100 | 100 |
101 uint8_t payload[kPayloadSize]; | 101 uint8_t payload[kPayloadSize]; |
102 ASSERT_EQ(1u, fread(payload, kPayloadSize, 1, f)); | 102 ASSERT_EQ(1u, fread(payload, kPayloadSize, 1, f)); |
103 EXPECT_EQ(0, memcmp(kFakeData, payload, kPayloadSize)); | 103 EXPECT_EQ(0, memcmp(kFakeData, payload, kPayloadSize)); |
104 | 104 |
105 EXPECT_EQ(0, fclose(f)); | 105 EXPECT_EQ(0, fclose(f)); |
106 } | 106 } |
OLD | NEW |