| 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 2525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2536 scoped_ptr<content::MediaStreamUI> ui) { | 2536 scoped_ptr<content::MediaStreamUI> ui) { |
| 2537 if (policy_value_ || request_url_allowed_via_whitelist_) { | 2537 if (policy_value_ || request_url_allowed_via_whitelist_) { |
| 2538 ASSERT_EQ(1U, devices.size()); | 2538 ASSERT_EQ(1U, devices.size()); |
| 2539 ASSERT_EQ("fake_dev", devices[0].id); | 2539 ASSERT_EQ("fake_dev", devices[0].id); |
| 2540 } else { | 2540 } else { |
| 2541 ASSERT_EQ(0U, devices.size()); | 2541 ASSERT_EQ(0U, devices.size()); |
| 2542 } | 2542 } |
| 2543 } | 2543 } |
| 2544 | 2544 |
| 2545 void FinishAudioTest() { | 2545 void FinishAudioTest() { |
| 2546 content::MediaStreamRequest request(0, 0, 0, std::string(), | 2546 content::MediaStreamRequest request(0, 0, 0, |
| 2547 request_url_.GetOrigin(), | 2547 request_url_.GetOrigin(), |
| 2548 content::MEDIA_DEVICE_ACCESS, | 2548 content::MEDIA_DEVICE_ACCESS, |
| 2549 std::string(), std::string(), | 2549 std::string(), std::string(), |
| 2550 content::MEDIA_DEVICE_AUDIO_CAPTURE, | 2550 content::MEDIA_DEVICE_AUDIO_CAPTURE, |
| 2551 content::MEDIA_NO_SERVICE); | 2551 content::MEDIA_NO_SERVICE); |
| 2552 // TODO(raymes): Test MEDIA_DEVICE_OPEN (Pepper) which grants both webcam | 2552 // TODO(raymes): Test MEDIA_DEVICE_OPEN (Pepper) which grants both webcam |
| 2553 // and microphone permissions at the same time. | 2553 // and microphone permissions at the same time. |
| 2554 MediaStreamDevicesController controller( | 2554 MediaStreamDevicesController controller( |
| 2555 browser()->tab_strip_model()->GetActiveWebContents(), request, | 2555 browser()->tab_strip_model()->GetActiveWebContents(), request, |
| 2556 base::Bind(&MediaStreamDevicesControllerBrowserTest::Accept, this)); | 2556 base::Bind(&MediaStreamDevicesControllerBrowserTest::Accept, this)); |
| 2557 controller.Accept(false); | 2557 controller.Accept(false); |
| 2558 | 2558 |
| 2559 base::MessageLoop::current()->QuitWhenIdle(); | 2559 base::MessageLoop::current()->QuitWhenIdle(); |
| 2560 } | 2560 } |
| 2561 | 2561 |
| 2562 void FinishVideoTest() { | 2562 void FinishVideoTest() { |
| 2563 // TODO(raymes): Test MEDIA_DEVICE_OPEN (Pepper) which grants both webcam | 2563 // TODO(raymes): Test MEDIA_DEVICE_OPEN (Pepper) which grants both webcam |
| 2564 // and microphone permissions at the same time. | 2564 // and microphone permissions at the same time. |
| 2565 content::MediaStreamRequest request(0, 0, 0, std::string(), | 2565 content::MediaStreamRequest request(0, 0, 0, |
| 2566 request_url_.GetOrigin(), | 2566 request_url_.GetOrigin(), |
| 2567 content::MEDIA_DEVICE_ACCESS, | 2567 content::MEDIA_DEVICE_ACCESS, |
| 2568 std::string(), | 2568 std::string(), |
| 2569 std::string(), | 2569 std::string(), |
| 2570 content::MEDIA_NO_SERVICE, | 2570 content::MEDIA_NO_SERVICE, |
| 2571 content::MEDIA_DEVICE_VIDEO_CAPTURE); | 2571 content::MEDIA_DEVICE_VIDEO_CAPTURE); |
| 2572 MediaStreamDevicesController controller( | 2572 MediaStreamDevicesController controller( |
| 2573 browser()->tab_strip_model()->GetActiveWebContents(), request, | 2573 browser()->tab_strip_model()->GetActiveWebContents(), request, |
| 2574 base::Bind(&MediaStreamDevicesControllerBrowserTest::Accept, this)); | 2574 base::Bind(&MediaStreamDevicesControllerBrowserTest::Accept, this)); |
| 2575 controller.Accept(false); | 2575 controller.Accept(false); |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2732 chrome_variations::VariationsService::GetVariationsServerURL( | 2732 chrome_variations::VariationsService::GetVariationsServerURL( |
| 2733 g_browser_process->local_state()); | 2733 g_browser_process->local_state()); |
| 2734 EXPECT_TRUE(StartsWithASCII(url.spec(), default_variations_url, true)); | 2734 EXPECT_TRUE(StartsWithASCII(url.spec(), default_variations_url, true)); |
| 2735 std::string value; | 2735 std::string value; |
| 2736 EXPECT_TRUE(net::GetValueForKeyInQuery(url, "restrict", &value)); | 2736 EXPECT_TRUE(net::GetValueForKeyInQuery(url, "restrict", &value)); |
| 2737 EXPECT_EQ("restricted", value); | 2737 EXPECT_EQ("restricted", value); |
| 2738 } | 2738 } |
| 2739 #endif | 2739 #endif |
| 2740 | 2740 |
| 2741 } // namespace policy | 2741 } // namespace policy |
| OLD | NEW |