未验证 提交 0fcf6be4 编写于 作者: O openharmony_ci 提交者: Gitee

!6948 删除废弃的API9接口

Merge pull request !6948 from yangzk/master
......@@ -13,13 +13,13 @@
* limitations under the License.
*/
import FormExtension from '@ohos.application.FormExtension';
import FormExtension from '@ohos.app.form.FormExtensionAbility';
import formBindingData from '@ohos.application.formBindingData';
import formInfo from '@ohos.application.formInfo';
import commonEvent from '@ohos.commonEvent';
export default class FormAbility extends FormExtension {
onCreate(want) {
onAddForm(want) {
// Called to return a FormBindingData object.
console.info("FormAbility onCreate")
let formData = {
......@@ -40,24 +40,24 @@ export default class FormAbility extends FormExtension {
return formBindingData.createFormBindingData(formData);
}
onCastToNormal(formId) {
onCastToNormalForm(formId) {
// Called when the form provider is notified that a temporary form is successfully
// converted to a normal form.
}
onUpdate(formId) {
onUpdateForm(formId) {
// Called to notify the form provider to update a specified form.
}
onVisibilityChange(newStatus) {
onChangeFormVisibility(newStatus) {
// Called when the form provider receives form events from the system.
}
onEvent(formId, message) {
onFormEvent(formId, message) {
// Called when a specified message event defined by the form provider is triggered.
}
onDestroy(formId) {
onRemoveForm(formId) {
// Called to notify the form provider that a specified form has been destroyed.
}
......
......@@ -13,7 +13,7 @@
* limitations under the License.
*/
import ServiceExtension from '@ohos.application.ServiceExtensionAbility'
import ServiceExtension from '@ohos.app.ability.ServiceExtensionAbility'
import commonEvent from "@ohos.commonEvent";
import Want from '@ohos.application.Want';
import rpc from '@ohos.rpc';
......
......@@ -19,10 +19,10 @@ import FormInfo from '@ohos.application.formInfo';
import formInfoNew from '@ohos.app.form.formInfo';
import formError from '@ohos.application.formError';
import formHost from '@ohos.application.formHost';
import errorManager from '@ohos.application.errorManager';
import errorManager from '@ohos.app.ability.errorManager';
import abilityConstant from '@ohos.app.ability.AbilityConstant'
import appManager from '@ohos.application.appManager'
import applicationContext from '@ohos.application.context'
import appManagerNew from '@ohos.app.ability.appManager'
import commonEvent from '@ohos.commonEvent';
import ability from '@ohos.ability.ability';
import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry';
......@@ -313,7 +313,7 @@ export default function ApiCoverTest() {
*/
it('SUB_AA_ABILITY_Extension_API_012', 0, async function (done) {
try {
let info: appManager.ProcessRunningInfo;
let info: appManagerNew.ProcessRunningInfo;
let stageContext: common.AbilityStageContext = globalThis.stageContext;
let abilityContext: common.UIAbilityContext = globalThis.abilityContext;
let appContext: common.ApplicationContext = abilityContext.getApplicationContext();
......@@ -453,23 +453,12 @@ export default function ApiCoverTest() {
expect("ohos.extra.param.key.form_name").assertEqual(FormInfo.FormParam.NAME_KEY)
expect("ohos.extra.param.key.form_temporary").assertEqual(FormInfo.FormParam.TEMPORARY_KEY)
expect("ohos.extra.param.key.form_identity").assertEqual(FormInfo.FormParam.IDENTITY_KEY)
expect("ohos.extra.param.key.bundle_name").assertEqual(FormInfo.FormParam.BUNDLE_NAME_KEY)
expect("ohos.extra.param.key.ability_name").assertEqual(FormInfo.FormParam.ABILITY_NAME_KEY)
expect(0).assertEqual(FormInfo.FormState.DEFAULT)
expect(1).assertEqual(FormInfo.FormState.READY)
expect(-1).assertEqual(FormInfo.FormState.UNKNOWN)
expect(0).assertEqual(FormInfo.ColorMode.MODE_DARK)
expect(1).assertEqual(FormInfo.ColorMode.MODE_LIGHT)
console.info("SUB_AA_Form_provider_TestFormInfo_0100:" + FormInfo.FormDimension.Dimension_2_1);
expect(1).assertEqual(FormInfo.FormDimension.Dimension_1_2)
expect(2).assertEqual(FormInfo.FormDimension.Dimension_2_2)
expect(3).assertEqual(FormInfo.FormDimension.Dimension_2_4)
expect(4).assertEqual(FormInfo.FormDimension.Dimension_4_4)
expect(5).assertEqual(FormInfo.FormDimension.Dimension_2_1)
expect(1).assertEqual(FormInfo.FormType.JS);
expect(2).assertEqual(FormInfo.FormType.eTS);
expect(1).assertEqual(FormInfo.VisibilityType.FORM_VISIBLE);
expect(2).assertEqual(FormInfo.VisibilityType.FORM_INVISIBLE);
done();
});
......@@ -515,50 +504,6 @@ export default function ApiCoverTest() {
done();
});
/*
* @tc.number SUB_AA_ReisterErrorObserver_0100
* @tc.name Test ReisterErrorObserver.
* @tc.desc Function test
* @tc.level 3
*/
it('SUB_AA_ReisterErrorObserver_0100', 0, async function (done) {
let errorObserver:errorManager.ErrorObserver;
errorObserver = {
onUnhandledException:(errMessage) => {
console.info("SUB_AA_ReisterErrorObserver_0100" + JSON.stringify(errMessage));
}
}
let errCodeId = errorManager.registerErrorObserver(errorObserver)
expect(errCodeId).assertEqual(0)
errorManager.unregisterErrorObserver(errCodeId).then((data)=>{
expect(data).assertEqual(undefined)
done();
}).catch((err)=>{
expect().assertFail()
done();
})
});
/*
* @tc.number SUB_AA_ReisterErrorObserver_0200
* @tc.name Test unregisterErrorObserver with error number.
* @tc.desc Function test
* @tc.level 3
*/
it('SUB_AA_ReisterErrorObserver_0200', 0, async function (done) {
errorManager.unregisterErrorObserver(-1, (err, data)=>{
console.info("SUB_AA_ReisterErrorObserver_0200:" + JSON.stringify(err) + " " + JSON.stringify(data));
console.info("SUB_AA_ReisterErrorObserver_0200:" + typeof(err.code));
if(err.code != 0){
expect(err.code).assertEqual(-2)
done()
}else{
expect().assertFail()
done();
}
})
});
/*
* @tc.number SUB_AA_Test_AbilityConstant_0100
* @tc.name Test abilityConstant.
......@@ -582,9 +527,9 @@ export default function ApiCoverTest() {
* @tc.level 3
*/
it('SUB_AA_Test_ProcessRunningInformation_0100', 0, async function (done) {
let processRunningInformation:appManager.ProcessRunningInformation;
let processRunningInformation:appManagerNew.ProcessRunningInformation;
let process;
appManager.getProcessRunningInformation().then((processRunningInformations)=>{
appManagerNew.getProcessRunningInformation().then((processRunningInformations)=>{
console.info("SUB_AA_Test_ProcessRunningInformation_0100:" + JSON.stringify(processRunningInformations));
for(let i = 0; i < processRunningInformations.length; i++){
console.info("SUB_AA_Test_ProcessRunningInformation_0100:" + JSON.stringify(processRunningInformations[i]));
......@@ -611,11 +556,15 @@ export default function ApiCoverTest() {
*/
it('SUB_AA_Test_ProcessRunningInformation_0200', 0, async function (done) {
let process;
appManager.getProcessRunningInformation((error, processRunningInformations)=>{
if(error.code == 0){
console.info("SUB_AA_Test_ProcessRunningInformation_0100:" + JSON.stringify(processRunningInformations));
appManagerNew.getProcessRunningInformation((error, processRunningInformations)=>{
if (error) {
console.info("SUB_AA_Test_ProcessRunningInformation_0200:" + JSON.stringify(error));
expect().assertFail()
done()
}
console.info("SUB_AA_Test_ProcessRunningInformation_0200:" + JSON.stringify(processRunningInformations));
for(let i = 0; i < processRunningInformations.length; i++){
console.info("SUB_AA_Test_ProcessRunningInformation_0100:" + JSON.stringify(processRunningInformations[i]));
console.info("SUB_AA_Test_ProcessRunningInformation_0200:" + JSON.stringify(processRunningInformations[i]));
expect(processRunningInformations[i].pid).assertLarger(0)
expect(processRunningInformations[i].uid).assertLarger(0)
if(processRunningInformations[i].processName == "com.example.apicoverhaptest"){
......@@ -624,11 +573,6 @@ export default function ApiCoverTest() {
}
expect(process.bundleNames[0]).assertEqual("com.example.apicoverhaptest")
done()
}else{
console.info("SUB_AA_Test_ProcessRunningInformation_0100:" + JSON.stringify(error));
expect().assertFail()
done()
}
})
});
......@@ -738,7 +682,7 @@ export default function ApiCoverTest() {
*/
it('SUB_AA_FMS_AcquireForm_0100', 0, async function (done) {
let subscriber = null
let formExtensionContext:applicationContext.FormExtensionContext
let formExtensionContext:common.FormExtensionContext
let pacMap:ability.PacMap
let subscribeInfo = {
events: ["Form_StartAbility"]
......
......@@ -13,7 +13,7 @@
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
import wantAgent from '@ohos.wantAgent';
import wantAgent from '@ohos.app.ability.wantAgent';
var TAG
export default function wantAgentCoverTest() {
......
......@@ -13,8 +13,8 @@
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
import formProvider from '@ohos.application.formProvider';
import formInfo from '@ohos.application.formInfo';
import formProvider from '@ohos.app.form.formProvider';
import formInfo from '@ohos.app.form.formInfo';
import formError from '@ohos.application.formError';
let module1FormInfo: formInfo.FormInfo = {
......@@ -59,6 +59,7 @@ let module2FormInfo: formInfo.FormInfo = {
customizeData: {}
}
const ERR_ADD_INVALID_PARAM = 401;
var expectResult = Array();
expectResult.push(module1FormInfo);
expectResult.push(module2FormInfo);
......@@ -75,7 +76,7 @@ export default function abilityTest() {
formProvider.getFormsInfo((err, value) => {
console.info("formProvider::GetFormsInfoTest err: " + JSON.stringify(err));
console.info("formProvider::GetFormsInfoTest value: " + JSON.stringify(value));
expect(err.code).assertEqual(0);
expect(err).assertEqual(null);
expect(value.length).assertEqual(2);
checkResultArray(expectResult, value)
done();
......@@ -124,12 +125,18 @@ export default function abilityTest() {
*/
it('SUB_AA_OpenHarmony_ProviderGetForsInfo_0400', 0, async function (done) {
console.info("SUB_AA_OpenHarmony_ProviderGetForsInfo_0400");
try {
formProvider.getFormsInfo(undefined, function(err, value) {
console.info("formProvider::GetFormsInfoTest err: " + JSON.stringify(err));
console.info("formProvider::GetFormsInfoTest value: " + JSON.stringify(value));
expect(err.code).assertEqual(formError.FormError.ERR_ADD_INVALID_PARAM);
expect().assertFail();
done();
});
})
} catch (err) {
console.info("formProvider::GetFormsInfoTest err: " + JSON.stringify(err));
expect(err.code).assertEqual(ERR_ADD_INVALID_PARAM);
done();
}
});
/**
......@@ -143,7 +150,7 @@ export default function abilityTest() {
formProvider.getFormsInfo(filter, function(err, value) {
console.info("formProvider::GetFormsInfoTest: " + JSON.stringify(err));
console.info("formProvider::GetFormsInfoTest: " + JSON.stringify(value));
expect(err.code).assertEqual(0);
expect(err).assertEqual(null);
expect(value.length).assertEqual(2);
checkResultArray(expectResult, value);
done();
......@@ -163,7 +170,7 @@ export default function abilityTest() {
formProvider.getFormsInfo(filter, function(err, value) {
console.info("formProvider::GetFormsInfoTest err: " + JSON.stringify(err));
console.info("formProvider::GetFormsInfoTest value: " + JSON.stringify(value));
expect(err.code).assertEqual(0);
expect(err).assertEqual(null);
expect(value.length).assertEqual(2);
checkResultArray(expectResult, value);
done();
......@@ -183,7 +190,7 @@ export default function abilityTest() {
formProvider.getFormsInfo(filter, function(err, value) {
console.info("formProvider::GetFormsInfoTest err: " + JSON.stringify(err));
console.info("formProvider::GetFormsInfoTest value: " + JSON.stringify(value));
expect(err.code).assertEqual(0);
expect(err).assertEqual(null);
expect(value.length).assertEqual(2);
checkResultArray(expectResult, value);
done();
......@@ -203,7 +210,7 @@ export default function abilityTest() {
formProvider.getFormsInfo(filter, function(err, value) {
console.info("formProvider::GetFormsInfoTest err: " + JSON.stringify(err));
console.info("formProvider::GetFormsInfoTest value: " + JSON.stringify(value));
expect(err.code).assertEqual(0);
expect(err).assertEqual(null);
expect(value.length).assertEqual(0);
done();
});
......@@ -222,7 +229,7 @@ export default function abilityTest() {
formProvider.getFormsInfo(filter, function(err, value) {
console.info("formProvider::GetFormsInfoTest err: " + JSON.stringify(err));
console.info("formProvider::GetFormsInfoTest value: " + JSON.stringify(value));
expect(err.code).assertEqual(0);
expect(err).assertEqual(null);
expect(value.length).assertEqual(1);
checkResult(module1FormInfo, value[0]);
done();
......@@ -241,7 +248,7 @@ export default function abilityTest() {
formProvider.getFormsInfo(filter, function(err, value) {
console.info("formProvider::GetFormsInfoTest err: " + JSON.stringify(err));
console.info("formProvider::GetFormsInfoTest value: " + JSON.stringify(value));
expect(err.code).assertEqual(0);
expect(err).assertEqual(null);
expect(value.length).assertEqual(0);
done();
});
......
......@@ -12,35 +12,35 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import FormExtension from '@ohos.application.FormExtension';
import FormExtension from '@ohos.app.form.FormExtensionAbility';
import formBindingData from '@ohos.application.formBindingData';
import formInfo from '@ohos.application.formInfo';
export default class FormAbility extends FormExtension {
onCreate(want) {
onAddForm(want) {
// Called to return a FormBindingData object.
let formData = {};
return formBindingData.createFormBindingData(formData);
}
onCastToNormal(formId) {
onCastToNormalForm(formId) {
// Called when the form provider is notified that a temporary form is successfully
// converted to a normal form.
}
onUpdate(formId) {
onUpdateForm(formId) {
// Called to notify the form provider to update a specified form.
}
onVisibilityChange(newStatus) {
onChangeFormVisibility(newStatus) {
// Called when the form provider receives form events from the system.
}
onEvent(formId, message) {
onFormEvent(formId, message) {
// Called when a specified message event defined by the form provider is triggered.
}
onDestroy(formId) {
onRemoveForm(formId) {
// Called to notify the form provider that a specified form has been destroyed.
}
......
......@@ -12,35 +12,35 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import FormExtension from '@ohos.application.FormExtension';
import FormExtension from '@ohos.app.form.FormExtensionAbility';
import formBindingData from '@ohos.application.formBindingData';
import formInfo from '@ohos.application.formInfo';
export default class FormAbility extends FormExtension {
onCreate(want) {
onAddForm(want) {
// Called to return a FormBindingData object.
let formData = {};
return formBindingData.createFormBindingData(formData);
}
onCastToNormal(formId) {
onCastToNormalForm(formId) {
// Called when the form provider is notified that a temporary form is successfully
// converted to a normal form.
}
onUpdate(formId) {
onUpdateForm(formId) {
// Called to notify the form provider to update a specified form.
}
onVisibilityChange(newStatus) {
onChangeFormVisibility(newStatus) {
// Called when the form provider receives form events from the system.
}
onEvent(formId, message) {
onFormEvent(formId, message) {
// Called when a specified message event defined by the form provider is triggered.
}
onDestroy(formId) {
onRemoveForm(formId) {
// Called to notify the form provider that a specified form has been destroyed.
}
......
......@@ -20,7 +20,7 @@ import rpc from '@ohos.rpc';
import featureAbility from '@ohos.ability.featureAbility';
import wantConstant from '@ohos.ability.wantConstant'
import Prompt from '@system.prompt';
import abilityManager from '@ohos.application.abilityManager';
import abilityManager from '@ohos.app.ability.abilityManager';
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
......
......@@ -19,7 +19,7 @@ import ability from '@ohos.app.ability.UIAbility'
import rpc from '@ohos.rpc';
import wantConstant from '@ohos.ability.wantConstant'
import Prompt from '@system.prompt';
import abilityManager from '@ohos.application.abilityManager';
import abilityManager from '@ohos.app.ability.abilityManager';
export default function StartAbilityForResult(abilityContext) {
......
......@@ -13,35 +13,35 @@
* limitations under the License.
*/
import FormExtension from '@ohos.application.FormExtension';
import FormExtension from '@ohos.app.form.FormExtensionAbility';
import formBindingData from '@ohos.application.formBindingData';
import formInfo from '@ohos.application.formInfo';
export default class FormAbility extends FormExtension {
onCreate(want) {
onAddForm(want) {
// Called to return a FormBindingData object.
let formData = {};
return formBindingData.createFormBindingData(formData);
}
onCastToNormal(formId) {
onCastToNormalForm(formId) {
// Called when the form provider is notified that a temporary form is successfully
// converted to a normal form.
}
onUpdate(formId) {
onUpdateForm(formId) {
// Called to notify the form provider to update a specified form.
}
onVisibilityChange(newStatus) {
onChangeFormVisibility(newStatus) {
// Called when the form provider receives form events from the system.
}
onEvent(formId, message) {
onFormEvent(formId, message) {
// Called when a specified message event defined by the form provider is triggered.
}
onDestroy(formId) {
onRemoveForm(formId) {
// Called to notify the form provider that a specified form has been destroyed.
}
......
......@@ -21,7 +21,7 @@ import ability from '@ohos.app.ability.UIAbility'
import rpc from '@ohos.rpc';
import wantConstant from '@ohos.ability.wantConstant'
import Prompt from '@system.prompt';
import abilityManager from '@ohos.application.abilityManager';
import abilityManager from '@ohos.app.ability.abilityManager';
import commonEvent from '@ohos.commonEvent';
const SYSTEM_INNER_ERROR = 16000050
......
......@@ -13,11 +13,11 @@
* limitations under the License.
*/
import FormExtension from '@ohos.application.FormExtension';
import FormExtension from '@ohos.app.form.FormExtensionAbility';
import formBindingData from '@ohos.application.formBindingData';
export default class ServiceAbility extends FormExtension {
onCreate(want) {
onAddForm(want) {
console.info('qianyiyingyong ServiceAbility onCreate');
let formData = {};
return formBindingData.createFormBindingData(formData);
......@@ -27,7 +27,7 @@ export default class ServiceAbility extends FormExtension {
console.info('qianyiyingyong ServiceAbility onRequest');
}
onDestroy(formId) {
onRemoveForm(formId) {
console.info('qianyiyingyong ServiceAbility onDestroy');
}
};
\ No newline at end of file
import FormExtension from '@ohos.application.FormExtension';
import FormExtension from '@ohos.app.form.FormExtensionAbility';
import formBindingData from '@ohos.application.formBindingData';
import formInfo from '@ohos.application.formInfo';
......
import FormExtension from '@ohos.application.FormExtension';
import FormExtension from '@ohos.app.form.FormExtensionAbility';
import formBindingData from '@ohos.application.formBindingData';
import formInfo from '@ohos.application.formInfo';
......
import FormExtension from '@ohos.application.FormExtension';
import FormExtension from '@ohos.app.form.FormExtensionAbility';
import formBindingData from '@ohos.application.formBindingData';
import formInfo from '@ohos.application.formInfo';
......
import FormExtension from '@ohos.application.FormExtension';
import FormExtension from '@ohos.app.form.FormExtensionAbility';
import formBindingData from '@ohos.application.formBindingData';
import formInfo from '@ohos.application.formInfo';
......
import FormExtension from '@ohos.application.FormExtension';
import FormExtension from '@ohos.app.form.FormExtensionAbility';
import formBindingData from '@ohos.application.formBindingData';
import formInfo from '@ohos.application.formInfo';
......
import FormExtension from '@ohos.application.FormExtension';
import FormExtension from '@ohos.app.form.FormExtensionAbility';
import formBindingData from '@ohos.application.formBindingData';
import formInfo from '@ohos.application.formInfo';
......
......@@ -13,7 +13,7 @@
* limitations under the License.
*/
import AbilityStage from "@ohos.application.AbilityStage"
import AbilityStage from "@ohos.app.ability.AbilityStage"
export default class MyAbilityStage extends AbilityStage {
onCreate() {
......
......@@ -13,7 +13,7 @@
* limitations under the License.
*/
import Ability from '@ohos.application.Ability'
import Ability from '@ohos.app.ability.UIAbility'
import dataShare from '@ohos.data.dataShare'
import rpc from "@ohos.rpc";
......@@ -111,7 +111,7 @@ export default class MainAbility extends Ability {
console.log("[ttt] [DataShareTest] <<Consumer>> MainAbility onWindowStageCreate")
globalThis.abilityContext = this.context;
let context = this.context;
dseConnectionId = context.connectAbility(dseWant, dseConnect);
dseConnectionId = context.connectServiceExtensionAbility(dseWant, dseConnect);
globalThis.connectDataShareExtAbility = (async () => {
console.log("[ttt] [DataShareTest] <<Consumer>> connectDataShareExtAbility begin");
await dataShare.createDataShareHelper(globalThis.abilityContext, dseUri, (err,data)=>{
......@@ -122,7 +122,7 @@ export default class MainAbility extends Ability {
console.info("[ttt] [DataShareTest] <<Consumer>> ----- 3 -----, err = " + err);
console.info("[ttt] [DataShareTest] <<Consumer>> ----- 4 -----, JSON.stringify(err) = " + JSON.stringify(err));
});
dseConnectionId = await context.connectAbility(dseWant, dseConnect);
dseConnectionId = await context.connectServiceExtensionAbility(dseWant, dseConnect);
})
windowStage.setUIContent(this.context, "MainAbility/pages/index", null)
}
......
......@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import Ability from '@ohos.application.Ability'
import Ability from '@ohos.app.ability.UIAbility'
export default class TestAbility extends Ability {
onCreate(want, launchParam) {
......
......@@ -779,72 +779,6 @@ export default function ActsNotificationWantAgentTest() {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2800 END`)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2900
* @tc.name : function getOperationType(agent: WantAgent, callback: AsyncCallback<number>): void
* @tc.desc : Obtains the {@link OperationType} of a {@link WantAgent}
*/
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2900', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2900 START`)
WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITY
WantAgentInfo.wantAgentFlags = [wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG]
wantAgent.getWantAgent(WantAgentInfo, (err, data) => {
if (err.code) {
console.info(`${TAG} getWantAgent AsyncCallback err: ${err.code}`)
expect(false).assertTrue()
done()
} else {
WantAgent = data
console.info(`${TAG} getWantAgent AsyncCallback success: ${JSON.stringify(data)}`)
wantAgent.getOperationType(WantAgent, (err, data) => {
if (err.code) {
console.info(`${TAG} getOperationType AsyncCallback err: ${err.code}`)
expect(false).assertTrue()
done()
} else {
console.info(`${TAG} getOperationType AsyncCallback success: ${JSON.stringify(data)}`)
expect(true).assertTrue()
done()
}
})
}
})
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2900 END`)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_3000
* @tc.name : function getOperationType(agent: WantAgent): Promise<number>
* @tc.desc : Obtains the {@link OperationType} of a {@link WantAgent}
*/
it('SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_3000', 0, async function (done) {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_3000 START`)
WantAgentInfo.operationType = wantAgent.OperationType.START_ABILITY
WantAgentInfo.wantAgentFlags = [wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG]
wantAgent.getWantAgent(WantAgentInfo).then((data) => {
WantAgent = data
console.info(`${TAG} getWantAgent Promise success: ${JSON.stringify(data)}`)
wantAgent.getOperationType(WantAgent)
.then((data) => {
console.info(`${TAG} getOperationType Promise success: ${JSON.stringify(data)}`)
expect(true).assertTrue()
done()
})
.catch((err) => {
console.info(`${TAG} getOperationType Promise err: ${err.code}`)
expect(false).assertTrue()
done()
})
}).catch((err) => {
console.info(`${TAG} getWantAgent Promise err: ${err.code}`)
expect(false).assertTrue()
done()
})
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_3000 END`)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_3100
* @tc.name : function trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: AsyncCallback<CompleteData>): void
......
import hilog from '@ohos.hilog';
import AbilityStage from "@ohos.application.AbilityStage"
import AbilityStage from "@ohos.app.ability.AbilityStage"
export default class MyAbilityStage extends AbilityStage {
onCreate() {
......
......@@ -2,7 +2,7 @@ import hilog from '@ohos.hilog';
import Window from '@ohos.window';
import { Hypium } from '@ohos/hypium';
import testsuite from '../test/List.test';
import Ability from '@ohos.application.Ability';
import Ability from '@ohos.app.ability.UIAbility';
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry';
export default class MainAbility extends Ability {
......
......@@ -13,7 +13,7 @@
* limitations under the License.
*/
import AbilityStage from "@ohos.application.AbilityStage"
import AbilityStage from "@ohos.app.ability.AbilityStage"
export default class MyAbilityStage extends AbilityStage {
onCreate() {
......
......@@ -15,7 +15,7 @@
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from '../test/List.test'
import Ability from '@ohos.application.Ability'
import Ability from '@ohos.app.ability.UIAbility'
export default class MainAbility extends Ability {
onCreate(want, launchParam) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册