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

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

Issue 3185022: Share one thread between all AudioOutputControllers instead of creating one per stream. (Closed)
Patch Set: - Created 10 years, 4 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 | « media/audio/audio_output_controller_unittest.cc ('k') | media/audio/fake_audio_output_stream.h » ('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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/platform_thread.h" 6 #include "base/platform_thread.h"
7 #include "media/audio/audio_io.h" 7 #include "media/audio/audio_io.h"
8 #include "media/audio/audio_manager.h"
8 #include "testing/gmock/include/gmock/gmock.h" 9 #include "testing/gmock/include/gmock/gmock.h"
9 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
10 11
11 using ::testing::_; 12 using ::testing::_;
12 using ::testing::AtLeast; 13 using ::testing::AtLeast;
13 using ::testing::Exactly; 14 using ::testing::Exactly;
14 using ::testing::NotNull; 15 using ::testing::NotNull;
15 16
16 namespace { 17 namespace {
17 18
(...skipping 23 matching lines...) Expand all
41 // Ask for one recorded packet every 50ms. 42 // Ask for one recorded packet every 50ms.
42 AudioInputStream* stream = audio_man->MakeAudioInputStream( 43 AudioInputStream* stream = audio_man->MakeAudioInputStream(
43 AudioManager::AUDIO_MOCK, 2, 8000, 8, 400); 44 AudioManager::AUDIO_MOCK, 2, 8000, 8, 400);
44 ASSERT_TRUE(NULL != stream); 45 ASSERT_TRUE(NULL != stream);
45 EXPECT_TRUE(stream->Open()); 46 EXPECT_TRUE(stream->Open());
46 stream->Start(&callback); 47 stream->Start(&callback);
47 PlatformThread::Sleep(340); // Give sufficient time to receive 5 / 6 packets. 48 PlatformThread::Sleep(340); // Give sufficient time to receive 5 / 6 packets.
48 stream->Stop(); 49 stream->Stop();
49 stream->Close(); 50 stream->Close();
50 } 51 }
51
OLDNEW
« no previous file with comments | « media/audio/audio_output_controller_unittest.cc ('k') | media/audio/fake_audio_output_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698