Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
956d4aa7
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看板
未验证
提交
956d4aa7
编写于
6月 15, 2022
作者:
O
openharmony_ci
提交者:
Gitee
6月 15, 2022
浏览文件
操作
浏览文件
下载
差异文件
!3543 适配release分支目前暂不支持分辨率相关功能
Merge pull request !3543 from zj/OpenHarmony-3.1-Release
上级
396039e8
c0d1a2ea
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
0 addition
and
203 deletion
+0
-203
ace/ace_ets_component_three/entry/src/main/ets/MainAbility/test/CommonJsunit.test.ets
...entry/src/main/ets/MainAbility/test/CommonJsunit.test.ets
+0
-201
ace/ace_ets_component_three/entry/src/main/ets/MainAbility/test/List.test.ets
...t_three/entry/src/main/ets/MainAbility/test/List.test.ets
+0
-2
未找到文件。
ace/ace_ets_component_three/entry/src/main/ets/MainAbility/test/CommonJsunit.test.ets
已删除
100755 → 0
浏览文件 @
396039e8
// @ts-nocheck
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index.ets"
import display from '@ohos.display';
import Utils from './Utils';
export default function commonJsunit() {
describe('commonTest', function () {
var dpiValue;
beforeAll(async function (done) {
console.info("commonJsunit beforeEach start");
await display.getDefaultDisplay().then(dsp => {
console.info('getDefaultDisplay id : ' + JSON.stringify(dsp));
dpiValue = dsp.densityDPI;
console.info('getDefaultDisplay dpiValue is : ' + JSON.stringify(dpiValue));
Utils.sleep(2000);
}, (err) => {
console.info('getDefaultDisplay failed, err :' + JSON.stringify(err));
})
done()
});
it('commonTest_0100', 0, async function (done) {
display.getDefaultDisplay().then(dsp => {
console.info('getDefaultDisplay id : ' + JSON.stringify(dsp));
dpiValue = dsp.densityDPI;
setTimeout(() => {
console.info('commonTest_0100 START' + dpiValue);
}, 2000)
}, (err) => {
console.info('getDefaultDisplay failed, err :' + JSON.stringify(err));
})
console.info('commonTest_0100 START' + dpiValue);
var a = 90;
var ret = a * (dpiValue/160);
var b = vp2px(a);
console.info('commonTest_0100 vp2px result:' + b);
console.info('commonTest_0100 vp2px result:' + ret);
expect(b == ret).assertTrue();
console.info('commonTest_0100 END');
done();
});
it('commonTest_0200', 0, async function (done) {
console.info('commonTest_0200 START' + dpiValue);
var a = -90;
var ret = a * (dpiValue/160);
var b = vp2px(a);
console.info('commonTest_0200 vp2px result:' + b);
console.info('commonTest_0200 vp2px result:' + ret);
expect(b == ret).assertTrue();
console.info('commonTest_0200 END');
done();
});
it('commonTest_0300', 0, async function (done) {
console.info('commonTest_0300 START');
var a = '30';
var b = vp2px(a);
console.info('commonTest_0300 vp2px result:' + b);
expect(b == undefined).assertTrue();
console.info('commonTest_0300 END');
done();
});
it('commonTest_0400', 0, async function (done) {
console.info('commonTest_0400 START');
var a = 80;
var ret = a / (dpiValue/160);
var b = px2vp(a);
console.info('commonTest_0400 px2vp result:' + b);
expect(b == ret).assertTrue();
console.info('commonTest_0400 END');
done();
});
it('commonTest_0500', 0, async function (done) {
console.info('commonTest_0500 START');
var a = -800000000;
var ret = a / (dpiValue/160);
var b = px2vp(a);
console.info('commonTest_0500 px2vp result:' + b);
expect(b == ret).assertTrue();
console.info('commonTest_0500 END');
done();
});
it('commonTest_0600', 0, async function (done) {
console.info('commonTest_0600 START');
var a = '80';
var b = px2vp(a);
console.info('commonTest_0600 px2vp result:' + b);
expect(b == undefined).assertTrue();
console.info('commonTest_0600 END');
done();
});
it('commonTest_0700', 0, async function (done) {
console.info('commonTest_0700 START');
var a = 70;
var ret = a * (dpiValue/160);
var b = fp2px(a);
console.info('commonTest_0700 fp2px result:' + b);
expect(b == ret).assertTrue();
console.info('commonTest_0700 END');
done();
});
it('commonTest_0800', 0, async function (done) {
console.info('commonTest_0800 START');
var a = -70;
var ret = a * (dpiValue/160);
var b = fp2px(a);
console.info('commonTest_0800 fp2px result:' + b);
expect(b == ret).assertTrue();
console.info('commonTest_0800 END');
done();
});
it('commonTest_0900', 0, async function (done) {
console.info('commonTest_0900 START');
var a = '70';
var b = fp2px(a);
console.info('commonTest_0900 fp2px result:' + b);
expect(b == undefined).assertTrue();
console.info('commonTest_0900 END');
done();
});
it('commonTest_1000', 0, async function (done) {
console.info('commonTest_1000 START');
var a = 60;
var ret = a / (dpiValue/160);
var b = px2fp(a);
console.info('commonTest_1000 px2fp result:' + b);
expect(b == ret).assertTrue();
console.info('commonTest_1000 END');
done();
});
it('commonTest_1100', 0, async function (done) {
console.info('commonTest_1100 START');
var a = -60;
var ret = a / (dpiValue/160);
var b = px2fp(a);
console.info('commonTest_1100 px2fp result:' + b);
expect(b == ret).assertTrue();
console.info('commonTest_1100 END');
done();
});
it('commonTest_1200', 0, async function (done) {
console.info('commonTest_1200 START');
var a = '60';
var b = px2fp(a);
console.info('commonTest_1200 px2fp result:' + b);
expect(b == undefined).assertTrue();
console.info('commonTest_1200 END');
done();
});
it('commonTest_1500', 0, async function (done) {
console.info('commonTest_1500 START');
var a = '50';
var b = lpx2px(a);
console.info('commonTest_1500 lpx2px result:' + b);
expect(b == undefined).assertTrue();
console.info('commonTest_1500 END');
done();
});
it('commonTest_1800', 0, async function (done) {
console.info('commonTest_1800 START');
var a = '40';
var b = px2lpx(a);
console.info('commonTest_1800 px2lpx result:' + b);
expect(b == undefined).assertTrue();
console.info('commonTest_1800 END');
done();
});
})
}
\ No newline at end of file
ace/ace_ets_component_three/entry/src/main/ets/MainAbility/test/List.test.ets
浏览文件 @
956d4aa7
...
...
@@ -25,7 +25,6 @@ import qrCodeJsunit from './QrCodeJsunit.test.ets';
import tapGesture from './TapGesture.test.ets';
import progressJsunit from './ProgressJsunit.test.ets';
import animateJsunit from './AnimateJsunit.test.ets';
import commonJsunit from './CommonJsunit.test.ets';
import spanJsunit from './SpanJsunit.test.ets';
import ratingJsunit from './RatingJsunit.test.ets';
import canvas2Jsunit from './Canvas2Jsunit.test.ets';
...
...
@@ -60,7 +59,6 @@ export default function testsuite() {
longPressGestureJsUnit();
responseRegionJsunit();
animateJsunit();
commonJsunit();
spanJsunit();
ratingJsunit();
toggleJsunit();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录