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

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

Issue 1780333007: AudioManagerBase: Create and run the audio thread lazily. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: fixed media unittests on mac Created 4 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 | « media/audio/alsa/alsa_output_unittest.cc ('k') | media/audio/audio_manager.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) 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include "base/environment.h" 8 #include "base/environment.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 }; 92 };
93 93
94 // This class mocks the platform specific audio manager and overrides 94 // This class mocks the platform specific audio manager and overrides
95 // the GetMessageLoop() method to ensure that we can run our tests on 95 // the GetMessageLoop() method to ensure that we can run our tests on
96 // the main thread instead of the audio thread. 96 // the main thread instead of the audio thread.
97 class MockAudioManager : public AudioManagerAnyPlatform { 97 class MockAudioManager : public AudioManagerAnyPlatform {
98 public: 98 public:
99 MockAudioManager() : AudioManagerAnyPlatform(&fake_audio_log_factory_) {} 99 MockAudioManager() : AudioManagerAnyPlatform(&fake_audio_log_factory_) {}
100 ~MockAudioManager() override {} 100 ~MockAudioManager() override {}
101 101
102 scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner() const override { 102 scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner() override {
103 return base::MessageLoop::current()->task_runner(); 103 return base::MessageLoop::current()->task_runner();
104 } 104 }
105 105
106 private: 106 private:
107 FakeAudioLogFactory fake_audio_log_factory_; 107 FakeAudioLogFactory fake_audio_log_factory_;
108 DISALLOW_COPY_AND_ASSIGN(MockAudioManager); 108 DISALLOW_COPY_AND_ASSIGN(MockAudioManager);
109 }; 109 };
110 110
111 // Test fixture class. 111 // Test fixture class.
112 class AudioLowLatencyInputOutputTest : public testing::Test { 112 class AudioLowLatencyInputOutputTest : public testing::Test {
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 433
434 // All Close() operations that run on the mocked audio thread, 434 // All Close() operations that run on the mocked audio thread,
435 // should be synchronous and not post additional close tasks to 435 // should be synchronous and not post additional close tasks to
436 // mocked the audio thread. Hence, there is no need to call 436 // mocked the audio thread. Hence, there is no need to call
437 // message_loop()->RunUntilIdle() after the Close() methods. 437 // message_loop()->RunUntilIdle() after the Close() methods.
438 aos->Close(); 438 aos->Close();
439 ais->Close(); 439 ais->Close();
440 } 440 }
441 441
442 } // namespace media 442 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/alsa/alsa_output_unittest.cc ('k') | media/audio/audio_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698