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

Side by Side Diff: media/audio/mock_audio_manager.h

Issue 10704154: Small refactor to media architecture in order to allow end-to-end tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changed MockAudioManager ctor Created 8 years, 5 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 | « content/browser/speech/speech_recognizer_unittest.cc ('k') | media/audio/mock_audio_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef MEDIA_AUDIO_MOCK_AUDIO_MANAGER_H_
6 #define MEDIA_AUDIO_MOCK_AUDIO_MANAGER_H_
7 #pragma once
8
9 #include "media/audio/audio_manager.h"
10
11 namespace media {
12 // This class is a simple mock around AudioManager, used exclusively for tests,
Satish 2012/07/12 09:38:13 a newline above to make it easier for reading
Primiano Tucci (use gerrit) 2012/07/12 09:42:03 Done.
13 // which has the following purposes:
14 // 1) Avoids to use the actual (system and platform dependent) AudioManager.
15 // Some bots does not have input devices, thus using the actual AudioManager
16 // would causing failures on classes which expect that.
17 // 2) Allows the mock audio events to be dispatched on an arbitrary thread,
18 // rather than forcing them on the audio thread, easing their handling in
19 // browser tests (Note: sharing a thread can cause deadlocks on production
20 // classes if WaitableEvents or any other form of lock is used for
21 // synchronization purposes).
22 class MockAudioManager : public media::AudioManager {
23 public:
24 explicit MockAudioManager(
25 scoped_refptr<base::MessageLoopProxy> message_loop_proxy);
tommi (sloooow) - chröme 2012/07/12 08:32:05 should be: explicit MockAudioManager(base::Message
Primiano Tucci (use gerrit) 2012/07/12 09:42:03 Done.
26
27 virtual bool HasAudioOutputDevices() OVERRIDE;
28
29 virtual bool HasAudioInputDevices() OVERRIDE;
30
31 virtual string16 GetAudioInputDeviceModel() OVERRIDE;
32
33 virtual bool CanShowAudioInputSettings() OVERRIDE;
34
35 virtual void ShowAudioInputSettings() OVERRIDE;
36
37 virtual void GetAudioInputDeviceNames(
38 media::AudioDeviceNames* device_names) OVERRIDE;
39
40 virtual media::AudioOutputStream* MakeAudioOutputStream(
41 const media::AudioParameters& params) OVERRIDE;
42
43 virtual media::AudioOutputStream* MakeAudioOutputStreamProxy(
44 const media::AudioParameters& params) OVERRIDE;
45
46 virtual media::AudioInputStream* MakeAudioInputStream(
47 const media::AudioParameters& params,
48 const std::string& device_id) OVERRIDE;
49
50 virtual void MuteAll() OVERRIDE;
51
52 virtual void UnMuteAll() OVERRIDE;
53
54 virtual bool IsRecordingInProcess() OVERRIDE;
55
56 virtual scoped_refptr<base::MessageLoopProxy> GetMessageLoop() OVERRIDE;
57
58 virtual void Init() OVERRIDE;
59
60 private:
61 virtual ~MockAudioManager();
62
63 scoped_refptr<base::MessageLoopProxy> message_loop_proxy_;
64
65 DISALLOW_COPY_AND_ASSIGN(MockAudioManager);
66 };
67
68 } // namespace media.
69
70 #endif // MEDIA_AUDIO_MOCK_AUDIO_MANAGER_H_
OLDNEW
« no previous file with comments | « content/browser/speech/speech_recognizer_unittest.cc ('k') | media/audio/mock_audio_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698