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 <algorithm> | 5 #include <algorithm> |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 2776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2787 content::MediaStreamDevice fake_audio_device( | 2787 content::MediaStreamDevice fake_audio_device( |
2788 content::MEDIA_DEVICE_AUDIO_CAPTURE, "fake_dev", "Fake Audio Device"); | 2788 content::MEDIA_DEVICE_AUDIO_CAPTURE, "fake_dev", "Fake Audio Device"); |
2789 audio_devices.push_back(fake_audio_device); | 2789 audio_devices.push_back(fake_audio_device); |
2790 | 2790 |
2791 PolicyMap policies; | 2791 PolicyMap policies; |
2792 ConfigurePolicyMap(&policies, key::kAudioCaptureAllowed, NULL, NULL); | 2792 ConfigurePolicyMap(&policies, key::kAudioCaptureAllowed, NULL, NULL); |
2793 UpdateProviderPolicy(policies); | 2793 UpdateProviderPolicy(policies); |
2794 | 2794 |
2795 content::BrowserThread::PostTaskAndReply( | 2795 content::BrowserThread::PostTaskAndReply( |
2796 content::BrowserThread::IO, FROM_HERE, | 2796 content::BrowserThread::IO, FROM_HERE, |
2797 base::Bind(&MediaCaptureDevicesDispatcher::OnAudioCaptureDevicesChanged, | 2797 base::Bind(&MediaCaptureDevicesDispatcher::SetTestAudioCaptureDevices, |
2798 base::Unretained(MediaCaptureDevicesDispatcher::GetInstance()), | 2798 base::Unretained(MediaCaptureDevicesDispatcher::GetInstance()), |
2799 audio_devices), | 2799 audio_devices), |
2800 base::Bind(&MediaStreamDevicesControllerBrowserTest::FinishAudioTest, | 2800 base::Bind(&MediaStreamDevicesControllerBrowserTest::FinishAudioTest, |
2801 this)); | 2801 this)); |
2802 | 2802 |
2803 base::MessageLoop::current()->Run(); | 2803 base::MessageLoop::current()->Run(); |
2804 } | 2804 } |
2805 | 2805 |
2806 IN_PROC_BROWSER_TEST_P(MediaStreamDevicesControllerBrowserTest, | 2806 IN_PROC_BROWSER_TEST_P(MediaStreamDevicesControllerBrowserTest, |
2807 AudioCaptureAllowedUrls) { | 2807 AudioCaptureAllowedUrls) { |
(...skipping 12 matching lines...) Expand all Loading... |
2820 | 2820 |
2821 for (size_t i = 0; i < arraysize(allow_pattern); ++i) { | 2821 for (size_t i = 0; i < arraysize(allow_pattern); ++i) { |
2822 PolicyMap policies; | 2822 PolicyMap policies; |
2823 ConfigurePolicyMap(&policies, key::kAudioCaptureAllowed, | 2823 ConfigurePolicyMap(&policies, key::kAudioCaptureAllowed, |
2824 key::kAudioCaptureAllowedUrls, allow_pattern[i]); | 2824 key::kAudioCaptureAllowedUrls, allow_pattern[i]); |
2825 UpdateProviderPolicy(policies); | 2825 UpdateProviderPolicy(policies); |
2826 | 2826 |
2827 content::BrowserThread::PostTaskAndReply( | 2827 content::BrowserThread::PostTaskAndReply( |
2828 content::BrowserThread::IO, FROM_HERE, | 2828 content::BrowserThread::IO, FROM_HERE, |
2829 base::Bind( | 2829 base::Bind( |
2830 &MediaCaptureDevicesDispatcher::OnAudioCaptureDevicesChanged, | 2830 &MediaCaptureDevicesDispatcher::SetTestAudioCaptureDevices, |
2831 base::Unretained(MediaCaptureDevicesDispatcher::GetInstance()), | 2831 base::Unretained(MediaCaptureDevicesDispatcher::GetInstance()), |
2832 audio_devices), | 2832 audio_devices), |
2833 base::Bind( | 2833 base::Bind( |
2834 &MediaStreamDevicesControllerBrowserTest::FinishAudioTest, | 2834 &MediaStreamDevicesControllerBrowserTest::FinishAudioTest, |
2835 this)); | 2835 this)); |
2836 | 2836 |
2837 base::MessageLoop::current()->Run(); | 2837 base::MessageLoop::current()->Run(); |
2838 } | 2838 } |
2839 } | 2839 } |
2840 | 2840 |
2841 IN_PROC_BROWSER_TEST_P(MediaStreamDevicesControllerBrowserTest, | 2841 IN_PROC_BROWSER_TEST_P(MediaStreamDevicesControllerBrowserTest, |
2842 VideoCaptureAllowed) { | 2842 VideoCaptureAllowed) { |
2843 content::MediaStreamDevices video_devices; | 2843 content::MediaStreamDevices video_devices; |
2844 content::MediaStreamDevice fake_video_device( | 2844 content::MediaStreamDevice fake_video_device( |
2845 content::MEDIA_DEVICE_VIDEO_CAPTURE, "fake_dev", "Fake Video Device"); | 2845 content::MEDIA_DEVICE_VIDEO_CAPTURE, "fake_dev", "Fake Video Device"); |
2846 video_devices.push_back(fake_video_device); | 2846 video_devices.push_back(fake_video_device); |
2847 | 2847 |
2848 PolicyMap policies; | 2848 PolicyMap policies; |
2849 ConfigurePolicyMap(&policies, key::kVideoCaptureAllowed, NULL, NULL); | 2849 ConfigurePolicyMap(&policies, key::kVideoCaptureAllowed, NULL, NULL); |
2850 UpdateProviderPolicy(policies); | 2850 UpdateProviderPolicy(policies); |
2851 | 2851 |
2852 content::BrowserThread::PostTaskAndReply( | 2852 content::BrowserThread::PostTaskAndReply( |
2853 content::BrowserThread::IO, FROM_HERE, | 2853 content::BrowserThread::IO, FROM_HERE, |
2854 base::Bind(&MediaCaptureDevicesDispatcher::OnVideoCaptureDevicesChanged, | 2854 base::Bind(&MediaCaptureDevicesDispatcher::SetTestVideoCaptureDevices, |
2855 base::Unretained(MediaCaptureDevicesDispatcher::GetInstance()), | 2855 base::Unretained(MediaCaptureDevicesDispatcher::GetInstance()), |
2856 video_devices), | 2856 video_devices), |
2857 base::Bind(&MediaStreamDevicesControllerBrowserTest::FinishVideoTest, | 2857 base::Bind(&MediaStreamDevicesControllerBrowserTest::FinishVideoTest, |
2858 this)); | 2858 this)); |
2859 | 2859 |
2860 base::MessageLoop::current()->Run(); | 2860 base::MessageLoop::current()->Run(); |
2861 } | 2861 } |
2862 | 2862 |
2863 IN_PROC_BROWSER_TEST_P(MediaStreamDevicesControllerBrowserTest, | 2863 IN_PROC_BROWSER_TEST_P(MediaStreamDevicesControllerBrowserTest, |
2864 VideoCaptureAllowedUrls) { | 2864 VideoCaptureAllowedUrls) { |
(...skipping 11 matching lines...) Expand all Loading... |
2876 }; | 2876 }; |
2877 | 2877 |
2878 for (size_t i = 0; i < arraysize(allow_pattern); ++i) { | 2878 for (size_t i = 0; i < arraysize(allow_pattern); ++i) { |
2879 PolicyMap policies; | 2879 PolicyMap policies; |
2880 ConfigurePolicyMap(&policies, key::kVideoCaptureAllowed, | 2880 ConfigurePolicyMap(&policies, key::kVideoCaptureAllowed, |
2881 key::kVideoCaptureAllowedUrls, allow_pattern[i]); | 2881 key::kVideoCaptureAllowedUrls, allow_pattern[i]); |
2882 UpdateProviderPolicy(policies); | 2882 UpdateProviderPolicy(policies); |
2883 | 2883 |
2884 content::BrowserThread::PostTaskAndReply( | 2884 content::BrowserThread::PostTaskAndReply( |
2885 content::BrowserThread::IO, FROM_HERE, | 2885 content::BrowserThread::IO, FROM_HERE, |
2886 base::Bind( | 2886 base::Bind(&MediaCaptureDevicesDispatcher::SetTestVideoCaptureDevices, |
2887 &MediaCaptureDevicesDispatcher::OnVideoCaptureDevicesChanged, | |
2888 base::Unretained(MediaCaptureDevicesDispatcher::GetInstance()), | 2887 base::Unretained(MediaCaptureDevicesDispatcher::GetInstance()), |
2889 video_devices), | 2888 video_devices), |
2890 base::Bind( | 2889 base::Bind( |
2891 &MediaStreamDevicesControllerBrowserTest::FinishVideoTest, | 2890 &MediaStreamDevicesControllerBrowserTest::FinishVideoTest, |
2892 this)); | 2891 this)); |
2893 | 2892 |
2894 base::MessageLoop::current()->Run(); | 2893 base::MessageLoop::current()->Run(); |
2895 } | 2894 } |
2896 } | 2895 } |
2897 | 2896 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2976 PrefService* prefs = browser()->profile()->GetPrefs(); | 2975 PrefService* prefs = browser()->profile()->GetPrefs(); |
2977 EXPECT_TRUE(extensions::NativeMessageProcessHost::IsHostAllowed( | 2976 EXPECT_TRUE(extensions::NativeMessageProcessHost::IsHostAllowed( |
2978 prefs, "host.name")); | 2977 prefs, "host.name")); |
2979 EXPECT_FALSE(extensions::NativeMessageProcessHost::IsHostAllowed( | 2978 EXPECT_FALSE(extensions::NativeMessageProcessHost::IsHostAllowed( |
2980 prefs, "other.host.name")); | 2979 prefs, "other.host.name")); |
2981 } | 2980 } |
2982 | 2981 |
2983 #endif // !defined(CHROME_OS) | 2982 #endif // !defined(CHROME_OS) |
2984 | 2983 |
2985 } // namespace policy | 2984 } // namespace policy |
OLD | NEW |