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

Side by Side Diff: media/audio/audio_input_unittest.cc

Issue 9580038: Convert uses of int ms to TimeDelta in media/audio. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 9 months 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
« no previous file with comments | « no previous file | media/audio/audio_low_latency_input_output_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/environment.h" 6 #include "base/environment.h"
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/threading/platform_thread.h" 9 #include "base/threading/platform_thread.h"
10 #include "media/audio/audio_io.h" 10 #include "media/audio/audio_io.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 if (!CanRunAudioTests(audio_man.get())) 152 if (!CanRunAudioTests(audio_man.get()))
153 return; 153 return;
154 MessageLoop message_loop(MessageLoop::TYPE_DEFAULT); 154 MessageLoop message_loop(MessageLoop::TYPE_DEFAULT);
155 AudioInputStream* ais = CreateTestAudioInputStream(audio_man.get()); 155 AudioInputStream* ais = CreateTestAudioInputStream(audio_man.get());
156 EXPECT_TRUE(ais->Open()); 156 EXPECT_TRUE(ais->Open());
157 157
158 TestInputCallback test_callback(kSamplesPerPacket * 4); 158 TestInputCallback test_callback(kSamplesPerPacket * 4);
159 ais->Start(&test_callback); 159 ais->Start(&test_callback);
160 // Verify at least 500ms worth of audio was recorded, after giving sufficient 160 // Verify at least 500ms worth of audio was recorded, after giving sufficient
161 // extra time. 161 // extra time.
162 message_loop.PostDelayedTask(FROM_HERE, MessageLoop::QuitClosure(), 590); 162 message_loop.PostDelayedTask(
163 FROM_HERE,
164 MessageLoop::QuitClosure(),
165 base::TimeDelta::FromMilliseconds(590));
163 message_loop.Run(); 166 message_loop.Run();
164 EXPECT_GE(test_callback.callback_count(), 10); 167 EXPECT_GE(test_callback.callback_count(), 10);
165 EXPECT_FALSE(test_callback.had_error()); 168 EXPECT_FALSE(test_callback.had_error());
166 169
167 ais->Stop(); 170 ais->Stop();
168 ais->Close(); 171 ais->Close();
169 } 172 }
OLDNEW
« no previous file with comments | « no previous file | media/audio/audio_low_latency_input_output_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698