提交 cf9adc65 编写于 作者: Z zhoujun62

ActsSupportFunctionTest fail

Signed-off-by: Nzhoujun62 <zhoujun62@huawei.com>
上级 e0ec19de
......@@ -14,6 +14,14 @@
],
"type": "AppInstallKit",
"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 @@
],
"type": "AppInstallKit",
"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 @@
"installationFree": false,
"pages": "$profile:main_pages",
"uiSyntax": "ets",
"metadata": [
{
"name": "ArkTSPartialUpdate",
"value": "false"
}
],
"abilities": [
{
"name": "MainAbility",
......
......@@ -19,6 +19,14 @@
],
"type": "AppInstallKit",
"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() {
let status1 = undefined;
let status2 = undefined;
let lifeList = [];
let listCheck = ["onCreate", "onActive"];
let onActive = "Fa_SupportFunction_MainAbility_onActive";
let listCheck = ["onCreate", "wakeUpScreen"];
let wakeUpScreen = "Fa_SupportFunction_MainAbility_wakeUpScreen";
var subscriber;
var subscribeInfo = {
events: [onActive]
events: [wakeUpScreen]
}
await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
......@@ -119,7 +119,7 @@ export default function FaShowOnLockTest() {
commonEvent.subscribe(subscriber, async (err, data) => {
console.log(TAG + "SubscribeInfoCallback : " + JSON.stringify(data));
if (data.event == onActive) {
if (data.event == wakeUpScreen) {
lifeList = data.parameters.lifeList;
setTimeout(async () => {
await power.isScreenOn().then((data) => {
......@@ -186,12 +186,12 @@ export default function FaShowOnLockTest() {
let status1 = undefined;
let status2 = undefined;
let lifeList = [];
let listCheck = ["onCreate", "onActive"];
let onActive = "Fa_SupportFunction_MainAbility_onActive";
let listCheck = ["onCreate", "wakeUpScreen"];
let wakeUpScreen = "Fa_SupportFunction_MainAbility_wakeUpScreen";
var subscriber;
var subscribeInfo = {
events: [onActive]
events: [wakeUpScreen]
}
await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
......@@ -200,7 +200,7 @@ export default function FaShowOnLockTest() {
commonEvent.subscribe(subscriber, async (err, data) => {
console.log(TAG + "SubscribeInfoCallback : " + JSON.stringify(data));
if (data.event == onActive) {
if (data.event == wakeUpScreen) {
lifeList = data.parameters.lifeList;
setTimeout(async () => {
await power.isScreenOn().then((data) => {
......@@ -267,12 +267,12 @@ export default function FaShowOnLockTest() {
let status1 = undefined;
let status2 = undefined;
let lifeList = [];
let listCheck = ["onCreate", "onActive"];
let onActive = "Fa_SupportFunction_MainAbility_onActive";
let listCheck = ["onCreate", "wakeUpScreen"];
let wakeUpScreen = "Fa_SupportFunction_MainAbility_wakeUpScreen";
var subscriber;
var subscribeInfo = {
events: [onActive]
events: [wakeUpScreen]
}
await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
......@@ -281,7 +281,7 @@ export default function FaShowOnLockTest() {
commonEvent.subscribe(subscriber, async (err, data) => {
console.log(TAG + "SubscribeInfoCallback : " + JSON.stringify(data));
if (data.event == onActive) {
if (data.event == wakeUpScreen) {
lifeList = data.parameters.lifeList;
setTimeout(async () => {
await power.isScreenOn().then((data) => {
......@@ -349,13 +349,13 @@ export default function FaShowOnLockTest() {
let status2 = undefined;
let status3 = undefined;
let lifeList = [];
let listCheck = ["onCreate", "onActive"];
let onActive = "Fa_SupportFunction_MainAbility2_onActive";
let listCheck = ["onCreate", "wakeUpScreen"];
let wakeUpScreen = "Fa_SupportFunction_MainAbility2_wakeUpScreen";
let wakeUpErr = "Fa_SupportFunction_MainAbility2_wakeUpErr";
var subscriber;
var subscribeInfo = {
events: [onActive, wakeUpErr]
events: [wakeUpScreen, wakeUpErr]
}
await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
......@@ -368,7 +368,7 @@ export default function FaShowOnLockTest() {
status3 = true;
}
if (data.event == onActive) {
if (data.event == wakeUpScreen) {
lifeList = data.parameters.lifeList;
setTimeout(async () => {
await power.isScreenOn().then((data) => {
......@@ -437,13 +437,13 @@ export default function FaShowOnLockTest() {
let status2 = undefined;
let status3 = undefined;
let lifeList = [];
let listCheck = ["onCreate", "onActive"];
let onActive = "Fa_SupportFunction_MainAbility2_onActive";
let listCheck = ["onCreate", "wakeUpScreen"];
let wakeUpScreen = "Fa_SupportFunction_MainAbility2_wakeUpScreen";
let wakeUpErr = "Fa_SupportFunction_MainAbility2_wakeUpErr";
var subscriber;
var subscribeInfo = {
events: [onActive, wakeUpErr]
events: [wakeUpScreen, wakeUpErr]
}
await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
......@@ -456,7 +456,7 @@ export default function FaShowOnLockTest() {
status3 = true;
}
if (data.event == onActive) {
if (data.event == wakeUpScreen) {
lifeList = data.parameters.lifeList;
setTimeout(async () => {
await power.isScreenOn().then((data) => {
......@@ -525,13 +525,13 @@ export default function FaShowOnLockTest() {
let status2 = undefined;
let status3 = undefined;
let lifeList = [];
let listCheck = ["onCreate", "onActive"];
let onActive = "Fa_SupportFunction_MainAbility2_onActive";
let listCheck = ["onCreate", "wakeUpScreen"];
let wakeUpScreen = "Fa_SupportFunction_MainAbility2_wakeUpScreen";
let wakeUpErr = "Fa_SupportFunction_MainAbility2_wakeUpErr";
var subscriber;
var subscribeInfo = {
events: [onActive, wakeUpErr]
events: [wakeUpScreen, wakeUpErr]
}
await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
......@@ -544,7 +544,7 @@ export default function FaShowOnLockTest() {
status3 = true;
}
if (data.event == onActive) {
if (data.event == wakeUpScreen) {
lifeList = data.parameters.lifeList;
setTimeout(async () => {
await power.isScreenOn().then((data) => {
......@@ -613,13 +613,13 @@ export default function FaShowOnLockTest() {
let status2 = undefined;
let status3 = undefined;
let lifeList = [];
let listCheck = ["onCreate", "onActive"];
let onActive = "Fa_SupportFunction_MainAbility2_onActive";
let listCheck = ["onCreate", "wakeUpScreen"];
let wakeUpScreen = "Fa_SupportFunction_MainAbility2_wakeUpScreen";
let wakeUpErr = "Fa_SupportFunction_MainAbility2_wakeUpErr";
var subscriber;
var subscribeInfo = {
events: [onActive, wakeUpErr]
events: [wakeUpScreen, wakeUpErr]
}
await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
......@@ -632,7 +632,7 @@ export default function FaShowOnLockTest() {
status3 = true;
}
if (data.event == onActive) {
if (data.event == wakeUpScreen) {
lifeList = data.parameters.lifeList;
setTimeout(async () => {
await power.isScreenOn().then((data) => {
......@@ -701,13 +701,13 @@ export default function FaShowOnLockTest() {
let status2 = undefined;
let status3 = undefined;
let lifeList = [];
let listCheck = ["onCreate", "onActive"];
let onActive = "Fa_SupportFunction_MainAbility2_onActive";
let listCheck = ["onCreate", "wakeUpScreen"];
let wakeUpScreen = "Fa_SupportFunction_MainAbility2_wakeUpScreen";
let wakeUpErr = "Fa_SupportFunction_MainAbility2_wakeUpErr";
var subscriber;
var subscribeInfo = {
events: [onActive, wakeUpErr]
events: [wakeUpScreen, wakeUpErr]
}
await commonEvent.createSubscriber(subscribeInfo).then(async (data) => {
console.log(TAG + "createSubscriber data : " + JSON.stringify(data));
......@@ -720,7 +720,7 @@ export default function FaShowOnLockTest() {
status3 = true;
}
if (data.event == onActive) {
if (data.event == wakeUpScreen) {
lifeList = data.parameters.lifeList;
setTimeout(async () => {
await power.isScreenOn().then((data) => {
......
......@@ -13,6 +13,12 @@
"installationFree": false,
"pages": "$profile:main_pages",
"uiSyntax": "ets",
"metadata": [
{
"name": "ArkTSPartialUpdate",
"value": "false"
}
],
"abilities": [
{
"name": "MainAbility",
......
......@@ -30,6 +30,15 @@ export default {
try {
ability_featureAbility.getContext().setWakeUpScreen(true).then((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) => {
console.log(TAG1 + "setWakeUpScreen error = " + JSON.stringify(error));
})
......@@ -41,12 +50,30 @@ export default {
ability_featureAbility.getContext().setWakeUpScreen(true, (error, data) => {
console.log(TAG1 + "setWakeUpScreen data = " + JSON.stringify(data));
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) {
try {
ability_featureAbility.getContext().setWakeUpScreen(false).then((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) => {
console.log(TAG1 + "setWakeUpScreen error = " + JSON.stringify(error));
})
......
......@@ -19,11 +19,11 @@ var TAG1 = "Fa:SupportFunction:MainAbility2:";
var listPush1 = "Fa_SupportFunction_MainAbility2_";
var lifeList = [];
export default {
onCreate() {
async onCreate() {
console.log(TAG1 + 'onCreate');
lifeList.push('onCreate');
ability_featureAbility.getWant().then((data) => {
ability_featureAbility.getWant().then(async (data) => {
console.log(TAG1 + "getWant data = " + JSON.stringify(data));
if(data.parameters.number == 1) {
......@@ -41,6 +41,16 @@ export default {
if(data.parameters.number == 5) {
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) => {
console.log(TAG1 + "getWant error = " + JSON.stringify(error));
})
......@@ -72,6 +82,10 @@ export default {
}
}
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
function setWakeUpScreenP(featureAbility, wakeUp) {
try {
console.log(TAG1 + "setWakeUpScreenP start");
......
......@@ -13,6 +13,12 @@
"installationFree": false,
"pages": "$profile:main_pages",
"uiSyntax": "ets",
"metadata": [
{
"name": "ArkTSPartialUpdate",
"value": "false"
}
],
"abilities": [
{
"name": "MainAbility",
......
......@@ -13,6 +13,12 @@
"installationFree": false,
"pages": "$profile:main_pages",
"uiSyntax": "ets",
"metadata": [
{
"name": "ArkTSPartialUpdate",
"value": "false"
}
],
"abilities": [
{
"skills": [
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册