Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
7c1b2543
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看板
未验证
提交
7c1b2543
编写于
6月 28, 2023
作者:
O
openharmony_ci
提交者:
Gitee
6月 28, 2023
浏览文件
操作
浏览文件
下载
差异文件
!9110 【XTS】【代码上库】master补充ISV厂商基于OHOS发行的操作信息名称、版本、apiversion和发布类型等属性参数
Merge pull request !9110 from smartltt/master_0628
上级
36952dc3
211583b6
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
136 addition
and
0 deletion
+136
-0
startup/startup_standard/deviceinfo/src/main/js/test/DeviceInfoJsUnit.test.js
...dard/deviceinfo/src/main/js/test/DeviceInfoJsUnit.test.js
+136
-0
未找到文件。
startup/startup_standard/deviceinfo/src/main/js/test/DeviceInfoJsUnit.test.js
浏览文件 @
7c1b2543
...
@@ -1634,5 +1634,141 @@ export default function DeviceInfoTest() {
...
@@ -1634,5 +1634,141 @@ export default function DeviceInfoTest() {
expect
(
len
).
assertLess
(
MAX_CHARACTERS_NUM_TWO
)
expect
(
len
).
assertLess
(
MAX_CHARACTERS_NUM_TWO
)
console
.
info
(
'
device_info_test_064 : end
'
);
console
.
info
(
'
device_info_test_064 : end
'
);
})
})
/**
* @tc.number SUB_STARTUP_JS_DEVCEINFO_0665
* @tc.name testGetdistributionOSName01
* @tc.desc Get the distributionOSName name represented by an empty string.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
device_info_test_0665
'
,
0
,
function
()
{
console
.
info
(
'
device_info_test_0665 start
'
);
let
distributionOSNameInfo
=
deviceinfo
.
distributionOSName
;
console
.
info
(
'
the value of the distributionOSNameInfo is :
'
+
distributionOSNameInfo
);
expect
(
distributionOSNameInfo
).
assertInstanceOf
(
'
String
'
);
if
(
distributionOSNameInfo
!=
""
&&
distributionOSNameInfo
!=
null
&&
distributionOSNameInfo
!=
undefined
)
{
let
str
=
/
[\w
-
\.\(\)]
/g
;
let
arr
=
distributionOSNameInfo
.
match
(
str
);
let
bufferstr
=
arr
.
join
(
''
);
console
.
info
(
'
the value of the bufferstr is :
'
+
bufferstr
);
expect
(
distributionOSNameInfo
).
assertEqual
(
bufferstr
);
}
else
{
console
.
info
(
'
the return value is null and the type is :
'
+
typeof
(
distributionOSNameInfo
));
expect
(
distributionOSNameInfo
==
""
).
assertTrue
();
}
console
.
info
(
'
device_info_test_0665 :end
'
);
})
/**
* @tc.number SUB_STARTUP_JS_DEVCEINFO_0666
* @tc.name testGetdistributionOSVersion01
* @tc.desc Get the operating system full name and the return value is not null.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
device_info_test_0666
'
,
0
,
function
()
{
console
.
info
(
'
device_info_test_0666 start
'
);
let
distributionOSVersionInfo
=
deviceinfo
.
distributionOSVersion
;
console
.
info
(
'
the value of the deviceinfo distributionOSVersion is :
'
+
distributionOSVersionInfo
);
expect
(
distributionOSVersionInfo
).
assertInstanceOf
(
'
String
'
);
if
(
distributionOSVersionInfo
!=
""
&&
distributionOSVersionInfo
!=
null
&&
distributionOSVersionInfo
!=
undefined
)
{
let
str
=
/
[\w
-
\.\(\)]
/g
;
let
arr
=
distributionOSVersionInfo
.
match
(
str
);
let
bufferstr
=
arr
.
join
(
''
);
console
.
info
(
'
the value of the bufferstr is :
'
+
bufferstr
);
expect
(
distributionOSVersionInfo
).
assertEqual
(
bufferstr
);
}
else
{
console
.
info
(
'
the return value is null or incorrect.
'
);
expect
().
assertFail
();
}
console
.
info
(
'
device_info_test_0666 :end
'
);
})
/**
* @tc.number SUB_STARTUP_JS_DEVCEINFO_0667
* @tc.name testGetdistributionOSVersion02
* @tc.desc Get a string representing the operating system full name which has a maximum of 32 characters.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
device_info_test_0667
'
,
0
,
function
()
{
console
.
info
(
'
device_info_test_0667 start
'
);
let
distributionOSVersionInfo
=
deviceinfo
.
distributionOSVersion
;
console
.
info
(
'
the value of the deviceinfo distributionOSVersion is :
'
+
distributionOSVersionInfo
);
let
len
=
distributionOSVersionInfo
.
length
;
console
.
info
(
'
the value of the operating system full name characters is :
'
+
len
);
expect
(
len
).
assertLess
(
MAX_CHARACTERS_NUM_ONE
);
let
str
=
/
[\w
-
\.\(\)]
/g
;
let
arr
=
distributionOSVersionInfo
.
match
(
str
);
let
bufferstr
=
arr
.
join
(
''
);
console
.
info
(
'
the value of the bufferstr is :
'
+
bufferstr
);
expect
(
distributionOSVersionInfo
).
assertEqual
(
bufferstr
);
console
.
info
(
'
device_info_test_0667 :end
'
);
})
/**
* @tc.number SUB_STARTUP_JS_DEVCEINFO_0668
* @tc.name testGetdistributionOSApiVersion01
* @tc.desc Get the API version number, which return value type is number and return value is greater than 0.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
device_info_test_0668
'
,
0
,
function
()
{
console
.
info
(
'
device_info_test_0668 start
'
);
let
ret
=
false
;
let
distributionOSApiVersionInfo
=
deviceinfo
.
distributionOSApiVersion
;
console
.
info
(
'
the value of the deviceinfo distributionOSApiVersion is :
'
+
distributionOSApiVersionInfo
);
expect
(
distributionOSApiVersionInfo
).
assertInstanceOf
(
'
Number
'
);
if
(
distributionOSApiVersionInfo
>=
0
)
{
ret
=
true
;
}
expect
(
ret
).
assertTrue
();
let
str
=
/
[\w
-
\.\(\)]
/g
;
let
arr
=
distributionOSApiVersionInfo
.
toString
().
match
(
str
);
let
substr
=
arr
.
join
(
''
);
let
numstr
=
parseInt
(
substr
);
console
.
info
(
'
the value of the bufferstr is :
'
+
numstr
);
expect
(
distributionOSApiVersionInfo
).
assertEqual
(
numstr
);
console
.
info
(
'
device_info_test_0668 :end
'
);
})
/**
* @tc.number SUB_STARTUP_JS_DEVCEINFO_0669
* @tc.name testGetOSReleaserType01
* @tc.desc Get the OS release type represented by a string and the return value is not null.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
device_info_test_0669
'
,
0
,
function
()
{
console
.
info
(
'
device_info_test_0669 start
'
);
let
osReleaseTypeInfo
=
deviceinfo
.
osReleaseType
;
console
.
info
(
'
the value of the deviceinfo distributionOSReleaseType is :
'
+
osReleaseTypeInfo
);
expect
(
osReleaseTypeInfo
).
assertInstanceOf
(
'
String
'
);
if
(
osReleaseTypeInfo
!=
""
&&
osReleaseTypeInfo
!=
null
&&
osReleaseTypeInfo
!=
undefined
)
{
let
str
=
/
[\w
-
\.\(\)]
/g
;
let
arr
=
osReleaseTypeInfo
.
match
(
str
);
let
bufferstr
=
arr
.
join
(
''
);
console
.
info
(
'
the value of the bufferstr is :
'
+
bufferstr
);
expect
(
osReleaseTypeInfo
).
assertEqual
(
bufferstr
);
}
else
{
console
.
info
(
'
the return value is null or incorrect.
'
);
expect
().
assertFail
();
}
console
.
info
(
'
device_info_test_0669 :end
'
);
})
})
})
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录