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

Unified Diff: components/copresence/rpc/rpc_handler_unittest.cc

Issue 600843004: Setting AudioConfiguration and deleting DeviceCapabilities hacks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Correcting DeviceCapabilities Created 6 years, 3 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 | « components/copresence/rpc/rpc_handler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/copresence/rpc/rpc_handler_unittest.cc
diff --git a/components/copresence/rpc/rpc_handler_unittest.cc b/components/copresence/rpc/rpc_handler_unittest.cc
index db96f4e8be21c59f2c970b6941164e90508a5f56..86febf12530a5afb9de17c4cde1fc7f6cff98924 100644
--- a/components/copresence/rpc/rpc_handler_unittest.cc
+++ b/components/copresence/rpc/rpc_handler_unittest.cc
@@ -27,20 +27,6 @@ namespace {
const char kChromeVersion[] = "Chrome Version String";
-void AddMessageWithStrategy(ReportRequest* report,
- BroadcastScanConfiguration strategy) {
- report->mutable_manage_messages_request()->add_message_to_publish()
- ->mutable_token_exchange_strategy()->set_broadcast_scan_configuration(
- strategy);
-}
-
-void AddSubscriptionWithStrategy(ReportRequest* report,
- BroadcastScanConfiguration strategy) {
- report->mutable_manage_subscriptions_request()->add_subscription()
- ->mutable_token_exchange_strategy()->set_broadcast_scan_configuration(
- strategy);
-}
-
void CreateSubscribedMessage(const std::vector<std::string>& subscription_ids,
const std::string& message_string,
SubscribedMessage* message_proto) {
@@ -201,54 +187,6 @@ TEST_F(RpcHandlerTest, Initialize) {
EXPECT_FALSE(identity.chrome_id().empty());
}
-TEST_F(RpcHandlerTest, GetDeviceCapabilities) {
- // Empty request.
- rpc_handler_.SendReportRequest(make_scoped_ptr(new ReportRequest));
- EXPECT_EQ(RpcHandler::kReportRequestRpcName, rpc_name_);
- const TokenTechnology* token_technology = &GetTokenTechnologyFromReport();
- EXPECT_EQ(AUDIO_ULTRASOUND_PASSBAND, token_technology->medium());
- EXPECT_EQ(TRANSMIT, token_technology->instruction_type(0));
- EXPECT_EQ(RECEIVE, token_technology->instruction_type(1));
-
- // Request with broadcast only.
- scoped_ptr<ReportRequest> report(new ReportRequest);
- AddMessageWithStrategy(report.get(), BROADCAST_ONLY);
- rpc_handler_.SendReportRequest(report.Pass());
- token_technology = &GetTokenTechnologyFromReport();
- EXPECT_EQ(1, token_technology->instruction_type_size());
- EXPECT_EQ(TRANSMIT, token_technology->instruction_type(0));
- EXPECT_FALSE(GetReportSent()->has_manage_subscriptions_request());
-
- // Request with scan only.
- report.reset(new ReportRequest);
- AddSubscriptionWithStrategy(report.get(), SCAN_ONLY);
- AddSubscriptionWithStrategy(report.get(), SCAN_ONLY);
- rpc_handler_.SendReportRequest(report.Pass());
- token_technology = &GetTokenTechnologyFromReport();
- EXPECT_EQ(1, token_technology->instruction_type_size());
- EXPECT_EQ(RECEIVE, token_technology->instruction_type(0));
- EXPECT_FALSE(GetReportSent()->has_manage_messages_request());
-
- // Request with both scan and broadcast only (conflict).
- report.reset(new ReportRequest);
- AddMessageWithStrategy(report.get(), SCAN_ONLY);
- AddMessageWithStrategy(report.get(), BROADCAST_ONLY);
- AddSubscriptionWithStrategy(report.get(), BROADCAST_ONLY);
- rpc_handler_.SendReportRequest(report.Pass());
- token_technology = &GetTokenTechnologyFromReport();
- EXPECT_EQ(TRANSMIT, token_technology->instruction_type(0));
- EXPECT_EQ(RECEIVE, token_technology->instruction_type(1));
-
- // Request with broadcast and scan.
- report.reset(new ReportRequest);
- AddMessageWithStrategy(report.get(), SCAN_ONLY);
- AddSubscriptionWithStrategy(report.get(), BROADCAST_AND_SCAN);
- rpc_handler_.SendReportRequest(report.Pass());
- token_technology = &GetTokenTechnologyFromReport();
- EXPECT_EQ(TRANSMIT, token_technology->instruction_type(0));
- EXPECT_EQ(RECEIVE, token_technology->instruction_type(1));
-}
-
TEST_F(RpcHandlerTest, CreateRequestHeader) {
SetDeviceId("CreateRequestHeader Device ID");
rpc_handler_.SendReportRequest(make_scoped_ptr(new ReportRequest),
« no previous file with comments | « components/copresence/rpc/rpc_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698