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

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

Issue 185863003: [Media] Add user gesture reporting for API calls to midi and media streams. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 9 months 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
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 2720 matching lines...) Expand 10 before | Expand all | Expand 10 after
2731 if (policy_value_ || request_url_allowed_via_whitelist_) { 2731 if (policy_value_ || request_url_allowed_via_whitelist_) {
2732 ASSERT_EQ(1U, devices.size()); 2732 ASSERT_EQ(1U, devices.size());
2733 ASSERT_EQ("fake_dev", devices[0].id); 2733 ASSERT_EQ("fake_dev", devices[0].id);
2734 } else { 2734 } else {
2735 ASSERT_EQ(0U, devices.size()); 2735 ASSERT_EQ(0U, devices.size());
2736 } 2736 }
2737 } 2737 }
2738 2738
2739 void FinishAudioTest() { 2739 void FinishAudioTest() {
2740 content::MediaStreamRequest request(0, 0, 0, 2740 content::MediaStreamRequest request(0, 0, 0,
2741 request_url_.GetOrigin(), 2741 request_url_.GetOrigin(), false,
2742 content::MEDIA_DEVICE_ACCESS, 2742 content::MEDIA_DEVICE_ACCESS,
2743 std::string(), std::string(), 2743 std::string(), std::string(),
2744 content::MEDIA_DEVICE_AUDIO_CAPTURE, 2744 content::MEDIA_DEVICE_AUDIO_CAPTURE,
2745 content::MEDIA_NO_SERVICE); 2745 content::MEDIA_NO_SERVICE);
2746 // TODO(raymes): Test MEDIA_DEVICE_OPEN (Pepper) which grants both webcam 2746 // TODO(raymes): Test MEDIA_DEVICE_OPEN (Pepper) which grants both webcam
2747 // and microphone permissions at the same time. 2747 // and microphone permissions at the same time.
2748 MediaStreamDevicesController controller( 2748 MediaStreamDevicesController controller(
2749 browser()->tab_strip_model()->GetActiveWebContents(), request, 2749 browser()->tab_strip_model()->GetActiveWebContents(), request,
2750 base::Bind(&MediaStreamDevicesControllerBrowserTest::Accept, this)); 2750 base::Bind(&MediaStreamDevicesControllerBrowserTest::Accept, this));
2751 controller.Accept(false); 2751 controller.Accept(false);
2752 2752
2753 base::MessageLoop::current()->QuitWhenIdle(); 2753 base::MessageLoop::current()->QuitWhenIdle();
2754 } 2754 }
2755 2755
2756 void FinishVideoTest() { 2756 void FinishVideoTest() {
2757 // TODO(raymes): Test MEDIA_DEVICE_OPEN (Pepper) which grants both webcam 2757 // TODO(raymes): Test MEDIA_DEVICE_OPEN (Pepper) which grants both webcam
2758 // and microphone permissions at the same time. 2758 // and microphone permissions at the same time.
2759 content::MediaStreamRequest request(0, 0, 0, 2759 content::MediaStreamRequest request(0, 0, 0,
2760 request_url_.GetOrigin(), 2760 request_url_.GetOrigin(), false,
2761 content::MEDIA_DEVICE_ACCESS, 2761 content::MEDIA_DEVICE_ACCESS,
2762 std::string(), 2762 std::string(),
2763 std::string(), 2763 std::string(),
2764 content::MEDIA_NO_SERVICE, 2764 content::MEDIA_NO_SERVICE,
2765 content::MEDIA_DEVICE_VIDEO_CAPTURE); 2765 content::MEDIA_DEVICE_VIDEO_CAPTURE);
2766 MediaStreamDevicesController controller( 2766 MediaStreamDevicesController controller(
2767 browser()->tab_strip_model()->GetActiveWebContents(), request, 2767 browser()->tab_strip_model()->GetActiveWebContents(), request,
2768 base::Bind(&MediaStreamDevicesControllerBrowserTest::Accept, this)); 2768 base::Bind(&MediaStreamDevicesControllerBrowserTest::Accept, this));
2769 controller.Accept(false); 2769 controller.Accept(false);
2770 2770
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
2976 PrefService* prefs = browser()->profile()->GetPrefs(); 2976 PrefService* prefs = browser()->profile()->GetPrefs();
2977 EXPECT_TRUE(extensions::NativeMessageProcessHost::IsHostAllowed( 2977 EXPECT_TRUE(extensions::NativeMessageProcessHost::IsHostAllowed(
2978 prefs, "host.name")); 2978 prefs, "host.name"));
2979 EXPECT_FALSE(extensions::NativeMessageProcessHost::IsHostAllowed( 2979 EXPECT_FALSE(extensions::NativeMessageProcessHost::IsHostAllowed(
2980 prefs, "other.host.name")); 2980 prefs, "other.host.name"));
2981 } 2981 }
2982 2982
2983 #endif // !defined(CHROME_OS) 2983 #endif // !defined(CHROME_OS)
2984 2984
2985 } // namespace policy 2985 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698