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

Unified Diff: chrome/browser/media/router/test_helper.cc

Issue 2947403004: [MediaRouter] Replace RouteMessage with PresentationConnectionMessage (Closed)
Patch Set: rebase Created 3 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 | « chrome/browser/media/router/test_helper.h ('k') | chrome/common/media_router/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media/router/test_helper.cc
diff --git a/chrome/browser/media/router/test_helper.cc b/chrome/browser/media/router/test_helper.cc
index b41874300c6663ae1737894d5d5cb70c1520e606..17122d423979f063ea2f41ed9b32aee6a05e1c2b 100644
--- a/chrome/browser/media/router/test_helper.cc
+++ b/chrome/browser/media/router/test_helper.cc
@@ -4,10 +4,30 @@
#include "chrome/browser/media/router/test_helper.h"
+#include "base/base64.h"
+#include "base/json/string_escape.h"
#include "chrome/common/media_router/media_source.h"
namespace media_router {
+std::string PresentationConnectionMessageToString(
+ const content::PresentationConnectionMessage& message) {
+ if (!message.message && !message.data)
+ return "null";
+ std::string result;
+ if (message.message) {
+ result = "text=";
+ base::EscapeJSONString(*message.message, true, &result);
+ } else {
+ const base::StringPiece src(
+ reinterpret_cast<const char*>(message.data->data()),
+ message.data->size());
+ base::Base64Encode(src, &result);
+ result = "binary=" + result;
+ }
+ return result;
+}
+
MockIssuesObserver::MockIssuesObserver(MediaRouter* router)
: IssuesObserver(router) {}
MockIssuesObserver::~MockIssuesObserver() {}
« no previous file with comments | « chrome/browser/media/router/test_helper.h ('k') | chrome/common/media_router/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698