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 2654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2665 scoped_ptr<content::MediaStreamUI> ui) { | 2665 scoped_ptr<content::MediaStreamUI> ui) { |
2666 if (policy_value_ || request_url_allowed_via_whitelist_) { | 2666 if (policy_value_ || request_url_allowed_via_whitelist_) { |
2667 ASSERT_EQ(1U, devices.size()); | 2667 ASSERT_EQ(1U, devices.size()); |
2668 ASSERT_EQ("fake_dev", devices[0].id); | 2668 ASSERT_EQ("fake_dev", devices[0].id); |
2669 } else { | 2669 } else { |
2670 ASSERT_EQ(0U, devices.size()); | 2670 ASSERT_EQ(0U, devices.size()); |
2671 } | 2671 } |
2672 } | 2672 } |
2673 | 2673 |
2674 void FinishAudioTest() { | 2674 void FinishAudioTest() { |
2675 content::MediaStreamRequest request(0, 0, 0, std::string(), | 2675 content::MediaStreamRequest request(0, 0, 0, |
2676 request_url_.GetOrigin(), | 2676 request_url_.GetOrigin(), |
2677 content::MEDIA_DEVICE_ACCESS, | 2677 content::MEDIA_DEVICE_ACCESS, |
2678 std::string(), std::string(), | 2678 std::string(), std::string(), |
2679 content::MEDIA_DEVICE_AUDIO_CAPTURE, | 2679 content::MEDIA_DEVICE_AUDIO_CAPTURE, |
2680 content::MEDIA_NO_SERVICE); | 2680 content::MEDIA_NO_SERVICE); |
2681 // TODO(raymes): Test MEDIA_DEVICE_OPEN (Pepper) which grants both webcam | 2681 // TODO(raymes): Test MEDIA_DEVICE_OPEN (Pepper) which grants both webcam |
2682 // and microphone permissions at the same time. | 2682 // and microphone permissions at the same time. |
2683 MediaStreamDevicesController controller( | 2683 MediaStreamDevicesController controller( |
2684 browser()->tab_strip_model()->GetActiveWebContents(), request, | 2684 browser()->tab_strip_model()->GetActiveWebContents(), request, |
2685 base::Bind(&MediaStreamDevicesControllerBrowserTest::Accept, this)); | 2685 base::Bind(&MediaStreamDevicesControllerBrowserTest::Accept, this)); |
2686 controller.Accept(false); | 2686 controller.Accept(false); |
2687 | 2687 |
2688 base::MessageLoop::current()->QuitWhenIdle(); | 2688 base::MessageLoop::current()->QuitWhenIdle(); |
2689 } | 2689 } |
2690 | 2690 |
2691 void FinishVideoTest() { | 2691 void FinishVideoTest() { |
2692 // TODO(raymes): Test MEDIA_DEVICE_OPEN (Pepper) which grants both webcam | 2692 // TODO(raymes): Test MEDIA_DEVICE_OPEN (Pepper) which grants both webcam |
2693 // and microphone permissions at the same time. | 2693 // and microphone permissions at the same time. |
2694 content::MediaStreamRequest request(0, 0, 0, std::string(), | 2694 content::MediaStreamRequest request(0, 0, 0, |
2695 request_url_.GetOrigin(), | 2695 request_url_.GetOrigin(), |
2696 content::MEDIA_DEVICE_ACCESS, | 2696 content::MEDIA_DEVICE_ACCESS, |
2697 std::string(), | 2697 std::string(), |
2698 std::string(), | 2698 std::string(), |
2699 content::MEDIA_NO_SERVICE, | 2699 content::MEDIA_NO_SERVICE, |
2700 content::MEDIA_DEVICE_VIDEO_CAPTURE); | 2700 content::MEDIA_DEVICE_VIDEO_CAPTURE); |
2701 MediaStreamDevicesController controller( | 2701 MediaStreamDevicesController controller( |
2702 browser()->tab_strip_model()->GetActiveWebContents(), request, | 2702 browser()->tab_strip_model()->GetActiveWebContents(), request, |
2703 base::Bind(&MediaStreamDevicesControllerBrowserTest::Accept, this)); | 2703 base::Bind(&MediaStreamDevicesControllerBrowserTest::Accept, this)); |
2704 controller.Accept(false); | 2704 controller.Accept(false); |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2861 chrome_variations::VariationsService::GetVariationsServerURL( | 2861 chrome_variations::VariationsService::GetVariationsServerURL( |
2862 g_browser_process->local_state()); | 2862 g_browser_process->local_state()); |
2863 EXPECT_TRUE(StartsWithASCII(url.spec(), default_variations_url, true)); | 2863 EXPECT_TRUE(StartsWithASCII(url.spec(), default_variations_url, true)); |
2864 std::string value; | 2864 std::string value; |
2865 EXPECT_TRUE(net::GetValueForKeyInQuery(url, "restrict", &value)); | 2865 EXPECT_TRUE(net::GetValueForKeyInQuery(url, "restrict", &value)); |
2866 EXPECT_EQ("restricted", value); | 2866 EXPECT_EQ("restricted", value); |
2867 } | 2867 } |
2868 #endif | 2868 #endif |
2869 | 2869 |
2870 } // namespace policy | 2870 } // namespace policy |
OLD | NEW |