Chromium Code Reviews| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 453 session_id)) | 453 session_id)) |
| 454 .Times(1); | 454 .Times(1); |
| 455 message_loop_->RunAllPending(); | 455 message_loop_->RunAllPending(); |
| 456 | 456 |
| 457 // Starts a non-opened device. | 457 // Starts a non-opened device. |
| 458 // This should fail and trigger error code 'kDeviceNotAvailable'. | 458 // This should fail and trigger error code 'kDeviceNotAvailable'. |
| 459 int invalid_session_id = session_id + 1; | 459 int invalid_session_id = session_id + 1; |
| 460 manager_->Start(invalid_session_id, audio_input_event_handler.get()); | 460 manager_->Start(invalid_session_id, audio_input_event_handler.get()); |
| 461 EXPECT_CALL(*audio_input_event_handler, | 461 EXPECT_CALL(*audio_input_event_handler, |
| 462 DeviceStarted(invalid_session_id, | 462 DeviceStarted(invalid_session_id, |
| 463 AudioInputDeviceManager::kInvalidDeviceId)) | 463 std::string())) |
|
scherkus (not reviewing)
2012/07/24 17:57:48
nit: fits on previous line
tommi (sloooow) - chröme
2012/07/25 13:46:17
Done.
| |
| 464 .Times(1); | 464 .Times(1); |
| 465 message_loop_->RunAllPending(); | 465 message_loop_->RunAllPending(); |
| 466 | 466 |
| 467 manager_->Close(session_id); | 467 manager_->Close(session_id); |
| 468 EXPECT_CALL(*audio_input_listener_, | 468 EXPECT_CALL(*audio_input_listener_, |
| 469 Closed(content::MEDIA_STREAM_DEVICE_TYPE_AUDIO_CAPTURE, | 469 Closed(content::MEDIA_STREAM_DEVICE_TYPE_AUDIO_CAPTURE, |
| 470 session_id)) | 470 session_id)) |
| 471 .Times(1); | 471 .Times(1); |
| 472 message_loop_->RunAllPending(); | 472 message_loop_->RunAllPending(); |
| 473 } | 473 } |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 499 EXPECT_CALL(*audio_input_event_handler, | 499 EXPECT_CALL(*audio_input_event_handler, |
| 500 DeviceStarted(session_id, | 500 DeviceStarted(session_id, |
| 501 media::AudioManagerBase::kDefaultDeviceId)) | 501 media::AudioManagerBase::kDefaultDeviceId)) |
| 502 .Times(1); | 502 .Times(1); |
| 503 message_loop_->RunAllPending(); | 503 message_loop_->RunAllPending(); |
| 504 | 504 |
| 505 // Starts the session for the second time, it should fail. | 505 // Starts the session for the second time, it should fail. |
| 506 manager_->Start(session_id, audio_input_event_handler.get()); | 506 manager_->Start(session_id, audio_input_event_handler.get()); |
| 507 EXPECT_CALL(*audio_input_event_handler, | 507 EXPECT_CALL(*audio_input_event_handler, |
| 508 DeviceStarted(session_id, | 508 DeviceStarted(session_id, |
| 509 AudioInputDeviceManager::kInvalidDeviceId)) | 509 std::string())) |
|
scherkus (not reviewing)
2012/07/24 17:57:48
nit: fits on previous line
tommi (sloooow) - chröme
2012/07/25 13:46:17
Done.
| |
| 510 .Times(1); | 510 .Times(1); |
| 511 | 511 |
| 512 manager_->Stop(session_id); | 512 manager_->Stop(session_id); |
| 513 manager_->Close(session_id); | 513 manager_->Close(session_id); |
| 514 EXPECT_CALL(*audio_input_listener_, | 514 EXPECT_CALL(*audio_input_listener_, |
| 515 Closed(content::MEDIA_STREAM_DEVICE_TYPE_AUDIO_CAPTURE, | 515 Closed(content::MEDIA_STREAM_DEVICE_TYPE_AUDIO_CAPTURE, |
| 516 session_id)) | 516 session_id)) |
| 517 .Times(1); | 517 .Times(1); |
| 518 message_loop_->RunAllPending(); | 518 message_loop_->RunAllPending(); |
| 519 } | 519 } |
| 520 | 520 |
| 521 } // namespace media_stream | 521 } // namespace media_stream |
| OLD | NEW |