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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/environment.h" | 7 #include "base/environment.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 base::FilePath data_file; | 289 base::FilePath data_file; |
290 CHECK(PathService::Get(base::DIR_SOURCE_ROOT, &data_file)); | 290 CHECK(PathService::Get(base::DIR_SOURCE_ROOT, &data_file)); |
291 data_file = | 291 data_file = |
292 data_file.Append(FILE_PATH_LITERAL("media")) | 292 data_file.Append(FILE_PATH_LITERAL("media")) |
293 .Append(FILE_PATH_LITERAL("test")) | 293 .Append(FILE_PATH_LITERAL("test")) |
294 .Append(FILE_PATH_LITERAL("data")) | 294 .Append(FILE_PATH_LITERAL("data")) |
295 .Append(FILE_PATH_LITERAL("speech_16b_stereo_48kHz.raw")); | 295 .Append(FILE_PATH_LITERAL("speech_16b_stereo_48kHz.raw")); |
296 DCHECK(base::PathExists(data_file)); | 296 DCHECK(base::PathExists(data_file)); |
297 int64 data_file_size64 = 0; | 297 int64 data_file_size64 = 0; |
298 DCHECK(base::GetFileSize(data_file, &data_file_size64)); | 298 DCHECK(base::GetFileSize(data_file, &data_file_size64)); |
299 EXPECT_EQ(length, base::ReadFile(data_file, data, length)); | 299 EXPECT_EQ(length, file_util::ReadFile(data_file, data, length)); |
300 DCHECK(data_file_size64 > length); | 300 DCHECK(data_file_size64 > length); |
301 } | 301 } |
302 | 302 |
303 void SetChannelCodec(webrtc::VoiceEngine* engine, int channel) { | 303 void SetChannelCodec(webrtc::VoiceEngine* engine, int channel) { |
304 // TODO(xians): move the codec as an input param to this function, and add | 304 // TODO(xians): move the codec as an input param to this function, and add |
305 // tests for different codecs, also add support to Android and IOS. | 305 // tests for different codecs, also add support to Android and IOS. |
306 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 306 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
307 webrtc::CodecInst isac; | 307 webrtc::CodecInst isac; |
308 strcpy(isac.plname, "ISAC"); | 308 strcpy(isac.plname, "ISAC"); |
309 isac.pltype = 104; | 309 isac.pltype = 104; |
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
969 LOG(WARNING) << "Test disabled due to the test hangs on WinXP."; | 969 LOG(WARNING) << "Test disabled due to the test hangs on WinXP."; |
970 return; | 970 return; |
971 } | 971 } |
972 #endif | 972 #endif |
973 int latency = RunWebRtcLoopbackTimeTest(audio_manager_.get(), true); | 973 int latency = RunWebRtcLoopbackTimeTest(audio_manager_.get(), true); |
974 PrintPerfResultMs("webrtc_loopback_with_signal_processing (100 packets)", | 974 PrintPerfResultMs("webrtc_loopback_with_signal_processing (100 packets)", |
975 "t", latency); | 975 "t", latency); |
976 } | 976 } |
977 | 977 |
978 } // namespace content | 978 } // namespace content |
OLD | NEW |