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 2716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2727 if (policy_value_ || request_url_allowed_via_whitelist_) { | 2727 if (policy_value_ || request_url_allowed_via_whitelist_) { |
2728 ASSERT_EQ(1U, devices.size()); | 2728 ASSERT_EQ(1U, devices.size()); |
2729 ASSERT_EQ("fake_dev", devices[0].id); | 2729 ASSERT_EQ("fake_dev", devices[0].id); |
2730 } else { | 2730 } else { |
2731 ASSERT_EQ(0U, devices.size()); | 2731 ASSERT_EQ(0U, devices.size()); |
2732 } | 2732 } |
2733 } | 2733 } |
2734 | 2734 |
2735 void FinishAudioTest() { | 2735 void FinishAudioTest() { |
2736 content::MediaStreamRequest request(0, 0, 0, | 2736 content::MediaStreamRequest request(0, 0, 0, |
2737 request_url_.GetOrigin(), | 2737 request_url_.GetOrigin(), false, |
2738 content::MEDIA_DEVICE_ACCESS, | 2738 content::MEDIA_DEVICE_ACCESS, |
2739 std::string(), std::string(), | 2739 std::string(), std::string(), |
2740 content::MEDIA_DEVICE_AUDIO_CAPTURE, | 2740 content::MEDIA_DEVICE_AUDIO_CAPTURE, |
2741 content::MEDIA_NO_SERVICE); | 2741 content::MEDIA_NO_SERVICE); |
2742 // TODO(raymes): Test MEDIA_DEVICE_OPEN (Pepper) which grants both webcam | 2742 // TODO(raymes): Test MEDIA_DEVICE_OPEN (Pepper) which grants both webcam |
2743 // and microphone permissions at the same time. | 2743 // and microphone permissions at the same time. |
2744 MediaStreamDevicesController controller( | 2744 MediaStreamDevicesController controller( |
2745 browser()->tab_strip_model()->GetActiveWebContents(), request, | 2745 browser()->tab_strip_model()->GetActiveWebContents(), request, |
2746 base::Bind(&MediaStreamDevicesControllerBrowserTest::Accept, this)); | 2746 base::Bind(&MediaStreamDevicesControllerBrowserTest::Accept, this)); |
2747 controller.Accept(false); | 2747 controller.Accept(false); |
2748 | 2748 |
2749 base::MessageLoop::current()->QuitWhenIdle(); | 2749 base::MessageLoop::current()->QuitWhenIdle(); |
2750 } | 2750 } |
2751 | 2751 |
2752 void FinishVideoTest() { | 2752 void FinishVideoTest() { |
2753 // TODO(raymes): Test MEDIA_DEVICE_OPEN (Pepper) which grants both webcam | 2753 // TODO(raymes): Test MEDIA_DEVICE_OPEN (Pepper) which grants both webcam |
2754 // and microphone permissions at the same time. | 2754 // and microphone permissions at the same time. |
2755 content::MediaStreamRequest request(0, 0, 0, | 2755 content::MediaStreamRequest request(0, 0, 0, |
2756 request_url_.GetOrigin(), | 2756 request_url_.GetOrigin(), false, |
2757 content::MEDIA_DEVICE_ACCESS, | 2757 content::MEDIA_DEVICE_ACCESS, |
2758 std::string(), | 2758 std::string(), |
2759 std::string(), | 2759 std::string(), |
2760 content::MEDIA_NO_SERVICE, | 2760 content::MEDIA_NO_SERVICE, |
2761 content::MEDIA_DEVICE_VIDEO_CAPTURE); | 2761 content::MEDIA_DEVICE_VIDEO_CAPTURE); |
2762 MediaStreamDevicesController controller( | 2762 MediaStreamDevicesController controller( |
2763 browser()->tab_strip_model()->GetActiveWebContents(), request, | 2763 browser()->tab_strip_model()->GetActiveWebContents(), request, |
2764 base::Bind(&MediaStreamDevicesControllerBrowserTest::Accept, this)); | 2764 base::Bind(&MediaStreamDevicesControllerBrowserTest::Accept, this)); |
2765 controller.Accept(false); | 2765 controller.Accept(false); |
2766 | 2766 |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2971 PrefService* prefs = browser()->profile()->GetPrefs(); | 2971 PrefService* prefs = browser()->profile()->GetPrefs(); |
2972 EXPECT_TRUE(extensions::NativeMessageProcessHost::IsHostAllowed( | 2972 EXPECT_TRUE(extensions::NativeMessageProcessHost::IsHostAllowed( |
2973 prefs, "host.name")); | 2973 prefs, "host.name")); |
2974 EXPECT_FALSE(extensions::NativeMessageProcessHost::IsHostAllowed( | 2974 EXPECT_FALSE(extensions::NativeMessageProcessHost::IsHostAllowed( |
2975 prefs, "other.host.name")); | 2975 prefs, "other.host.name")); |
2976 } | 2976 } |
2977 | 2977 |
2978 #endif // !defined(CHROME_OS) | 2978 #endif // !defined(CHROME_OS) |
2979 | 2979 |
2980 } // namespace policy | 2980 } // namespace policy |
OLD | NEW |