summaryrefslogtreecommitdiff
path: root/src/components/policy/policy_external/test/policy_manager_impl_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/policy/policy_external/test/policy_manager_impl_test.cc')
-rw-r--r--src/components/policy/policy_external/test/policy_manager_impl_test.cc31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/components/policy/policy_external/test/policy_manager_impl_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_test.cc
index 6521db7c36..1916e09efc 100644
--- a/src/components/policy/policy_external/test/policy_manager_impl_test.cc
+++ b/src/components/policy/policy_external/test/policy_manager_impl_test.cc
@@ -345,6 +345,37 @@ TEST_F(PolicyManagerImplTest2, GetCurrentDeviceId) {
EXPECT_EQ("", policy_manager_->GetCurrentDeviceId(app_id_2_));
}
+TEST_F(PolicyManagerImplTest2, UpdateApplication_AppServices) {
+ // Arrange
+ std::string kServiceType = "MEDIA";
+ CreateLocalPT(preloaded_pt_filename_);
+ EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
+ GetPTU("json/valid_sdl_pt_update.json");
+ EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
+ // Try to add existing app
+ policy_table::AppServiceParameters app_service_parameters =
+ policy_table::AppServiceParameters();
+ policy_manager_->GetAppServiceParameters(app_id_2_, &app_service_parameters);
+
+ ASSERT_FALSE(app_service_parameters.find(kServiceType) ==
+ app_service_parameters.end());
+
+ auto service_names = *(app_service_parameters[kServiceType].service_names);
+
+ ASSERT_TRUE(service_names.is_initialized());
+ ASSERT_EQ(service_names.size(), 2u);
+ EXPECT_EQ(static_cast<std::string>(service_names[0]), "SDL App");
+ EXPECT_EQ(static_cast<std::string>(service_names[1]), "SDL Music");
+
+ auto handled_rpcs = app_service_parameters[kServiceType].handled_rpcs;
+
+ ASSERT_TRUE(handled_rpcs.is_initialized());
+ EXPECT_EQ(handled_rpcs[0].function_id, 41);
+
+ // Check no update required
+ EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
+}
+
TEST_F(
PolicyManagerImplTest_ExternalConsent,
ExternalConsent_SetExternalConsentStatusWhileAppExists_ExpectUserConsentsUpdateForApp) {