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

Side by Side Diff: media/audio/win/audio_unified_win_unittest.cc

Issue 109043002: Move more file_util functions 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
« no previous file with comments | « media/audio/win/audio_unified_win.cc ('k') | media/base/container_names_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/test/test_timeouts.h" 10 #include "base/test/test_timeouts.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 elements_to_write_(0) { 67 elements_to_write_(0) {
68 delta_times_.reset(new int[kMaxDeltaSamples]); 68 delta_times_.reset(new int[kMaxDeltaSamples]);
69 } 69 }
70 70
71 virtual ~UnifiedSourceCallback() { 71 virtual ~UnifiedSourceCallback() {
72 base::FilePath file_name; 72 base::FilePath file_name;
73 EXPECT_TRUE(PathService::Get(base::DIR_EXE, &file_name)); 73 EXPECT_TRUE(PathService::Get(base::DIR_EXE, &file_name));
74 file_name = file_name.AppendASCII(kDeltaTimeMsFileName); 74 file_name = file_name.AppendASCII(kDeltaTimeMsFileName);
75 75
76 EXPECT_TRUE(!text_file_); 76 EXPECT_TRUE(!text_file_);
77 text_file_ = file_util::OpenFile(file_name, "wt"); 77 text_file_ = base::OpenFile(file_name, "wt");
78 DLOG_IF(ERROR, !text_file_) << "Failed to open log file."; 78 DLOG_IF(ERROR, !text_file_) << "Failed to open log file.";
79 VLOG(0) << ">> Output file " << file_name.value() << " has been created."; 79 VLOG(0) << ">> Output file " << file_name.value() << " has been created.";
80 80
81 // Write the array which contains delta times to a text file. 81 // Write the array which contains delta times to a text file.
82 size_t elements_written = 0; 82 size_t elements_written = 0;
83 while (elements_written < elements_to_write_) { 83 while (elements_written < elements_to_write_) {
84 fprintf(text_file_, "%d\n", delta_times_[elements_written]); 84 fprintf(text_file_, "%d\n", delta_times_[elements_written]);
85 ++elements_written; 85 ++elements_written;
86 } 86 }
87 file_util::CloseFile(text_file_); 87 base::CloseFile(text_file_);
88 } 88 }
89 89
90 virtual int OnMoreData(AudioBus* dest, 90 virtual int OnMoreData(AudioBus* dest,
91 AudioBuffersState buffers_state) { 91 AudioBuffersState buffers_state) {
92 NOTREACHED(); 92 NOTREACHED();
93 return 0; 93 return 0;
94 }; 94 };
95 95
96 virtual int OnMoreIOData(AudioBus* source, 96 virtual int OnMoreIOData(AudioBus* source,
97 AudioBus* dest, 97 AudioBus* dest,
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 357
358 EXPECT_TRUE(wus->Open()); 358 EXPECT_TRUE(wus->Open());
359 wus->Start(&source); 359 wus->Start(&source);
360 loop.PostDelayedTask(FROM_HERE, base::MessageLoop::QuitClosure(), 360 loop.PostDelayedTask(FROM_HERE, base::MessageLoop::QuitClosure(),
361 base::TimeDelta::FromMilliseconds(10000)); 361 base::TimeDelta::FromMilliseconds(10000));
362 loop.Run(); 362 loop.Run();
363 wus->Close(); 363 wus->Close();
364 } 364 }
365 365
366 } // namespace media 366 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/win/audio_unified_win.cc ('k') | media/base/container_names_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698