| 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 #include "base/environment.h" | 5 #include "base/environment.h" |
| 6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "base/test/test_timeouts.h" | 10 #include "base/test/test_timeouts.h" |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 } | 261 } |
| 262 | 262 |
| 263 void ReadDataFromSpeechFile(char* data, int length) { | 263 void ReadDataFromSpeechFile(char* data, int length) { |
| 264 base::FilePath data_file; | 264 base::FilePath data_file; |
| 265 CHECK(PathService::Get(base::DIR_SOURCE_ROOT, &data_file)); | 265 CHECK(PathService::Get(base::DIR_SOURCE_ROOT, &data_file)); |
| 266 data_file = | 266 data_file = |
| 267 data_file.Append(FILE_PATH_LITERAL("media")) | 267 data_file.Append(FILE_PATH_LITERAL("media")) |
| 268 .Append(FILE_PATH_LITERAL("test")) | 268 .Append(FILE_PATH_LITERAL("test")) |
| 269 .Append(FILE_PATH_LITERAL("data")) | 269 .Append(FILE_PATH_LITERAL("data")) |
| 270 .Append(FILE_PATH_LITERAL("speech_16b_stereo_48kHz.raw")); | 270 .Append(FILE_PATH_LITERAL("speech_16b_stereo_48kHz.raw")); |
| 271 DCHECK(file_util::PathExists(data_file)); | 271 DCHECK(base::PathExists(data_file)); |
| 272 int64 data_file_size64 = 0; | 272 int64 data_file_size64 = 0; |
| 273 DCHECK(file_util::GetFileSize(data_file, &data_file_size64)); | 273 DCHECK(file_util::GetFileSize(data_file, &data_file_size64)); |
| 274 EXPECT_EQ(length, file_util::ReadFile(data_file, data, length)); | 274 EXPECT_EQ(length, file_util::ReadFile(data_file, data, length)); |
| 275 DCHECK(data_file_size64 > length); | 275 DCHECK(data_file_size64 > length); |
| 276 } | 276 } |
| 277 | 277 |
| 278 void SetChannelCodec(webrtc::VoiceEngine* engine, int channel) { | 278 void SetChannelCodec(webrtc::VoiceEngine* engine, int channel) { |
| 279 // TODO(xians): move the codec as an input param to this function, and add | 279 // TODO(xians): move the codec as an input param to this function, and add |
| 280 // tests for different codecs, also add support to Android and IOS. | 280 // tests for different codecs, also add support to Android and IOS. |
| 281 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 281 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
| (...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 929 WebRtcLoopbackTimeWithSignalProcessing | 929 WebRtcLoopbackTimeWithSignalProcessing |
| 930 #endif | 930 #endif |
| 931 | 931 |
| 932 TEST_F(WebRTCAudioDeviceTest, MAYBE_WebRtcLoopbackTimeWithSignalProcessing) { | 932 TEST_F(WebRTCAudioDeviceTest, MAYBE_WebRtcLoopbackTimeWithSignalProcessing) { |
| 933 int latency = RunWebRtcLoopbackTimeTest(audio_manager_.get(), true); | 933 int latency = RunWebRtcLoopbackTimeTest(audio_manager_.get(), true); |
| 934 PrintPerfResultMs("webrtc_loopback_with_signal_processing (100 packets)", | 934 PrintPerfResultMs("webrtc_loopback_with_signal_processing (100 packets)", |
| 935 "t", latency); | 935 "t", latency); |
| 936 } | 936 } |
| 937 | 937 |
| 938 } // namespace content | 938 } // namespace content |
| OLD | NEW |