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 #include <queue> | 6 #include <queue> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
851 base::RunLoop().RunUntilIdle(); | 851 base::RunLoop().RunUntilIdle(); |
852 } | 852 } |
853 | 853 |
854 TEST_F(MediaStreamDispatcherHostTest, CloseFromUI) { | 854 TEST_F(MediaStreamDispatcherHostTest, CloseFromUI) { |
855 StreamOptions options(false, true); | 855 StreamOptions options(false, true); |
856 | 856 |
857 base::Closure close_callback; | 857 base::Closure close_callback; |
858 scoped_ptr<MockMediaStreamUIProxy> stream_ui(new MockMediaStreamUIProxy()); | 858 scoped_ptr<MockMediaStreamUIProxy> stream_ui(new MockMediaStreamUIProxy()); |
859 EXPECT_CALL(*stream_ui, OnStarted(_, _)) | 859 EXPECT_CALL(*stream_ui, OnStarted(_, _)) |
860 .WillOnce(SaveArg<0>(&close_callback)); | 860 .WillOnce(SaveArg<0>(&close_callback)); |
861 media_stream_manager_->UseFakeUI(stream_ui.PassAs<FakeMediaStreamUIProxy>()); | 861 media_stream_manager_->UseFakeUI(stream_ui.Pass()); |
862 | 862 |
863 GenerateStreamAndWaitForResult(kRenderId, kPageRequestId, options); | 863 GenerateStreamAndWaitForResult(kRenderId, kPageRequestId, options); |
864 | 864 |
865 EXPECT_EQ(host_->audio_devices_.size(), 0u); | 865 EXPECT_EQ(host_->audio_devices_.size(), 0u); |
866 EXPECT_EQ(host_->video_devices_.size(), 1u); | 866 EXPECT_EQ(host_->video_devices_.size(), 1u); |
867 | 867 |
868 ASSERT_FALSE(close_callback.is_null()); | 868 ASSERT_FALSE(close_callback.is_null()); |
869 EXPECT_CALL(*host_.get(), OnDeviceStopped(kRenderId)); | 869 EXPECT_CALL(*host_.get(), OnDeviceStopped(kRenderId)); |
870 close_callback.Run(); | 870 close_callback.Run(); |
871 base::RunLoop().RunUntilIdle(); | 871 base::RunLoop().RunUntilIdle(); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
915 | 915 |
916 TEST_F(MediaStreamDispatcherHostTest, EnumerateVideoDevicesNoAccess) { | 916 TEST_F(MediaStreamDispatcherHostTest, EnumerateVideoDevicesNoAccess) { |
917 SetupFakeUI(false); | 917 SetupFakeUI(false); |
918 stream_ui_->SetCameraAccess(false); | 918 stream_ui_->SetCameraAccess(false); |
919 EnumerateDevicesAndWaitForResult(kRenderId, kPageRequestId, | 919 EnumerateDevicesAndWaitForResult(kRenderId, kPageRequestId, |
920 MEDIA_DEVICE_VIDEO_CAPTURE); | 920 MEDIA_DEVICE_VIDEO_CAPTURE); |
921 EXPECT_TRUE(DoesNotContainLabels(host_->enumerated_devices_)); | 921 EXPECT_TRUE(DoesNotContainLabels(host_->enumerated_devices_)); |
922 } | 922 } |
923 | 923 |
924 }; // namespace content | 924 }; // namespace content |
OLD | NEW |