| 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/environment.h" | 6 #include "base/environment.h" |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/process_util.h" | 9 #include "base/process_util.h" |
| 10 #include "base/sync_socket.h" | 10 #include "base/sync_socket.h" |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 CHECK(host_->audio_entries_.size()) | 279 CHECK(host_->audio_entries_.size()) |
| 280 << "Calls Create() before calling this method"; | 280 << "Calls Create() before calling this method"; |
| 281 media::AudioOutputController* controller = | 281 media::AudioOutputController* controller = |
| 282 host_->LookupControllerByIdForTesting(kStreamId); | 282 host_->LookupControllerByIdForTesting(kStreamId); |
| 283 CHECK(controller) << "AudioOutputController not found"; | 283 CHECK(controller) << "AudioOutputController not found"; |
| 284 | 284 |
| 285 // Expect an error signal sent through IPC. | 285 // Expect an error signal sent through IPC. |
| 286 EXPECT_CALL(*host_, OnStreamError(kStreamId)); | 286 EXPECT_CALL(*host_, OnStreamError(kStreamId)); |
| 287 | 287 |
| 288 // Simulate an error sent from the audio device. | 288 // Simulate an error sent from the audio device. |
| 289 host_->OnError(controller, 0); | 289 host_->OnError(controller); |
| 290 SyncWithAudioThread(); | 290 SyncWithAudioThread(); |
| 291 | 291 |
| 292 // Expect the audio stream record is removed. | 292 // Expect the audio stream record is removed. |
| 293 EXPECT_EQ(0u, host_->audio_entries_.size()); | 293 EXPECT_EQ(0u, host_->audio_entries_.size()); |
| 294 } | 294 } |
| 295 | 295 |
| 296 // Called on the audio thread. | 296 // Called on the audio thread. |
| 297 static void PostQuitMessageLoop(MessageLoop* message_loop) { | 297 static void PostQuitMessageLoop(MessageLoop* message_loop) { |
| 298 message_loop->PostTask(FROM_HERE, MessageLoop::QuitClosure()); | 298 message_loop->PostTask(FROM_HERE, MessageLoop::QuitClosure()); |
| 299 } | 299 } |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 TEST_F(AudioRendererHostTest, SimulateErrorAndClose) { | 387 TEST_F(AudioRendererHostTest, SimulateErrorAndClose) { |
| 388 Create(); | 388 Create(); |
| 389 Play(); | 389 Play(); |
| 390 SimulateError(); | 390 SimulateError(); |
| 391 Close(); | 391 Close(); |
| 392 } | 392 } |
| 393 | 393 |
| 394 // TODO(hclam): Add tests for data conversation in low latency mode. | 394 // TODO(hclam): Add tests for data conversation in low latency mode. |
| 395 | 395 |
| 396 } // namespace content | 396 } // namespace content |
| OLD | NEW |