未验证 提交 59ae4c0e 编写于 作者: O openharmony_ci 提交者: Gitee

!6682 xts-setDisplayOrientation失败用例适配

Merge pull request !6682 from chengxingzhen/cherry-pick-1669289537
......@@ -19,6 +19,7 @@ import bundle from '@ohos.bundle';
var TAG1 = "Fa:SupportFunction:MainAbility3:";
var listPush1 = "Fa_SupportFunction_MainAbility3_";
var lifeList = [];
let setDisplayOrientation1 = 0;
export default {
onCreate() {
console.log(TAG1 + 'onCreate');
......@@ -39,6 +40,11 @@ export default {
ability_featureAbility.getContext().setDisplayOrientation(orientation, (error, setDisplayOrientation) => {
console.log(TAG1 + "setDisplayOrientation data = " + JSON.stringify(setDisplayOrientation));
console.log(TAG1 + "setDisplayOrientation error = " + JSON.stringify(error));
if (setDisplayOrientation == undefined) {
setDisplayOrientation1 = 1
} else {
console.log(`${TAG1} setDisplayOrientation callBack is error: ${JSON.stringify(setDisplayOrientation)}`);
}
ability_featureAbility.getContext().getDisplayOrientation((error, displayOrientationAfter) => {
console.log(TAG1 + "getDisplayOrientation2 data = " + JSON.stringify(displayOrientationAfter));
......@@ -49,7 +55,7 @@ export default {
displayOrientationBefore: displayOrientationBefore,
displayOrientationAfter: displayOrientationAfter,
lifeList: lifeList,
setDisplayOrientation: setDisplayOrientation
setDisplayOrientation: setDisplayOrientation1
}
}
commonEvent.publish(listPush1 + "onActive", options, (err) => {
......
......@@ -33,7 +33,7 @@ export default {
let displayOrientationBefore = undefined;
let displayOrientationAfter = undefined;
let setDisplayOrientation = undefined;
let setDisplayOrientation = 0;
let orientation = undefined;
let number = undefined;
let wantNum = undefined;
......@@ -116,7 +116,11 @@ export default {
await ability_featureAbility.getContext().setDisplayOrientation(orientation).then((data) => {
console.log(TAG1 + "setShowOnLockScreen data = " + JSON.stringify(data));
setDisplayOrientation = data;
if (data == undefined) {
setDisplayOrientation = 1
} else {
console.log(`${TAG1} setDisplayOrientation callBack is error: ${JSON.stringify(data)}`);
}
}).catch((error) => {
console.log(TAG1 + "setShowOnLockScreen error = " + JSON.stringify(error));
})
......
......@@ -33,7 +33,7 @@ export default {
let displayOrientationBefore = undefined;
let displayOrientationAfter = undefined;
let setDisplayOrientation = undefined;
let setDisplayOrientation = 0;
let orientation = bundle.DisplayOrientation.FOLLOW_RECENT;
await ability_featureAbility.getContext().getDisplayOrientation().then((data) => {
......@@ -45,7 +45,11 @@ export default {
await ability_featureAbility.getContext().setDisplayOrientation(orientation).then((data) => {
console.log(TAG1 + "setShowOnLockScreen data = " + JSON.stringify(data));
setDisplayOrientation = data;
if (data == undefined) {
setDisplayOrientation = 1
} else {
console.log(`${TAG1} setDisplayOrientation callBack is error: ${JSON.stringify(data)}`);
}
}).catch((error) => {
console.log(TAG1 + "setShowOnLockScreen error = " + JSON.stringify(error));
})
......
......@@ -33,7 +33,7 @@ export default {
let displayOrientationBefore = undefined;
let displayOrientationAfter = undefined;
let setDisplayOrientation = undefined;
let setDisplayOrientation = 0;
let orientation = bundle.DisplayOrientation.FOLLOW_RECENT;
await ability_featureAbility.getContext().getDisplayOrientation().then((data) => {
......@@ -45,7 +45,11 @@ export default {
await ability_featureAbility.getContext().setDisplayOrientation(orientation).then((data) => {
console.log(TAG1 + "setShowOnLockScreen data = " + JSON.stringify(data));
setDisplayOrientation = data;
if (data == undefined) {
setDisplayOrientation = 1
} else {
console.log(`${TAG1} setDisplayOrientation callBack is error: ${JSON.stringify(data)}`);
}
}).catch((error) => {
console.log(TAG1 + "setShowOnLockScreen error = " + JSON.stringify(error));
})
......
......@@ -33,7 +33,7 @@ export default {
let displayOrientationBefore = undefined;
let displayOrientationAfter = undefined;
let setDisplayOrientation = undefined;
let setDisplayOrientation = 0;
let orientation = bundle.DisplayOrientation.FOLLOW_RECENT;
await ability_featureAbility.getContext().getDisplayOrientation().then((data) => {
......@@ -45,7 +45,11 @@ export default {
await ability_featureAbility.getContext().setDisplayOrientation(orientation).then((data) => {
console.log(TAG1 + "setShowOnLockScreen data = " + JSON.stringify(data));
setDisplayOrientation = data;
if (data == undefined) {
setDisplayOrientation = 1
} else {
console.log(`${TAG1} setDisplayOrientation callBack is error: ${JSON.stringify(data)}`);
}
}).catch((error) => {
console.log(TAG1 + "setShowOnLockScreen error = " + JSON.stringify(error));
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册