提交 36f8eb68 编写于 作者: Y yangzk

IssueNo: #I5X5NZ

Description: 适配ServiceExtensionAbility
Sig: SIG_ApplicationFramework
Feature or Bugfix: Feature
Binary Source: No
Signed-off-by: Nyangzk <yangzhongkai@huawei.com>
Change-Id: I2249e8978ab7dafc6b7128f23471b27147763f82
上级 3de19324
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
import FormExtension from '@ohos.application.FormExtension'; import FormExtension from '@ohos.app.form.FormExtensionAbility';
import formBindingData from '@ohos.application.formBindingData'; import formBindingData from '@ohos.application.formBindingData';
import formInfo from '@ohos.application.formInfo'; import formInfo from '@ohos.application.formInfo';
import commonEvent from '@ohos.commonEvent'; import commonEvent from '@ohos.commonEvent';
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
import ServiceExtension from '@ohos.application.ServiceExtensionAbility' import ServiceExtension from '@ohos.app.ability.ServiceExtensionAbility'
import commonEvent from "@ohos.commonEvent"; import commonEvent from "@ohos.commonEvent";
import Want from '@ohos.application.Want'; import Want from '@ohos.application.Want';
import rpc from '@ohos.rpc'; import rpc from '@ohos.rpc';
......
...@@ -19,10 +19,10 @@ import FormInfo from '@ohos.application.formInfo'; ...@@ -19,10 +19,10 @@ import FormInfo from '@ohos.application.formInfo';
import formInfoNew from '@ohos.app.form.formInfo'; import formInfoNew from '@ohos.app.form.formInfo';
import formError from '@ohos.application.formError'; import formError from '@ohos.application.formError';
import formHost from '@ohos.application.formHost'; 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 abilityConstant from '@ohos.app.ability.AbilityConstant'
import appManager from '@ohos.application.appManager' 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 commonEvent from '@ohos.commonEvent';
import ability from '@ohos.ability.ability'; import ability from '@ohos.ability.ability';
import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry';
...@@ -453,23 +453,12 @@ export default function ApiCoverTest() { ...@@ -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_name").assertEqual(FormInfo.FormParam.NAME_KEY)
expect("ohos.extra.param.key.form_temporary").assertEqual(FormInfo.FormParam.TEMPORARY_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.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(0).assertEqual(FormInfo.FormState.DEFAULT)
expect(1).assertEqual(FormInfo.FormState.READY) expect(1).assertEqual(FormInfo.FormState.READY)
expect(-1).assertEqual(FormInfo.FormState.UNKNOWN) expect(-1).assertEqual(FormInfo.FormState.UNKNOWN)
expect(0).assertEqual(FormInfo.ColorMode.MODE_DARK) expect(0).assertEqual(FormInfo.ColorMode.MODE_DARK)
expect(1).assertEqual(FormInfo.ColorMode.MODE_LIGHT) 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(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(); done();
}); });
...@@ -515,50 +504,6 @@ export default function ApiCoverTest() { ...@@ -515,50 +504,6 @@ export default function ApiCoverTest() {
done(); 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.number SUB_AA_Test_AbilityConstant_0100
* @tc.name Test abilityConstant. * @tc.name Test abilityConstant.
...@@ -584,7 +529,7 @@ export default function ApiCoverTest() { ...@@ -584,7 +529,7 @@ export default function ApiCoverTest() {
it('SUB_AA_Test_ProcessRunningInformation_0100', 0, async function (done) { it('SUB_AA_Test_ProcessRunningInformation_0100', 0, async function (done) {
let processRunningInformation:appManager.ProcessRunningInformation; let processRunningInformation:appManager.ProcessRunningInformation;
let process; let process;
appManager.getProcessRunningInformation().then((processRunningInformations)=>{ appManagerNew.getProcessRunningInformation().then((processRunningInformations)=>{
console.info("SUB_AA_Test_ProcessRunningInformation_0100:" + JSON.stringify(processRunningInformations)); console.info("SUB_AA_Test_ProcessRunningInformation_0100:" + JSON.stringify(processRunningInformations));
for(let i = 0; i < processRunningInformations.length; i++){ 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_0100:" + JSON.stringify(processRunningInformations[i]));
...@@ -611,24 +556,23 @@ export default function ApiCoverTest() { ...@@ -611,24 +556,23 @@ export default function ApiCoverTest() {
*/ */
it('SUB_AA_Test_ProcessRunningInformation_0200', 0, async function (done) { it('SUB_AA_Test_ProcessRunningInformation_0200', 0, async function (done) {
let process; let process;
appManager.getProcessRunningInformation((error, processRunningInformations)=>{ appManagerNew.getProcessRunningInformation((error, processRunningInformations)=>{
if(error.code == 0){ if (error) {
console.info("SUB_AA_Test_ProcessRunningInformation_0100:" + JSON.stringify(processRunningInformations)); console.info("SUB_AA_Test_ProcessRunningInformation_0200:" + JSON.stringify(error));
for(let i = 0; i < processRunningInformations.length; i++){
console.info("SUB_AA_Test_ProcessRunningInformation_0100:" + JSON.stringify(processRunningInformations[i]));
expect(processRunningInformations[i].pid).assertLarger(0)
expect(processRunningInformations[i].uid).assertLarger(0)
if(processRunningInformations[i].processName == "com.example.apicoverhaptest"){
process = processRunningInformations[i]
}
}
expect(process.bundleNames[0]).assertEqual("com.example.apicoverhaptest")
done()
}else{
console.info("SUB_AA_Test_ProcessRunningInformation_0100:" + JSON.stringify(error));
expect().assertFail() expect().assertFail()
done() 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_0200:" + JSON.stringify(processRunningInformations[i]));
expect(processRunningInformations[i].pid).assertLarger(0)
expect(processRunningInformations[i].uid).assertLarger(0)
if(processRunningInformations[i].processName == "com.example.apicoverhaptest"){
process = processRunningInformations[i]
}
}
expect(process.bundleNames[0]).assertEqual("com.example.apicoverhaptest")
done()
}) })
}); });
...@@ -738,7 +682,7 @@ export default function ApiCoverTest() { ...@@ -738,7 +682,7 @@ export default function ApiCoverTest() {
*/ */
it('SUB_AA_FMS_AcquireForm_0100', 0, async function (done) { it('SUB_AA_FMS_AcquireForm_0100', 0, async function (done) {
let subscriber = null let subscriber = null
let formExtensionContext:applicationContext.FormExtensionContext let formExtensionContext:common.FormExtensionContext
let pacMap:ability.PacMap let pacMap:ability.PacMap
let subscribeInfo = { let subscribeInfo = {
events: ["Form_StartAbility"] events: ["Form_StartAbility"]
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' 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 var TAG
export default function wantAgentCoverTest() { export default function wantAgentCoverTest() {
......
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
* limitations under the License. * limitations under the License.
*/ */
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
import formProvider from '@ohos.application.formProvider'; import formProvider from '@ohos.app.form.formProvider';
import formInfo from '@ohos.application.formInfo'; import formInfo from '@ohos.app.form.formInfo';
import formError from '@ohos.application.formError'; import formError from '@ohos.application.formError';
let module1FormInfo: formInfo.FormInfo = { let module1FormInfo: formInfo.FormInfo = {
...@@ -59,6 +59,7 @@ let module2FormInfo: formInfo.FormInfo = { ...@@ -59,6 +59,7 @@ let module2FormInfo: formInfo.FormInfo = {
customizeData: {} customizeData: {}
} }
const ERR_ADD_INVALID_PARAM = 401;
var expectResult = Array(); var expectResult = Array();
expectResult.push(module1FormInfo); expectResult.push(module1FormInfo);
expectResult.push(module2FormInfo); expectResult.push(module2FormInfo);
...@@ -75,7 +76,7 @@ export default function abilityTest() { ...@@ -75,7 +76,7 @@ export default function abilityTest() {
formProvider.getFormsInfo((err, value) => { formProvider.getFormsInfo((err, value) => {
console.info("formProvider::GetFormsInfoTest err: " + JSON.stringify(err)); console.info("formProvider::GetFormsInfoTest err: " + JSON.stringify(err));
console.info("formProvider::GetFormsInfoTest value: " + JSON.stringify(value)); console.info("formProvider::GetFormsInfoTest value: " + JSON.stringify(value));
expect(err.code).assertEqual(0); expect(err).assertEqual(null);
expect(value.length).assertEqual(2); expect(value.length).assertEqual(2);
checkResultArray(expectResult, value) checkResultArray(expectResult, value)
done(); done();
...@@ -124,12 +125,18 @@ export default function abilityTest() { ...@@ -124,12 +125,18 @@ export default function abilityTest() {
*/ */
it('SUB_AA_OpenHarmony_ProviderGetForsInfo_0400', 0, async function (done) { it('SUB_AA_OpenHarmony_ProviderGetForsInfo_0400', 0, async function (done) {
console.info("SUB_AA_OpenHarmony_ProviderGetForsInfo_0400"); console.info("SUB_AA_OpenHarmony_ProviderGetForsInfo_0400");
formProvider.getFormsInfo(undefined, function(err, value) { try {
formProvider.getFormsInfo(undefined, function(err, value) {
console.info("formProvider::GetFormsInfoTest err: " + JSON.stringify(err));
console.info("formProvider::GetFormsInfoTest value: " + JSON.stringify(value));
expect().assertFail();
done();
})
} catch (err) {
console.info("formProvider::GetFormsInfoTest err: " + JSON.stringify(err)); console.info("formProvider::GetFormsInfoTest err: " + JSON.stringify(err));
console.info("formProvider::GetFormsInfoTest value: " + JSON.stringify(value)); expect(err.code).assertEqual(ERR_ADD_INVALID_PARAM);
expect(err.code).assertEqual(formError.FormError.ERR_ADD_INVALID_PARAM);
done(); done();
}); }
}); });
/** /**
...@@ -143,7 +150,7 @@ export default function abilityTest() { ...@@ -143,7 +150,7 @@ export default function abilityTest() {
formProvider.getFormsInfo(filter, function(err, value) { formProvider.getFormsInfo(filter, function(err, value) {
console.info("formProvider::GetFormsInfoTest: " + JSON.stringify(err)); console.info("formProvider::GetFormsInfoTest: " + JSON.stringify(err));
console.info("formProvider::GetFormsInfoTest: " + JSON.stringify(value)); console.info("formProvider::GetFormsInfoTest: " + JSON.stringify(value));
expect(err.code).assertEqual(0); expect(err).assertEqual(null);
expect(value.length).assertEqual(2); expect(value.length).assertEqual(2);
checkResultArray(expectResult, value); checkResultArray(expectResult, value);
done(); done();
...@@ -163,7 +170,7 @@ export default function abilityTest() { ...@@ -163,7 +170,7 @@ export default function abilityTest() {
formProvider.getFormsInfo(filter, function(err, value) { formProvider.getFormsInfo(filter, function(err, value) {
console.info("formProvider::GetFormsInfoTest err: " + JSON.stringify(err)); console.info("formProvider::GetFormsInfoTest err: " + JSON.stringify(err));
console.info("formProvider::GetFormsInfoTest value: " + JSON.stringify(value)); console.info("formProvider::GetFormsInfoTest value: " + JSON.stringify(value));
expect(err.code).assertEqual(0); expect(err).assertEqual(null);
expect(value.length).assertEqual(2); expect(value.length).assertEqual(2);
checkResultArray(expectResult, value); checkResultArray(expectResult, value);
done(); done();
...@@ -183,7 +190,7 @@ export default function abilityTest() { ...@@ -183,7 +190,7 @@ export default function abilityTest() {
formProvider.getFormsInfo(filter, function(err, value) { formProvider.getFormsInfo(filter, function(err, value) {
console.info("formProvider::GetFormsInfoTest err: " + JSON.stringify(err)); console.info("formProvider::GetFormsInfoTest err: " + JSON.stringify(err));
console.info("formProvider::GetFormsInfoTest value: " + JSON.stringify(value)); console.info("formProvider::GetFormsInfoTest value: " + JSON.stringify(value));
expect(err.code).assertEqual(0); expect(err).assertEqual(null);
expect(value.length).assertEqual(2); expect(value.length).assertEqual(2);
checkResultArray(expectResult, value); checkResultArray(expectResult, value);
done(); done();
...@@ -203,7 +210,7 @@ export default function abilityTest() { ...@@ -203,7 +210,7 @@ export default function abilityTest() {
formProvider.getFormsInfo(filter, function(err, value) { formProvider.getFormsInfo(filter, function(err, value) {
console.info("formProvider::GetFormsInfoTest err: " + JSON.stringify(err)); console.info("formProvider::GetFormsInfoTest err: " + JSON.stringify(err));
console.info("formProvider::GetFormsInfoTest value: " + JSON.stringify(value)); console.info("formProvider::GetFormsInfoTest value: " + JSON.stringify(value));
expect(err.code).assertEqual(0); expect(err).assertEqual(null);
expect(value.length).assertEqual(0); expect(value.length).assertEqual(0);
done(); done();
}); });
...@@ -222,7 +229,7 @@ export default function abilityTest() { ...@@ -222,7 +229,7 @@ export default function abilityTest() {
formProvider.getFormsInfo(filter, function(err, value) { formProvider.getFormsInfo(filter, function(err, value) {
console.info("formProvider::GetFormsInfoTest err: " + JSON.stringify(err)); console.info("formProvider::GetFormsInfoTest err: " + JSON.stringify(err));
console.info("formProvider::GetFormsInfoTest value: " + JSON.stringify(value)); console.info("formProvider::GetFormsInfoTest value: " + JSON.stringify(value));
expect(err.code).assertEqual(0); expect(err).assertEqual(null);
expect(value.length).assertEqual(1); expect(value.length).assertEqual(1);
checkResult(module1FormInfo, value[0]); checkResult(module1FormInfo, value[0]);
done(); done();
...@@ -241,7 +248,7 @@ export default function abilityTest() { ...@@ -241,7 +248,7 @@ export default function abilityTest() {
formProvider.getFormsInfo(filter, function(err, value) { formProvider.getFormsInfo(filter, function(err, value) {
console.info("formProvider::GetFormsInfoTest err: " + JSON.stringify(err)); console.info("formProvider::GetFormsInfoTest err: " + JSON.stringify(err));
console.info("formProvider::GetFormsInfoTest value: " + JSON.stringify(value)); console.info("formProvider::GetFormsInfoTest value: " + JSON.stringify(value));
expect(err.code).assertEqual(0); expect(err).assertEqual(null);
expect(value.length).assertEqual(0); expect(value.length).assertEqual(0);
done(); done();
}); });
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import FormExtension from '@ohos.application.FormExtension'; import FormExtension from '@ohos.app.form.FormExtensionAbility';
import formBindingData from '@ohos.application.formBindingData'; import formBindingData from '@ohos.application.formBindingData';
import formInfo from '@ohos.application.formInfo'; import formInfo from '@ohos.application.formInfo';
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import FormExtension from '@ohos.application.FormExtension'; import FormExtension from '@ohos.app.form.FormExtensionAbility';
import formBindingData from '@ohos.application.formBindingData'; import formBindingData from '@ohos.application.formBindingData';
import formInfo from '@ohos.application.formInfo'; import formInfo from '@ohos.application.formInfo';
......
...@@ -20,7 +20,7 @@ import rpc from '@ohos.rpc'; ...@@ -20,7 +20,7 @@ import rpc from '@ohos.rpc';
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
import wantConstant from '@ohos.ability.wantConstant' import wantConstant from '@ohos.ability.wantConstant'
import Prompt from '@system.prompt'; import Prompt from '@system.prompt';
import abilityManager from '@ohos.application.abilityManager'; import abilityManager from '@ohos.app.ability.abilityManager';
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
......
...@@ -19,7 +19,7 @@ import ability from '@ohos.app.ability.UIAbility' ...@@ -19,7 +19,7 @@ import ability from '@ohos.app.ability.UIAbility'
import rpc from '@ohos.rpc'; import rpc from '@ohos.rpc';
import wantConstant from '@ohos.ability.wantConstant' import wantConstant from '@ohos.ability.wantConstant'
import Prompt from '@system.prompt'; import Prompt from '@system.prompt';
import abilityManager from '@ohos.application.abilityManager'; import abilityManager from '@ohos.app.ability.abilityManager';
export default function StartAbilityForResult(abilityContext) { export default function StartAbilityForResult(abilityContext) {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
import FormExtension from '@ohos.application.FormExtension'; import FormExtension from '@ohos.app.form.FormExtensionAbility';
import formBindingData from '@ohos.application.formBindingData'; import formBindingData from '@ohos.application.formBindingData';
import formInfo from '@ohos.application.formInfo'; import formInfo from '@ohos.application.formInfo';
......
...@@ -21,7 +21,7 @@ import ability from '@ohos.app.ability.UIAbility' ...@@ -21,7 +21,7 @@ import ability from '@ohos.app.ability.UIAbility'
import rpc from '@ohos.rpc'; import rpc from '@ohos.rpc';
import wantConstant from '@ohos.ability.wantConstant' import wantConstant from '@ohos.ability.wantConstant'
import Prompt from '@system.prompt'; import Prompt from '@system.prompt';
import abilityManager from '@ohos.application.abilityManager'; import abilityManager from '@ohos.app.ability.abilityManager';
import commonEvent from '@ohos.commonEvent'; import commonEvent from '@ohos.commonEvent';
const SYSTEM_INNER_ERROR = 16000050 const SYSTEM_INNER_ERROR = 16000050
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
import FormExtension from '@ohos.application.FormExtension'; import FormExtension from '@ohos.app.form.FormExtensionAbility';
import formBindingData from '@ohos.application.formBindingData'; import formBindingData from '@ohos.application.formBindingData';
export default class ServiceAbility extends FormExtension { export default class ServiceAbility extends FormExtension {
......
import FormExtension from '@ohos.application.FormExtension'; import FormExtension from '@ohos.app.form.FormExtensionAbility';
import formBindingData from '@ohos.application.formBindingData'; import formBindingData from '@ohos.application.formBindingData';
import formInfo from '@ohos.application.formInfo'; 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 formBindingData from '@ohos.application.formBindingData';
import formInfo from '@ohos.application.formInfo'; 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 formBindingData from '@ohos.application.formBindingData';
import formInfo from '@ohos.application.formInfo'; 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 formBindingData from '@ohos.application.formBindingData';
import formInfo from '@ohos.application.formInfo'; 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 formBindingData from '@ohos.application.formBindingData';
import formInfo from '@ohos.application.formInfo'; 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 formBindingData from '@ohos.application.formBindingData';
import formInfo from '@ohos.application.formInfo'; import formInfo from '@ohos.application.formInfo';
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
import AbilityStage from "@ohos.application.AbilityStage" import AbilityStage from "@ohos.app.ability.AbilityStage"
export default class MyAbilityStage extends AbilityStage { export default class MyAbilityStage extends AbilityStage {
onCreate() { onCreate() {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
import Ability from '@ohos.application.Ability' import Ability from '@ohos.app.ability.UIAbility'
import dataShare from '@ohos.data.dataShare' import dataShare from '@ohos.data.dataShare'
import rpc from "@ohos.rpc"; import rpc from "@ohos.rpc";
...@@ -111,7 +111,7 @@ export default class MainAbility extends Ability { ...@@ -111,7 +111,7 @@ export default class MainAbility extends Ability {
console.log("[ttt] [DataShareTest] <<Consumer>> MainAbility onWindowStageCreate") console.log("[ttt] [DataShareTest] <<Consumer>> MainAbility onWindowStageCreate")
globalThis.abilityContext = this.context; globalThis.abilityContext = this.context;
let context = this.context; let context = this.context;
dseConnectionId = context.connectAbility(dseWant, dseConnect); dseConnectionId = context.connectServiceExtensionAbility(dseWant, dseConnect);
globalThis.connectDataShareExtAbility = (async () => { globalThis.connectDataShareExtAbility = (async () => {
console.log("[ttt] [DataShareTest] <<Consumer>> connectDataShareExtAbility begin"); console.log("[ttt] [DataShareTest] <<Consumer>> connectDataShareExtAbility begin");
await dataShare.createDataShareHelper(globalThis.abilityContext, dseUri, (err,data)=>{ await dataShare.createDataShareHelper(globalThis.abilityContext, dseUri, (err,data)=>{
...@@ -122,7 +122,7 @@ export default class MainAbility extends Ability { ...@@ -122,7 +122,7 @@ export default class MainAbility extends Ability {
console.info("[ttt] [DataShareTest] <<Consumer>> ----- 3 -----, err = " + err); console.info("[ttt] [DataShareTest] <<Consumer>> ----- 3 -----, err = " + err);
console.info("[ttt] [DataShareTest] <<Consumer>> ----- 4 -----, JSON.stringify(err) = " + JSON.stringify(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) windowStage.setUIContent(this.context, "MainAbility/pages/index", null)
} }
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import Ability from '@ohos.application.Ability' import Ability from '@ohos.app.ability.UIAbility'
export default class TestAbility extends Ability { export default class TestAbility extends Ability {
onCreate(want, launchParam) { onCreate(want, launchParam) {
......
...@@ -779,72 +779,6 @@ export default function ActsNotificationWantAgentTest() { ...@@ -779,72 +779,6 @@ export default function ActsNotificationWantAgentTest() {
console.info(`${TAG} SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_2800 END`) 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.number : SUB_NOTIFICATION_ANS_GET_WANT_AGENT_TEST_3100
* @tc.name : function trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: AsyncCallback<CompleteData>): void * @tc.name : function trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: AsyncCallback<CompleteData>): void
......
import hilog from '@ohos.hilog'; import hilog from '@ohos.hilog';
import AbilityStage from "@ohos.application.AbilityStage" import AbilityStage from "@ohos.app.ability.AbilityStage"
export default class MyAbilityStage extends AbilityStage { export default class MyAbilityStage extends AbilityStage {
onCreate() { onCreate() {
......
...@@ -2,7 +2,7 @@ import hilog from '@ohos.hilog'; ...@@ -2,7 +2,7 @@ import hilog from '@ohos.hilog';
import Window from '@ohos.window'; import Window from '@ohos.window';
import { Hypium } from '@ohos/hypium'; import { Hypium } from '@ohos/hypium';
import testsuite from '../test/List.test'; 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'; import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry';
export default class MainAbility extends Ability { export default class MainAbility extends Ability {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
import AbilityStage from "@ohos.application.AbilityStage" import AbilityStage from "@ohos.app.ability.AbilityStage"
export default class MyAbilityStage extends AbilityStage { export default class MyAbilityStage extends AbilityStage {
onCreate() { onCreate() {
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium' import { Hypium } from '@ohos/hypium'
import testsuite from '../test/List.test' 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 { export default class MainAbility extends Ability {
onCreate(want, launchParam) { onCreate(want, launchParam) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册