Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
38ba468e
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
38ba468e
编写于
8月 25, 2022
作者:
O
openharmony_ci
提交者:
Gitee
8月 25, 2022
浏览文件
操作
浏览文件
下载
差异文件
!5158 3.2.6.3新增xts用例
Merge pull request !5158 from 华华小仙女/master
上级
e5482e3c
993c0de0
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
184 addition
and
30 deletion
+184
-30
graphic/windowStage/entry/src/main/ets/test/windowCallback.test.ets
...ndowStage/entry/src/main/ets/test/windowCallback.test.ets
+99
-18
graphic/windowStage/entry/src/main/ets/test/windowPromise.test.ets
...indowStage/entry/src/main/ets/test/windowPromise.test.ets
+85
-12
未找到文件。
graphic/windowStage/entry/src/main/ets/test/windowCallback.test.ets
浏览文件 @
38ba468e
...
...
@@ -1418,12 +1418,12 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
})
})
/**
* @tc.number SUB_WINDOW_SETPREFERREDORIENTATION_JSAPI_00
1
* @tc.name Test setPreferredOrientation
* @tc.number SUB_WINDOW_SETPREFERREDORIENTATION_JSAPI_00
2
* @tc.name Test setPreferredOrientation
Test2
* @tc.desc Sets the display direction property of the window
*/
it('setPreferredOrientation', 0, async function (done) {
let caseName = 'setPreferredOrientation';
it('setPreferredOrientation
Test2
', 0, async function (done) {
let caseName = 'setPreferredOrientation
Test2
';
let msgStr = 'jsunittest ' + caseName + ' ';
console.log(msgStr + 'begin');
let mainWin = await windowStage.getMainWindow().catch(err => {
...
...
@@ -1446,12 +1446,12 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
done();
})
/**
* @tc.number SUB_WINDOW_SETFORBIDSPLITMOVE_JSAPI_00
1
* @tc.name Test setForbidSplitMove
* @tc.number SUB_WINDOW_SETFORBIDSPLITMOVE_JSAPI_00
2
* @tc.name Test setForbidSplitMove
Test2
* @tc.desc Sets whether Windows are forbidden to move in split screen mode
*/
it('setForbidSplitMove', 0, async function (done) {
let caseName = 'setForbidSplitMove';
it('setForbidSplitMove
Test2
', 0, async function (done) {
let caseName = 'setForbidSplitMove
Test2
';
let msgStr = 'jsunittest ' + caseName + ' ';
console.log(msgStr + 'begin');
let mainWin = await windowStage.getMainWindow().catch(err => {
...
...
@@ -1477,10 +1477,10 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
done();
})
/**
* @tc.number SUB_WINDOW_SNAPSHOT_JSAPI_002
* @tc.name Test snapshotTest2
* @tc.desc Scenario of screenshot of verification window
*/
* @tc.number SUB_WINDOW_SNAPSHOT_JSAPI_002
* @tc.name Test snapshotTest2
* @tc.desc Scenario of screenshot of verification window
*/
it('snapshotTest2', 0, async function (done) {
let caseName = 'snapshotTest2';
let msgStr = 'jsunittest ' + caseName + ' ';
...
...
@@ -1558,12 +1558,12 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
controller.animationForShown = (context: ohosWindow.TransitionContext) => {
let toWindow = context.toWindow
animateTo({
duration: 1000,
// 动画时长
tempo: 0.5,
// 播放速率
curve: Curve.EaseInOut,
// 动画曲线
delay: 0,
// 动画延迟
iterations: 1,
// 播放次数
playMode: PlayMode.Normal,
// 动画模式
duration: 1000,
tempo: 0.5,
curve: Curve.EaseInOut,
delay: 0,
iterations: 1,
playMode: PlayMode.Normal,
}, () => {
var obj: ohosWindow.TranslateOptions;
obj.x = 100.0;
...
...
@@ -1581,5 +1581,86 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
});
})
/**
* @tc.number SUB_WINDOW_GETCUTOUTINFO_JSAPI_002
* @tc.name Test getCutoutInfoTest2
* @tc.desc Obtain information about unavailable screen areas such as the hole screen, fringe screen, and waterfall screen
*/
it('getCutoutInfoTest2', 0, async function (done) {
let caseName = 'getCutoutInfoTest2';
let msgStr = 'jsunittest ' + caseName + ' ';
console.log(msgStr + 'begin context==' + JSON.stringify(context));
let dpClass = display.getDefaultDisplaySync();
expect(!!dpClass).assertTrue();
dpClass.getCutoutInfo((err, data) => {
if (err && err.code) {
unexpectedError(err, caseName, 'displayClass.getCutoutInfo', done);
}else{
console.info(msgStr+'Succeeded in getting cutoutInfo. Data: ' + JSON.stringify(data));
done();
}
})
})
/**
* @tc.number SUB_WINDOW_SHOWWITHANIMATION_JSAPI_002
* @tc.name Test showWithAnimationTest2
* @tc.desc Displays the current window, playing an animation in the process
*/
it('showWithAnimationTest2', 0, async function (done) {
let caseName = 'showWithAnimationTest2';
let msgStr = 'jsunittest ' + caseName + ' ';
console.log(msgStr + 'begin context==' + JSON.stringify(context));
let wndId = 'showWithAnimationTest2';
let baseType = ohosWindow.WindowType.TYPE_FLOAT;
ohosWindow.create(context, wndId, baseType, (err, data) => {
if (err && err.code) {
unexpectedError(err, caseName, 'ohosWindow.create ' + baseType, done);
} else {
let tempWnd=data;
console.log(msgStr + 'ohosWindow.create ' + baseType + ', tempWnd: ' + JSON.stringify(tempWnd));
expect(!!tempWnd).assertTrue();
tempWnd.showWithAnimation((error, animationData) => {
if (error && error.code) {
unexpectedError(error, caseName, 'Failed to show the window with animation', done);
}else {
console.info('Succeeded in showing the window with animation. Data: ' + JSON.stringify(animationData));
done();
}
})
}
})
})
/**
* @tc.number SUB_WINDOW_HIDEWITHANIMATION_JSAPI_002
* @tc.name Test hideWithAnimationTest2
* @tc.desc Hide the current window and play an animation in the process
*/
it('hideWithAnimationTest2', 0, async function (done) {
let caseName = 'hideWithAnimationTest2';
let msgStr = 'jsunittest ' + caseName + ' ';
console.log(msgStr + 'begin context==' + JSON.stringify(context));
let wndId = 'hideWithAnimationTest2';
let baseType = ohosWindow.WindowType.TYPE_FLOAT;
ohosWindow.create(context, wndId, baseType, (creare_err, tempWnd) => {
if (creare_err && creare_err.code) {
unexpectedError(creare_err, caseName, 'ohosWindow.create ' + baseType, done);
}
expect(!!tempWnd).assertTrue();
ohosWindow.find(wndId, (findErr, findWnd) => {
if (findErr && findErr.code) {
unexpectedError(findErr, caseName, 'Failed to hide the window with animation', done);
}else {
findWnd.hideWithAnimation((err, data) => {
if (err && err.code) {
unexpectedError(err, caseName, 'Failed to hide the window with animation', done);
}else {
console.info('Succeeded in hiding the window with animation. Data: ' + JSON.stringify(data));
done();
}
})
}
})
})
})
})
}
graphic/windowStage/entry/src/main/ets/test/windowPromise.test.ets
浏览文件 @
38ba468e
...
...
@@ -1353,11 +1353,11 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
})
/**
* @tc.number SUB_WINDOW_SETPREFERREDORIENTATION_JSAPI_001
* @tc.name Test setPreferredOrientation
* @tc.name Test setPreferredOrientation
Test1
* @tc.desc Sets the display direction property of the window
*/
it('setPreferredOrientation', 0, async function (done) {
let caseName = 'setPreferredOrientation';
it('setPreferredOrientation
Test1
', 0, async function (done) {
let caseName = 'setPreferredOrientation
Test1
';
let msgStr = 'jsunittest ' + caseName + ' ';
console.log(msgStr + 'begin');
let mainWin = await windowStage.getMainWindow().catch(err => {
...
...
@@ -1380,11 +1380,11 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
})
/**
* @tc.number SUB_WINDOW_SETFORBIDSPLITMOVE_JSAPI_001
* @tc.name Test setForbidSplitMove
* @tc.name Test setForbidSplitMove
Test1
* @tc.desc Sets whether Windows are forbidden to move in split screen mode
*/
it('setForbidSplitMove', 0, async function (done) {
let caseName = 'setForbidSplitMove';
it('setForbidSplitMove
Test1
', 0, async function (done) {
let caseName = 'setForbidSplitMove
Test1
';
let msgStr = 'jsunittest ' + caseName + ' ';
console.log(msgStr + 'begin');
let mainWin = await windowStage.getMainWindow().catch(err => {
...
...
@@ -1464,12 +1464,12 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
controller.animationForShown = (context: ohosWindow.TransitionContext) => {
let toWindow = context.toWindow
animateTo({
duration: 1000,
// 动画时长
tempo: 0.5,
// 播放速率
curve: Curve.EaseInOut,
// 动画曲线
delay: 0,
// 动画延迟
iterations: 1,
// 播放次数
playMode: PlayMode.Normal,
// 动画模式
duration: 1000,
tempo: 0.5,
curve: Curve.EaseInOut,
delay: 0,
iterations: 1,
playMode: PlayMode.Normal,
}, () => {
var obj: ohosWindow.TranslateOptions;
obj.x = 100.0;
...
...
@@ -1484,5 +1484,78 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
}
done();
})
/**
* @tc.number SUB_WINDOW_GETCUTOUTINFO_JSAPI_001
* @tc.name Test getCutoutInfoTest1
* @tc.desc Obtain information about unavailable screen areas such as the hole screen, fringe screen, and waterfall screen
*/
it('getCutoutInfoTest1', 0, async function (done) {
let caseName = 'getCutoutInfoTest1';
let msgStr = 'jsunittest ' + caseName + ' ';
console.log(msgStr + 'begin context==' + JSON.stringify(context));
let dpClass = display.getDefaultDisplaySync();
expect(!!dpClass).assertTrue();
dpClass.getCutoutInfo().then((data) => {
console.info('Succeeded in getting cutoutInfo. Data: ' + JSON.stringify(data));
done();
}).catch(err=>{
unexpectedError(err, caseName, 'displayClass.getCutoutInfo', done);
});
})
/**
* @tc.number SUB_WINDOW_SHOWWITHANIMATION_JSAPI_001
* @tc.name Test showWithAnimationTest1
* @tc.desc Displays the current window, playing an animation in the process
*/
it('showWithAnimationTest1', 0, async function (done) {
let caseName = 'showWithAnimationTest1';
let msgStr = 'jsunittest ' + caseName + ' ';
console.log(msgStr + 'begin context==' + JSON.stringify(context));
let wndId = 'showWithAnimationTest1';
let baseType = ohosWindow.WindowType.TYPE_FLOAT;
let tempWnd = await ohosWindow.create(context,wndId, baseType).catch((err) => {
unexpectedError(err, caseName, 'ohosWindow.create ' + baseType, done);
});
console.log(msgStr + 'ohosWindow.create ' + baseType + ', tempWnd: ' + JSON.stringify(tempWnd));
expect(!!tempWnd).assertTrue();
console.info('showWithAnimationTest1 ****' + Reflect.has(tempWnd,'showWithAnimation'))
await tempWnd.showWithAnimation().then((data)=> {
console.info('Succeeded in showing the window with animation. Data: ' + JSON.stringify(data));
done();
}).catch((err)=>{
unexpectedError(err, caseName, 'Failed to show the window with animation', done);
})
})
/**
* @tc.number SUB_WINDOW_HIDEWITHANIMATION_JSAPI_001
* @tc.name Test hideWithAnimationTest1
* @tc.desc Hide the current window and play an animation in the process
*/
it('hideWithAnimationTest1', 0, async function (done) {
let caseName = 'hideWithAnimationTest1';
let msgStr = 'jsunittest ' + caseName + ' ';
console.log(msgStr + 'begin context==' + JSON.stringify(context));
let wndId = 'hideWithAnimationTest1';
let baseType = ohosWindow.WindowType.TYPE_FLOAT;
let tempWnd = await ohosWindow.create(context,wndId, baseType).catch((err) => {
unexpectedError(err, caseName, 'ohosWindow.create ' + baseType, done);
});
console.log(msgStr + 'ohosWindow.create ' + baseType + ', tempWnd: ' + JSON.stringify(tempWnd));
expect(!!tempWnd).assertTrue();
let findWnd = await ohosWindow.find(wndId).catch((err) => {
expectedError(err, caseName, 'ohosWindow.find', done);
});
console.log(msgStr + 'find findWnd: ' + JSON.stringify(findWnd));
expect(!!findWnd).assertTrue();
console.info('hideWithAnimationTest1 ****' + Reflect.has(findWnd,'hideWithAnimation'))
console.info('hideWithAnimationTest1 ****' + Reflect.has(findWnd,'destroy'))
let promise = findWnd.hideWithAnimation();
promise.then((data)=> {
console.info('Succeeded in hiding the window with animation. Data: ' + JSON.stringify(data));
done();
}).catch((err)=>{
console.error('Failed to hide the window with animation. Cause: ' + JSON.stringify(err));
})
})
})
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录