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

Side by Side Diff: media/audio/mac/audio_auhal_mac_unittest.cc

Issue 135853022: Defer OSX output stream Start() around system supend and resume. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Wait for initialization. Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « media/audio/mac/audio_auhal_mac.cc ('k') | media/audio/mac/audio_manager_mac.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/synchronization/waitable_event.h" 9 #include "base/synchronization/waitable_event.h"
10 #include "media/audio/audio_io.h" 10 #include "media/audio/audio_io.h"
(...skipping 25 matching lines...) Expand all
36 MOCK_METHOD3(OnMoreIOData, int(AudioBus* source, 36 MOCK_METHOD3(OnMoreIOData, int(AudioBus* source,
37 AudioBus* dest, 37 AudioBus* dest,
38 AudioBuffersState buffers_state)); 38 AudioBuffersState buffers_state));
39 MOCK_METHOD1(OnError, void(AudioOutputStream* stream)); 39 MOCK_METHOD1(OnError, void(AudioOutputStream* stream));
40 }; 40 };
41 41
42 class AUHALStreamTest : public testing::Test { 42 class AUHALStreamTest : public testing::Test {
43 public: 43 public:
44 AUHALStreamTest() 44 AUHALStreamTest()
45 : message_loop_(base::MessageLoop::TYPE_UI), 45 : message_loop_(base::MessageLoop::TYPE_UI),
46 manager_(AudioManager::CreateForTesting()) {} 46 manager_(AudioManager::CreateForTesting()) {
47 // Wait for the AudioManager to finish any initialization on the audio loop.
48 base::RunLoop().RunUntilIdle();
49 }
47 50
48 virtual ~AUHALStreamTest() { 51 virtual ~AUHALStreamTest() {
49 base::RunLoop().RunUntilIdle(); 52 base::RunLoop().RunUntilIdle();
50 } 53 }
51 54
52 AudioOutputStream* Create() { 55 AudioOutputStream* Create() {
53 return manager_->MakeAudioOutputStream( 56 return manager_->MakeAudioOutputStream(
54 manager_->GetDefaultOutputStreamParameters(), "", ""); 57 manager_->GetDefaultOutputStreamParameters(), "", "");
55 } 58 }
56 59
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 .WillOnce(DoAll(ZeroBuffer(), SignalEvent(&event), Return(0))); 106 .WillOnce(DoAll(ZeroBuffer(), SignalEvent(&event), Return(0)));
104 EXPECT_CALL(source_, OnError(_)).Times(0); 107 EXPECT_CALL(source_, OnError(_)).Times(0);
105 stream->Start(&source_); 108 stream->Start(&source_);
106 event.Wait(); 109 event.Wait();
107 110
108 stream->Stop(); 111 stream->Stop();
109 stream->Close(); 112 stream->Close();
110 } 113 }
111 114
112 } // namespace media 115 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/mac/audio_auhal_mac.cc ('k') | media/audio/mac/audio_manager_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698