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

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

Issue 8229013: Fix problem when we did not play beginning of HTML5 audio stream in low latency mode. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 9 years, 2 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/bind.h" 5 #include "base/bind.h"
6 #include "base/environment.h" 6 #include "base/environment.h"
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/task.h" 9 #include "base/task.h"
10 #include "base/synchronization/waitable_event.h" 10 #include "base/synchronization/waitable_event.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 }; 47 };
48 48
49 class MockAudioOutputControllerSyncReader 49 class MockAudioOutputControllerSyncReader
50 : public AudioOutputController::SyncReader { 50 : public AudioOutputController::SyncReader {
51 public: 51 public:
52 MockAudioOutputControllerSyncReader() {} 52 MockAudioOutputControllerSyncReader() {}
53 53
54 MOCK_METHOD1(UpdatePendingBytes, void(uint32 bytes)); 54 MOCK_METHOD1(UpdatePendingBytes, void(uint32 bytes));
55 MOCK_METHOD2(Read, uint32(void* data, uint32 size)); 55 MOCK_METHOD2(Read, uint32(void* data, uint32 size));
56 MOCK_METHOD0(Close, void()); 56 MOCK_METHOD0(Close, void());
57 MOCK_METHOD0(DataReady, bool());
57 58
58 private: 59 private:
59 DISALLOW_COPY_AND_ASSIGN(MockAudioOutputControllerSyncReader); 60 DISALLOW_COPY_AND_ASSIGN(MockAudioOutputControllerSyncReader);
60 }; 61 };
61 62
62 static bool HasAudioOutputDevices() { 63 static bool HasAudioOutputDevices() {
63 AudioManager* audio_man = AudioManager::GetAudioManager(); 64 AudioManager* audio_man = AudioManager::GetAudioManager();
64 CHECK(audio_man); 65 CHECK(audio_man);
65 return audio_man->HasAudioOutputDevices(); 66 return audio_man->HasAudioOutputDevices();
66 } 67 }
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 controller->Close(base::Bind(&SignalClosedEvent, &closed_event_1)); 325 controller->Close(base::Bind(&SignalClosedEvent, &closed_event_1));
325 326
326 base::WaitableEvent closed_event_2(true, false); 327 base::WaitableEvent closed_event_2(true, false);
327 controller->Close(base::Bind(&SignalClosedEvent, &closed_event_2)); 328 controller->Close(base::Bind(&SignalClosedEvent, &closed_event_2));
328 329
329 closed_event_1.Wait(); 330 closed_event_1.Wait();
330 closed_event_2.Wait(); 331 closed_event_2.Wait();
331 } 332 }
332 333
333 } // namespace media 334 } // namespace media
OLDNEW
« media/audio/audio_output_controller.cc ('K') | « media/audio/audio_output_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698