Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
06833552
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看板
未验证
提交
06833552
编写于
6月 28, 2023
作者:
O
openharmony_ci
提交者:
Gitee
6月 28, 2023
浏览文件
操作
浏览文件
下载
差异文件
!9106 stage接口xts用例补充
Merge pull request !9106 from huangdong/dev
上级
c628157c
1ed61627
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
244 addition
and
0 deletion
+244
-0
arkui/ace_ets_component_completion/ace_ets_component_wholeCompletion/src/main/ets/test/stageMediaquery.test.ets
...holeCompletion/src/main/ets/test/stageMediaquery.test.ets
+32
-0
arkui/ace_ets_component_completion/ace_ets_component_wholeCompletion/src/main/ets/test/stageRouter.test.ets
...nt_wholeCompletion/src/main/ets/test/stageRouter.test.ets
+212
-0
未找到文件。
arkui/ace_ets_component_completion/ace_ets_component_wholeCompletion/src/main/ets/test/stageMediaquery.test.ets
浏览文件 @
06833552
...
...
@@ -224,5 +224,37 @@ export default function stageMediaquery() {
console.info('testmediaQueryOff0012 END');
done();
});
it('testmediaQueryOff0013', 0, async function (done) {
let mediaQuery = globalThis.uiContent.getMediaquery();
console.info('testmediaQueryOff0013 START');
let result;
try {
result = mediaQuery.matchMediaSync('(orientation: landscape)')
expect(typeof(result)).assertEqual('object');
console.info("push button page success " + JSON.stringify(result));
} catch (err) {
console.error("push button page error " + JSON.stringify(result));
}
console.info('testmediaQueryOff0013 END');
done();
});
it('testRunScopedTask0010', 0, async function (done) {
let uiContent = globalThis.uiContent
console.info('testRunScopedTask0010 START');
let result;
try {
result = uiContent.runScopedTask(()=>{
console.info("success")
});
expect(result).assertUndefined();
console.info("push button page success " + JSON.stringify(result));
} catch (err) {
console.error("push button page error " + JSON.stringify(result));
}
console.info('testRunScopedTask0010 END');
done();
});
})
}
\ No newline at end of file
arkui/ace_ets_component_completion/ace_ets_component_wholeCompletion/src/main/ets/test/stageRouter.test.ets
浏览文件 @
06833552
...
...
@@ -364,6 +364,218 @@ export default function stageRouterTest() {
done();
});
it('testrouterstage0016', 0, async function (done) {
let router = globalThis.uiContent.getRouter();
console.info('testrouterstage0016 START');
let result;
try {
result = router.pushNamedRoute({
name: 'pushUrl',
params: {
data1: 'message',
data2: {
data3: [123, 456, 789]
}
}
})
.then(() => {})
.catch(err => {
console.error(`replaceUrl failed, code is ${err.code}, message is ${err.message}`);
})
expect(typeof(result)).assertEqual('object');
console.info("push button page success " + JSON.stringify(result));
} catch (err) {
console.error("push button page error " + JSON.stringify(result));
}
console.info('testrouterstage0016 END');
done();
});
it('testrouterstage0017', 0, async function (done) {
let router = globalThis.uiContent.getRouter();
console.info('testrouterstage0017 START');
let result;
try {
result = router.pushNamedRoute({
name: 'pushUrl',
params: {
data1: 'message',
data2: {
data3: [123, 456, 789]
}
}
}, (err) => {
if (err) {
console.error(`replaceUrl failed, code is ${err.code}, message is ${err.message}`);
return;
}
console.info('replaceUrl success');
});
expect(result).assertUndefined();
console.info("push button page success " + JSON.stringify(result));
} catch (err) {
console.error("push button page error " + JSON.stringify(result));
}
console.info('testrouterstage0017 END');
done();
});
it('testrouterstage0018', 0, async function (done) {
let router = globalThis.uiContent.getRouter();
console.info('testrouterstage0018 START');
let result;
try {
result = router.pushNamedRoute({
name: 'pushUrl',
params: {
data1: 'message',
data2: {
data3: [123, 456, 789]
}
}
}, router.RouterMode.Standard)
.then(() => {})
.catch(err => {
console.error(`replaceUrl failed, code is ${err.code}, message is ${err.message}`);
})
expect(typeof(result)).assertEqual('object');
console.info("push button page success " + JSON.stringify(result));
} catch (err) {
console.error("push button page error " + JSON.stringify(result));
}
console.info('testrouterstage0018 END');
done();
});
it('testrouterstage0019', 0, async function (done) {
let router = globalThis.uiContent.getRouter();
console.info('testrouterstage0019 START');
let result;
try {
result = router.pushNamedRoute({
name: 'pushUrl',
params: {
data1: 'message',
data2: {
data3: [123, 456, 789]
}
}
}, router.RouterMode.Standard, (err) => {
if (err) {
console.error(`replaceUrl failed, code is ${err.code}, message is ${err.message}`);
return;
}
console.info('replaceUrl success');
});
expect(result).assertUndefined();
console.info("push button page success " + JSON.stringify(result));
} catch (err) {
console.error("push button page error " + JSON.stringify(result));
}
console.info('testrouterstage0019 END');
done();
});
it('testrouterstage0020', 0, async function (done) {
let router = globalThis.uiContent.getRouter();
console.info('testrouterstage0020 START');
let result;
try {
result = router.replaceNamedRoute({
name: 'pushUrl',
params: {
data1: 'message'
}
})
.then(() => {})
.catch(err => {
console.error(`replaceUrl failed, code is ${err.code}, message is ${err.message}`);
})
expect(typeof(result)).assertEqual('object');
console.info("push button page success " + JSON.stringify(result));
} catch (err) {
console.error("push button page error " + JSON.stringify(result));
}
console.info('testrouterstage0020 END');
done();
});
it('testrouterstage0021', 0, async function (done) {
let router = globalThis.uiContent.getRouter();
console.info('testrouterstage0021 START');
let result;
try {
result = router.replaceNamedRoute({
name: 'pushUrl',
params: {
data1: 'message'
}
}, (err) => {
if (err) {
console.error(`replaceUrl failed, code is ${err.code}, message is ${err.message}`);
return;
}
console.info('replaceUrl success');
});
expect(result).assertUndefined();
console.info("push button page success " + JSON.stringify(result));
} catch (err) {
console.error("push button page error " + JSON.stringify(result));
}
console.info('testrouterstage0021 END');
done();
});
it('testrouterstage0022', 0, async function (done) {
let router = globalThis.uiContent.getRouter();
console.info('testrouterstage0022 START');
let result;
try {
result = router.replaceNamedRoute({
name: 'pushUrl',
params: {
data1: 'message'
}
}, router.RouterMode.Standard)
.then(() => {})
.catch(err => {
console.error(`replaceUrl failed, code is ${err.code}, message is ${err.message}`);
})
expect(typeof(result)).assertEqual('object');
console.info("push button page success " + JSON.stringify(result));
} catch (err) {
console.error("push button page error " + JSON.stringify(result));
}
console.info('testrouterstage0022 END');
done();
});
it('testrouterstage0023', 0, async function (done) {
let router = globalThis.uiContent.getRouter();
console.info('testrouterstage0023 START');
let result;
try {
result = router.replaceNamedRoute({
name: 'pushUrl',
params: {
data1: 'message'
}
}, router.RouterMode.Standard, (err) => {
if (err) {
console.error(`replaceUrl failed, code is ${err.code}, message is ${err.message}`);
return;
}
console.info('replaceUrl success');
});
expect(result).assertUndefined();
console.info("push button page success " + JSON.stringify(result));
} catch (err) {
console.error("push button page error " + JSON.stringify(result));
}
console.info('testrouterstage0023 END');
done();
});
})
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录