提交 356b75fb 编写于 作者: O openharmony_ci 提交者: Gitee

!725 L1/L2 敏感词 社区许可证头 版权头修改

Merge pull request !725 from jiyong/master
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export default {
onCreate() {
console.info('AceApplication onCreate');
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import file from '@system.file'
import {Core, ExpectExtend} from 'deccjsunit/index'
......
......@@ -146,7 +146,7 @@ protected:
bool uninstallResult = false;
sem_init(&g_sem, 0, 0);
InstallParam installParam = { .installLocation = 1, .keepData = false };
uninstallResult = Uninstall("com.huawei.testnative", &installParam, TestBundleStateCallback);
uninstallResult = Uninstall("com.openharmony.testnative", &installParam, TestBundleStateCallback);
sem_wait(&g_sem);
if (uninstallResult) {
printf("sem exit \n");
......@@ -207,14 +207,14 @@ HWTEST_F(AbilityMgrTest, testSetWantElement, Function | MediumTest | Level0)
Want want = { nullptr };
ElementName element = { nullptr };
SetElementDeviceID(&element, "0001000");
SetElementBundleName(&element, "com.huawei.testnative");
SetElementBundleName(&element, "com.openharmony.testnative");
SetElementAbilityName(&element, "SecondAbility");
if (element.abilityName != nullptr) {
bool setResult = SetWantElement(&want, element);
if (setResult) {
EXPECT_STREQ(want.element->deviceId, "0001000");
EXPECT_STREQ(want.element->abilityName, "SecondAbility");
EXPECT_STREQ(want.element->bundleName, "com.huawei.testnative");
EXPECT_STREQ(want.element->bundleName, "com.openharmony.testnative");
}
}
ClearElement(&element);
......@@ -280,14 +280,14 @@ HWTEST_F(AbilityMgrTest, testWantToUri, Function | MediumTest | Level0)
Want want = { nullptr };
ElementName element = { nullptr };
SetElementDeviceID(&element, "0001000");
SetElementBundleName(&element, "com.huawei.testnative");
SetElementBundleName(&element, "com.openharmony.testnative");
SetElementAbilityName(&element, "SecondAbility");
if (element.abilityName !=nullptr) {
bool setResult = SetWantElement(&want, element);
if (setResult) {
const char *uri = WantToUri(want);
printf("uri is %s \n", uri);
const char *expectResult = "#Want;device=0001000;bundle=com.huawei.testnative;ability=SecondAbility;end";
const char *expectResult = "#Want;device=0001000;bundle=com.openharmony.testnative;ability=SecondAbility;end";
EXPECT_STREQ(uri, expectResult);
free((void*)uri);
}
......@@ -367,7 +367,7 @@ HWTEST_F(AbilityMgrTest, testWantParseUri, Function | MediumTest | Level0)
Want want = { nullptr };
ElementName element = { nullptr };
SetElementDeviceID(&element, "0001000");
SetElementBundleName(&element, "com.huawei.testnative");
SetElementBundleName(&element, "com.openharmony.testnative");
SetElementAbilityName(&element, "SecondAbility");
if (element.abilityName != nullptr) {
bool setResult = SetWantElement(&want, element);
......@@ -446,7 +446,7 @@ HWTEST_F(AbilityMgrTest, testGetBundleNameIllegal, Function | MediumTest | Level
memset_s(&want, sizeof(Want), 0, sizeof(Want));
ElementName element;
memset_s(&element, sizeof(ElementName), 0, sizeof(ElementName));
SetElementBundleName(&element, "com.huawei.testnative");
SetElementBundleName(&element, "com.openharmony.testnative");
SetElementAbilityName(&element, "SecondAbility");
SetWantElement(&want, element);
int result = StartAbility(&want);
......@@ -468,7 +468,7 @@ HWTEST_F(AbilityMgrTest, testGetSrcPathIllegal, Function | MediumTest | Level1)
printf("------start testGetSrcPathIllegal------\n");
Want want = { nullptr };
ElementName element = { nullptr };
SetElementBundleName(&element, "com.huawei.testnative");
SetElementBundleName(&element, "com.openharmony.testnative");
SetElementAbilityName(&element, "SecondAbility");
SetWantElement(&want, element);
int result = StartAbility(&want);
......@@ -489,7 +489,7 @@ HWTEST_F(AbilityMgrTest, testGetDataPathIllegal, Function | MediumTest | Level1)
printf("------start testGetDataPathIllegal------\n");
Want want = { nullptr };
ElementName element = { nullptr };
SetElementBundleName(&element, "com.huawei.testnative");
SetElementBundleName(&element, "com.openharmony.testnative");
SetElementAbilityName(&element, "SecondAbility");
SetWantElement(&want, element);
int result = StartAbility(&want);
......@@ -513,7 +513,7 @@ HWTEST_F(AbilityMgrTest, testDumpIllegal, Function | MediumTest | Level1)
memset_s(&want, sizeof(Want), 0, sizeof(Want));
ElementName element;
memset_s(&element, sizeof(ElementName), 0, sizeof(ElementName));
SetElementBundleName(&element, "com.huawei.testnative");
SetElementBundleName(&element, "com.openharmony.testnative");
SetElementAbilityName(&element, "SecondAbility");
SetWantElement(&want, element);
Ability *ability = new Ability();
......@@ -536,7 +536,7 @@ HWTEST_F(AbilityMgrTest, testStartAbility, Function | MediumTest | Level1)
printf("------start testStartAbility------\n");
Want want = { nullptr };
ElementName element = { nullptr };
SetElementBundleName(&element, "com.huawei.testnative");
SetElementBundleName(&element, "com.openharmony.testnative");
SetElementAbilityName(&element, "MainAbility");
SetWantElement(&want, element);
int result = StartAbility(&want);
......@@ -573,7 +573,7 @@ HWTEST_F(AbilityMgrTest, testStopAbility, Function | MediumTest | Level0)
printf("------start testStopAbility------\n");
Want want = { nullptr };
ElementName element = { nullptr };
SetElementBundleName(&element, "com.huawei.testnative");
SetElementBundleName(&element, "com.openharmony.testnative");
SetElementAbilityName(&element, "ServiceAbility");
SetWantElement(&want, element);
g_errorCode = StartAbility(&want);
......@@ -613,7 +613,7 @@ HWTEST_F(AbilityMgrTest, testConnectAbility, Function | MediumTest | Level1)
printf("------start testConnectAbility------\n");
Want want = { nullptr };
ElementName element = { nullptr };
SetElementBundleName(&element, "com.huawei.testnative");
SetElementBundleName(&element, "com.openharmony.testnative");
SetElementAbilityName(&element, "ServiceAbility");
SetWantElement(&want, element);
sem_init(&g_sem, 0, 0);
......@@ -643,7 +643,7 @@ HWTEST_F(AbilityMgrTest, testDisConnectAbility, Function | MediumTest | Level1)
printf("------start testDisConnectAbility------\n");
Want want = { nullptr };
ElementName element = { nullptr };
SetElementBundleName(&element, "com.huawei.testnative");
SetElementBundleName(&element, "com.openharmony.testnative");
SetElementAbilityName(&element, "ServiceAbility");
SetWantElement(&want, element);
sem_init(&g_sem, 0, 0);
......@@ -675,7 +675,7 @@ HWTEST_F(AbilityMgrTest, testConnectAbilityIllegal, Function | MediumTest | Leve
printf("------start testConnectAbilityIllegal------\n");
Want want = { nullptr };
ElementName element = { nullptr };
SetElementBundleName(&element, "com.huawei.testnative");
SetElementBundleName(&element, "com.openharmony.testnative");
SetElementAbilityName(&element, "ServiceAbility");
SetWantElement(&want, element);
g_errorCode = ConnectAbility(nullptr, &g_conn, this);
......@@ -699,7 +699,7 @@ HWTEST_F(AbilityMgrTest, testDisConnectAbilityIllegal, Function | MediumTest | L
printf("------start testDisConnectAbilityIllegal------\n");
Want want = { nullptr };
ElementName element = { nullptr };
SetElementBundleName(&element, "com.huawei.testnative");
SetElementBundleName(&element, "com.openharmony.testnative");
SetElementAbilityName(&element, "ServiceAbility");
SetWantElement(&want, element);
sem_init(&g_sem, 0, 0);
......@@ -730,7 +730,7 @@ HWTEST_F(AbilityMgrTest, testTerminateAbility, Function | MediumTest | Level1)
printf("------start testTerminateAbility------\n");
Want want = { nullptr };
ElementName element = { nullptr };
SetElementBundleName(&element, "com.huawei.testnative");
SetElementBundleName(&element, "com.openharmony.testnative");
SetElementAbilityName(&element, "SecondAbility");
SetWantElement(&want, element);
int result1 = StartAbility(&want);
......@@ -761,7 +761,7 @@ HWTEST_F(AbilityMgrTest, testWantMatchBundle, Function | MediumTest | Level1)
ElementName element;
memset_s(&element, sizeof(ElementName), 0, sizeof(ElementName));
SetElementAbilityName(&element, "MainAbility");
SetElementBundleName(&element, "com.huawei.testnative");
SetElementBundleName(&element, "com.openharmony.testnative");
SetElementDeviceID(&element, "");
SetWantElement(&want, element);
AbilityInfo abilityInfo;
......@@ -797,7 +797,7 @@ HWTEST_F(AbilityMgrTest, testWantNotMathBundle, Function | MediumTest | Level2)
std::string aName = "NoThisAbility";
memset_s(&element, sizeof(ElementName), 0, sizeof(ElementName));
SetElementAbilityName(&element, aName.c_str());
SetElementBundleName(&element, "com.huawei.nothishap");
SetElementBundleName(&element, "com.openharmony.nothishap");
SetWantElement(&want, element);
AbilityInfo abilityInfo;
memset_s(&abilityInfo, sizeof(AbilityInfo), 0, sizeof(AbilityInfo));
......@@ -826,7 +826,7 @@ HWTEST_F(AbilityMgrTest, testWantOnlyMathBundleName, Function | MediumTest | Lev
std::string aName = "Ability";
memset_s(&element, sizeof(ElementName), 0, sizeof(ElementName));
SetElementAbilityName(&element, aName.c_str());
SetElementBundleName(&element, "com.huawei.testnative");
SetElementBundleName(&element, "com.openharmony.testnative");
SetWantElement(&want, element);
AbilityInfo abilityInfo;
memset_s(&abilityInfo, sizeof(AbilityInfo), 0, sizeof(AbilityInfo));
......@@ -855,7 +855,7 @@ HWTEST_F(AbilityMgrTest, testWantOnlyMathAbility, Function | MediumTest | Level1
std::string aName = "MainAbility";
memset_s(&element, sizeof(ElementName), 0, sizeof(ElementName));
SetElementAbilityName(&element, aName.c_str());
SetElementBundleName(&element, "com.huawei.test");
SetElementBundleName(&element, "com.openharmony.test");
SetWantElement(&want, element);
AbilityInfo abilityInfo;
memset_s(&abilityInfo, sizeof(AbilityInfo), 0, sizeof(AbilityInfo));
......@@ -883,7 +883,7 @@ HWTEST_F(AbilityMgrTest, testWantDataMatchLength, Function | MediumTest | Level1
ElementName element;
memset_s(&element, sizeof(ElementName), 0, sizeof(ElementName));
SetElementAbilityName(&element, "MainAbility");
SetElementBundleName(&element, "com.huawei.testnative");
SetElementBundleName(&element, "com.openharmony.testnative");
SetWantElement(&want, element);
SetWantData(&want, "test", 5);
AbilityInfo abilityInfo;
......@@ -916,7 +916,7 @@ HWTEST_F(AbilityMgrTest, testWantDataNotMatchLength, Function | MediumTest | Lev
ElementName element;
memset_s(&element, sizeof(ElementName), 0, sizeof(ElementName));
SetElementAbilityName(&element, "SecondAbility");
SetElementBundleName(&element, "com.huawei.testnative");
SetElementBundleName(&element, "com.openharmony.testnative");
SetWantElement(&want, element);
SetWantData(&want, "test", 3);
int result = StartAbility(&want);
......
......@@ -146,7 +146,7 @@ protected:
bool uninstallResult = false;
sem_init(&g_sem, 0, 0);
InstallParam installParam = { .installLocation = 1, .keepData = false };
uninstallResult = Uninstall("com.huawei.testnative", &installParam, TestBundleStateCallback);
uninstallResult = Uninstall("com.openharmony.testnative", &installParam, TestBundleStateCallback);
sem_wait(&g_sem);
if (uninstallResult) {
printf("sem exit \n");
......@@ -207,14 +207,14 @@ HWTEST_F(AbilityMgrTest2, testSetWantElement, Function | MediumTest | Level0)
Want want = { nullptr };
ElementName element = { nullptr };
SetElementDeviceID(&element, "0001000");
SetElementBundleName(&element, "com.huawei.testnative");
SetElementBundleName(&element, "com.openharmony.testnative");
SetElementAbilityName(&element, "ServiceAbility");
if (element.abilityName != nullptr) {
bool setResult = SetWantElement(&want, element);
if (setResult) {
EXPECT_STREQ(want.element->deviceId, "0001000");
EXPECT_STREQ(want.element->abilityName, "ServiceAbility");
EXPECT_STREQ(want.element->bundleName, "com.huawei.testnative");
EXPECT_STREQ(want.element->bundleName, "com.openharmony.testnative");
}
}
ClearElement(&element);
......@@ -280,14 +280,14 @@ HWTEST_F(AbilityMgrTest2, testWantToUri, Function | MediumTest | Level0)
Want want = { nullptr };
ElementName element = { nullptr };
SetElementDeviceID(&element, "0001000");
SetElementBundleName(&element, "com.huawei.testnative");
SetElementBundleName(&element, "com.openharmony.testnative");
SetElementAbilityName(&element, "SecondAbility");
if (element.abilityName !=nullptr) {
bool setResult = SetWantElement(&want, element);
if (setResult) {
const char *uri = WantToUri(want);
printf("uri is %s \n", uri);
const char *expectResult = "#Want;device=0001000;bundle=com.huawei.testnative;ability=SecondAbility;end";
const char *expectResult = "#Want;device=0001000;bundle=com.openharmony.testnative;ability=SecondAbility;end";
EXPECT_STREQ(uri, expectResult);
free((void*)uri);
}
......@@ -367,7 +367,7 @@ HWTEST_F(AbilityMgrTest2, testWantParseUri, Function | MediumTest | Level0)
Want want = { nullptr };
ElementName element = { nullptr };
SetElementDeviceID(&element, "0001000");
SetElementBundleName(&element, "com.huawei.testnative");
SetElementBundleName(&element, "com.openharmony.testnative");
SetElementAbilityName(&element, "ServiceAbility");
if (element.abilityName != nullptr) {
bool setResult = SetWantElement(&want, element);
......@@ -446,7 +446,7 @@ HWTEST_F(AbilityMgrTest2, testGetBundleNameIllegal, Function | MediumTest | Leve
memset_s(&want, sizeof(Want), 0, sizeof(Want));
ElementName element;
memset_s(&element, sizeof(ElementName), 0, sizeof(ElementName));
SetElementBundleName(&element, "com.huawei.testnative");
SetElementBundleName(&element, "com.openharmony.testnative");
SetElementAbilityName(&element, "ServiceAbility");
SetWantElement(&want, element);
int result = StartAbility(&want);
......@@ -470,7 +470,7 @@ HWTEST_F(AbilityMgrTest2, testGetSrcPathIllegal, Function | MediumTest | Level1)
printf("------start testGetSrcPathIllegal------\n");
Want want = { nullptr };
ElementName element = { nullptr };
SetElementBundleName(&element, "com.huawei.testnative");
SetElementBundleName(&element, "com.openharmony.testnative");
SetElementAbilityName(&element, "ServiceAbility");
SetWantElement(&want, element);
int result = StartAbility(&want);
......@@ -494,7 +494,7 @@ HWTEST_F(AbilityMgrTest2, testGetDataPathIllegal, Function | MediumTest | Level1
printf("------start testGetDataPathIllegal------\n");
Want want = { nullptr };
ElementName element = { nullptr };
SetElementBundleName(&element, "com.huawei.testnative");
SetElementBundleName(&element, "com.openharmony.testnative");
SetElementAbilityName(&element, "ServiceAbility");
SetWantElement(&want, element);
int result = StartAbility(&want);
......@@ -520,7 +520,7 @@ HWTEST_F(AbilityMgrTest2, testDumpIllegal, Function | MediumTest | Level1)
memset_s(&want, sizeof(Want), 0, sizeof(Want));
ElementName element;
memset_s(&element, sizeof(ElementName), 0, sizeof(ElementName));
SetElementBundleName(&element, "com.huawei.testnative");
SetElementBundleName(&element, "com.openharmony.testnative");
SetElementAbilityName(&element, "ServiceAbility");
SetWantElement(&want, element);
Ability *ability = new Ability();
......@@ -545,7 +545,7 @@ HWTEST_F(AbilityMgrTest2, testStartAbility, Function | MediumTest | Level1)
printf("------start testStartAbility------\n");
Want want = { nullptr };
ElementName element = { nullptr };
SetElementBundleName(&element, "com.huawei.testnative");
SetElementBundleName(&element, "com.openharmony.testnative");
SetElementAbilityName(&element, "ServiceAbility");
SetWantElement(&want, element);
int result = StartAbility(&want);
......@@ -584,7 +584,7 @@ HWTEST_F(AbilityMgrTest2, testStopAbility, Function | MediumTest | Level0)
printf("------start testStopAbility------\n");
Want want = { nullptr };
ElementName element = { nullptr };
SetElementBundleName(&element, "com.huawei.testnative");
SetElementBundleName(&element, "com.openharmony.testnative");
SetElementAbilityName(&element, "ServiceAbility");
SetWantElement(&want, element);
g_errorCode = StartAbility(&want);
......@@ -624,7 +624,7 @@ HWTEST_F(AbilityMgrTest2, testConnectAbility, Function | MediumTest | Level1)
printf("------start testConnectAbility------\n");
Want want = { nullptr };
ElementName element = { nullptr };
SetElementBundleName(&element, "com.huawei.testnative");
SetElementBundleName(&element, "com.openharmony.testnative");
SetElementAbilityName(&element, "ServiceAbility");
SetWantElement(&want, element);
sem_init(&g_sem, 0, 0);
......@@ -655,7 +655,7 @@ HWTEST_F(AbilityMgrTest2, testDisConnectAbility, Function | MediumTest | Level1)
printf("------start testDisConnectAbility------\n");
Want want = { nullptr };
ElementName element = { nullptr };
SetElementBundleName(&element, "com.huawei.testnative");
SetElementBundleName(&element, "com.openharmony.testnative");
SetElementAbilityName(&element, "ServiceAbility");
SetWantElement(&want, element);
sem_init(&g_sem, 0, 0);
......@@ -688,7 +688,7 @@ HWTEST_F(AbilityMgrTest2, testConnectAbilityIllegal, Function | MediumTest | Lev
printf("------start testConnectAbilityIllegal------\n");
Want want = { nullptr };
ElementName element = { nullptr };
SetElementBundleName(&element, "com.huawei.testnative");
SetElementBundleName(&element, "com.openharmony.testnative");
SetElementAbilityName(&element, "ServiceAbility");
SetWantElement(&want, element);
g_errorCode = ConnectAbility(nullptr, &g_conn, this);
......@@ -712,7 +712,7 @@ HWTEST_F(AbilityMgrTest2, testDisConnectAbilityIllegal, Function | MediumTest |
printf("------start testDisConnectAbilityIllegal------\n");
Want want = { nullptr };
ElementName element = { nullptr };
SetElementBundleName(&element, "com.huawei.testnative");
SetElementBundleName(&element, "com.openharmony.testnative");
SetElementAbilityName(&element, "ServiceAbility");
SetWantElement(&want, element);
sem_init(&g_sem, 0, 0);
......@@ -744,7 +744,7 @@ HWTEST_F(AbilityMgrTest2, testTerminateAbility, Function | MediumTest | Level1)
printf("------start testTerminateAbility------\n");
Want want = { nullptr };
ElementName element = { nullptr };
SetElementBundleName(&element, "com.huawei.testnative");
SetElementBundleName(&element, "com.openharmony.testnative");
SetElementAbilityName(&element, "ServiceAbility");
SetWantElement(&want, element);
int result1 = StartAbility(&want);
......@@ -775,7 +775,7 @@ HWTEST_F(AbilityMgrTest2, testWantMatchBundle, Function | MediumTest | Level1)
ElementName element;
memset_s(&element, sizeof(ElementName), 0, sizeof(ElementName));
SetElementAbilityName(&element, "ServiceAbility");
SetElementBundleName(&element, "com.huawei.testnative");
SetElementBundleName(&element, "com.openharmony.testnative");
SetElementDeviceID(&element, "");
SetWantElement(&want, element);
AbilityInfo abilityInfo;
......@@ -815,7 +815,7 @@ HWTEST_F(AbilityMgrTest2, testWantNotMathBundle, Function | MediumTest | Level2)
std::string aName = "NoThisAbility";
memset_s(&element, sizeof(ElementName), 0, sizeof(ElementName));
SetElementAbilityName(&element, aName.c_str());
SetElementBundleName(&element, "com.huawei.nothishap");
SetElementBundleName(&element, "com.openharmony.nothishap");
SetWantElement(&want, element);
AbilityInfo abilityInfo;
memset_s(&abilityInfo, sizeof(AbilityInfo), 0, sizeof(AbilityInfo));
......@@ -848,7 +848,7 @@ HWTEST_F(AbilityMgrTest2, testWantOnlyMathBundleName, Function | MediumTest | Le
std::string aName = "Ability";
memset_s(&element, sizeof(ElementName), 0, sizeof(ElementName));
SetElementAbilityName(&element, aName.c_str());
SetElementBundleName(&element, "com.huawei.testnative");
SetElementBundleName(&element, "com.openharmony.testnative");
SetWantElement(&want, element);
AbilityInfo abilityInfo;
memset_s(&abilityInfo, sizeof(AbilityInfo), 0, sizeof(AbilityInfo));
......@@ -881,7 +881,7 @@ HWTEST_F(AbilityMgrTest2, testWantOnlyMathAbility, Function | MediumTest | Level
std::string aName = "ServiceAbility";
memset_s(&element, sizeof(ElementName), 0, sizeof(ElementName));
SetElementAbilityName(&element, aName.c_str());
SetElementBundleName(&element, "com.huawei.test");
SetElementBundleName(&element, "com.openharmony.test");
SetWantElement(&want, element);
AbilityInfo abilityInfo;
memset_s(&abilityInfo, sizeof(AbilityInfo), 0, sizeof(AbilityInfo));
......@@ -913,7 +913,7 @@ HWTEST_F(AbilityMgrTest2, testWantDataMatchLength, Function | MediumTest | Level
ElementName element;
memset_s(&element, sizeof(ElementName), 0, sizeof(ElementName));
SetElementAbilityName(&element, "ServiceAbility");
SetElementBundleName(&element, "com.huawei.testnative");
SetElementBundleName(&element, "com.openharmony.testnative");
SetWantElement(&want, element);
SetWantData(&want, "test", 5);
AbilityInfo abilityInfo;
......@@ -946,7 +946,7 @@ HWTEST_F(AbilityMgrTest2, testWantDataNotMatchLength, Function | MediumTest | Le
ElementName element;
memset_s(&element, sizeof(ElementName), 0, sizeof(ElementName));
SetElementAbilityName(&element, "ServiceAbility");
SetElementBundleName(&element, "com.huawei.testnative");
SetElementBundleName(&element, "com.openharmony.testnative");
SetWantElement(&want, element);
SetWantData(&want, "test", 3);
int result = StartAbility(&want);
......
......@@ -83,7 +83,7 @@ protected:
{
sem_init(&g_sem, 0, 0);
InstallParam installParam = { .installLocation = 1, .keepData = false };
Uninstall("com.huawei.testjsdemo", &installParam, TestBundleStateCallback);
Uninstall("com.openharmony.testjsdemo", &installParam, TestBundleStateCallback);
sem_wait(&g_sem);
printf("callback uninstallresult is %d \n", g_errorCode);
EXPECT_EQ(g_errorCode, 0);
......@@ -103,10 +103,10 @@ HWTEST_F(BundleMgrTest, testClearAbilityInfoIllegal, Function | MediumTest | Lev
// abilityInfo is nullptr
AbilityInfo abilityInfo;
memset_s(&abilityInfo, sizeof(abilityInfo), 0, sizeof(abilityInfo));
abilityInfo.bundleName = (char*)"com.huawei.testjsdemo";
abilityInfo.bundleName = (char*)"com.openharmony.testjsdemo";
printf("abilityInfo.bundleName is %s \n", abilityInfo.bundleName);
ClearAbilityInfo(nullptr);
EXPECT_STREQ(abilityInfo.bundleName, "com.huawei.testjsdemo");
EXPECT_STREQ(abilityInfo.bundleName, "com.openharmony.testjsdemo");
printf("------end testClearAbilityInfoIllegal------\n");
}
......@@ -120,11 +120,11 @@ HWTEST_F(BundleMgrTest, testClearBundleInfoIllegal, Function | MediumTest | Leve
printf("------start testClearBundleInfoIllegal------\n");
BundleInfo bundleInfo;
memset_s(&bundleInfo, sizeof(bundleInfo), 0, sizeof(bundleInfo));
bundleInfo.bundleName = (char*)"com.huawei.testjsdemo";
bundleInfo.bundleName = (char*)"com.openharmony.testjsdemo";
printf("abilityInfo.bundleName is %s \n", bundleInfo.bundleName);
ClearBundleInfo(nullptr);
printf("abilityInfo.bundleName afterclear is %s \n", bundleInfo.bundleName);
EXPECT_STREQ(bundleInfo.bundleName, "com.huawei.testjsdemo");
EXPECT_STREQ(bundleInfo.bundleName, "com.openharmony.testjsdemo");
printf("------end testClearBundleInfoIllegal------\n");
}
......@@ -201,10 +201,10 @@ HWTEST_F(BundleMgrTest, testSetElementBundleName, Function | MediumTest | Level0
printf("------start testSetElementBundleName------\n");
Want want = { nullptr };
ElementName element = { nullptr };
SetElementBundleName(&element, "com.huawei.testjsdemo");
SetElementBundleName(&element, "com.openharmony.testjsdemo");
SetWantElement(&want, element);
printf("element is %s \n", want.element->bundleName);
char bName[] = "com.huawei.testjsdemo";
char bName[] = "com.openharmony.testjsdemo";
EXPECT_STREQ(want.element->bundleName, bName);
ClearElement(&element);
ClearWant(&want);
......@@ -439,7 +439,7 @@ HWTEST_F(BundleMgrTest, testBundleMgrInstallBadfile, Function | MediumTest | Lev
HWTEST_F(BundleMgrTest, testUninstallNullCallback, Function | MediumTest | Level2)
{
printf("------start testUninstallNullCallback------\n");
const char *bundleName = (char*)"com.huawei.testdemo";
const char *bundleName = (char*)"com.openharmony.testdemo";
InstallParam installParam = { .installLocation = 1, .keepData = false };
bool isUninstallSuccess = Uninstall(bundleName, &installParam, nullptr);
EXPECT_FALSE(isUninstallSuccess);
......@@ -477,7 +477,7 @@ HWTEST_F(BundleMgrTest, testUninstallright, Function | MediumTest | Level0)
sem_wait(&g_sem);
EXPECT_TRUE(installResult);
sleep(1);
const char *bundleName = (char*)"com.huawei.testnative";
const char *bundleName = (char*)"com.openharmony.testnative";
bool isUninstallSuccess = false;
sem_init(&g_sem, 0, 0);
bool uninstallState = Uninstall(bundleName, &installParam, TestBundleStateCallback);
......@@ -502,7 +502,7 @@ HWTEST_F(BundleMgrTest, testUninstallright, Function | MediumTest | Level0)
HWTEST_F(BundleMgrTest, testUninstallErrorName, Function | MediumTest | Level2)
{
printf("------start testUninstallErrorName------\n");
const char *bundleName = (char*)"com.huawei.nothisBundleName";
const char *bundleName = (char*)"com.openharmony.nothisBundleName";
bool isUninstallSuccess = false;
sem_init(&g_sem, 0, 0);
InstallParam installParam = { .installLocation = 1, .keepData = false };
......@@ -560,7 +560,7 @@ HWTEST_F(BundleMgrTest, testQueryAbilityInfoRight, Function | MediumTest | Level
ElementName element;
memset_s(&element, sizeof(ElementName), 0, sizeof(ElementName));
SetElementAbilityName(&element, "MainAbility");
SetElementBundleName(&element, "com.huawei.testjsdemo");
SetElementBundleName(&element, "com.openharmony.testjsdemo");
SetWantElement(&want, element);
SetWantData(&want, "test", 4);
AbilityInfo abilityInfo;
......@@ -595,7 +595,7 @@ HWTEST_F(BundleMgrTest, testQueryAbilityInfoIllegal, Function | MediumTest | Lev
ElementName element;
memset_s(&element, sizeof(ElementName), 0, sizeof(ElementName));
SetElementAbilityName(&element, "MainAbility");
SetElementBundleName(&element, "com.huawei.testjsdemo");
SetElementBundleName(&element, "com.openharmony.testjsdemo");
SetWantElement(&want, element);
SetWantData(&want, "test", 4);
g_errorCode = QueryAbilityInfo(&want, nullptr);
......@@ -625,7 +625,7 @@ HWTEST_F(BundleMgrTest, testGetBundleInfoRight, Function | MediumTest | Level1)
printf("------start testGetBundleInfoRight------\n");
BundleInfo bundleInfo;
memset_s(&bundleInfo, sizeof(bundleInfo), 0, sizeof(bundleInfo));
const char *bundleName = (char*)"com.huawei.testjsdemo";
const char *bundleName = (char*)"com.openharmony.testjsdemo";
int32_t flags = 0;
printf("bundleName is %s \n", bundleName);
sleep(2);
......@@ -656,7 +656,7 @@ HWTEST_F(BundleMgrTest, testGetBundleInfoIllegal, Function | MediumTest | Level2
printf("------start testGetBundleInfoIllegal------\n");
BundleInfo bundleInfo;
memset_s(&bundleInfo, sizeof(bundleInfo), 0, sizeof(bundleInfo));
const char *bundleName = (char*)"com.huawei.nothishap";
const char *bundleName = (char*)"com.openharmony.nothishap";
int32_t flags = 0;
// error bundleName
g_errorCode = GetBundleInfo(bundleName, flags, &bundleInfo);
......@@ -678,7 +678,7 @@ HWTEST_F(BundleMgrTest, testGetBundleInfoIllegal, Function | MediumTest | Level2
printf("bundleInfo3.codePath is %s \n", bundleInfo.codePath);
EXPECT_TRUE(g_errorCode == 2);
// flags not exit
g_errorCode = GetBundleInfo("com.huawei.testjsdemo", 2, &bundleInfo);
g_errorCode = GetBundleInfo("com.openharmony.testjsdemo", 2, &bundleInfo);
sleep(2);
printf("bundleInfo3.bundleName is %s \n", bundleInfo.bundleName);
printf("bundleInfo3.versionCode is %d \n", bundleInfo.versionCode);
......@@ -855,7 +855,7 @@ HWTEST_F(BundleMgrTest, testGetBundleNameForUidWithIllegal, Function | MediumTes
HWTEST_F(BundleMgrTest, testGetBundleSizeWithLegal_0001, Function | MediumTest | Level1)
{
printf("------start testGetBundleSizeWithLegal_0001------\n");
char *bundleName = (char*)"com.huawei.testjsdemo";
char *bundleName = (char*)"com.openharmony.testjsdemo";
uint32_t resultCode = GetBundleSize(bundleName);
EXPECT_GT(resultCode, 0);
printf("------end testGetBundleSizeWithLegal_0001------\n");
......@@ -869,7 +869,7 @@ HWTEST_F(BundleMgrTest, testGetBundleSizeWithLegal_0001, Function | MediumTest |
HWTEST_F(BundleMgrTest, testGetBundleSizeWithLegal_0002, Function | MediumTest | Level1)
{
printf("------start testGetBundleSizeWithLegal_0002------\n");
char *bundleName = (char*)"com.huawei.testjsdemoBundleNamelengthequalto127" \
char *bundleName = (char*)"com.openharmony.testjsdemoBundleNamelengthequalto127" \
"testjsdemoBundleNamelengthequalto127testjsdemoBundleNamelengthequalto127testjsde";
sem_init(&g_sem, 0, 0);
InstallParam installParam = {.installLocation = 1,.keepData = false };
......@@ -894,7 +894,7 @@ HWTEST_F(BundleMgrTest, testGetBundleSizeWithLegal_0002, Function | MediumTest |
HWTEST_F(BundleMgrTest, testGetBundleSizeWithIllegal_0001, Function | MediumTest | Level2)
{
printf("------start testGetBundleSizeWithIllegal_0001------\n");
char *bundleName = (char*)"com.huawei.testjsdemoBundleNameLength128test" \
char *bundleName = (char*)"com.openharmony.testjsdemoBundleNameLength128test" \
"jsdemoBundleNameLength128testjsdemoBundleNameLength128testjsdemoBundleNameLength128T";
EXPECT_EQ(strlen(bundleName), 128);
uint32_t resultCode = GetBundleSize(bundleName);
......@@ -925,7 +925,7 @@ HWTEST_F(BundleMgrTest, testGetBundleSizeWithIllegal_0002, Function | MediumTest
HWTEST_F(BundleMgrTest, testGetBundleSizeWithIllegal_0003, Function | MediumTest | Level2)
{
printf("------start testGetBundleSizeWithIllegal_0003------\n");
char *bundleName = (char*)"com.huawei.nothishap";
char *bundleName = (char*)"com.openharmony.nothishap";
// error bundleName
uint32_t resultCode = GetBundleSize(bundleName);
EXPECT_EQ(resultCode, 0);
......@@ -955,7 +955,7 @@ HWTEST_F(BundleMgrTest, testGetBundleSizeWithIllegal_0004, Function | MediumTest
HWTEST_F(BundleMgrTest, testStressConfig_0001, Function | MediumTest | Level2)
{
printf("------start testStressConfig_0001------\n");
char *bundleName = (char*)"com.huawei.testjsdemo";
char *bundleName = (char*)"com.openharmony.testjsdemo";
for (int i = 1; i <= 100; i++) {
uint32_t resultCode = GetBundleSize(bundleName);
EXPECT_GT(resultCode, 0);
......@@ -971,8 +971,8 @@ HWTEST_F(BundleMgrTest, testStressConfig_0001, Function | MediumTest | Level2)
HWTEST_F(BundleMgrTest, testStressConfig_0002, Function | MediumTest | Level2)
{
printf("------start testStressConfig_0002------\n");
char *bundleName = (char*)"com.huawei.testjsdemo";
char *bundleName2 = (char*)"com.huawei.testjsdemoBtestjsdemoB";
char *bundleName = (char*)"com.openharmony.testjsdemo";
char *bundleName2 = (char*)"com.openharmony.testjsdemoBtestjsdemoB";
sem_init(&g_sem, 0, 0);
InstallParam installParam = {.installLocation = 1,.keepData = false };
string hapPath = g_testPath + "frequentlyStress.hap";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册