mirror of
https://gitee.com/openharmony/bundlemanager_app_domain_verify
synced 2024-12-28 19:44:12 +00:00
commit
17d2aaf888
@ -423,4 +423,17 @@ HWTEST_F(AppDomainVerifyBeanParcelTest, AppDomainVerifyBeanParcelTest0010, TestS
|
||||
APP_DOMAIN_VERIFY_HILOGE(APP_DOMAIN_VERIFY_MODULE_COMMON, "AppDomainVerifyBeanParcelTest002 end");
|
||||
printf("AppDomainVerifyBeanParcelTest001 end\n");
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: AppDomainVerifyBeanParcelTest0011
|
||||
* @tc.desc: Dump test.
|
||||
* @tc.type: FUNC
|
||||
*/
|
||||
HWTEST_F(AppDomainVerifyBeanParcelTest, AppDomainVerifyBeanParcelTest0011, TestSize.Level0)
|
||||
{
|
||||
VerifyResultInfo verifyResultInfo;
|
||||
verifyResultInfo.appIdentifier = APP_IDENTIFIER;
|
||||
std::string result = verifyResultInfo.Dump();
|
||||
ASSERT_TRUE(result == "appIdentifier:appIdentifier\n");
|
||||
}
|
||||
}
|
||||
|
@ -66,4 +66,15 @@ bool AppDomainVerifyRdbDataManager::CheckRdbStoreExist(const std::shared_ptr<Nat
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool AppDomainVerifyRdbDataManager::QueryDomainByBundleName(
|
||||
const std::string& bundleName, std::vector<RdbDataItem>& items)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool AppDomainVerifyRdbDataManager::QueryBundleNameByDomain(const std::string& domain, std::vector<RdbDataItem>& items)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -487,4 +487,29 @@ HWTEST_F(MgrDataMgrTest, MgrDataMgrLoadAllFromRdbTest005, TestSize.Level0)
|
||||
ASSERT_TRUE(appDomainVerifyDataMgr->LoadAllFromRdb());
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: QueryAssociatedDomainsTest006
|
||||
* @tc.desc: QueryAssociatedDomains
|
||||
* @tc.type: FUNC
|
||||
*/
|
||||
HWTEST_F(MgrDataMgrTest, QueryAssociatedDomainsTest006, TestSize.Level0)
|
||||
{
|
||||
auto appDomainVerifyDataMgr = std::make_shared<AppDomainVerifyDataMgr>();
|
||||
std::string bundleName;
|
||||
std::vector<std::string> domains;
|
||||
ASSERT_FALSE(appDomainVerifyDataMgr->QueryAssociatedDomains(bundleName, domains));
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: QueryAssociatedBundleNamesTest007
|
||||
* @tc.desc: QueryAssociatedBundleNames
|
||||
* @tc.type: FUNC
|
||||
*/
|
||||
HWTEST_F(MgrDataMgrTest, QueryAssociatedBundleNamesTest007, TestSize.Level0)
|
||||
{
|
||||
auto appDomainVerifyDataMgr = std::make_shared<AppDomainVerifyDataMgr>();
|
||||
std::string domain;
|
||||
std::vector<std::string> bundleNames;
|
||||
ASSERT_FALSE(appDomainVerifyDataMgr->QueryAssociatedBundleNames(domain, bundleNames));
|
||||
}
|
||||
}
|
@ -35,6 +35,7 @@
|
||||
#include "system_ability_definition.h"
|
||||
#include "app_domain_verify_parcel_util.h"
|
||||
#include "mock_convert_callback.h"
|
||||
#include "permission_manager.h"
|
||||
|
||||
namespace OHOS::AppDomainVerify {
|
||||
using namespace testing;
|
||||
@ -658,4 +659,89 @@ HWTEST_F(MgrServiceTest, MgrServiceTest034, TestSize.Level0)
|
||||
bundleName, std::make_tuple(InnerVerifyStatus::STATE_FAIL, std::string(), 0));
|
||||
EXPECT_FALSE(appDomainVerifyMgrService->SaveDomainVerifyStatus(bundleName, verifyResultInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: CheckPermission035
|
||||
* @tc.desc: CheckPermission
|
||||
* @tc.type: FUNC
|
||||
*/
|
||||
HWTEST_F(MgrServiceTest, CheckPermission035, TestSize.Level0)
|
||||
{
|
||||
std::string permission;
|
||||
EXPECT_FALSE(PermissionManager::CheckPermission(permission));
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: IsSystemAppCall036
|
||||
* @tc.desc: IsSystemAppCall
|
||||
* @tc.type: FUNC
|
||||
*/
|
||||
HWTEST_F(MgrServiceTest, IsSystemAppCall036, TestSize.Level0)
|
||||
{
|
||||
EXPECT_TRUE(PermissionManager::IsSystemAppCall());
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: MgrServiceTest037
|
||||
* @tc.desc: QueryAssociatedDomains
|
||||
* @tc.type: FUNC
|
||||
*/
|
||||
HWTEST_F(MgrServiceTest, MgrServiceTest037, TestSize.Level0)
|
||||
{
|
||||
ASSERT_TRUE(appDomainVerifyMgrService);
|
||||
ASSERT_TRUE(appDomainVerifyMgrService->dataManager_);
|
||||
std::string bundleName;
|
||||
std::vector<std::string> domains;
|
||||
EXPECT_EQ(appDomainVerifyMgrService->QueryAssociatedDomains(bundleName, domains), 201);
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: MgrServiceTest038
|
||||
* @tc.desc: QueryAssociatedBundleNames
|
||||
* @tc.type: FUNC
|
||||
*/
|
||||
HWTEST_F(MgrServiceTest, MgrServiceTest038, TestSize.Level0)
|
||||
{
|
||||
ASSERT_TRUE(appDomainVerifyMgrService);
|
||||
ASSERT_TRUE(appDomainVerifyMgrService->dataManager_);
|
||||
std::string domain;
|
||||
std::vector<std::string> bundleNames;
|
||||
EXPECT_EQ(appDomainVerifyMgrService->QueryAssociatedBundleNames(domain, bundleNames), 201);
|
||||
}
|
||||
|
||||
/**
|
||||
* @tc.name: MgrServiceVerifyDomainTest039
|
||||
* @tc.desc: OnUpdateWhiteListUrls
|
||||
* @tc.type: FUNC
|
||||
*/
|
||||
HWTEST_F(MgrServiceTest, MgrServiceVerifyDomainTest039, TestSize.Level0)
|
||||
{
|
||||
std::string appIdentifier = "appIdentifier";
|
||||
std::string bundleName = "bundleName";
|
||||
std::string fingerprint = "fingerprint";
|
||||
|
||||
std::vector<SkillUri> skillUris;
|
||||
SkillUri skillUri;
|
||||
skillUris.push_back(skillUri);
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
WRITE_PARCEL_AND_RETURN_IF_FAIL(InterfaceToken, data, std::u16string(u"abc"));
|
||||
WRITE_PARCEL_AND_RETURN_IF_FAIL(String, data, appIdentifier);
|
||||
WRITE_PARCEL_AND_RETURN_IF_FAIL(String, data, bundleName);
|
||||
WRITE_PARCEL_AND_RETURN_IF_FAIL(String, data, fingerprint);
|
||||
|
||||
uint32_t size = static_cast<uint32_t>(skillUris.size());
|
||||
WRITE_PARCEL_AND_RETURN_IF_FAIL(Uint32, data, size);
|
||||
|
||||
int32_t error = appDomainVerifyMgrService->OnRemoteRequest(
|
||||
AppDomainVerifyMgrInterfaceCode::UPDATE_WHITE_LIST_URLS, data, reply, option);
|
||||
ASSERT_TRUE(error != ERR_OK);
|
||||
error = appDomainVerifyMgrService->OnRemoteRequest(
|
||||
AppDomainVerifyMgrInterfaceCode::QUERY_ASSOCIATED_DOMAINS, data, reply, option);
|
||||
ASSERT_TRUE(error != ERR_OK);
|
||||
error = appDomainVerifyMgrService->OnRemoteRequest(
|
||||
AppDomainVerifyMgrInterfaceCode::QUERY_ASSOCIATED_BUNDLE_NAMES, data, reply, option);
|
||||
ASSERT_TRUE(error != ERR_OK);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user