Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
a52bfa59
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看板
未验证
提交
a52bfa59
编写于
11月 18, 2022
作者:
O
openharmony_ci
提交者:
Gitee
11月 18, 2022
浏览文件
操作
浏览文件
下载
差异文件
!6565 add screenDensity property
Merge pull request !6565 from 杨清/1228
上级
32f4e415
d8ab6465
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
50 addition
and
20 deletion
+50
-20
global/resmgr_standard/resmgrjs/src/main/js/test/Resmgr.test.js
.../resmgr_standard/resmgrjs/src/main/js/test/Resmgr.test.js
+50
-20
未找到文件。
global/resmgr_standard/resmgrjs/src/main/js/test/Resmgr.test.js
浏览文件 @
a52bfa59
...
...
@@ -737,8 +737,8 @@ describe('resMgrTest', function () {
console
.
log
(
'
getConfiguration_test_001 1
'
+
cfg
.
direction
);
console
.
log
(
'
getConfiguration_test_001 1
'
+
resmgr
.
Direction
.
DIRECTION_HORIZONTAL
);
console
.
log
(
'
getConfiguration_test_001 11
'
);
if
(
cfg
.
direction
==
resmgr
.
Direction
.
DIRECTION_
HORIZONT
AL
){
console
.
log
(
'
getConfiguration_test_001 DIRECTION_
HORIZONT
AL
'
);
if
(
cfg
.
direction
==
resmgr
.
Direction
.
DIRECTION_
VERTIC
AL
){
console
.
log
(
'
getConfiguration_test_001 DIRECTION_
VERTIC
AL
'
);
}
else
if
(
cfg
.
direction
==
resmgr
.
Direction
.
DIRECTION_HORIZONTAL
){
console
.
log
(
'
getConfiguration_test_001 DIRECTION_HORIZONTAL
'
);
}
...
...
@@ -773,6 +773,27 @@ describe('resMgrTest', function () {
done
();
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_1300
* @tc.name test getConfiguration method in promise mode
* @tc.desc get the configuration in promise mode
*/
it
(
'
getConfiguration_test_004
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getConfiguration
().
then
(
cfg
=>
{
console
.
log
(
'
getConfiguration_test_004
'
+
resmgr
.
Direction
.
DIRECTION_HORIZONTAL
);
if
(
cfg
.
direction
==
resmgr
.
Direction
.
DIRECTION_VERTICAL
){
console
.
log
(
'
getConfiguration_test_004 DIRECTION_VERTICAL
'
);
}
else
if
(
cfg
.
direction
==
resmgr
.
Direction
.
DIRECTION_HORIZONTAL
){
console
.
log
(
'
getConfiguration_test_004 DIRECTION_HORIZONTAL
'
);
}
expect
(
cfg
!==
null
).
assertTrue
();
console
.
log
(
'
getConfiguration_test_004
'
+
JSON
.
stringify
(
cfg
));
done
();
})
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_1500
* @tc.name test getDeviceCapability method in callback mode
...
...
@@ -873,6 +894,27 @@ describe('resMgrTest', function () {
done
();
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_1500
* @tc.name test getDeviceCapability method in callback mode
* @tc.desc get the device capability in callback mode
*/
it
(
'
getDeviceCapability_test_008
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getDeviceCapability
().
then
(
dc
=>
{
if
(
dc
.
deviceType
==
resmgr
.
DeviceType
.
DEVICE_TYPE_PHONE
){
console
.
log
(
'
getDeviceCapability_test_008 DEVICE_TYPE_PHONE
'
);
}
if
(
dc
.
screenDensity
==
resmgr
.
ScreenDensity
.
SCREEN_LDPI
){
console
.
log
(
'
getDeviceCapability_test_008 SCREEN_LDPI
'
);
}
expect
(
dc
!==
null
).
assertTrue
();
console
.
log
(
'
getDeviceCapability_test_008
'
+
JSON
.
stringify
(
dc
));
done
();
})
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_1500
* @tc.name test getDeviceCapability method in callback mode
...
...
@@ -881,17 +923,17 @@ describe('resMgrTest', function () {
it
(
'
getScreenDensity_test_001
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getDeviceCapability
((
error
,
dc
)
=>
{
if
(
dc
.
deviceType
==
resmgr
.
ScreenDensity
.
SCREEN_SDPI
){
if
(
dc
.
screenDensity
==
resmgr
.
ScreenDensity
.
SCREEN_SDPI
){
console
.
log
(
'
getScreenDensity_test_001 SCREEN_SDPI
'
);
}
else
if
(
dc
.
deviceType
==
resmgr
.
ScreenDensity
.
SCREEN_MDPI
){
}
else
if
(
dc
.
screenDensity
==
resmgr
.
ScreenDensity
.
SCREEN_MDPI
){
console
.
log
(
'
getScreenDensity_test_001 SCREEN_MDPI
'
);
}
else
if
(
dc
.
deviceType
==
resmgr
.
ScreenDensity
.
SCREEN_LDPI
){
}
else
if
(
dc
.
screenDensity
==
resmgr
.
ScreenDensity
.
SCREEN_LDPI
){
console
.
log
(
'
getScreenDensity_test_001 SCREEN_LDPI
'
);
}
else
if
(
dc
.
deviceType
==
resmgr
.
ScreenDensity
.
SCREEN_XLDPI
){
}
else
if
(
dc
.
screenDensity
==
resmgr
.
ScreenDensity
.
SCREEN_XLDPI
){
console
.
log
(
'
getScreenDensity_test_001 SCREEN_XLDPI
'
);
}
else
if
(
dc
.
deviceType
==
resmgr
.
ScreenDensity
.
SCREEN_XXLDPI
){
}
else
if
(
dc
.
screenDensity
==
resmgr
.
ScreenDensity
.
SCREEN_XXLDPI
){
console
.
log
(
'
getScreenDensity_test_001 SCREEN_XXLDPI
'
);
}
else
if
(
dc
.
deviceType
==
resmgr
.
ScreenDensity
.
SCREEN_XXXLDPI
){
}
else
if
(
dc
.
screenDensity
==
resmgr
.
ScreenDensity
.
SCREEN_XXXLDPI
){
console
.
log
(
'
getScreenDensity_test_001 SCREEN_XXXLDPI
'
);
}
expect
(
dc
!==
null
).
assertTrue
();
...
...
@@ -973,18 +1015,6 @@ describe('resMgrTest', function () {
done
();
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_1600
* @tc.name test getDeviceCapability method in promise mode
* @tc.desc get the device capability in promise mode
*/
it
(
'
getScreenDensity_test_002
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
getScreenDensity_test_002 0
'
);
expect
(
resmgr
.
ScreenDensity
.
SCREEN_SDPI
).
assertEqual
(
120
);
console
.
log
(
'
getScreenDensity_test_002 1
'
);
done
();
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_1700
* @tc.name test getPluralString method in callback mode
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录