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

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

Issue 1245213002: [MediaRouter] Implement send binary message from PSDImpl to MRPManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pass scoped_ptr<>, avoid copying Created 5 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
Index: chrome/browser/media/router/media_router_mojo_impl_unittest.cc
diff --git a/chrome/browser/media/router/media_router_mojo_impl_unittest.cc b/chrome/browser/media/router/media_router_mojo_impl_unittest.cc
index c62926952cbab8af3c4e67f9684ffdbee103e2a0..106d4d31e0490f4d94d472970dac37b5212956cc 100644
--- a/chrome/browser/media/router/media_router_mojo_impl_unittest.cc
+++ b/chrome/browser/media/router/media_router_mojo_impl_unittest.cc
@@ -390,6 +390,29 @@ TEST_F(MediaRouterMojoImplTest, SendRouteMessage) {
ProcessEventLoop();
}
+TEST_F(MediaRouterMojoImplTest, SendRouteBinaryMessage) {
+ scoped_ptr<std::vector<uint8>> expected_binary_data(
+ new std::vector<uint8_t>(8, 1));
+
+ EXPECT_CALL(mock_media_route_provider_,
+ SendRouteBinaryMessageInternal(
+ mojo::String(kRouteId),
+ std::vector<uint8>(*expected_binary_data.get()), _))
+ .WillOnce(Invoke([](
+ const MediaRoute::Id& route_id, const std::vector<uint8>& data,
+ const interfaces::MediaRouteProvider::SendRouteMessageCallback& cb) {
+ cb.Run(true);
+ }));
+
+ SendMessageCallbackHandler handler;
+ EXPECT_CALL(handler, Invoke(true));
+ router()->SendRouteBinaryMessage(
+ kRouteId, expected_binary_data.Pass(),
+ base::Bind(&SendMessageCallbackHandler::Invoke,
+ base::Unretained(&handler)));
+ ProcessEventLoop();
+}
+
TEST_F(MediaRouterMojoImplTest, ListenForRouteMessages) {
mojo::Array<interfaces::RouteMessagePtr> mojo_messages(2);
mojo_messages[0] = interfaces::RouteMessage::New();

Powered by Google App Engine
This is Rietveld 408576698