Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2136)

Unified Diff: chrome/browser/media/webrtc/media_stream_devices_controller_browsertest.cc

Issue 2746853002: Change MediaStreamDevicesController::RequestPermissions to use the requesting WebContents (Closed)
Patch Set: Change MediaStreamDevicesController::RequestPermissions to use the requesting WebContents Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/media/webrtc/media_stream_devices_controller_browsertest.cc
diff --git a/chrome/browser/media/webrtc/media_stream_devices_controller_browsertest.cc b/chrome/browser/media/webrtc/media_stream_devices_controller_browsertest.cc
index 48c3e4c09d599a400b4f149d335f3cc7e6715d65..7526eeefd9e901ad05c8ee1e1d980d262f587be0 100644
--- a/chrome/browser/media/webrtc/media_stream_devices_controller_browsertest.cc
+++ b/chrome/browser/media/webrtc/media_stream_devices_controller_browsertest.cc
@@ -24,6 +24,7 @@
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/prefs/pref_service.h"
#include "components/variations/variations_associated_data.h"
+#include "content/public/browser/render_frame_host.h"
#include "content/public/common/media_stream_request.h"
#include "content/public/test/mock_render_process_host.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -106,7 +107,7 @@ class MediaStreamDevicesControllerTest : public WebRtcTestBase {
const content::MediaStreamRequest& request,
const content::MediaResponseCallback& callback) {
MediaStreamDevicesController::RequestPermissionsWithDelegate(
- web_contents, request, callback, &prompt_delegate_);
+ request, callback, &prompt_delegate_);
}
TestPermissionPromptDelegate* prompt_delegate() { return &prompt_delegate_; }
@@ -169,9 +170,13 @@ class MediaStreamDevicesControllerTest : public WebRtcTestBase {
content::MediaStreamType video_type =
video_id.empty() ? content::MEDIA_NO_SERVICE
: content::MEDIA_DEVICE_VIDEO_CAPTURE;
- return content::MediaStreamRequest(0, 0, 0, example_url(), false,
- request_type, audio_id, video_id,
- audio_type, video_type, false);
+ EXPECT_EQ(example_url(),
+ GetWebContents()->GetMainFrame()->GetLastCommittedURL());
+ int render_process_id = GetWebContents()->GetRenderProcessHost()->GetID();
+ int render_frame_id = GetWebContents()->GetMainFrame()->GetRoutingID();
+ return content::MediaStreamRequest(
+ render_process_id, render_frame_id, 0, example_url(), false,
+ request_type, audio_id, video_id, audio_type, video_type, false);
}
content::MediaStreamRequest CreateRequest(const std::string& audio_id,

Powered by Google App Engine
This is Rietveld 408576698