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

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

Issue 2291893002: Let Contraints Controll Mute/Unmute Audio Local Playback For Desktop Sharing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 2 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
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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 3235 matching lines...) Expand 10 before | Expand all | Expand 10 after
3246 std::unique_ptr<content::MediaStreamUI> ui) { 3246 std::unique_ptr<content::MediaStreamUI> ui) {
3247 if (policy_value_ || request_url_allowed_via_whitelist_) { 3247 if (policy_value_ || request_url_allowed_via_whitelist_) {
3248 ASSERT_EQ(1U, devices.size()); 3248 ASSERT_EQ(1U, devices.size());
3249 ASSERT_EQ("fake_dev", devices[0].id); 3249 ASSERT_EQ("fake_dev", devices[0].id);
3250 } else { 3250 } else {
3251 ASSERT_EQ(0U, devices.size()); 3251 ASSERT_EQ(0U, devices.size());
3252 } 3252 }
3253 } 3253 }
3254 3254
3255 void FinishAudioTest() { 3255 void FinishAudioTest() {
3256 content::MediaStreamRequest request(0, 0, 0, 3256 content::MediaStreamRequest request(
3257 request_url_.GetOrigin(), false, 3257 0, 0, 0, request_url_.GetOrigin(), false, content::MEDIA_DEVICE_ACCESS,
3258 content::MEDIA_DEVICE_ACCESS, 3258 std::string(), std::string(), content::MEDIA_DEVICE_AUDIO_CAPTURE,
3259 std::string(), std::string(), 3259 content::MEDIA_NO_SERVICE, false);
3260 content::MEDIA_DEVICE_AUDIO_CAPTURE,
3261 content::MEDIA_NO_SERVICE);
3262 // TODO(raymes): Test MEDIA_DEVICE_OPEN (Pepper) which grants both webcam 3260 // TODO(raymes): Test MEDIA_DEVICE_OPEN (Pepper) which grants both webcam
3263 // and microphone permissions at the same time. 3261 // and microphone permissions at the same time.
3264 MediaStreamDevicesController controller( 3262 MediaStreamDevicesController controller(
3265 browser()->tab_strip_model()->GetActiveWebContents(), request, 3263 browser()->tab_strip_model()->GetActiveWebContents(), request,
3266 base::Bind(&MediaStreamDevicesControllerBrowserTest::Accept, 3264 base::Bind(&MediaStreamDevicesControllerBrowserTest::Accept,
3267 base::Unretained(this))); 3265 base::Unretained(this)));
3268 if (controller.IsAskingForAudio()) 3266 if (controller.IsAskingForAudio())
3269 controller.PermissionGranted(); 3267 controller.PermissionGranted();
3270 3268
3271 base::MessageLoop::current()->QuitWhenIdle(); 3269 base::MessageLoop::current()->QuitWhenIdle();
3272 } 3270 }
3273 3271
3274 void FinishVideoTest() { 3272 void FinishVideoTest() {
3275 content::MediaStreamRequest request(0, 0, 0, 3273 content::MediaStreamRequest request(
3276 request_url_.GetOrigin(), false, 3274 0, 0, 0, request_url_.GetOrigin(), false, content::MEDIA_DEVICE_ACCESS,
3277 content::MEDIA_DEVICE_ACCESS, 3275 std::string(), std::string(), content::MEDIA_NO_SERVICE,
3278 std::string(), 3276 content::MEDIA_DEVICE_VIDEO_CAPTURE, false);
3279 std::string(),
3280 content::MEDIA_NO_SERVICE,
3281 content::MEDIA_DEVICE_VIDEO_CAPTURE);
3282 // TODO(raymes): Test MEDIA_DEVICE_OPEN (Pepper) which grants both webcam 3277 // TODO(raymes): Test MEDIA_DEVICE_OPEN (Pepper) which grants both webcam
3283 // and microphone permissions at the same time. 3278 // and microphone permissions at the same time.
3284 MediaStreamDevicesController controller( 3279 MediaStreamDevicesController controller(
3285 browser()->tab_strip_model()->GetActiveWebContents(), request, 3280 browser()->tab_strip_model()->GetActiveWebContents(), request,
3286 base::Bind(&MediaStreamDevicesControllerBrowserTest::Accept, 3281 base::Bind(&MediaStreamDevicesControllerBrowserTest::Accept,
3287 base::Unretained(this))); 3282 base::Unretained(this)));
3288 if (controller.IsAskingForVideo()) 3283 if (controller.IsAskingForVideo())
3289 controller.PermissionGranted(); 3284 controller.PermissionGranted();
3290 3285
3291 base::MessageLoop::current()->QuitWhenIdle(); 3286 base::MessageLoop::current()->QuitWhenIdle();
(...skipping 1202 matching lines...) Expand 10 before | Expand all | Expand 10 after
4494 4489
4495 SetEmptyPolicy(); 4490 SetEmptyPolicy();
4496 // Policy not set. 4491 // Policy not set.
4497 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); 4492 CheckSystemTimezoneAutomaticDetectionPolicyUnset();
4498 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); 4493 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false));
4499 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); 4494 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests());
4500 } 4495 }
4501 #endif // defined(OS_CHROMEOS) 4496 #endif // defined(OS_CHROMEOS)
4502 4497
4503 } // namespace policy 4498 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698