提交 b33344f3 编写于 作者: Z zwx1016320 提交者: 张育帅
上级 ddb900da
......@@ -26,51 +26,26 @@ export default class ImExtAbility extends inputMethodExtensionAbility {
console.info("inputMethodExtensionAbility want.abilityName is: " + want.abilityName);
console.info("---------------------------1-----------------------------");
this.context.startAbility(want, (data)=>{
console.info("startAbility001 inputMethodExtensionAbility start successfully." + JSON.stringify(data));
})
this.context.terminateSelf((err) => {
console.info('startAbility001 terminateSelf success' + JSON.stringify(err));
});
console.info("---------------------------2-----------------------------");
this.context.startAbility(want,options,(data) => {
console.info("startAbility002 inputMethodExtensionAbility start successfully." + JSON.stringify(data));
})
this.context.terminateSelf().then((data) => {
console.info("startAbility002 terminateSelf success:." + JSON.stringify(data));
}).catch((err) => {
console.info('startAbility002 terminateSelf fail: ' + JSON.stringify(err));
})
console.info("---------------------------3-----------------------------");
this.context.startAbility(want).then((data) => {
console.info("startAbility003 inputMethodExtensionAbility start successfully." + JSON.stringify(data));
}).catch((err) => {
console.info('startAbility003 failed:' + JSON.stringify(err));
})
this.context.terminateSelf().then((data) => {
console.info("startAbility003 terminateSelf success:." + JSON.stringify(data));
}).catch((err) => {
console.info('startAbility003 terminateSelf fail: ' + JSON.stringify(err));
})
console.info("---------------------------4-----------------------------");
this.context.startAbility(want, options).then((data) => {
console.info("startAbility004 inputMethodExtensionAbility start successfully." + JSON.stringify(data));
}).catch((err) => {
console.info('startAbility004 failed:' + JSON.stringify(err));
})
try{
this.context.destroy((err, data)=>{
if(err){
console.info('destroy001 destroy fail: ' + JSON.stringify(err));
}
console.info("destroy001 inputMethodExtensionAbility destroy successfully." + JSON.stringify(data));
})
}catch(error){
console.info('destroy001 destroy catch error: ' + JSON.stringify(error));
}
this.context.terminateSelf().then((data) => {
console.info("startAbility004 terminateSelf success:." + JSON.stringify(data));
}).catch((err) => {
console.info('startAbility004 terminateSelf fail: ' + JSON.stringify(err));
})
try{
this.context.destroy().then((data) => {
console.info("destroy002 terminateSelf success:." + JSON.stringify(data));
}).catch((err) => {
console.info('destroy002 terminateSelf fail: ' + JSON.stringify(err));
})
}catch(error){
console.info('destroy002 destroy catch error: ' + JSON.stringify(error));
}
}
onDestroy() {
......
......@@ -32,7 +32,10 @@ export default function imeAbilityTest(abilityContext) {
console.info('beforeEach: switchInputMethod to kikakeyboard.');
let serviceAbilityProperty = {
packageName: "com.example.kikakeyboard",
methodId: "ServiceExtAbility"
methodId: "ServiceExtAbility",
name:"com.example.kikakeyboard",
id:"ServiceExtAbility",
extra:{}
}
inputMethod.switchInputMethod(serviceAbilityProperty).then((data)=>{
......@@ -61,6 +64,9 @@ export default function imeAbilityTest(abilityContext) {
let imExtAbilityProperty = {
packageName : "com.acts.imeability.test",
methodId : "com.acts.imeability.test.ImExtAbility",
name:"com.acts.imeability.test",
id:"com.acts.imeability.test.ImExtAbility",
extra:{}
}
inputMethod.switchInputMethod(imExtAbilityProperty).then((data)=>{
......@@ -86,6 +92,9 @@ export default function imeAbilityTest(abilityContext) {
let imExtAbilityProperty = {
packageName : "com.acts.imeability.test",
methodId : "com.acts.imeability.test.ImExtAbility",
name:"com.acts.imeability.test",
id:"com.acts.imeability.test.ImExtAbility",
extra:{}
}
inputMethod.switchInputMethod(imExtAbilityProperty).then((data)=>{
......
......@@ -314,8 +314,11 @@ export default function inputMethodStageJSUnit() {
it('inputMethod_test_switchCurrentInputMethodAndSubtype_001', 0, async function (done) {
console.info("************* inputMethod_test_switchCurrentInputMethodAndSubtype_001 Test start*************");
let inputMethodProperty = {
packageName:"com.example.kikakeyboard",
methodId:"ServiceExtAbility"
packageName: "com.example.kikakeyboard",
methodId: "ServiceExtAbility",
name:"com.example.kikakeyboard",
id:"ServiceExtAbility",
extra:{}
}
let inputMethodSubProperty : subtype = {
id: "com.example.kikakeyboard",
......@@ -356,8 +359,11 @@ export default function inputMethodStageJSUnit() {
it('inputMethod_test_switchCurrentInputMethodAndSubtype_002', 0, async function (done) {
console.info("************* inputMethod_test_switchCurrentInputMethodAndSubtype_002 Test start*************");
let inputMethodProperty = {
packageName:"com.example.kikakeyboard",
methodId:"ServiceExtAbility"
packageName: "com.example.kikakeyboard",
methodId: "ServiceExtAbility",
name:"com.example.kikakeyboard",
id:"ServiceExtAbility",
extra:{}
}
let inputMethodSubProperty : subtype = {
id: "com.example.kikakeyboard",
......@@ -505,7 +511,7 @@ export default function inputMethodStageJSUnit() {
try {
console.info("inputMethod_test_showOptionalInputMethods_002 result:" + JSON.stringify(inputMethodSetting));
inputMethodSetting.showOptionalInputMethods().then((data) => {
console.info("inputMethod_test_showOptionalInputMethods_002 showOptionalInputMethods catch error: " + JSON.stringify(data));
console.info("inputMethod_test_showOptionalInputMethods_002 showOptionalInputMethods success data is: " + JSON.stringify(data));
expect(true).assertTrue();
done();
}).catch(err => {
......
......@@ -114,8 +114,11 @@ export default function inputMethodJSUnit() {
it('inputmethod_test_switchInputMethod_001', 0, async function (done) {
console.info("************* inputmethod_test_switchInputMethod_001 Test start*************");
let inputMethodProperty = {
packageName:"com.example.kikakeyboard",
methodId:"ServiceExtAbility"
packageName: "com.example.kikakeyboard",
methodId: "ServiceExtAbility",
name:"com.example.kikakeyboard",
id:"ServiceExtAbility",
extra:{}
}
inputMethod.switchInputMethod(inputMethodProperty).then(data => {
console.info("inputmethod_test_switchInputMethod_001 data:" + data)
......@@ -137,8 +140,11 @@ export default function inputMethodJSUnit() {
it('inputmethod_test_switchInputMethod_002', 0, async function (done) {
console.info("************* inputmethod_test_switchInputMethod_002 Test start*************");
let inputMethodProperty = {
packageName:"com.example.kikakeyboard",
methodId:"ServiceExtAbility"
packageName: "com.example.kikakeyboard",
methodId: "ServiceExtAbility",
name:"com.example.kikakeyboard",
id:"ServiceExtAbility",
extra:{}
}
inputMethod.switchInputMethod(inputMethodProperty, (err, data)=>{
if(err){
......
......@@ -22,7 +22,7 @@
"mkdir -p /data/app/el2/100/base/com.acts.theme.wallpapertest/haps"
],
"push": [
"./resource./wallpaper/wp.png ->/data/app/el2/100/base/com.acts.theme.wallpapertest/haps/wp.png"
"./resource/wallpaper/wp.png ->/data/app/el2/100/base/com.acts.theme.wallpapertest/haps/wp.png"
]
}
]
......
......@@ -14,7 +14,7 @@
*/
import wallpaper from '@ohos.wallpaper';
import image from '@ohos.multimedia.image';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index';
const WALLPAPER_SYSTEM = 0;
const WALLPAPER_LOCKSCREEN = 1;
......@@ -913,7 +913,7 @@ export default function wallpaperJSUnit() {
console.info('------------------testGetMinWidthSync101 start----------------------');
let number = null;
try{
number = wallpaper.getMinHeightSync()
number = wallpaper.getMinWidthSync()
console.info('wallpaperXTS ===> testGetMinWidthSync101 data : ' + JSON.stringify(number));
if (typeof number == "number") {
expect(true).assertTrue();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册