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

Unified Diff: chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_apitest.cc

Issue 264793017: Implements RTP header dumping. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix leak Created 6 years, 7 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/extensions/api/webrtc_logging_private/webrtc_logging_private_apitest.cc
diff --git a/chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_apitest.cc b/chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_apitest.cc
index 37df1c81d92e5a178846594a268e251ad6f021a4..e7ca2f13ae5e665000acbdf84bd03a72b12ccd68 100644
--- a/chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_apitest.cc
+++ b/chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_apitest.cc
@@ -276,3 +276,38 @@ IN_PROC_BROWSER_TEST_F(WebrtcLoggingPrivateApiTest, TestStartStopUpload) {
g_browser_process->webrtc_log_uploader()->OverrideUploadWithBufferForTesting(
NULL);
}
+
+IN_PROC_BROWSER_TEST_F(WebrtcLoggingPrivateApiTest, TestStartStopRtpDump) {
+ scoped_refptr<Extension> empty_extension(utils::CreateEmptyExtension());
+
+ // Start RTP dump.
+ scoped_refptr<extensions::WebrtcLoggingPrivateStartRtpDumpFunction>
+ start_function(
+ new extensions::WebrtcLoggingPrivateStartRtpDumpFunction());
+ start_function->set_extension(empty_extension.get());
+ start_function->set_has_callback(true);
+
+ content::WebContents* contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
+ base::ListValue parameters;
+ parameters.AppendInteger(extensions::ExtensionTabUtil::GetTabId(contents));
+ parameters.AppendString(contents->GetURL().GetOrigin().spec());
+ parameters.AppendBoolean(true);
+ parameters.AppendBoolean(true);
+ std::string parameter_string;
+ base::JSONWriter::Write(&parameters, &parameter_string);
+
+ scoped_ptr<base::Value> result(utils::RunFunctionAndReturnSingleResult(
+ start_function.get(), parameter_string, browser()));
+ ASSERT_FALSE(result.get());
+
+ // Stop RTP dump.
+ scoped_refptr<extensions::WebrtcLoggingPrivateStopRtpDumpFunction>
+ stop_function(new extensions::WebrtcLoggingPrivateStopRtpDumpFunction());
+ stop_function->set_extension(empty_extension.get());
+ stop_function->set_has_callback(true);
+
+ result.reset(utils::RunFunctionAndReturnSingleResult(
+ stop_function.get(), parameter_string, browser()));
+ ASSERT_FALSE(result.get());
+}

Powered by Google App Engine
This is Rietveld 408576698