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

Unified Diff: content/browser/media/webrtc_internals_browsertest.cc

Issue 405683003: Adds the UserMedia requests to the UI of chrome://webrtc-internals. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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
« no previous file with comments | « no previous file | content/browser/resources/media/tab_view.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/media/webrtc_internals_browsertest.cc
diff --git a/content/browser/media/webrtc_internals_browsertest.cc b/content/browser/media/webrtc_internals_browsertest.cc
index 7b352d66b2448d514a684650c5f846fabd510216..6504d3b747433ec6f7d47464f97ce09b09750695 100644
--- a/content/browser/media/webrtc_internals_browsertest.cc
+++ b/content/browser/media/webrtc_internals_browsertest.cc
@@ -232,7 +232,7 @@ class MAYBE_WebRtcInternalsBrowserTest: public ContentBrowserTest {
ASSERT_TRUE(ExecuteScriptAndExtractString(
shell()->web_contents(),
"window.domAutomationController.send("
- "JSON.stringify(userMediaRequests));",
+ "JSON.stringify(userMediaRequests));",
&json_requests));
scoped_ptr<base::Value> value_requests;
value_requests.reset(base::JSONReader::Read(json_requests));
@@ -259,6 +259,24 @@ class MAYBE_WebRtcInternalsBrowserTest: public ContentBrowserTest {
EXPECT_EQ(requests[i].audio_constraints, audio);
EXPECT_EQ(requests[i].video_constraints, video);
}
+
+ bool user_media_tab_existed = false;
+ ASSERT_TRUE(ExecuteScriptAndExtractBool(
+ shell()->web_contents(),
+ "window.domAutomationController.send("
+ "$('user-media-tab-id') != null);",
+ &user_media_tab_existed));
+ EXPECT_EQ(!requests.empty(), user_media_tab_existed);
+
+ if (user_media_tab_existed) {
+ int user_media_request_count = -1;
+ ASSERT_TRUE(ExecuteScriptAndExtractInt(
+ shell()->web_contents(),
+ "window.domAutomationController.send("
+ "$('user-media-tab-id').childNodes.length);",
+ &user_media_request_count));
+ ASSERT_EQ(requests.size(), static_cast<size_t>(user_media_request_count));
+ }
}
// Verifies that DOM for |pc| is correctly created with the right content.
« no previous file with comments | « no previous file | content/browser/resources/media/tab_view.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698