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

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

Issue 2919793002: Detect AudioInputStream muting and propagate to MediaStreamAudioSource. (Closed)
Patch Set: Reworked test again, to make tsan2 happy. Created 3 years, 6 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/audio_input_device.cc ('k') | media/audio/audio_input_ipc.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) 2017 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2017 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/memory/ptr_util.h" 5 #include "base/memory/ptr_util.h"
6 #include "base/memory/shared_memory.h" 6 #include "base/memory/shared_memory.h"
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/process/process_handle.h" 8 #include "base/process/process_handle.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 ~MockCaptureCallback() override {} 47 ~MockCaptureCallback() override {}
48 48
49 MOCK_METHOD0(OnCaptureStarted, void()); 49 MOCK_METHOD0(OnCaptureStarted, void());
50 MOCK_METHOD4(Capture, 50 MOCK_METHOD4(Capture,
51 void(const AudioBus* audio_source, 51 void(const AudioBus* audio_source,
52 int audio_delay_milliseconds, 52 int audio_delay_milliseconds,
53 double volume, 53 double volume,
54 bool key_pressed)); 54 bool key_pressed));
55 55
56 MOCK_METHOD1(OnCaptureError, void(const std::string& message)); 56 MOCK_METHOD1(OnCaptureError, void(const std::string& message));
57 MOCK_METHOD1(OnCaptureMuted, void(bool is_muted));
57 }; 58 };
58 59
59 // Used to terminate a loop from a different thread than the loop belongs to. 60 // Used to terminate a loop from a different thread than the loop belongs to.
60 // |task_runner| should be a SingleThreadTaskRunner. 61 // |task_runner| should be a SingleThreadTaskRunner.
61 ACTION_P(QuitLoop, task_runner) { 62 ACTION_P(QuitLoop, task_runner) {
62 task_runner->PostTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); 63 task_runner->PostTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure());
63 } 64 }
64 65
65 } // namespace. 66 } // namespace.
66 67
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 EXPECT_CALL(*input_ipc, RecordStream()); 141 EXPECT_CALL(*input_ipc, RecordStream());
141 EXPECT_CALL(callback, OnCaptureStarted()) 142 EXPECT_CALL(callback, OnCaptureStarted())
142 .WillOnce(QuitLoop(io_loop.task_runner())); 143 .WillOnce(QuitLoop(io_loop.task_runner()));
143 base::RunLoop().Run(); 144 base::RunLoop().Run();
144 device->Stop(); 145 device->Stop();
145 base::RunLoop().RunUntilIdle(); 146 base::RunLoop().RunUntilIdle();
146 duplicated_memory_handle.Close(); 147 duplicated_memory_handle.Close();
147 } 148 }
148 149
149 } // namespace media. 150 } // namespace media.
OLDNEW
« no previous file with comments | « media/audio/audio_input_device.cc ('k') | media/audio/audio_input_ipc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698