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

Side by Side Diff: content/renderer/media/webrtc_audio_device_unittest.cc

Issue 102873002: Move GetFileSize, NormalizeFilePath to base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 | Annotate | Revision Log
OLDNEW
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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 void ReadDataFromSpeechFile(char* data, int length) { 287 void ReadDataFromSpeechFile(char* data, int length) {
288 base::FilePath data_file; 288 base::FilePath data_file;
289 CHECK(PathService::Get(base::DIR_SOURCE_ROOT, &data_file)); 289 CHECK(PathService::Get(base::DIR_SOURCE_ROOT, &data_file));
290 data_file = 290 data_file =
291 data_file.Append(FILE_PATH_LITERAL("media")) 291 data_file.Append(FILE_PATH_LITERAL("media"))
292 .Append(FILE_PATH_LITERAL("test")) 292 .Append(FILE_PATH_LITERAL("test"))
293 .Append(FILE_PATH_LITERAL("data")) 293 .Append(FILE_PATH_LITERAL("data"))
294 .Append(FILE_PATH_LITERAL("speech_16b_stereo_48kHz.raw")); 294 .Append(FILE_PATH_LITERAL("speech_16b_stereo_48kHz.raw"));
295 DCHECK(base::PathExists(data_file)); 295 DCHECK(base::PathExists(data_file));
296 int64 data_file_size64 = 0; 296 int64 data_file_size64 = 0;
297 DCHECK(file_util::GetFileSize(data_file, &data_file_size64)); 297 DCHECK(base::GetFileSize(data_file, &data_file_size64));
298 EXPECT_EQ(length, file_util::ReadFile(data_file, data, length)); 298 EXPECT_EQ(length, file_util::ReadFile(data_file, data, length));
299 DCHECK(data_file_size64 > length); 299 DCHECK(data_file_size64 > length);
300 } 300 }
301 301
302 void SetChannelCodec(webrtc::VoiceEngine* engine, int channel) { 302 void SetChannelCodec(webrtc::VoiceEngine* engine, int channel) {
303 // TODO(xians): move the codec as an input param to this function, and add 303 // TODO(xians): move the codec as an input param to this function, and add
304 // tests for different codecs, also add support to Android and IOS. 304 // tests for different codecs, also add support to Android and IOS.
305 #if !defined(OS_ANDROID) && !defined(OS_IOS) 305 #if !defined(OS_ANDROID) && !defined(OS_IOS)
306 webrtc::CodecInst isac; 306 webrtc::CodecInst isac;
307 strcpy(isac.plname, "ISAC"); 307 strcpy(isac.plname, "ISAC");
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after
968 LOG(WARNING) << "Test disabled due to the test hangs on WinXP."; 968 LOG(WARNING) << "Test disabled due to the test hangs on WinXP.";
969 return; 969 return;
970 } 970 }
971 #endif 971 #endif
972 int latency = RunWebRtcLoopbackTimeTest(audio_manager_.get(), true); 972 int latency = RunWebRtcLoopbackTimeTest(audio_manager_.get(), true);
973 PrintPerfResultMs("webrtc_loopback_with_signal_processing (100 packets)", 973 PrintPerfResultMs("webrtc_loopback_with_signal_processing (100 packets)",
974 "t", latency); 974 "t", latency);
975 } 975 }
976 976
977 } // namespace content 977 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698