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(¶meters, ¶meter_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()); |
+} |