| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
| 9 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 9 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
| 10 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 10 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 const std::string& video_id, | 129 const std::string& video_id, |
| 130 content::MediaStreamRequestType request_type) { | 130 content::MediaStreamRequestType request_type) { |
| 131 content::MediaStreamType audio_type = | 131 content::MediaStreamType audio_type = |
| 132 audio_id.empty() ? content::MEDIA_NO_SERVICE | 132 audio_id.empty() ? content::MEDIA_NO_SERVICE |
| 133 : content::MEDIA_DEVICE_AUDIO_CAPTURE; | 133 : content::MEDIA_DEVICE_AUDIO_CAPTURE; |
| 134 content::MediaStreamType video_type = | 134 content::MediaStreamType video_type = |
| 135 video_id.empty() ? content::MEDIA_NO_SERVICE | 135 video_id.empty() ? content::MEDIA_NO_SERVICE |
| 136 : content::MEDIA_DEVICE_VIDEO_CAPTURE; | 136 : content::MEDIA_DEVICE_VIDEO_CAPTURE; |
| 137 return content::MediaStreamRequest(0, 0, 0, example_url(), false, | 137 return content::MediaStreamRequest(0, 0, 0, example_url(), false, |
| 138 request_type, audio_id, video_id, | 138 request_type, audio_id, video_id, |
| 139 audio_type, video_type); | 139 audio_type, video_type, false); |
| 140 } | 140 } |
| 141 | 141 |
| 142 content::MediaStreamRequest CreateRequest(const std::string& audio_id, | 142 content::MediaStreamRequest CreateRequest(const std::string& audio_id, |
| 143 const std::string& video_id) { | 143 const std::string& video_id) { |
| 144 return CreateRequestWithType(audio_id, video_id, | 144 return CreateRequestWithType(audio_id, video_id, |
| 145 content::MEDIA_DEVICE_ACCESS); | 145 content::MEDIA_DEVICE_ACCESS); |
| 146 } | 146 } |
| 147 | 147 |
| 148 void InitWithUrl(const GURL& url) { | 148 void InitWithUrl(const GURL& url) { |
| 149 DCHECK(example_url_.is_empty()); | 149 DCHECK(example_url_.is_empty()); |
| (...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 726 MediaStreamDevicesController controller( | 726 MediaStreamDevicesController controller( |
| 727 GetWebContents(), CreateRequest(example_audio_id(), example_video_id()), | 727 GetWebContents(), CreateRequest(example_audio_id(), example_video_id()), |
| 728 base::Bind(&MediaStreamDevicesControllerTest::OnMediaStreamResponse, | 728 base::Bind(&MediaStreamDevicesControllerTest::OnMediaStreamResponse, |
| 729 base::Unretained(this))); | 729 base::Unretained(this))); |
| 730 | 730 |
| 731 EXPECT_FALSE(controller.IsAllowedForAudio()); | 731 EXPECT_FALSE(controller.IsAllowedForAudio()); |
| 732 EXPECT_FALSE(controller.IsAllowedForVideo()); | 732 EXPECT_FALSE(controller.IsAllowedForVideo()); |
| 733 EXPECT_FALSE(controller.IsAskingForAudio()); | 733 EXPECT_FALSE(controller.IsAskingForAudio()); |
| 734 EXPECT_FALSE(controller.IsAskingForVideo()); | 734 EXPECT_FALSE(controller.IsAskingForVideo()); |
| 735 } | 735 } |
| OLD | NEW |