| 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 <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 3160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3171 std::unique_ptr<content::MediaStreamUI> ui) { | 3171 std::unique_ptr<content::MediaStreamUI> ui) { |
| 3172 if (policy_value_ || request_url_allowed_via_whitelist_) { | 3172 if (policy_value_ || request_url_allowed_via_whitelist_) { |
| 3173 ASSERT_EQ(1U, devices.size()); | 3173 ASSERT_EQ(1U, devices.size()); |
| 3174 ASSERT_EQ("fake_dev", devices[0].id); | 3174 ASSERT_EQ("fake_dev", devices[0].id); |
| 3175 } else { | 3175 } else { |
| 3176 ASSERT_EQ(0U, devices.size()); | 3176 ASSERT_EQ(0U, devices.size()); |
| 3177 } | 3177 } |
| 3178 } | 3178 } |
| 3179 | 3179 |
| 3180 void FinishAudioTest() { | 3180 void FinishAudioTest() { |
| 3181 content::MediaStreamRequest request(0, 0, 0, | 3181 content::MediaStreamRequest request( |
| 3182 request_url_.GetOrigin(), false, | 3182 0, 0, 0, request_url_.GetOrigin(), false, content::MEDIA_DEVICE_ACCESS, |
| 3183 content::MEDIA_DEVICE_ACCESS, | 3183 std::string(), std::string(), content::MEDIA_DEVICE_AUDIO_CAPTURE, |
| 3184 std::string(), std::string(), | 3184 content::MEDIA_NO_SERVICE, false); |
| 3185 content::MEDIA_DEVICE_AUDIO_CAPTURE, | |
| 3186 content::MEDIA_NO_SERVICE); | |
| 3187 // TODO(raymes): Test MEDIA_DEVICE_OPEN (Pepper) which grants both webcam | 3185 // TODO(raymes): Test MEDIA_DEVICE_OPEN (Pepper) which grants both webcam |
| 3188 // and microphone permissions at the same time. | 3186 // and microphone permissions at the same time. |
| 3189 MediaStreamDevicesController controller( | 3187 MediaStreamDevicesController controller( |
| 3190 browser()->tab_strip_model()->GetActiveWebContents(), request, | 3188 browser()->tab_strip_model()->GetActiveWebContents(), request, |
| 3191 base::Bind(&MediaStreamDevicesControllerBrowserTest::Accept, | 3189 base::Bind(&MediaStreamDevicesControllerBrowserTest::Accept, |
| 3192 base::Unretained(this))); | 3190 base::Unretained(this))); |
| 3193 if (controller.IsAskingForAudio()) | 3191 if (controller.IsAskingForAudio()) |
| 3194 controller.PermissionGranted(); | 3192 controller.PermissionGranted(); |
| 3195 | 3193 |
| 3196 base::MessageLoop::current()->QuitWhenIdle(); | 3194 base::MessageLoop::current()->QuitWhenIdle(); |
| 3197 } | 3195 } |
| 3198 | 3196 |
| 3199 void FinishVideoTest() { | 3197 void FinishVideoTest() { |
| 3200 content::MediaStreamRequest request(0, 0, 0, | 3198 content::MediaStreamRequest request( |
| 3201 request_url_.GetOrigin(), false, | 3199 0, 0, 0, request_url_.GetOrigin(), false, content::MEDIA_DEVICE_ACCESS, |
| 3202 content::MEDIA_DEVICE_ACCESS, | 3200 std::string(), std::string(), content::MEDIA_NO_SERVICE, |
| 3203 std::string(), | 3201 content::MEDIA_DEVICE_VIDEO_CAPTURE, false); |
| 3204 std::string(), | |
| 3205 content::MEDIA_NO_SERVICE, | |
| 3206 content::MEDIA_DEVICE_VIDEO_CAPTURE); | |
| 3207 // TODO(raymes): Test MEDIA_DEVICE_OPEN (Pepper) which grants both webcam | 3202 // TODO(raymes): Test MEDIA_DEVICE_OPEN (Pepper) which grants both webcam |
| 3208 // and microphone permissions at the same time. | 3203 // and microphone permissions at the same time. |
| 3209 MediaStreamDevicesController controller( | 3204 MediaStreamDevicesController controller( |
| 3210 browser()->tab_strip_model()->GetActiveWebContents(), request, | 3205 browser()->tab_strip_model()->GetActiveWebContents(), request, |
| 3211 base::Bind(&MediaStreamDevicesControllerBrowserTest::Accept, | 3206 base::Bind(&MediaStreamDevicesControllerBrowserTest::Accept, |
| 3212 base::Unretained(this))); | 3207 base::Unretained(this))); |
| 3213 if (controller.IsAskingForVideo()) | 3208 if (controller.IsAskingForVideo()) |
| 3214 controller.PermissionGranted(); | 3209 controller.PermissionGranted(); |
| 3215 | 3210 |
| 3216 base::MessageLoop::current()->QuitWhenIdle(); | 3211 base::MessageLoop::current()->QuitWhenIdle(); |
| (...skipping 1157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4374 | 4369 |
| 4375 SetEmptyPolicy(); | 4370 SetEmptyPolicy(); |
| 4376 // Policy not set. | 4371 // Policy not set. |
| 4377 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); | 4372 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); |
| 4378 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); | 4373 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); |
| 4379 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); | 4374 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); |
| 4380 } | 4375 } |
| 4381 #endif // defined(OS_CHROMEOS) | 4376 #endif // defined(OS_CHROMEOS) |
| 4382 | 4377 |
| 4383 } // namespace policy | 4378 } // namespace policy |
| OLD | NEW |