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 <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 MOCK_METHOD2(CreateStream, | 72 MOCK_METHOD2(CreateStream, |
73 void(AudioOutputIPCDelegate* delegate, | 73 void(AudioOutputIPCDelegate* delegate, |
74 const AudioParameters& params)); | 74 const AudioParameters& params)); |
75 MOCK_METHOD0(PlayStream, void()); | 75 MOCK_METHOD0(PlayStream, void()); |
76 MOCK_METHOD0(PauseStream, void()); | 76 MOCK_METHOD0(PauseStream, void()); |
77 MOCK_METHOD0(CloseStream, void()); | 77 MOCK_METHOD0(CloseStream, void()); |
78 MOCK_METHOD1(SetVolume, void(double volume)); | 78 MOCK_METHOD1(SetVolume, void(double volume)); |
79 }; | 79 }; |
80 | 80 |
81 ACTION_P2(SendPendingBytes, socket, pending_bytes) { | 81 ACTION_P2(SendPendingBytes, socket, pending_bytes) { |
82 socket->Send(&pending_bytes, sizeof(pending_bytes)); | 82 AudioDeviceThread::Packet packet = {pending_bytes, AudioTimestamp()}; |
| 83 socket->Send(&packet, sizeof(packet)); |
83 } | 84 } |
84 | 85 |
85 // Used to terminate a loop from a different thread than the loop belongs to. | 86 // Used to terminate a loop from a different thread than the loop belongs to. |
86 // |task_runner| should be a SingleThreadTaskRunner. | 87 // |task_runner| should be a SingleThreadTaskRunner. |
87 ACTION_P(QuitLoop, task_runner) { | 88 ACTION_P(QuitLoop, task_runner) { |
88 task_runner->PostTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); | 89 task_runner->PostTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); |
89 } | 90 } |
90 | 91 |
91 } // namespace. | 92 } // namespace. |
92 | 93 |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 // Runs the loop and waits for |thread| to call event's closure. | 363 // Runs the loop and waits for |thread| to call event's closure. |
363 event.RunAndWait(); | 364 event.RunAndWait(); |
364 | 365 |
365 audio_device_->Stop(); | 366 audio_device_->Stop(); |
366 io_loop_.RunUntilIdle(); | 367 io_loop_.RunUntilIdle(); |
367 } | 368 } |
368 | 369 |
369 INSTANTIATE_TEST_CASE_P(Render, AudioOutputDeviceTest, Values(false)); | 370 INSTANTIATE_TEST_CASE_P(Render, AudioOutputDeviceTest, Values(false)); |
370 | 371 |
371 } // namespace media. | 372 } // namespace media. |
OLD | NEW |