Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Side by Side Diff: chrome/browser/policy/policy_browsertest.cc

Issue 34393006: Refactor MediaStreamManager to never output real device id. It now always output sourceId in the fo… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased to latest code base. Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/renderer_host/media/device_request_message_filter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2616 matching lines...) Expand 10 before | Expand all | Expand 10 after
2627 scoped_ptr<content::MediaStreamUI> ui) { 2627 scoped_ptr<content::MediaStreamUI> ui) {
2628 if (policy_value_ || request_url_allowed_via_whitelist_) { 2628 if (policy_value_ || request_url_allowed_via_whitelist_) {
2629 ASSERT_EQ(1U, devices.size()); 2629 ASSERT_EQ(1U, devices.size());
2630 ASSERT_EQ("fake_dev", devices[0].id); 2630 ASSERT_EQ("fake_dev", devices[0].id);
2631 } else { 2631 } else {
2632 ASSERT_EQ(0U, devices.size()); 2632 ASSERT_EQ(0U, devices.size());
2633 } 2633 }
2634 } 2634 }
2635 2635
2636 void FinishAudioTest() { 2636 void FinishAudioTest() {
2637 content::MediaStreamRequest request(0, 0, 0, std::string(), 2637 content::MediaStreamRequest request(0, 0, 0,
2638 request_url_.GetOrigin(), 2638 request_url_.GetOrigin(),
2639 content::MEDIA_DEVICE_ACCESS, 2639 content::MEDIA_DEVICE_ACCESS,
2640 std::string(), std::string(), 2640 std::string(), std::string(),
2641 content::MEDIA_DEVICE_AUDIO_CAPTURE, 2641 content::MEDIA_DEVICE_AUDIO_CAPTURE,
2642 content::MEDIA_NO_SERVICE); 2642 content::MEDIA_NO_SERVICE);
2643 // TODO(raymes): Test MEDIA_DEVICE_OPEN (Pepper) which grants both webcam 2643 // TODO(raymes): Test MEDIA_DEVICE_OPEN (Pepper) which grants both webcam
2644 // and microphone permissions at the same time. 2644 // and microphone permissions at the same time.
2645 MediaStreamDevicesController controller( 2645 MediaStreamDevicesController controller(
2646 browser()->tab_strip_model()->GetActiveWebContents(), request, 2646 browser()->tab_strip_model()->GetActiveWebContents(), request,
2647 base::Bind(&MediaStreamDevicesControllerBrowserTest::Accept, this)); 2647 base::Bind(&MediaStreamDevicesControllerBrowserTest::Accept, this));
2648 controller.Accept(false); 2648 controller.Accept(false);
2649 2649
2650 base::MessageLoop::current()->QuitWhenIdle(); 2650 base::MessageLoop::current()->QuitWhenIdle();
2651 } 2651 }
2652 2652
2653 void FinishVideoTest() { 2653 void FinishVideoTest() {
2654 // TODO(raymes): Test MEDIA_DEVICE_OPEN (Pepper) which grants both webcam 2654 // TODO(raymes): Test MEDIA_DEVICE_OPEN (Pepper) which grants both webcam
2655 // and microphone permissions at the same time. 2655 // and microphone permissions at the same time.
2656 content::MediaStreamRequest request(0, 0, 0, std::string(), 2656 content::MediaStreamRequest request(0, 0, 0,
2657 request_url_.GetOrigin(), 2657 request_url_.GetOrigin(),
2658 content::MEDIA_DEVICE_ACCESS, 2658 content::MEDIA_DEVICE_ACCESS,
2659 std::string(), 2659 std::string(),
2660 std::string(), 2660 std::string(),
2661 content::MEDIA_NO_SERVICE, 2661 content::MEDIA_NO_SERVICE,
2662 content::MEDIA_DEVICE_VIDEO_CAPTURE); 2662 content::MEDIA_DEVICE_VIDEO_CAPTURE);
2663 MediaStreamDevicesController controller( 2663 MediaStreamDevicesController controller(
2664 browser()->tab_strip_model()->GetActiveWebContents(), request, 2664 browser()->tab_strip_model()->GetActiveWebContents(), request,
2665 base::Bind(&MediaStreamDevicesControllerBrowserTest::Accept, this)); 2665 base::Bind(&MediaStreamDevicesControllerBrowserTest::Accept, this));
2666 controller.Accept(false); 2666 controller.Accept(false);
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
2823 chrome_variations::VariationsService::GetVariationsServerURL( 2823 chrome_variations::VariationsService::GetVariationsServerURL(
2824 g_browser_process->local_state()); 2824 g_browser_process->local_state());
2825 EXPECT_TRUE(StartsWithASCII(url.spec(), default_variations_url, true)); 2825 EXPECT_TRUE(StartsWithASCII(url.spec(), default_variations_url, true));
2826 std::string value; 2826 std::string value;
2827 EXPECT_TRUE(net::GetValueForKeyInQuery(url, "restrict", &value)); 2827 EXPECT_TRUE(net::GetValueForKeyInQuery(url, "restrict", &value));
2828 EXPECT_EQ("restricted", value); 2828 EXPECT_EQ("restricted", value);
2829 } 2829 }
2830 #endif 2830 #endif
2831 2831
2832 } // namespace policy 2832 } // namespace policy
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/media/device_request_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698