| 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 3391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3402 UpdateProviderPolicy(policies); | 3402 UpdateProviderPolicy(policies); |
| 3403 | 3403 |
| 3404 content::BrowserThread::PostTaskAndReply( | 3404 content::BrowserThread::PostTaskAndReply( |
| 3405 content::BrowserThread::IO, FROM_HERE, | 3405 content::BrowserThread::IO, FROM_HERE, |
| 3406 base::Bind(&MediaCaptureDevicesDispatcher::SetTestAudioCaptureDevices, | 3406 base::Bind(&MediaCaptureDevicesDispatcher::SetTestAudioCaptureDevices, |
| 3407 base::Unretained(MediaCaptureDevicesDispatcher::GetInstance()), | 3407 base::Unretained(MediaCaptureDevicesDispatcher::GetInstance()), |
| 3408 audio_devices), | 3408 audio_devices), |
| 3409 base::Bind(&MediaStreamDevicesControllerBrowserTest::FinishAudioTest, | 3409 base::Bind(&MediaStreamDevicesControllerBrowserTest::FinishAudioTest, |
| 3410 this)); | 3410 this)); |
| 3411 | 3411 |
| 3412 base::MessageLoop::current()->Run(); | 3412 base::RunLoop().Run(); |
| 3413 } | 3413 } |
| 3414 | 3414 |
| 3415 IN_PROC_BROWSER_TEST_P(MediaStreamDevicesControllerBrowserTest, | 3415 IN_PROC_BROWSER_TEST_P(MediaStreamDevicesControllerBrowserTest, |
| 3416 AudioCaptureAllowedUrls) { | 3416 AudioCaptureAllowedUrls) { |
| 3417 content::MediaStreamDevices audio_devices; | 3417 content::MediaStreamDevices audio_devices; |
| 3418 content::MediaStreamDevice fake_audio_device( | 3418 content::MediaStreamDevice fake_audio_device( |
| 3419 content::MEDIA_DEVICE_AUDIO_CAPTURE, "fake_dev", "Fake Audio Device"); | 3419 content::MEDIA_DEVICE_AUDIO_CAPTURE, "fake_dev", "Fake Audio Device"); |
| 3420 audio_devices.push_back(fake_audio_device); | 3420 audio_devices.push_back(fake_audio_device); |
| 3421 | 3421 |
| 3422 const char* allow_pattern[] = { | 3422 const char* allow_pattern[] = { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 3436 content::BrowserThread::PostTaskAndReply( | 3436 content::BrowserThread::PostTaskAndReply( |
| 3437 content::BrowserThread::IO, FROM_HERE, | 3437 content::BrowserThread::IO, FROM_HERE, |
| 3438 base::Bind( | 3438 base::Bind( |
| 3439 &MediaCaptureDevicesDispatcher::SetTestAudioCaptureDevices, | 3439 &MediaCaptureDevicesDispatcher::SetTestAudioCaptureDevices, |
| 3440 base::Unretained(MediaCaptureDevicesDispatcher::GetInstance()), | 3440 base::Unretained(MediaCaptureDevicesDispatcher::GetInstance()), |
| 3441 audio_devices), | 3441 audio_devices), |
| 3442 base::Bind( | 3442 base::Bind( |
| 3443 &MediaStreamDevicesControllerBrowserTest::FinishAudioTest, | 3443 &MediaStreamDevicesControllerBrowserTest::FinishAudioTest, |
| 3444 this)); | 3444 this)); |
| 3445 | 3445 |
| 3446 base::MessageLoop::current()->Run(); | 3446 base::RunLoop().Run(); |
| 3447 } | 3447 } |
| 3448 } | 3448 } |
| 3449 | 3449 |
| 3450 IN_PROC_BROWSER_TEST_P(MediaStreamDevicesControllerBrowserTest, | 3450 IN_PROC_BROWSER_TEST_P(MediaStreamDevicesControllerBrowserTest, |
| 3451 VideoCaptureAllowed) { | 3451 VideoCaptureAllowed) { |
| 3452 content::MediaStreamDevices video_devices; | 3452 content::MediaStreamDevices video_devices; |
| 3453 content::MediaStreamDevice fake_video_device( | 3453 content::MediaStreamDevice fake_video_device( |
| 3454 content::MEDIA_DEVICE_VIDEO_CAPTURE, "fake_dev", "Fake Video Device"); | 3454 content::MEDIA_DEVICE_VIDEO_CAPTURE, "fake_dev", "Fake Video Device"); |
| 3455 video_devices.push_back(fake_video_device); | 3455 video_devices.push_back(fake_video_device); |
| 3456 | 3456 |
| 3457 PolicyMap policies; | 3457 PolicyMap policies; |
| 3458 ConfigurePolicyMap(&policies, key::kVideoCaptureAllowed, NULL, NULL); | 3458 ConfigurePolicyMap(&policies, key::kVideoCaptureAllowed, NULL, NULL); |
| 3459 UpdateProviderPolicy(policies); | 3459 UpdateProviderPolicy(policies); |
| 3460 | 3460 |
| 3461 content::BrowserThread::PostTaskAndReply( | 3461 content::BrowserThread::PostTaskAndReply( |
| 3462 content::BrowserThread::IO, FROM_HERE, | 3462 content::BrowserThread::IO, FROM_HERE, |
| 3463 base::Bind(&MediaCaptureDevicesDispatcher::SetTestVideoCaptureDevices, | 3463 base::Bind(&MediaCaptureDevicesDispatcher::SetTestVideoCaptureDevices, |
| 3464 base::Unretained(MediaCaptureDevicesDispatcher::GetInstance()), | 3464 base::Unretained(MediaCaptureDevicesDispatcher::GetInstance()), |
| 3465 video_devices), | 3465 video_devices), |
| 3466 base::Bind(&MediaStreamDevicesControllerBrowserTest::FinishVideoTest, | 3466 base::Bind(&MediaStreamDevicesControllerBrowserTest::FinishVideoTest, |
| 3467 this)); | 3467 this)); |
| 3468 | 3468 |
| 3469 base::MessageLoop::current()->Run(); | 3469 base::RunLoop().Run(); |
| 3470 } | 3470 } |
| 3471 | 3471 |
| 3472 IN_PROC_BROWSER_TEST_P(MediaStreamDevicesControllerBrowserTest, | 3472 IN_PROC_BROWSER_TEST_P(MediaStreamDevicesControllerBrowserTest, |
| 3473 VideoCaptureAllowedUrls) { | 3473 VideoCaptureAllowedUrls) { |
| 3474 content::MediaStreamDevices video_devices; | 3474 content::MediaStreamDevices video_devices; |
| 3475 content::MediaStreamDevice fake_video_device( | 3475 content::MediaStreamDevice fake_video_device( |
| 3476 content::MEDIA_DEVICE_VIDEO_CAPTURE, "fake_dev", "Fake Video Device"); | 3476 content::MEDIA_DEVICE_VIDEO_CAPTURE, "fake_dev", "Fake Video Device"); |
| 3477 video_devices.push_back(fake_video_device); | 3477 video_devices.push_back(fake_video_device); |
| 3478 | 3478 |
| 3479 const char* allow_pattern[] = { | 3479 const char* allow_pattern[] = { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 3492 | 3492 |
| 3493 content::BrowserThread::PostTaskAndReply( | 3493 content::BrowserThread::PostTaskAndReply( |
| 3494 content::BrowserThread::IO, FROM_HERE, | 3494 content::BrowserThread::IO, FROM_HERE, |
| 3495 base::Bind(&MediaCaptureDevicesDispatcher::SetTestVideoCaptureDevices, | 3495 base::Bind(&MediaCaptureDevicesDispatcher::SetTestVideoCaptureDevices, |
| 3496 base::Unretained(MediaCaptureDevicesDispatcher::GetInstance()), | 3496 base::Unretained(MediaCaptureDevicesDispatcher::GetInstance()), |
| 3497 video_devices), | 3497 video_devices), |
| 3498 base::Bind( | 3498 base::Bind( |
| 3499 &MediaStreamDevicesControllerBrowserTest::FinishVideoTest, | 3499 &MediaStreamDevicesControllerBrowserTest::FinishVideoTest, |
| 3500 this)); | 3500 this)); |
| 3501 | 3501 |
| 3502 base::MessageLoop::current()->Run(); | 3502 base::RunLoop().Run(); |
| 3503 } | 3503 } |
| 3504 } | 3504 } |
| 3505 | 3505 |
| 3506 INSTANTIATE_TEST_CASE_P(MediaStreamDevicesControllerBrowserTestInstance, | 3506 INSTANTIATE_TEST_CASE_P(MediaStreamDevicesControllerBrowserTestInstance, |
| 3507 MediaStreamDevicesControllerBrowserTest, | 3507 MediaStreamDevicesControllerBrowserTest, |
| 3508 testing::Bool()); | 3508 testing::Bool()); |
| 3509 | 3509 |
| 3510 class WebBluetoothPolicyTest : public PolicyTest { | 3510 class WebBluetoothPolicyTest : public PolicyTest { |
| 3511 void SetUpCommandLine(base::CommandLine* command_line)override { | 3511 void SetUpCommandLine(base::CommandLine* command_line)override { |
| 3512 // This is needed while Web Bluetooth is an Origin Trial, but can go away | 3512 // This is needed while Web Bluetooth is an Origin Trial, but can go away |
| (...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4097 | 4097 |
| 4098 SetEmptyPolicy(); | 4098 SetEmptyPolicy(); |
| 4099 // Policy not set. | 4099 // Policy not set. |
| 4100 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); | 4100 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); |
| 4101 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); | 4101 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); |
| 4102 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); | 4102 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); |
| 4103 } | 4103 } |
| 4104 #endif // defined(OS_CHROMEOS) | 4104 #endif // defined(OS_CHROMEOS) |
| 4105 | 4105 |
| 4106 } // namespace policy | 4106 } // namespace policy |
| OLD | NEW |