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 <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 2155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2166 content::BrowserThread::PostTaskAndReply( | 2166 content::BrowserThread::PostTaskAndReply( |
2167 content::BrowserThread::IO, FROM_HERE, | 2167 content::BrowserThread::IO, FROM_HERE, |
2168 base::Bind( | 2168 base::Bind( |
2169 &MediaCaptureDevicesDispatcher::OnAudioCaptureDevicesChanged, | 2169 &MediaCaptureDevicesDispatcher::OnAudioCaptureDevicesChanged, |
2170 base::Unretained(MediaCaptureDevicesDispatcher::GetInstance()), | 2170 base::Unretained(MediaCaptureDevicesDispatcher::GetInstance()), |
2171 audio_devices), | 2171 audio_devices), |
2172 base::Bind( | 2172 base::Bind( |
2173 &MediaStreamDevicesControllerBrowserTest::FinishAudioTest, | 2173 &MediaStreamDevicesControllerBrowserTest::FinishAudioTest, |
2174 this)); | 2174 this)); |
2175 | 2175 |
2176 MessageLoop::current()->Run(); | 2176 base::MessageLoop::current()->Run(); |
2177 } | 2177 } |
2178 } | 2178 } |
2179 | 2179 |
2180 IN_PROC_BROWSER_TEST_P(MediaStreamDevicesControllerBrowserTest, | 2180 IN_PROC_BROWSER_TEST_P(MediaStreamDevicesControllerBrowserTest, |
2181 VideoCaptureAllowed) { | 2181 VideoCaptureAllowed) { |
2182 content::MediaStreamDevices video_devices; | 2182 content::MediaStreamDevices video_devices; |
2183 content::MediaStreamDevice fake_video_device( | 2183 content::MediaStreamDevice fake_video_device( |
2184 content::MEDIA_DEVICE_VIDEO_CAPTURE, "fake_dev", "Fake Video Device"); | 2184 content::MEDIA_DEVICE_VIDEO_CAPTURE, "fake_dev", "Fake Video Device"); |
2185 video_devices.push_back(fake_video_device); | 2185 video_devices.push_back(fake_video_device); |
2186 | 2186 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2223 content::BrowserThread::PostTaskAndReply( | 2223 content::BrowserThread::PostTaskAndReply( |
2224 content::BrowserThread::IO, FROM_HERE, | 2224 content::BrowserThread::IO, FROM_HERE, |
2225 base::Bind( | 2225 base::Bind( |
2226 &MediaCaptureDevicesDispatcher::OnVideoCaptureDevicesChanged, | 2226 &MediaCaptureDevicesDispatcher::OnVideoCaptureDevicesChanged, |
2227 base::Unretained(MediaCaptureDevicesDispatcher::GetInstance()), | 2227 base::Unretained(MediaCaptureDevicesDispatcher::GetInstance()), |
2228 video_devices), | 2228 video_devices), |
2229 base::Bind( | 2229 base::Bind( |
2230 &MediaStreamDevicesControllerBrowserTest::FinishVideoTest, | 2230 &MediaStreamDevicesControllerBrowserTest::FinishVideoTest, |
2231 this)); | 2231 this)); |
2232 | 2232 |
2233 MessageLoop::current()->Run(); | 2233 base::MessageLoop::current()->Run(); |
2234 } | 2234 } |
2235 } | 2235 } |
2236 | 2236 |
2237 INSTANTIATE_TEST_CASE_P(MediaStreamDevicesControllerBrowserTestInstance, | 2237 INSTANTIATE_TEST_CASE_P(MediaStreamDevicesControllerBrowserTestInstance, |
2238 MediaStreamDevicesControllerBrowserTest, | 2238 MediaStreamDevicesControllerBrowserTest, |
2239 testing::Bool()); | 2239 testing::Bool()); |
2240 | 2240 |
2241 #if !defined(OS_CHROMEOS) | 2241 #if !defined(OS_CHROMEOS) |
2242 // Similar to PolicyTest but sets the proper policy before the browser is | 2242 // Similar to PolicyTest but sets the proper policy before the browser is |
2243 // started. | 2243 // started. |
(...skipping 20 matching lines...) Expand all Loading... |
2264 chrome_variations::VariationsService::GetVariationsServerURL( | 2264 chrome_variations::VariationsService::GetVariationsServerURL( |
2265 g_browser_process->local_state()); | 2265 g_browser_process->local_state()); |
2266 EXPECT_TRUE(StartsWithASCII(url.spec(), default_variations_url, true)); | 2266 EXPECT_TRUE(StartsWithASCII(url.spec(), default_variations_url, true)); |
2267 std::string value; | 2267 std::string value; |
2268 EXPECT_TRUE(net::GetValueForKeyInQuery(url, "restrict", &value)); | 2268 EXPECT_TRUE(net::GetValueForKeyInQuery(url, "restrict", &value)); |
2269 EXPECT_EQ("restricted", value); | 2269 EXPECT_EQ("restricted", value); |
2270 } | 2270 } |
2271 #endif | 2271 #endif |
2272 | 2272 |
2273 } // namespace policy | 2273 } // namespace policy |
OLD | NEW |