| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "android_webview/native/permission/media_access_permission_request.h" | 5 #include "android_webview/native/permission/media_access_permission_request.h" |
| 6 #include "base/bind.h" | 6 #include "base/bind.h" |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 | 8 |
| 9 namespace android_webview { | 9 namespace android_webview { |
| 10 | 10 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 0, 0, 0, origin, false, content::MEDIA_GENERATE_STREAM, audio_id, | 54 0, 0, 0, origin, false, content::MEDIA_GENERATE_STREAM, audio_id, |
| 55 video_id, content::MEDIA_DEVICE_AUDIO_CAPTURE, | 55 video_id, content::MEDIA_DEVICE_AUDIO_CAPTURE, |
| 56 content::MEDIA_DEVICE_VIDEO_CAPTURE); | 56 content::MEDIA_DEVICE_VIDEO_CAPTURE); |
| 57 | 57 |
| 58 scoped_ptr<TestMediaAccessPermissionRequest> permission_request; | 58 scoped_ptr<TestMediaAccessPermissionRequest> permission_request; |
| 59 permission_request.reset(new TestMediaAccessPermissionRequest( | 59 permission_request.reset(new TestMediaAccessPermissionRequest( |
| 60 request, | 60 request, |
| 61 base::Bind(&MediaAccessPermissionRequestTest::Callback, | 61 base::Bind(&MediaAccessPermissionRequestTest::Callback, |
| 62 base::Unretained(this)), | 62 base::Unretained(this)), |
| 63 audio_devices, video_devices)); | 63 audio_devices, video_devices)); |
| 64 return permission_request.Pass(); | 64 return permission_request; |
| 65 } | 65 } |
| 66 | 66 |
| 67 std::string audio_device_id_; | 67 std::string audio_device_id_; |
| 68 std::string video_device_id_; | 68 std::string video_device_id_; |
| 69 std::string first_audio_device_id_; | 69 std::string first_audio_device_id_; |
| 70 std::string first_video_device_id_; | 70 std::string first_video_device_id_; |
| 71 content::MediaStreamDevices devices_; | 71 content::MediaStreamDevices devices_; |
| 72 content::MediaStreamRequestResult result_; | 72 content::MediaStreamRequestResult result_; |
| 73 private: | 73 private: |
| 74 void Callback( | 74 void Callback( |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 | 130 |
| 131 TEST_F(MediaAccessPermissionRequestTest, TestDenyPermissionRequest) { | 131 TEST_F(MediaAccessPermissionRequestTest, TestDenyPermissionRequest) { |
| 132 scoped_ptr<TestMediaAccessPermissionRequest> request = | 132 scoped_ptr<TestMediaAccessPermissionRequest> request = |
| 133 CreateRequest(std::string(), std::string()); | 133 CreateRequest(std::string(), std::string()); |
| 134 request->NotifyRequestResult(false); | 134 request->NotifyRequestResult(false); |
| 135 EXPECT_TRUE(devices_.empty()); | 135 EXPECT_TRUE(devices_.empty()); |
| 136 EXPECT_EQ(content::MEDIA_DEVICE_PERMISSION_DENIED, result_); | 136 EXPECT_EQ(content::MEDIA_DEVICE_PERMISSION_DENIED, result_); |
| 137 } | 137 } |
| 138 | 138 |
| 139 } // namespace android_webview | 139 } // namespace android_webview |
| OLD | NEW |