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

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

Issue 88283002: Reland review 34393006: Refactor MediaStreamManager to not output real device id. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years 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 2654 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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