| 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 "content/renderer/media/user_media_client_impl.h" | 5 #include "content/renderer/media/user_media_client_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 // For a null UserMediaRequest (no audio requested), we expect false. | 611 // For a null UserMediaRequest (no audio requested), we expect false. |
| 612 used_media_impl_->RequestUserMedia(); | 612 used_media_impl_->RequestUserMedia(); |
| 613 EXPECT_FALSE(used_media_impl_->UserMediaRequestHasAutomaticDeviceSelection( | 613 EXPECT_FALSE(used_media_impl_->UserMediaRequestHasAutomaticDeviceSelection( |
| 614 ms_dispatcher_->audio_input_request_id())); | 614 ms_dispatcher_->audio_input_request_id())); |
| 615 used_media_impl_->DeleteRequest(ms_dispatcher_->audio_input_request_id()); | 615 used_media_impl_->DeleteRequest(ms_dispatcher_->audio_input_request_id()); |
| 616 | 616 |
| 617 // If audio is requested, but no constraint, it should be true. | 617 // If audio is requested, but no constraint, it should be true. |
| 618 MockConstraintFactory factory; | 618 MockConstraintFactory factory; |
| 619 blink::WebMediaConstraints audio_constraints = | 619 blink::WebMediaConstraints audio_constraints = |
| 620 factory.CreateWebMediaConstraints(); | 620 factory.CreateWebMediaConstraints(); |
| 621 EXPECT_TRUE(AudioRequestHasAutomaticDeviceSelection( | 621 EXPECT_FALSE(AudioRequestHasAutomaticDeviceSelection( |
| 622 factory.CreateWebMediaConstraints())); | 622 factory.CreateWebMediaConstraints())); |
| 623 | 623 |
| 624 // If the constraint is present, it should dictate the result. | 624 // If the constraint is present, it should dictate the result. |
| 625 factory.Reset(); | 625 factory.Reset(); |
| 626 factory.AddAdvanced().renderToAssociatedSink.setExact(true); | 626 factory.AddAdvanced().renderToAssociatedSink.setExact(true); |
| 627 EXPECT_TRUE(AudioRequestHasAutomaticDeviceSelection( | 627 EXPECT_TRUE(AudioRequestHasAutomaticDeviceSelection( |
| 628 factory.CreateWebMediaConstraints())); | 628 factory.CreateWebMediaConstraints())); |
| 629 | 629 |
| 630 factory.Reset(); | 630 factory.Reset(); |
| 631 factory.AddAdvanced().renderToAssociatedSink.setExact(false); | 631 factory.AddAdvanced().renderToAssociatedSink.setExact(false); |
| 632 EXPECT_FALSE(AudioRequestHasAutomaticDeviceSelection( | 632 EXPECT_FALSE(AudioRequestHasAutomaticDeviceSelection( |
| 633 factory.CreateWebMediaConstraints())); | 633 factory.CreateWebMediaConstraints())); |
| 634 | 634 |
| 635 factory.Reset(); | 635 factory.Reset(); |
| 636 factory.basic().renderToAssociatedSink.setExact(false); | 636 factory.basic().renderToAssociatedSink.setExact(false); |
| 637 EXPECT_FALSE(AudioRequestHasAutomaticDeviceSelection( | 637 EXPECT_FALSE(AudioRequestHasAutomaticDeviceSelection( |
| 638 factory.CreateWebMediaConstraints())); | 638 factory.CreateWebMediaConstraints())); |
| 639 } | 639 } |
| 640 | 640 |
| 641 } // namespace content | 641 } // namespace content |
| OLD | NEW |