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

Side by Side Diff: trunk/src/media/audio/win/audio_low_latency_output_win_unittest.cc

Issue 105823009: Revert 239280 "Move more file_util functions to base namespace." (Closed) Base URL: svn://svn.chromium.org/chrome/
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 <windows.h> 5 #include <windows.h>
6 #include <mmsystem.h> 6 #include <mmsystem.h>
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/environment.h" 9 #include "base/environment.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 } 90 }
91 91
92 virtual ~ReadFromFileAudioSource() { 92 virtual ~ReadFromFileAudioSource() {
93 // Get complete file path to output file in directory containing 93 // Get complete file path to output file in directory containing
94 // media_unittests.exe. 94 // media_unittests.exe.
95 base::FilePath file_name; 95 base::FilePath file_name;
96 EXPECT_TRUE(PathService::Get(base::DIR_EXE, &file_name)); 96 EXPECT_TRUE(PathService::Get(base::DIR_EXE, &file_name));
97 file_name = file_name.AppendASCII(kDeltaTimeMsFileName); 97 file_name = file_name.AppendASCII(kDeltaTimeMsFileName);
98 98
99 EXPECT_TRUE(!text_file_); 99 EXPECT_TRUE(!text_file_);
100 text_file_ = base::OpenFile(file_name, "wt"); 100 text_file_ = file_util::OpenFile(file_name, "wt");
101 DLOG_IF(ERROR, !text_file_) << "Failed to open log file."; 101 DLOG_IF(ERROR, !text_file_) << "Failed to open log file.";
102 102
103 // Write the array which contains delta times to a text file. 103 // Write the array which contains delta times to a text file.
104 size_t elements_written = 0; 104 size_t elements_written = 0;
105 while (elements_written < elements_to_write_) { 105 while (elements_written < elements_to_write_) {
106 fprintf(text_file_, "%d\n", delta_times_[elements_written]); 106 fprintf(text_file_, "%d\n", delta_times_[elements_written]);
107 ++elements_written; 107 ++elements_written;
108 } 108 }
109 109
110 base::CloseFile(text_file_); 110 file_util::CloseFile(text_file_);
111 } 111 }
112 112
113 // AudioOutputStream::AudioSourceCallback implementation. 113 // AudioOutputStream::AudioSourceCallback implementation.
114 virtual int OnMoreData(AudioBus* audio_bus, 114 virtual int OnMoreData(AudioBus* audio_bus,
115 AudioBuffersState buffers_state) { 115 AudioBuffersState buffers_state) {
116 // Store time difference between two successive callbacks in an array. 116 // Store time difference between two successive callbacks in an array.
117 // These values will be written to a file in the destructor. 117 // These values will be written to a file in the destructor.
118 const base::TimeTicks now_time = base::TimeTicks::Now(); 118 const base::TimeTicks now_time = base::TimeTicks::Now();
119 const int diff = (now_time - previous_call_time_).InMilliseconds(); 119 const int diff = (now_time - previous_call_time_).InMilliseconds();
120 previous_call_time_ = now_time; 120 previous_call_time_ = now_time;
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 693
694 aos->Start(&source); 694 aos->Start(&source);
695 loop.PostDelayedTask(FROM_HERE, base::MessageLoop::QuitClosure(), 695 loop.PostDelayedTask(FROM_HERE, base::MessageLoop::QuitClosure(),
696 TestTimeouts::action_timeout()); 696 TestTimeouts::action_timeout());
697 loop.Run(); 697 loop.Run();
698 aos->Stop(); 698 aos->Stop();
699 aos->Close(); 699 aos->Close();
700 } 700 }
701 701
702 } // namespace media 702 } // namespace media
OLDNEW
« no previous file with comments | « trunk/src/media/audio/win/audio_low_latency_input_win_unittest.cc ('k') | trunk/src/media/audio/win/audio_unified_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698