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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 MOCK_METHOD2(CreateStream, | 68 MOCK_METHOD2(CreateStream, |
69 void(AudioOutputIPCDelegate* delegate, | 69 void(AudioOutputIPCDelegate* delegate, |
70 const AudioParameters& params)); | 70 const AudioParameters& params)); |
71 MOCK_METHOD0(PlayStream, void()); | 71 MOCK_METHOD0(PlayStream, void()); |
72 MOCK_METHOD0(PauseStream, void()); | 72 MOCK_METHOD0(PauseStream, void()); |
73 MOCK_METHOD0(CloseStream, void()); | 73 MOCK_METHOD0(CloseStream, void()); |
74 MOCK_METHOD1(SetVolume, void(double volume)); | 74 MOCK_METHOD1(SetVolume, void(double volume)); |
75 }; | 75 }; |
76 | 76 |
77 ACTION_P2(SendPendingBytes, socket, pending_bytes) { | 77 ACTION_P2(SendPendingBytes, socket, pending_bytes) { |
78 socket->Send(&pending_bytes, sizeof(pending_bytes)); | 78 AudioDeviceThread::Packet packet = {pending_bytes, AudioTimestamp()}; |
| 79 socket->Send(&packet, sizeof(packet)); |
79 } | 80 } |
80 | 81 |
81 // Used to terminate a loop from a different thread than the loop belongs to. | 82 // Used to terminate a loop from a different thread than the loop belongs to. |
82 // |task_runner| should be a SingleThreadTaskRunner. | 83 // |task_runner| should be a SingleThreadTaskRunner. |
83 ACTION_P(QuitLoop, task_runner) { | 84 ACTION_P(QuitLoop, task_runner) { |
84 task_runner->PostTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); | 85 task_runner->PostTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); |
85 } | 86 } |
86 | 87 |
87 } // namespace. | 88 } // namespace. |
88 | 89 |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 | 315 |
315 TEST_P(AudioOutputDeviceTest, UnauthorizedDevice) { | 316 TEST_P(AudioOutputDeviceTest, UnauthorizedDevice) { |
316 SetDevice(kUnauthorizedDeviceId); | 317 SetDevice(kUnauthorizedDeviceId); |
317 StartAudioDevice(); | 318 StartAudioDevice(); |
318 StopAudioDevice(); | 319 StopAudioDevice(); |
319 } | 320 } |
320 | 321 |
321 INSTANTIATE_TEST_CASE_P(Render, AudioOutputDeviceTest, Values(false)); | 322 INSTANTIATE_TEST_CASE_P(Render, AudioOutputDeviceTest, Values(false)); |
322 | 323 |
323 } // namespace media. | 324 } // namespace media. |
OLD | NEW |