未验证 提交 656de45a 编写于 作者: O openharmony_ci 提交者: Gitee

!8434 Solve XTS ActsSupportFunctionTest Fail Problem

Merge pull request !8434 from zhoujun62/my_xts_acts
...@@ -14,6 +14,14 @@ ...@@ -14,6 +14,14 @@
], ],
"type": "AppInstallKit", "type": "AppInstallKit",
"cleanup-apps": true "cleanup-apps": true
},
{
"type": "ShellKit",
"run-command": [
"power-shell wakeup",
"power-shell setmode 602",
"uinput -T -d 300 600 -m 300 600 300 100 -u 300 100"
]
} }
] ]
} }
......
...@@ -17,6 +17,14 @@ ...@@ -17,6 +17,14 @@
], ],
"type": "AppInstallKit", "type": "AppInstallKit",
"cleanup-apps": true "cleanup-apps": true
},
{
"type": "ShellKit",
"run-command": [
"power-shell wakeup",
"power-shell setmode 602",
"uinput -T -d 300 600 -m 300 600 300 100 -u 300 100"
]
} }
] ]
} }
......
...@@ -13,6 +13,12 @@ ...@@ -13,6 +13,12 @@
"installationFree": false, "installationFree": false,
"pages": "$profile:main_pages", "pages": "$profile:main_pages",
"uiSyntax": "ets", "uiSyntax": "ets",
"metadata": [
{
"name": "ArkTSPartialUpdate",
"value": "false"
}
],
"abilities": [ "abilities": [
{ {
"name": "MainAbility", "name": "MainAbility",
......
...@@ -19,6 +19,14 @@ ...@@ -19,6 +19,14 @@
], ],
"type": "AppInstallKit", "type": "AppInstallKit",
"cleanup-apps": true "cleanup-apps": true
},
{
"type": "ShellKit",
"run-command": [
"power-shell wakeup",
"power-shell setmode 602",
"uinput -T -d 300 600 -m 300 600 300 100 -u 300 100"
]
} }
] ]
} }
......
...@@ -105,12 +105,12 @@ export default function FaShowOnLockTest() { ...@@ -105,12 +105,12 @@ export default function FaShowOnLockTest() {
let status1 = undefined; let status1 = undefined;
let status2 = undefined; let status2 = undefined;
let lifeList = []; let lifeList = [];
let listCheck = ["onCreate", "onActive"]; let listCheck = ["onCreate", "wakeUpScreen"];
let onActive = "Fa_SupportFunction_MainAbility_onActive"; let wakeUpScreen = "Fa_SupportFunction_MainAbility_wakeUpScreen";
var subscriber; var subscriber;
var subscribeInfo = { var subscribeInfo = {
events: [onActive] events: [wakeUpScreen]
} }
await commonEvent.createSubscriber(subscribeInfo).then(async (data) => { await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
console.log(TAG + "createSubscriber data : " + JSON.stringify(data)); console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
...@@ -119,7 +119,7 @@ export default function FaShowOnLockTest() { ...@@ -119,7 +119,7 @@ export default function FaShowOnLockTest() {
commonEvent.subscribe(subscriber, async (err, data) => { commonEvent.subscribe(subscriber, async (err, data) => {
console.log(TAG + "SubscribeInfoCallback : " + JSON.stringify(data)); console.log(TAG + "SubscribeInfoCallback : " + JSON.stringify(data));
if (data.event == onActive) { if (data.event == wakeUpScreen) {
lifeList = data.parameters.lifeList; lifeList = data.parameters.lifeList;
setTimeout(async () => { setTimeout(async () => {
await power.isScreenOn().then((data) => { await power.isScreenOn().then((data) => {
...@@ -186,12 +186,12 @@ export default function FaShowOnLockTest() { ...@@ -186,12 +186,12 @@ export default function FaShowOnLockTest() {
let status1 = undefined; let status1 = undefined;
let status2 = undefined; let status2 = undefined;
let lifeList = []; let lifeList = [];
let listCheck = ["onCreate", "onActive"]; let listCheck = ["onCreate", "wakeUpScreen"];
let onActive = "Fa_SupportFunction_MainAbility_onActive"; let wakeUpScreen = "Fa_SupportFunction_MainAbility_wakeUpScreen";
var subscriber; var subscriber;
var subscribeInfo = { var subscribeInfo = {
events: [onActive] events: [wakeUpScreen]
} }
await commonEvent.createSubscriber(subscribeInfo).then(async (data) => { await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
console.log(TAG + "createSubscriber data : " + JSON.stringify(data)); console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
...@@ -200,7 +200,7 @@ export default function FaShowOnLockTest() { ...@@ -200,7 +200,7 @@ export default function FaShowOnLockTest() {
commonEvent.subscribe(subscriber, async (err, data) => { commonEvent.subscribe(subscriber, async (err, data) => {
console.log(TAG + "SubscribeInfoCallback : " + JSON.stringify(data)); console.log(TAG + "SubscribeInfoCallback : " + JSON.stringify(data));
if (data.event == onActive) { if (data.event == wakeUpScreen) {
lifeList = data.parameters.lifeList; lifeList = data.parameters.lifeList;
setTimeout(async () => { setTimeout(async () => {
await power.isScreenOn().then((data) => { await power.isScreenOn().then((data) => {
...@@ -267,12 +267,12 @@ export default function FaShowOnLockTest() { ...@@ -267,12 +267,12 @@ export default function FaShowOnLockTest() {
let status1 = undefined; let status1 = undefined;
let status2 = undefined; let status2 = undefined;
let lifeList = []; let lifeList = [];
let listCheck = ["onCreate", "onActive"]; let listCheck = ["onCreate", "wakeUpScreen"];
let onActive = "Fa_SupportFunction_MainAbility_onActive"; let wakeUpScreen = "Fa_SupportFunction_MainAbility_wakeUpScreen";
var subscriber; var subscriber;
var subscribeInfo = { var subscribeInfo = {
events: [onActive] events: [wakeUpScreen]
} }
await commonEvent.createSubscriber(subscribeInfo).then(async (data) => { await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
console.log(TAG + "createSubscriber data : " + JSON.stringify(data)); console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
...@@ -281,7 +281,7 @@ export default function FaShowOnLockTest() { ...@@ -281,7 +281,7 @@ export default function FaShowOnLockTest() {
commonEvent.subscribe(subscriber, async (err, data) => { commonEvent.subscribe(subscriber, async (err, data) => {
console.log(TAG + "SubscribeInfoCallback : " + JSON.stringify(data)); console.log(TAG + "SubscribeInfoCallback : " + JSON.stringify(data));
if (data.event == onActive) { if (data.event == wakeUpScreen) {
lifeList = data.parameters.lifeList; lifeList = data.parameters.lifeList;
setTimeout(async () => { setTimeout(async () => {
await power.isScreenOn().then((data) => { await power.isScreenOn().then((data) => {
...@@ -349,13 +349,13 @@ export default function FaShowOnLockTest() { ...@@ -349,13 +349,13 @@ export default function FaShowOnLockTest() {
let status2 = undefined; let status2 = undefined;
let status3 = undefined; let status3 = undefined;
let lifeList = []; let lifeList = [];
let listCheck = ["onCreate", "onActive"]; let listCheck = ["onCreate", "wakeUpScreen"];
let onActive = "Fa_SupportFunction_MainAbility2_onActive"; let wakeUpScreen = "Fa_SupportFunction_MainAbility2_wakeUpScreen";
let wakeUpErr = "Fa_SupportFunction_MainAbility2_wakeUpErr"; let wakeUpErr = "Fa_SupportFunction_MainAbility2_wakeUpErr";
var subscriber; var subscriber;
var subscribeInfo = { var subscribeInfo = {
events: [onActive, wakeUpErr] events: [wakeUpScreen, wakeUpErr]
} }
await commonEvent.createSubscriber(subscribeInfo).then(async (data) => { await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
console.log(TAG + "createSubscriber data : " + JSON.stringify(data)); console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
...@@ -368,7 +368,7 @@ export default function FaShowOnLockTest() { ...@@ -368,7 +368,7 @@ export default function FaShowOnLockTest() {
status3 = true; status3 = true;
} }
if (data.event == onActive) { if (data.event == wakeUpScreen) {
lifeList = data.parameters.lifeList; lifeList = data.parameters.lifeList;
setTimeout(async () => { setTimeout(async () => {
await power.isScreenOn().then((data) => { await power.isScreenOn().then((data) => {
...@@ -437,13 +437,13 @@ export default function FaShowOnLockTest() { ...@@ -437,13 +437,13 @@ export default function FaShowOnLockTest() {
let status2 = undefined; let status2 = undefined;
let status3 = undefined; let status3 = undefined;
let lifeList = []; let lifeList = [];
let listCheck = ["onCreate", "onActive"]; let listCheck = ["onCreate", "wakeUpScreen"];
let onActive = "Fa_SupportFunction_MainAbility2_onActive"; let wakeUpScreen = "Fa_SupportFunction_MainAbility2_wakeUpScreen";
let wakeUpErr = "Fa_SupportFunction_MainAbility2_wakeUpErr"; let wakeUpErr = "Fa_SupportFunction_MainAbility2_wakeUpErr";
var subscriber; var subscriber;
var subscribeInfo = { var subscribeInfo = {
events: [onActive, wakeUpErr] events: [wakeUpScreen, wakeUpErr]
} }
await commonEvent.createSubscriber(subscribeInfo).then(async (data) => { await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
console.log(TAG + "createSubscriber data : " + JSON.stringify(data)); console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
...@@ -456,7 +456,7 @@ export default function FaShowOnLockTest() { ...@@ -456,7 +456,7 @@ export default function FaShowOnLockTest() {
status3 = true; status3 = true;
} }
if (data.event == onActive) { if (data.event == wakeUpScreen) {
lifeList = data.parameters.lifeList; lifeList = data.parameters.lifeList;
setTimeout(async () => { setTimeout(async () => {
await power.isScreenOn().then((data) => { await power.isScreenOn().then((data) => {
...@@ -525,13 +525,13 @@ export default function FaShowOnLockTest() { ...@@ -525,13 +525,13 @@ export default function FaShowOnLockTest() {
let status2 = undefined; let status2 = undefined;
let status3 = undefined; let status3 = undefined;
let lifeList = []; let lifeList = [];
let listCheck = ["onCreate", "onActive"]; let listCheck = ["onCreate", "wakeUpScreen"];
let onActive = "Fa_SupportFunction_MainAbility2_onActive"; let wakeUpScreen = "Fa_SupportFunction_MainAbility2_wakeUpScreen";
let wakeUpErr = "Fa_SupportFunction_MainAbility2_wakeUpErr"; let wakeUpErr = "Fa_SupportFunction_MainAbility2_wakeUpErr";
var subscriber; var subscriber;
var subscribeInfo = { var subscribeInfo = {
events: [onActive, wakeUpErr] events: [wakeUpScreen, wakeUpErr]
} }
await commonEvent.createSubscriber(subscribeInfo).then(async (data) => { await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
console.log(TAG + "createSubscriber data : " + JSON.stringify(data)); console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
...@@ -544,7 +544,7 @@ export default function FaShowOnLockTest() { ...@@ -544,7 +544,7 @@ export default function FaShowOnLockTest() {
status3 = true; status3 = true;
} }
if (data.event == onActive) { if (data.event == wakeUpScreen) {
lifeList = data.parameters.lifeList; lifeList = data.parameters.lifeList;
setTimeout(async () => { setTimeout(async () => {
await power.isScreenOn().then((data) => { await power.isScreenOn().then((data) => {
...@@ -613,13 +613,13 @@ export default function FaShowOnLockTest() { ...@@ -613,13 +613,13 @@ export default function FaShowOnLockTest() {
let status2 = undefined; let status2 = undefined;
let status3 = undefined; let status3 = undefined;
let lifeList = []; let lifeList = [];
let listCheck = ["onCreate", "onActive"]; let listCheck = ["onCreate", "wakeUpScreen"];
let onActive = "Fa_SupportFunction_MainAbility2_onActive"; let wakeUpScreen = "Fa_SupportFunction_MainAbility2_wakeUpScreen";
let wakeUpErr = "Fa_SupportFunction_MainAbility2_wakeUpErr"; let wakeUpErr = "Fa_SupportFunction_MainAbility2_wakeUpErr";
var subscriber; var subscriber;
var subscribeInfo = { var subscribeInfo = {
events: [onActive, wakeUpErr] events: [wakeUpScreen, wakeUpErr]
} }
await commonEvent.createSubscriber(subscribeInfo).then(async (data) => { await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
console.log(TAG + "createSubscriber data : " + JSON.stringify(data)); console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
...@@ -632,7 +632,7 @@ export default function FaShowOnLockTest() { ...@@ -632,7 +632,7 @@ export default function FaShowOnLockTest() {
status3 = true; status3 = true;
} }
if (data.event == onActive) { if (data.event == wakeUpScreen) {
lifeList = data.parameters.lifeList; lifeList = data.parameters.lifeList;
setTimeout(async () => { setTimeout(async () => {
await power.isScreenOn().then((data) => { await power.isScreenOn().then((data) => {
...@@ -701,13 +701,13 @@ export default function FaShowOnLockTest() { ...@@ -701,13 +701,13 @@ export default function FaShowOnLockTest() {
let status2 = undefined; let status2 = undefined;
let status3 = undefined; let status3 = undefined;
let lifeList = []; let lifeList = [];
let listCheck = ["onCreate", "onActive"]; let listCheck = ["onCreate", "wakeUpScreen"];
let onActive = "Fa_SupportFunction_MainAbility2_onActive"; let wakeUpScreen = "Fa_SupportFunction_MainAbility2_wakeUpScreen";
let wakeUpErr = "Fa_SupportFunction_MainAbility2_wakeUpErr"; let wakeUpErr = "Fa_SupportFunction_MainAbility2_wakeUpErr";
var subscriber; var subscriber;
var subscribeInfo = { var subscribeInfo = {
events: [onActive, wakeUpErr] events: [wakeUpScreen, wakeUpErr]
} }
await commonEvent.createSubscriber(subscribeInfo).then(async (data) => { await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
console.log(TAG + "createSubscriber data : " + JSON.stringify(data)); console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
...@@ -720,7 +720,7 @@ export default function FaShowOnLockTest() { ...@@ -720,7 +720,7 @@ export default function FaShowOnLockTest() {
status3 = true; status3 = true;
} }
if (data.event == onActive) { if (data.event == wakeUpScreen) {
lifeList = data.parameters.lifeList; lifeList = data.parameters.lifeList;
setTimeout(async () => { setTimeout(async () => {
await power.isScreenOn().then((data) => { await power.isScreenOn().then((data) => {
......
...@@ -13,6 +13,12 @@ ...@@ -13,6 +13,12 @@
"installationFree": false, "installationFree": false,
"pages": "$profile:main_pages", "pages": "$profile:main_pages",
"uiSyntax": "ets", "uiSyntax": "ets",
"metadata": [
{
"name": "ArkTSPartialUpdate",
"value": "false"
}
],
"abilities": [ "abilities": [
{ {
"name": "MainAbility", "name": "MainAbility",
......
...@@ -30,6 +30,15 @@ export default { ...@@ -30,6 +30,15 @@ export default {
try { try {
ability_featureAbility.getContext().setWakeUpScreen(true).then((data) => { ability_featureAbility.getContext().setWakeUpScreen(true).then((data) => {
console.log(TAG1 + "setWakeUpScreen data = " + JSON.stringify(data)); console.log(TAG1 + "setWakeUpScreen data = " + JSON.stringify(data));
lifeList.push('wakeUpScreen');
let options = {
parameters: {
lifeList: lifeList
}
}
commonEvent.publish(listPush1 + "wakeUpScreen", options, (err) => {
console.log(TAG1 + listPush1 + "wakeUpScreen");
});
}).catch((error) => { }).catch((error) => {
console.log(TAG1 + "setWakeUpScreen error = " + JSON.stringify(error)); console.log(TAG1 + "setWakeUpScreen error = " + JSON.stringify(error));
}) })
...@@ -41,12 +50,30 @@ export default { ...@@ -41,12 +50,30 @@ export default {
ability_featureAbility.getContext().setWakeUpScreen(true, (error, data) => { ability_featureAbility.getContext().setWakeUpScreen(true, (error, data) => {
console.log(TAG1 + "setWakeUpScreen data = " + JSON.stringify(data)); console.log(TAG1 + "setWakeUpScreen data = " + JSON.stringify(data));
console.log(TAG1 + "setWakeUpScreen error = " + JSON.stringify(error)); console.log(TAG1 + "setWakeUpScreen error = " + JSON.stringify(error));
lifeList.push('wakeUpScreen');
let options = {
parameters: {
lifeList: lifeList
}
}
commonEvent.publish(listPush1 + "wakeUpScreen", options, (err) => {
console.log(TAG1 + listPush1 + "wakeUpScreen");
});
}) })
} }
if(data.parameters.number == 3) { if(data.parameters.number == 3) {
try { try {
ability_featureAbility.getContext().setWakeUpScreen(false).then((data) => { ability_featureAbility.getContext().setWakeUpScreen(false).then((data) => {
console.log(TAG1 + "setWakeUpScreen data = " + JSON.stringify(data)); console.log(TAG1 + "setWakeUpScreen data = " + JSON.stringify(data));
lifeList.push('wakeUpScreen');
let options = {
parameters: {
lifeList: lifeList
}
}
commonEvent.publish(listPush1 + "wakeUpScreen", options, (err) => {
console.log(TAG1 + listPush1 + "wakeUpScreen");
});
}).catch((error) => { }).catch((error) => {
console.log(TAG1 + "setWakeUpScreen error = " + JSON.stringify(error)); console.log(TAG1 + "setWakeUpScreen error = " + JSON.stringify(error));
}) })
......
...@@ -19,11 +19,11 @@ var TAG1 = "Fa:SupportFunction:MainAbility2:"; ...@@ -19,11 +19,11 @@ var TAG1 = "Fa:SupportFunction:MainAbility2:";
var listPush1 = "Fa_SupportFunction_MainAbility2_"; var listPush1 = "Fa_SupportFunction_MainAbility2_";
var lifeList = []; var lifeList = [];
export default { export default {
onCreate() { async onCreate() {
console.log(TAG1 + 'onCreate'); console.log(TAG1 + 'onCreate');
lifeList.push('onCreate'); lifeList.push('onCreate');
ability_featureAbility.getWant().then((data) => { ability_featureAbility.getWant().then(async (data) => {
console.log(TAG1 + "getWant data = " + JSON.stringify(data)); console.log(TAG1 + "getWant data = " + JSON.stringify(data));
if(data.parameters.number == 1) { if(data.parameters.number == 1) {
...@@ -41,6 +41,16 @@ export default { ...@@ -41,6 +41,16 @@ export default {
if(data.parameters.number == 5) { if(data.parameters.number == 5) {
setWakeUpScreenP(ability_featureAbility, {status1: true, status2: true}) setWakeUpScreenP(ability_featureAbility, {status1: true, status2: true})
} }
await sleep(300);
lifeList.push('wakeUpScreen');
let options = {
parameters: {
lifeList: lifeList
}
}
commonEvent.publish(listPush1 + "wakeUpScreen", options, (err) => {
console.log(TAG1 + listPush1 + "wakeUpScreen");
});
}).catch((error) => { }).catch((error) => {
console.log(TAG1 + "getWant error = " + JSON.stringify(error)); console.log(TAG1 + "getWant error = " + JSON.stringify(error));
}) })
...@@ -72,6 +82,10 @@ export default { ...@@ -72,6 +82,10 @@ export default {
} }
} }
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
function setWakeUpScreenP(featureAbility, wakeUp) { function setWakeUpScreenP(featureAbility, wakeUp) {
try { try {
console.log(TAG1 + "setWakeUpScreenP start"); console.log(TAG1 + "setWakeUpScreenP start");
......
...@@ -13,6 +13,12 @@ ...@@ -13,6 +13,12 @@
"installationFree": false, "installationFree": false,
"pages": "$profile:main_pages", "pages": "$profile:main_pages",
"uiSyntax": "ets", "uiSyntax": "ets",
"metadata": [
{
"name": "ArkTSPartialUpdate",
"value": "false"
}
],
"abilities": [ "abilities": [
{ {
"name": "MainAbility", "name": "MainAbility",
......
...@@ -13,6 +13,12 @@ ...@@ -13,6 +13,12 @@
"installationFree": false, "installationFree": false,
"pages": "$profile:main_pages", "pages": "$profile:main_pages",
"uiSyntax": "ets", "uiSyntax": "ets",
"metadata": [
{
"name": "ArkTSPartialUpdate",
"value": "false"
}
],
"abilities": [ "abilities": [
{ {
"skills": [ "skills": [
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册