Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
cd878eae
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看板
未验证
提交
cd878eae
编写于
3月 18, 2022
作者:
O
openharmony_ci
提交者:
Gitee
3月 18, 2022
浏览文件
操作
浏览文件
下载
差异文件
!2564 修改 xts_acts 用例名称 master
Merge pull request !2564 from xllify/master
上级
6d0b4b14
169388cc
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
427 addition
and
384 deletion
+427
-384
compileruntime/process_lib_standard/src/main/js/test/Process.test.js
...ime/process_lib_standard/src/main/js/test/Process.test.js
+99
-68
compileruntime/uri_lib_standard/src/main/js/test/uri.test.js
compileruntime/uri_lib_standard/src/main/js/test/uri.test.js
+60
-60
compileruntime/util_lib_standard/src/main/js/test/util.test.js
...leruntime/util_lib_standard/src/main/js/test/util.test.js
+268
-256
未找到文件。
compileruntime/process_lib_standard/src/main/js/test/Process.test.js
浏览文件 @
cd878eae
...
...
@@ -1775,12 +1775,12 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name:
testTid
001
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR3G-
001
* @tc.desc: Returns the tid of the current thread.
* @tc.require: AR000GFB04
* @tc.author: liwenqiang
*/
it
(
'
testTid
001
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR3G-
001
'
,
0
,
function
()
{
var
pres
=
process
.
tid
if
(
pres
>
0
)
{
...
...
@@ -1790,12 +1790,12 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name:
testTid
002
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR3G-
002
* @tc.desc: Returns the tid of the current thread.
* @tc.require: AR000GFB04
* @tc.author: liwenqiang
*/
it
(
'
testTid
002
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR3G-
002
'
,
0
,
function
()
{
for
(
var
i
=
0
;
i
<
5
;
i
++
)
{
var
pres
=
process
.
tid
...
...
@@ -1808,12 +1808,12 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name:
testTid
003
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR3G-
003
* @tc.desc: Returns the tid of the current thread.
* @tc.require: AR000GFB04
* @tc.author: liwenqiang
*/
it
(
'
testTid
003
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR3G-
003
'
,
0
,
function
()
{
for
(
var
i
=
0
;
i
<
3
;
i
++
)
{
var
pres
=
process
.
tid
...
...
@@ -1827,23 +1827,23 @@ describe('ChildProcessTest', function () {
/**
* @tc.name:
testIsisolatedProcess001
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR3G-004
* @tc.desc: Returns a boolean whether the process is isolated.
* @tc.require: AR000GFB04
* @tc.author: liwenqiang
*/
it
(
'
testIsisolatedProcess001
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR3G-004
'
,
0
,
function
()
{
var
pres
=
process
.
isIsolatedProcess
()
expect
(
pres
).
assertEqual
(
true
)
})
/**
* @tc.name:
testIsisolatedProcess002
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR3G-005
* @tc.desc: Returns a boolean whether the process is isolated.
* @tc.require: AR000GFB04
* @tc.author: liwenqiang
*/
it
(
'
testIsisolatedProcess002
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR3G-005
'
,
0
,
function
()
{
for
(
var
i
=
0
;
i
<
3
;
i
++
)
{
var
pres
=
process
.
isIsolatedProcess
()
...
...
@@ -1852,12 +1852,12 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name:
testIsisolatedProcess003
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR3G-006
* @tc.desc: Returns a boolean whether the process is isolated.
* @tc.require: AR000GFB04
* @tc.author: liwenqiang
*/
it
(
'
testIsisolatedProcess003
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR3G-006
'
,
0
,
function
()
{
for
(
var
i
=
0
;
i
<
5
;
i
++
)
{
var
pres
=
process
.
isIsolatedProcess
()
...
...
@@ -1867,23 +1867,23 @@ describe('ChildProcessTest', function () {
/**
* @tc.name:
testIsappuid001
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR3G-007
* @tc.desc: Returns a boolean whether the specified uid belongs to a particular application.
* @tc.require: AR000GFB04
* @tc.author: liwenqiang
*/
it
(
'
testIsappuid001
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR3G-007
'
,
0
,
function
()
{
var
isorno
=
process
.
isAppUid
(
167
)
expect
(
isorno
).
assertEqual
(
false
)
})
/**
* @tc.name:
testIsappuid002
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR3G-008
* @tc.desc: Returns a boolean whether the specified uid belongs to a particular application.
* @tc.require: AR000GFB04
* @tc.author: liwenqiang
*/
it
(
'
testIsappuid002
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR3G-008
'
,
0
,
function
()
{
var
isorno
=
process
.
isAppUid
(
123
)
expect
(
isorno
).
assertEqual
(
false
)
})
...
...
@@ -1922,23 +1922,23 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name:
testIs64Bit001
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR3G-009
* @tc.desc: Returns a boolean whether the process is running in a 64-bit environment.
* @tc.require: AR000GFB04
* @tc.author: liwenqiang
*/
it
(
'
testIs64Bit001
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR3G-009
'
,
0
,
function
()
{
var
isorno
=
process
.
is64Bit
()
expect
(
isorno
).
assertEqual
(
false
)
})
/**
* @tc.name:
testIs64Bit002
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR3G-010
* @tc.desc: Returns a boolean whether the process is running in a 64-bit environment.
* @tc.require: AR000GFB04
* @tc.author: liwenqiang
*/
it
(
'
testIs64Bit002
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR3G-010
'
,
0
,
function
()
{
for
(
var
i
=
0
;
i
<
3
;
i
++
)
{
var
isorno
=
process
.
is64Bit
()
...
...
@@ -1947,12 +1947,12 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name:
testIs64Bit003
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR3G-011
* @tc.desc: Returns a boolean whether the process is running in a 64-bit environment.
* @tc.require: AR000GFB04
* @tc.author: liwenqiang
*/
it
(
'
testIs64Bit003
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR3G-011
'
,
0
,
function
()
{
for
(
var
i
=
0
;
i
<
5
;
i
++
)
{
var
isorno
=
process
.
is64Bit
()
...
...
@@ -1962,12 +1962,12 @@ describe('ChildProcessTest', function () {
/**
* @tc.name:
testGetuidforname001
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR3G-012
* @tc.desc: Returns the uid based on the specified user name.
* @tc.require: AR000GFB04
* @tc.author: liwenqiang
*/
it
(
'
testGetuidforname001
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR3G-012
'
,
0
,
function
()
{
var
pres
=
process
.
getUidForName
(
"
root
"
)
if
(
pres
!=
-
1
)
{
...
...
@@ -1977,12 +1977,12 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name:
testGetuidforname002
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR3G-013
* @tc.desc: Returns the uid based on the specified user name.
* @tc.require: AR000GFB04
* @tc.author: liwenqiang
*/
it
(
'
testGetuidforname002
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR3G-013
'
,
0
,
function
()
{
for
(
var
i
=
0
;
i
<
3
;
i
++
)
{
var
pres
=
process
.
getUidForName
(
"
12356
"
)
...
...
@@ -1991,12 +1991,12 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name:
testGetuidforname003
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR3G-014
* @tc.desc: Returns the uid based on the specified user name.
* @tc.require: AR000GFB04
* @tc.author: liwenqiang
*/
it
(
'
testGetuidforname003
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR3G-014
'
,
0
,
function
()
{
for
(
var
i
=
0
;
i
<
5
;
i
++
)
{
var
pres
=
process
.
getUidForName
(
"
12356
"
)
...
...
@@ -2006,12 +2006,12 @@ describe('ChildProcessTest', function () {
/**
* @tc.name:
testGetthreadpriority001
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR3G-015
* @tc.desc: Returns the thread priority based on the specified tid.
* @tc.require: AR000GFB04
* @tc.author: liwenqiang
*/
it
(
'
testGetthreadpriority001
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR3G-015
'
,
0
,
function
()
{
var
pres
=
process
.
tid
var
pri
=
process
.
getThreadPriority
(
pres
)
if
(
pri
)
...
...
@@ -2022,12 +2022,12 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name:
testGetthreadpriority002
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR3G-016
* @tc.desc: Returns the thread priority based on the specified tid.
* @tc.require: AR000GFB04
* @tc.author: liwenqiang
*/
it
(
'
testGetthreadpriority002
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR3G-016
'
,
0
,
function
()
{
var
pres
=
process
.
tid
for
(
var
i
=
0
;
i
<
3
;
i
++
)
{
...
...
@@ -2041,12 +2041,12 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name:
testGetthreadpriority003
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR3G-017
* @tc.desc: Returns the thread priority based on the specified tid.
* @tc.require: AR000GFB04
* @tc.author: liwenqiang
*/
it
(
'
testGetthreadpriority003
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR3G-017
'
,
0
,
function
()
{
var
pres
=
process
.
tid
for
(
var
i
=
0
;
i
<
5
;
i
++
)
{
...
...
@@ -2060,13 +2060,13 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name:
testGetstartrealtime001
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR3G-019
* @tc.desc: Returns the elapsed real time (in milliseconds) taken from the start of
the system to the start of the process.
* @
the system to the start of the process.
* @tc.require: AR000GFB04
* @tc.author: liwenqiang
*/
it
(
'
testGetstartrealtime001
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR3G-019
'
,
0
,
function
()
{
for
(
var
i
=
0
;
i
<
3
;
i
++
)
{
var
pri
=
process
.
getStartRealtime
()
...
...
@@ -2079,13 +2079,13 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name:
testGetstartrealtime002
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR3G-018
* @tc.desc: Returns the elapsed real time (in milliseconds) taken from the start of
the system to the start of the process.
* @
the system to the start of the process.
* @tc.require: AR000GFB04
* @tc.author: liwenqiang
*/
it
(
'
testGetstartrealtime002
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR3G-018
'
,
0
,
function
()
{
var
pri
=
process
.
getStartRealtime
()
if
(
pri
!==
null
)
{
...
...
@@ -2095,13 +2095,13 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name:
testGetstartrealtime003
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR3G-020
* @tc.desc: Returns the elapsed real time (in milliseconds) taken from the start of
the system to the start of the process.
* @
the system to the start of the process.
* @tc.require: AR000GFB04
* @tc.author: liwenqiang
*/
it
(
'
testGetstartrealtime003
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR3G-020
'
,
0
,
function
()
{
for
(
var
i
=
0
;
i
<
5
;
i
++
)
{
var
pri
=
process
.
getStartRealtime
()
...
...
@@ -2113,10 +2113,23 @@ describe('ChildProcessTest', function () {
}
})
/**
* @tc.name: SUB_Runtime_JSAPI_SR000GGR3G-021
* @tc.desc: Returns the elapsed real time (in milliseconds)
* @taken from the start of the system to the start of the process.
* @tc.require: AR000GFB04
* @tc.author: liwenqiang
*/
it
(
'
SUB_Runtime_JSAPI_SR000GGR3G-021
'
,
0
,
function
()
{
var
priOne
=
process
.
getStartRealtime
()
var
priTwo
=
process
.
getStartRealtime
()
expect
(
priOne
-
priTwo
).
assertEqual
(
0
)
})
/**
* @tc.name: testGetstartrealtime004
* @tc.desc: Returns the elapsed real time (in milliseconds) taken from the start of
the system to the start of the process.
* @
the system to the start of the process.
* @tc.require: AR000GFB04
* @tc.author: liwenqiang
*/
...
...
@@ -2151,12 +2164,12 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name:
testGetpastCpuTime00
2
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR3G-02
2
* @tc.desc: Returns the cpu time (in milliseconds) from the time when the process starts to the current time.
* @tc.require: AR000GFB04
* @tc.author: liwenqiang
*/
it
(
'
testGetpastCpuTime00
2
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR3G-02
2
'
,
0
,
function
()
{
var
pri
=
process
.
getPastCpuTime
()
if
(
pri
>
0
)
{
...
...
@@ -2166,12 +2179,12 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name:
testGetpastCpuTime00
3
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR3G-02
3
* @tc.desc: Returns the cpu time (in milliseconds) from the time when the process starts to the current time.
* @tc.require: AR000GFB04
* @tc.author: liwenqiang
*/
it
(
'
testGetpastCpuTime00
3
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR3G-02
3
'
,
0
,
function
()
{
for
(
var
i
=
0
;
i
<
5
;
i
++
)
{
var
pri
=
process
.
getPastCpuTime
()
...
...
@@ -2184,12 +2197,12 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name:
testGetpastCpuTime00
4
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR3G-02
4
* @tc.desc: Returns the cpu time (in milliseconds) from the time when the process starts to the current time.
* @tc.require: AR000GFB04
* @tc.author: liwenqiang
*/
it
(
'
testGetpastCpuTime00
4
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR3G-02
4
'
,
0
,
function
()
{
for
(
var
i
=
0
;
i
<
8
;
i
++
)
{
var
pri
=
process
.
getPastCpuTime
()
...
...
@@ -2202,12 +2215,12 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name:
testGetSystemConfig001
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR3G-025
* @tc.desc: Returns the system configuration at runtime.
* @tc.require: AR000GFB04
* @tc.author: liwenqiang
*/
it
(
'
testGetSystemConfig001
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR3G-025
'
,
0
,
function
()
{
var
_SC_ARG_MAX
=
0
var
pri
=
process
.
getSystemConfig
(
_SC_ARG_MAX
)
if
(
pri
>
0
)
...
...
@@ -2218,12 +2231,12 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name:
testGetSystemConfig002
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR3G-026
* @tc.desc: Returns the system configuration at runtime.
* @tc.require: AR000GFB04
* @tc.author: liwenqiang
*/
it
(
'
testGetSystemConfig002
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR3G-026
'
,
0
,
function
()
{
var
_SC_ARG_MAX
=
0
for
(
var
i
=
0
;
i
<
3
;
i
++
)
{
...
...
@@ -2237,12 +2250,12 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name:
testGetSystemConfig003
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR3G-027
* @tc.desc: Returns the system configuration at runtime.
* @tc.require: AR000GFB04
* @tc.author: liwenqiang
*/
it
(
'
testGetSystemConfig003
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR3G-027
'
,
0
,
function
()
{
var
_SC_ARG_MAX
=
0
for
(
var
i
=
0
;
i
<
5
;
i
++
)
{
...
...
@@ -2256,12 +2269,12 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name:
testGetSystemConfig004
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR3G-028
* @tc.desc: Returns the system configuration at runtime.
* @tc.require: AR000GFB04
* @tc.author: liwenqiang
*/
it
(
'
testGetSystemConfig004
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR3G-028
'
,
0
,
function
()
{
var
_SC_OPEN_MAX
=
4
var
pri
=
process
.
getSystemConfig
(
_SC_OPEN_MAX
)
if
(
pri
>
0
)
...
...
@@ -2272,12 +2285,12 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name:
testGetSystemConfig005
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR3G-029
* @tc.desc: Returns the system configuration at runtime.
* @tc.require: AR000GFB04
* @tc.author: liwenqiang
*/
it
(
'
testGetSystemConfig005
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR3G-029
'
,
0
,
function
()
{
var
_SC_PAGESIZE
=
8
var
pri
=
process
.
getSystemConfig
(
_SC_PAGESIZE
)
if
(
pri
>
0
)
...
...
@@ -2288,12 +2301,12 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name:
testGetEnvironmentVar001
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR3G-033
* @tc.desc: Returns the system value for environment variables.
* @tc.require: AR000GFB04
* @tc.author: liwenqiang
*/
it
(
'
testGetEnvironmentVar001
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR3G-033
'
,
0
,
function
()
{
var
pri
=
process
.
getEnvironmentVar
(
"
USER
"
)
if
(
pri
!=
null
)
{
var
flag
=
new
Boolean
(
true
)
...
...
@@ -2302,12 +2315,12 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name:
testGetEnvironmentVar002
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR3G-036
* @tc.desc: Returns the system value for environment variables.
* @tc.require: AR000GFB04
* @tc.author: liwenqiang
*/
it
(
'
testGetEnvironmentVar002
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR3G-036
'
,
0
,
function
()
{
for
(
var
i
=
0
;
i
<
3
;
i
++
)
{
var
pri
=
process
.
getEnvironmentVar
(
"
PATH
"
)
...
...
@@ -2338,12 +2351,12 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name:
testGetEnvironmentVar00
4
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR3G-03
4
* @tc.desc: Returns the system value for environment variables.
* @tc.require: AR000GFB04
* @tc.author: liwenqiang
*/
it
(
'
testGetEnvironmentVar00
4
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR3G-03
4
'
,
0
,
function
()
{
for
(
var
i
=
0
;
i
<
6
;
i
++
)
{
var
pri
=
process
.
getEnvironmentVar
(
"
USER
"
)
...
...
@@ -2356,12 +2369,12 @@ describe('ChildProcessTest', function () {
})
/**
* @tc.name:
testGetEnvironmentVar00
5
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR3G-03
5
* @tc.desc: Returns the system value for environment variables.
* @tc.require: AR000GFB04
* @tc.author: liwenqiang
*/
it
(
'
testGetEnvironmentVar00
5
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR3G-03
5
'
,
0
,
function
()
{
for
(
var
i
=
0
;
i
<
8
;
i
++
)
{
var
pri
=
process
.
getEnvironmentVar
(
"
USER
"
)
...
...
@@ -2372,4 +2385,22 @@ describe('ChildProcessTest', function () {
}
}
})
/**
* @tc.name: SUB_Runtime_JSAPI_SR000GGR3G-037
* @tc.desc: Returns the system value for environment variables.
* @tc.require: AR000GFB04
* @tc.author: liwenqiang
*/
it
(
'
SUB_Runtime_JSAPI_SR000GGR3G-037
'
,
0
,
function
()
{
for
(
var
i
=
0
;
i
<
100
;
i
++
)
{
var
pri
=
process
.
getEnvironmentVar
(
"
i123
"
)
if
(
pri
==
null
)
{
var
flag
=
new
Boolean
(
true
)
expect
(
flag
).
assertEqual
(
true
)
}
}
})
})
\ No newline at end of file
compileruntime/uri_lib_standard/src/main/js/test/uri.test.js
浏览文件 @
cd878eae
...
...
@@ -17,12 +17,12 @@ import URI from '@ohos.uri'
describe
(
'
UriTest
'
,
function
()
{
/**
* @tc.name:
testConstructor001
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR34_012
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.require: AR000GFB2S
* @tc.author: zhaoduwei
*/
it
(
'
testConstructor001
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR34_012
'
,
0
,
function
()
{
try
{
let
that
=
new
URI
(
'
#http://username:password@host:8080/directory/file?foo=1&bar=2
'
);
}
catch
(
err
)
{
...
...
@@ -31,12 +31,12 @@ describe('UriTest', function () {
})
/**
* @tc.name:
testConstructor002
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR34_010
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.require: AR000GFB2S
* @tc.author: zhaoduwei
*/
it
(
'
testConstructor002
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR34_010
'
,
0
,
function
()
{
try
{
let
that
=
new
URI
({
name
:
'
gaogao
'
});
}
catch
(
err
)
{
...
...
@@ -45,12 +45,12 @@ describe('UriTest', function () {
})
/**
* @tc.name:
testConstructor003
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR34_032
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.require: AR000GFB2S
* @tc.author: zhaoduwei
*/
it
(
'
testConstructor003
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR34_032
'
,
0
,
function
()
{
try
{
let
that
=
new
URI
(
'
ht/tp://username:pas sword@host:8080/directory/file?foo=1&bar=2
'
);
}
catch
(
err
)
{
...
...
@@ -59,12 +59,12 @@ describe('UriTest', function () {
})
/**
* @tc.name:
testConstructor004
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR34_030
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.require: AR000GFB2S
* @tc.author: zhaoduwei
*/
it
(
'
testConstructor004
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR34_030
'
,
0
,
function
()
{
try
{
let
that
=
new
URI
(
'
http://username:password@[::]:8080/directory/file?Query#gaogao faofao
'
);
}
catch
(
err
)
{
...
...
@@ -73,12 +73,12 @@ describe('UriTest', function () {
})
/**
* @tc.name:
testConstructor005
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR34_028
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.require: AR000GFB2S
* @tc.author: zhaoduwei
*/
it
(
'
testConstructor005
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR34_028
'
,
0
,
function
()
{
try
{
let
that
=
new
URI
(
'
http://username:password@host:8080/directory/file?foo^=1&bar=2#gaogaofaofao
'
);
}
catch
(
err
)
{
...
...
@@ -87,12 +87,12 @@ describe('UriTest', function () {
})
/**
* @tc.name:
testConstructor006
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR34_013
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.require: AR000GFB2S
* @tc.author: zhaoduwei
*/
it
(
'
testConstructor006
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR34_013
'
,
0
,
function
()
{
try
{
let
that
=
new
URI
(
'
1http://username:password@host:8080/directory/file?foo=1&bar=2#gaogaofaofao
'
);
}
catch
(
err
)
{
...
...
@@ -101,12 +101,12 @@ describe('UriTest', function () {
})
/**
* @tc.name:
testConstructor007
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR34_014
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.require: AR000GFB2S
* @tc.author: zhaoduwei
*/
it
(
'
testConstructor007
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR34_014
'
,
0
,
function
()
{
try
{
let
that
=
new
URI
(
'
ht@tp://username:password@host:8080/directory/file?foo=1&bar=2#gaogaofaofao
'
);
}
catch
(
err
)
{
...
...
@@ -115,12 +115,12 @@ describe('UriTest', function () {
})
/**
* @tc.name:
testConstructor008
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR34_026
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.require: AR000GFB2S
* @tc.author: zhaoduwei
*/
it
(
'
testConstructor008
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR34_026
'
,
0
,
function
()
{
try
{
let
that
=
new
URI
(
'
http://username:password@[::]:80r80/directory/file?foo=1&bar=2#gaogaofaofao
'
);
}
catch
(
err
)
{
...
...
@@ -129,12 +129,12 @@ describe('UriTest', function () {
})
/**
* @tc.name:
testConstructor009
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR34_021
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.require: AR000GFB2S
* @tc.author: zhaoduwei
*/
it
(
'
testConstructor009
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR34_021
'
,
0
,
function
()
{
try
{
let
that
=
new
URI
(
'
http://username:password@[::12:55:8080/directory/file?foo=1&bar=2#gaogaofaofao
'
);
}
catch
(
err
)
{
...
...
@@ -143,12 +143,12 @@ describe('UriTest', function () {
})
/**
* @tc.name:
testConstructor010
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR34_018
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.require: AR000GFB2S
* @tc.author: zhaoduwei
*/
it
(
'
testConstructor010
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR34_018
'
,
0
,
function
()
{
try
{
let
that
=
new
URI
(
'
http://username:pa^ssword@[::12:55]:8080/directory/file?foo=1&bar=2#gaogaofaofao
'
);
}
catch
(
err
)
{
...
...
@@ -157,12 +157,12 @@ describe('UriTest', function () {
})
/**
* @tc.name:
testConstructor011
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR34_020
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.require: AR000GFB2S
* @tc.author: zhaoduwei
*/
it
(
'
testConstructor011
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR34_020
'
,
0
,
function
()
{
try
{
let
that
=
new
URI
(
'
http://username:password@[::1你2:55]:8080/directory/file?foo=1&bar=2#gaogaofaofao
'
);
}
catch
(
err
)
{
...
...
@@ -171,12 +171,12 @@ describe('UriTest', function () {
})
/**
* @tc.name:
testConstructor012
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR34_001
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.require: AR000GFB2S
* @tc.author: zhaoduwei
*/
it
(
'
testConstructor012
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR34_001
'
,
0
,
function
()
{
let
gaogao
=
new
URI
(
'
http://gg:gaogao@www.baidu.com:99/path/path?query#fagment
'
);
expect
(
gaogao
.
scheme
).
assertEqual
(
"
http
"
);
expect
(
gaogao
.
authority
).
assertEqual
(
"
gg:gaogao@www.baidu.com:99
"
);
...
...
@@ -209,12 +209,12 @@ describe('UriTest', function () {
})
/**
* @tc.name:
testConstructor014
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR34_002
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.require: AR000GFB2S
* @tc.author: zhaoduwei
*/
it
(
'
testConstructor014
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR34_002
'
,
0
,
function
()
{
let
gaogao
=
new
URI
(
'
http://gg:gaogao@[::]:88/path/path66?foooo#gaogao
'
);
expect
(
gaogao
.
scheme
).
assertEqual
(
"
http
"
);
expect
(
gaogao
.
authority
).
assertEqual
(
"
gg:gaogao@[::]:88
"
);
...
...
@@ -247,12 +247,12 @@ describe('UriTest', function () {
})
/**
* @tc.name:
testConstructor016
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR34_003
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.require: AR000GFB2S
* @tc.author: zhaoduwei
*/
it
(
'
testConstructor016
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR34_003
'
,
0
,
function
()
{
let
gaogao
=
new
URI
(
'
http://gg:gaogao@[::FFFF:129.144.52.38]:99/path/path?query#fagment
'
);
expect
(
gaogao
.
scheme
).
assertEqual
(
"
http
"
);
expect
(
gaogao
.
authority
).
assertEqual
(
"
gg:gaogao@[::FFFF:129.144.52.38]:99
"
);
...
...
@@ -343,12 +343,12 @@ describe('UriTest', function () {
})
/**
* @tc.name:
testConstructor021
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR34_004
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.require: AR000GFB2S
* @tc.author: zhaoduwei
*/
it
(
'
testConstructor021
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR34_004
'
,
0
,
function
()
{
let
gaogao
=
new
URI
(
'
http://gg:gaogao@199.98.55.44:99/path/path?query#fagment
'
);
expect
(
gaogao
.
scheme
).
assertEqual
(
"
http
"
);
expect
(
gaogao
.
authority
).
assertEqual
(
"
gg:gaogao@199.98.55.44:99
"
);
...
...
@@ -362,12 +362,12 @@ describe('UriTest', function () {
})
/**
* @tc.name:
testConstructor022
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR34_005
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.require: AR000GFB2S
* @tc.author: zhaoduwei
*/
it
(
'
testConstructor022
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR34_005
'
,
0
,
function
()
{
let
gaogao
=
new
URI
(
'
http://16.9.5.4:99/path/path?query#fagment
'
);
expect
(
gaogao
.
scheme
).
assertEqual
(
"
http
"
);
expect
(
gaogao
.
authority
).
assertEqual
(
"
16.9.5.4:99
"
);
...
...
@@ -400,12 +400,12 @@ describe('UriTest', function () {
})
/**
* @tc.name:
testConstructor024
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR34_006
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.require: AR000GFB2S
* @tc.author: zhaoduwei
*/
it
(
'
testConstructor024
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR34_006
'
,
0
,
function
()
{
let
gaogao
=
new
URI
(
'
http://user@49.10pe8.54.12:80/path/path23?query#qwer
'
);
expect
(
gaogao
.
scheme
).
assertEqual
(
"
http
"
);
expect
(
gaogao
.
authority
).
assertEqual
(
"
user@49.10pe8.54.12:80
"
);
...
...
@@ -419,12 +419,12 @@ describe('UriTest', function () {
})
/**
* @tc.name:
testConstructor025
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR34_007
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.require: AR000GFB2S
* @tc.author: zhaoduwei
*/
it
(
'
testConstructor025
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR34_007
'
,
0
,
function
()
{
let
gaogao
=
new
URI
(
'
http://user@www.baidu.com/path/path23?query#qwer
'
);
expect
(
gaogao
.
scheme
).
assertEqual
(
"
http
"
);
expect
(
gaogao
.
authority
).
assertEqual
(
"
user@www.baidu.com
"
);
...
...
@@ -438,12 +438,12 @@ describe('UriTest', function () {
})
/**
* @tc.name:
testConstructor026
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR34_008
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.require: AR000GFB2S
* @tc.author: zhaoduwei
*/
it
(
'
testConstructor026
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR34_008
'
,
0
,
function
()
{
let
gaogao
=
new
URI
(
'
http://user@www.hw.com:77/path/path23?query#qwer
'
);
expect
(
gaogao
.
scheme
).
assertEqual
(
"
http
"
);
expect
(
gaogao
.
authority
).
assertEqual
(
"
user@www.hw.com:77
"
);
...
...
@@ -457,12 +457,12 @@ describe('UriTest', function () {
})
/**
* @tc.name:
testConstructor027
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR34_009
* @tc.desc: Constructs a URI by parsing the given string.
* @tc.require: AR000GFB2S
* @tc.author: zhaoduwei
*/
it
(
'
testConstructor027
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR34_009
'
,
0
,
function
()
{
let
gaogao
=
new
URI
(
'
ht2tp://user@www.h12343w.com:77/path/path23?query#qwer
'
);
expect
(
gaogao
.
scheme
).
assertEqual
(
"
ht2tp
"
);
expect
(
gaogao
.
authority
).
assertEqual
(
"
user@www.h12343w.com:77
"
);
...
...
@@ -565,12 +565,12 @@ describe('UriTest', function () {
})
/**
* @tc.name:
testEquals002
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR34_034
* @tc.desc: Tests this URI for equality with another object.
* @tc.require: AR000GFB2S
* @tc.author: zhaoduwei
*/
it
(
'
testEquals002
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR34_034
'
,
0
,
function
()
{
let
gaogao
=
new
URI
(
'
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment
'
);
let
gaogao1
=
new
URI
(
'
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment
'
);
let
res
=
gaogao
.
equals
(
gaogao1
);
...
...
@@ -578,12 +578,12 @@ describe('UriTest', function () {
})
/**
* @tc.name:
testEquals003
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR34_035
* @tc.desc: Tests this URI for equality with another object.
* @tc.require: AR000GFB2S
* @tc.author: zhaoduwei
*/
it
(
'
testEquals003
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR34_035
'
,
0
,
function
()
{
let
gaogao
=
new
URI
(
'
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment
'
);
let
gaogao1
=
new
URI
(
'
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment123
'
);
let
res
=
gaogao
.
equals
(
gaogao1
);
...
...
@@ -617,12 +617,12 @@ describe('UriTest', function () {
})
/**
* @tc.name:
testNormalize001
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR34_036
* @tc.desc: Normalizes this URI's path.
* @tc.require: AR000GFB2S
* @tc.author: zhaoduwei
*/
it
(
'
testNormalize001
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR34_036
'
,
0
,
function
()
{
let
gaogao
=
new
URI
(
'
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path/66./../././mm/.././path1?query#fagment
'
);
let
res
=
gaogao
.
normalize
();
expect
(
res
.
path
).
assertEqual
(
"
/path/path1
"
);
...
...
@@ -630,12 +630,12 @@ describe('UriTest', function () {
})
/**
* @tc.name:
testNormalize002
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR34_037
* @tc.desc: Normalizes this URI's path.
* @tc.require: AR000GFB2S
* @tc.author: zhaoduwei
*/
it
(
'
testNormalize002
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR34_037
'
,
0
,
function
()
{
let
gaogao
=
new
URI
(
'
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../../path?query#fagment
'
);
let
res
=
gaogao
.
normalize
();
expect
(
res
.
path
).
assertEqual
(
"
/../../path
"
);
...
...
@@ -656,12 +656,12 @@ describe('UriTest', function () {
})
/**
* @tc.name:
testNormalize004
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR34_038
* @tc.desc: Normalizes this URI's path.
* @tc.require: AR000GFB2S
* @tc.author: zhaoduwei
*/
it
(
'
testNormalize004
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR34_038
'
,
0
,
function
()
{
let
gaogao
=
new
URI
(
'
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../path/.././../aa/bb/cc?query
'
);
let
res
=
gaogao
.
normalize
();
expect
(
res
.
path
).
assertEqual
(
"
/../../aa/bb/cc
"
);
...
...
@@ -669,12 +669,12 @@ describe('UriTest', function () {
})
/**
* @tc.name:
testNormalize005
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR34_039
* @tc.desc: Normalizes this URI's path.
* @tc.require: AR000GFB2S
* @tc.author: zhaoduwei
*/
it
(
'
testNormalize005
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR34_039
'
,
0
,
function
()
{
let
gaogao
=
new
URI
(
'
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/./path/./aa/bb/cc?query#fagment
'
);
let
res
=
gaogao
.
normalize
();
expect
(
res
.
path
).
assertEqual
(
"
/path/aa/bb/cc
"
);
...
...
@@ -682,12 +682,12 @@ describe('UriTest', function () {
})
/**
* @tc.name:
testToString001
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR34_042
* @tc.desc: Returns the content of this URI as a US-ASCII string.
* @tc.require: AR000GFB2S
* @tc.author: zhaoduwei
*/
it
(
'
testToString001
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR34_042
'
,
0
,
function
()
{
let
gaogao
=
new
URI
(
'
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../../path/.././../aa/bb/cc?query#fagment
'
);
let
res
=
gaogao
.
toString
();
expect
(
res
).
assertEqual
(
'
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../../path/.././../aa/bb/cc?query#fagment
'
);
...
...
@@ -718,12 +718,12 @@ describe('UriTest', function () {
})
/**
* @tc.name:
testToString004
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR34_043
* @tc.desc: Returns the content of this URI as a US-ASCII string.
* @tc.require: AR000GFB2S
* @tc.author: zhaoduwei
*/
it
(
'
testToString004
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR34_043
'
,
0
,
function
()
{
let
gaogao
=
new
URI
(
'
http://gg:gao你好gao@199.98.55.44:99/path/p你好ath?qu你好ery#fag你好ment
'
);
let
res
=
gaogao
.
toString
();
expect
(
res
).
assertEqual
(
'
http://gg:gao%E4%BD%A0%E5%A5%BDgao@199.98.55.44:99/path/
'
+
...
...
@@ -743,24 +743,24 @@ describe('UriTest', function () {
})
/**
* @tc.name:
testCheckIsAbsolute00
1
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR34_04
1
* @tc.desc: Tells whether or not this URI is absolute.
* @tc.require: AR000GFB2S
* @tc.author: zhaoduwei
*/
it
(
'
testCheckIsAbsolute00
1
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR34_04
1
'
,
0
,
function
()
{
let
gaogao
=
new
URI
(
'
f/tp://username:password@www.baidu.com:88/path?query#fagment
'
);
let
res
=
gaogao
.
checkIsAbsolute
();
expect
(
res
).
assertEqual
(
false
);
})
/**
* @tc.name:
testCheckIsAbsolute002
* @tc.name:
SUB_Runtime_JSAPI_SR000GGR34_040
* @tc.desc: Tells whether or not this URI is absolute.
* @tc.require: AR000GFB2S
* @tc.author: zhaoduwei
*/
it
(
'
testCheckIsAbsolute002
'
,
0
,
function
()
{
it
(
'
SUB_Runtime_JSAPI_SR000GGR34_040
'
,
0
,
function
()
{
let
gaogao
=
new
URI
(
'
ftp://username:password@www.baidu.com:88/path?query#fagment
'
);
let
res
=
gaogao
.
checkIsAbsolute
();
expect
(
res
).
assertEqual
(
true
);
...
...
compileruntime/util_lib_standard/src/main/js/test/util.test.js
浏览文件 @
cd878eae
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录