OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |