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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
134 SetDevice(kDefaultDeviceId); | 134 SetDevice(kDefaultDeviceId); |
135 } | 135 } |
136 | 136 |
137 AudioOutputDeviceTest::~AudioOutputDeviceTest() { | 137 AudioOutputDeviceTest::~AudioOutputDeviceTest() { |
138 audio_device_ = NULL; | 138 audio_device_ = NULL; |
139 } | 139 } |
140 | 140 |
141 void AudioOutputDeviceTest::SetDevice(const std::string& device_id) { | 141 void AudioOutputDeviceTest::SetDevice(const std::string& device_id) { |
142 audio_output_ipc_ = new MockAudioOutputIPC(); | 142 audio_output_ipc_ = new MockAudioOutputIPC(); |
143 audio_device_ = new AudioOutputDevice( | 143 audio_device_ = new AudioOutputDevice( |
144 scoped_ptr<AudioOutputIPC>(audio_output_ipc_), io_loop_.task_runner(), 0, | 144 std::unique_ptr<AudioOutputIPC>(audio_output_ipc_), |
danakj
2016/04/22 22:47:36
include memory or WrapUnique
dcheng
2016/04/22 23:13:20
Done.
| |
145 device_id, url::Origin()); | 145 io_loop_.task_runner(), 0, device_id, url::Origin()); |
146 EXPECT_CALL(*audio_output_ipc_, | 146 EXPECT_CALL(*audio_output_ipc_, |
147 RequestDeviceAuthorization(audio_device_.get(), 0, device_id, _)); | 147 RequestDeviceAuthorization(audio_device_.get(), 0, device_id, _)); |
148 audio_device_->RequestDeviceAuthorization(); | 148 audio_device_->RequestDeviceAuthorization(); |
149 io_loop_.RunUntilIdle(); | 149 io_loop_.RunUntilIdle(); |
150 | 150 |
151 // Simulate response from browser | 151 // Simulate response from browser |
152 OutputDeviceStatus device_status = | 152 OutputDeviceStatus device_status = |
153 (device_id == kUnauthorizedDeviceId) | 153 (device_id == kUnauthorizedDeviceId) |
154 ? OUTPUT_DEVICE_STATUS_ERROR_NOT_AUTHORIZED | 154 ? OUTPUT_DEVICE_STATUS_ERROR_NOT_AUTHORIZED |
155 : OUTPUT_DEVICE_STATUS_OK; | 155 : OUTPUT_DEVICE_STATUS_OK; |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
313 | 313 |
314 TEST_P(AudioOutputDeviceTest, UnauthorizedDevice) { | 314 TEST_P(AudioOutputDeviceTest, UnauthorizedDevice) { |
315 SetDevice(kUnauthorizedDeviceId); | 315 SetDevice(kUnauthorizedDeviceId); |
316 StartAudioDevice(); | 316 StartAudioDevice(); |
317 StopAudioDevice(); | 317 StopAudioDevice(); |
318 } | 318 } |
319 | 319 |
320 INSTANTIATE_TEST_CASE_P(Render, AudioOutputDeviceTest, Values(false)); | 320 INSTANTIATE_TEST_CASE_P(Render, AudioOutputDeviceTest, Values(false)); |
321 | 321 |
322 } // namespace media. | 322 } // namespace media. |
OLD | NEW |