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

Unified Diff: chrome/browser/ui/webui/media_router/media_router_webui_message_handler_unittest.cc

Issue 1950223002: [Media Router WebUI] Don't let pseudo sinks alone show user email. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « chrome/browser/ui/webui/media_router/media_router_webui_message_handler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/media_router/media_router_webui_message_handler_unittest.cc
diff --git a/chrome/browser/ui/webui/media_router/media_router_webui_message_handler_unittest.cc b/chrome/browser/ui/webui/media_router/media_router_webui_message_handler_unittest.cc
index 27174ea43668b82616d2e00f820d43bd9dd45393..725beb2aa258ee4c045f2faa1f93c25ac2b146ad 100644
--- a/chrome/browser/ui/webui/media_router/media_router_webui_message_handler_unittest.cc
+++ b/chrome/browser/ui/webui/media_router/media_router_webui_message_handler_unittest.cc
@@ -189,6 +189,34 @@ TEST_F(MediaRouterWebUIMessageHandlerTest, UpdateSinksWithIdentity) {
EXPECT_EQ(kUserEmailForTesting, value);
}
+TEST_F(MediaRouterWebUIMessageHandlerTest,
+ UpdateSinksWithIdentityAndPseudoSink) {
+ MediaSink::Id sink_id("pseudo:sinkId123");
+ std::string sink_name("The sink");
+
+ std::vector<MediaSinkWithCastModes> media_sink_with_cast_modes_list;
+ MediaSinkWithCastModes media_sink_with_cast_modes(
+ MediaSink(sink_id, sink_name, MediaSink::IconType::CAST));
+ media_sink_with_cast_modes.sink.set_domain(kUserDomainForTesting);
+ media_sink_with_cast_modes.cast_modes.insert(MediaCastMode::TAB_MIRROR);
+ media_sink_with_cast_modes_list.push_back(media_sink_with_cast_modes);
+
+ handler_->UpdateSinks(media_sink_with_cast_modes_list);
+ EXPECT_EQ(1u, web_ui_->call_data().size());
+ const content::TestWebUI::CallData& call_data = *web_ui_->call_data()[0];
+ EXPECT_EQ("media_router.ui.setSinkListAndIdentity",
+ call_data.function_name());
+ const base::Value* arg1 = call_data.arg1();
+ const base::DictionaryValue* sinks_with_identity_value = nullptr;
+ ASSERT_TRUE(arg1->GetAsDictionary(&sinks_with_identity_value));
+
+ bool show_email = false;
+ bool actual_show_email = true;
+ EXPECT_TRUE(
+ sinks_with_identity_value->GetBoolean("showEmail", &actual_show_email));
+ EXPECT_EQ(show_email, actual_show_email);
+}
+
TEST_F(MediaRouterWebUIMessageHandlerTest, UpdateSinksWithIdentityAndDomain) {
MediaSink::Id sink_id("sinkId123");
std::string sink_name("The sink");
« no previous file with comments | « chrome/browser/ui/webui/media_router/media_router_webui_message_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698