Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: webrtc/modules/media_file/media_file_unittest.cc

Issue 2513363004: WebRTC: Replace ProjectRootPath by ResourcePath (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/modules/BUILD.gn ('k') | webrtc/test/testsupport/fileutils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « webrtc/modules/BUILD.gn ('k') | webrtc/test/testsupport/fileutils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698