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 13 matching lines...) Expand all Loading... |
24 #include "chrome/browser/api/infobars/infobar_service.h" | 24 #include "chrome/browser/api/infobars/infobar_service.h" |
25 #include "chrome/browser/autocomplete/autocomplete_controller.h" | 25 #include "chrome/browser/autocomplete/autocomplete_controller.h" |
26 #include "chrome/browser/browser_process.h" | 26 #include "chrome/browser/browser_process.h" |
27 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 27 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
28 #include "chrome/browser/devtools/devtools_window.h" | 28 #include "chrome/browser/devtools/devtools_window.h" |
29 #include "chrome/browser/download/download_prefs.h" | 29 #include "chrome/browser/download/download_prefs.h" |
30 #include "chrome/browser/extensions/crx_installer.h" | 30 #include "chrome/browser/extensions/crx_installer.h" |
31 #include "chrome/browser/extensions/extension_service.h" | 31 #include "chrome/browser/extensions/extension_service.h" |
32 #include "chrome/browser/extensions/extension_system.h" | 32 #include "chrome/browser/extensions/extension_system.h" |
33 #include "chrome/browser/media/media_capture_devices_dispatcher.h" | 33 #include "chrome/browser/media/media_capture_devices_dispatcher.h" |
34 #include "chrome/browser/media/media_internals.h" | |
35 #include "chrome/browser/media/media_stream_devices_controller.h" | 34 #include "chrome/browser/media/media_stream_devices_controller.h" |
36 #include "chrome/browser/net/url_request_mock_util.h" | 35 #include "chrome/browser/net/url_request_mock_util.h" |
37 #include "chrome/browser/plugins/plugin_prefs.h" | 36 #include "chrome/browser/plugins/plugin_prefs.h" |
38 #include "chrome/browser/policy/browser_policy_connector.h" | 37 #include "chrome/browser/policy/browser_policy_connector.h" |
39 #include "chrome/browser/policy/mock_configuration_policy_provider.h" | 38 #include "chrome/browser/policy/mock_configuration_policy_provider.h" |
40 #include "chrome/browser/policy/policy_map.h" | 39 #include "chrome/browser/policy/policy_map.h" |
41 #include "chrome/browser/prefs/pref_service.h" | 40 #include "chrome/browser/prefs/pref_service.h" |
42 #include "chrome/browser/prefs/session_startup_pref.h" | 41 #include "chrome/browser/prefs/session_startup_pref.h" |
43 #include "chrome/browser/profiles/profile.h" | 42 #include "chrome/browser/profiles/profile.h" |
44 #include "chrome/browser/search_engines/template_url.h" | 43 #include "chrome/browser/search_engines/template_url.h" |
(...skipping 1786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1831 content::MediaStreamDevice fake_audio_device( | 1830 content::MediaStreamDevice fake_audio_device( |
1832 content::MEDIA_DEVICE_AUDIO_CAPTURE, "fake_dev", "Fake Audio Device"); | 1831 content::MEDIA_DEVICE_AUDIO_CAPTURE, "fake_dev", "Fake Audio Device"); |
1833 audio_devices.push_back(fake_audio_device); | 1832 audio_devices.push_back(fake_audio_device); |
1834 | 1833 |
1835 PolicyMap policies; | 1834 PolicyMap policies; |
1836 policies.Set(key::kAudioCaptureAllowed, POLICY_LEVEL_MANDATORY, | 1835 policies.Set(key::kAudioCaptureAllowed, POLICY_LEVEL_MANDATORY, |
1837 POLICY_SCOPE_USER, | 1836 POLICY_SCOPE_USER, |
1838 base::Value::CreateBooleanValue(policy_value_)); | 1837 base::Value::CreateBooleanValue(policy_value_)); |
1839 UpdateProviderPolicy(policies); | 1838 UpdateProviderPolicy(policies); |
1840 | 1839 |
1841 MediaCaptureDevicesDispatcher* dispatcher = | |
1842 MediaInternals::GetInstance()->GetMediaCaptureDevicesDispatcher(); | |
1843 | |
1844 content::BrowserThread::PostTaskAndReply( | 1840 content::BrowserThread::PostTaskAndReply( |
1845 content::BrowserThread::IO, FROM_HERE, | 1841 content::BrowserThread::IO, FROM_HERE, |
1846 base::Bind(&MediaCaptureDevicesDispatcher::AudioCaptureDevicesChanged, | 1842 base::Bind(&MediaCaptureDevicesDispatcher::OnAudioCaptureDevicesChanged, |
1847 dispatcher, audio_devices), | 1843 base::Unretained(MediaCaptureDevicesDispatcher::GetInstance()), |
| 1844 audio_devices), |
1848 base::Bind(&MediaStreamDevicesControllerBrowserTest::FinishAudioTest, | 1845 base::Bind(&MediaStreamDevicesControllerBrowserTest::FinishAudioTest, |
1849 this)); | 1846 this)); |
1850 | 1847 |
1851 MessageLoop::current()->Run(); | 1848 MessageLoop::current()->Run(); |
1852 } | 1849 } |
1853 | 1850 |
1854 IN_PROC_BROWSER_TEST_P(MediaStreamDevicesControllerBrowserTest, | 1851 IN_PROC_BROWSER_TEST_P(MediaStreamDevicesControllerBrowserTest, |
1855 VideoCaptureAllowed) { | 1852 VideoCaptureAllowed) { |
1856 content::MediaStreamDevices video_devices; | 1853 content::MediaStreamDevices video_devices; |
1857 content::MediaStreamDevice fake_video_device( | 1854 content::MediaStreamDevice fake_video_device( |
1858 content::MEDIA_DEVICE_VIDEO_CAPTURE, "fake_dev", "Fake Video Device"); | 1855 content::MEDIA_DEVICE_VIDEO_CAPTURE, "fake_dev", "Fake Video Device"); |
1859 video_devices.push_back(fake_video_device); | 1856 video_devices.push_back(fake_video_device); |
1860 | 1857 |
1861 PolicyMap policies; | 1858 PolicyMap policies; |
1862 policies.Set(key::kVideoCaptureAllowed, POLICY_LEVEL_MANDATORY, | 1859 policies.Set(key::kVideoCaptureAllowed, POLICY_LEVEL_MANDATORY, |
1863 POLICY_SCOPE_USER, | 1860 POLICY_SCOPE_USER, |
1864 base::Value::CreateBooleanValue(policy_value_)); | 1861 base::Value::CreateBooleanValue(policy_value_)); |
1865 UpdateProviderPolicy(policies); | 1862 UpdateProviderPolicy(policies); |
1866 | 1863 |
1867 MediaCaptureDevicesDispatcher* dispatcher = | |
1868 MediaInternals::GetInstance()->GetMediaCaptureDevicesDispatcher(); | |
1869 | |
1870 content::BrowserThread::PostTaskAndReply( | 1864 content::BrowserThread::PostTaskAndReply( |
1871 content::BrowserThread::IO, FROM_HERE, | 1865 content::BrowserThread::IO, FROM_HERE, |
1872 base::Bind(&MediaCaptureDevicesDispatcher::VideoCaptureDevicesChanged, | 1866 base::Bind(&MediaCaptureDevicesDispatcher::OnVideoCaptureDevicesChanged, |
1873 dispatcher, video_devices), | 1867 base::Unretained(MediaCaptureDevicesDispatcher::GetInstance()), |
| 1868 video_devices), |
1874 base::Bind(&MediaStreamDevicesControllerBrowserTest::FinishVideoTest, | 1869 base::Bind(&MediaStreamDevicesControllerBrowserTest::FinishVideoTest, |
1875 this)); | 1870 this)); |
1876 | 1871 |
1877 MessageLoop::current()->Run(); | 1872 MessageLoop::current()->Run(); |
1878 } | 1873 } |
1879 | 1874 |
1880 INSTANTIATE_TEST_CASE_P(MediaStreamDevicesControllerBrowserTestInstance, | 1875 INSTANTIATE_TEST_CASE_P(MediaStreamDevicesControllerBrowserTestInstance, |
1881 MediaStreamDevicesControllerBrowserTest, | 1876 MediaStreamDevicesControllerBrowserTest, |
1882 testing::Bool()); | 1877 testing::Bool()); |
1883 | 1878 |
1884 } // namespace policy | 1879 } // namespace policy |
OLD | NEW |