Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
9fef186c
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看板
提交
9fef186c
编写于
5月 23, 2022
作者:
B
bayanxing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
补全promise测试用例
Signed-off-by:
N
bayanxing
<
bayanxing@kaihongdigi.com
>
上级
55115a32
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
304 addition
and
0 deletion
+304
-0
resourceschedule/resourceschedule_standard/deviceusagestatisticsjsunit/src/main/js/default/test/BundleState.test.js
...isticsjsunit/src/main/js/default/test/BundleState.test.js
+304
-0
未找到文件。
resourceschedule/resourceschedule_standard/deviceusagestatisticsjsunit/src/main/js/default/test/BundleState.test.js
浏览文件 @
9fef186c
...
...
@@ -302,6 +302,30 @@ describe('bundlestate', function() {
console
.
info
(
'
queryCurrentBundleActiveStates_043 end
'
);
})
/*
* @tc.number: SUB_INTELLITV_JS_BUNDLE_0066
* @tc.name: queryCurrentBundleActiveStates_066.
* @tc.desc: Execute queryCurrentBundleActiveStates with promise.
* @tc.size: MEDIUM
* @tc.type: Function
* @tc.level: level 0
*/
it
(
'
queryCurrentBundleActiveStates_066
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
queryCurrentBundleActiveStates_066 start
'
);
bundlestate
.
queryCurrentBundleActiveStates
(
true
,
false
).
then
((
res
)
=>
{
console
.
info
(
'
queryCurrentBundleActiveStates_066 promise success result =
'
+
JSON
.
stringify
(
res
));
expect
(
res
).
assertFail
();
}).
catch
((
err
)
=>
{
console
.
info
(
'
queryCurrentBundleActiveStates_066 promise fail result =
'
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertLarger
(
0
);
})
done
();
});
console
.
info
(
'
queryCurrentBundleActiveStates_066 end
'
);
})
/*
* @tc.number: SUB_INTELLITV_JS_BUNDLE_0044
* @tc.name: queryCurrentBundleActiveStates_044.
...
...
@@ -326,6 +350,28 @@ describe('bundlestate', function() {
console
.
info
(
'
queryCurrentBundleActiveStates_044 end
'
);
})
/*
* @tc.number: SUB_INTELLITV_JS_BUNDLE_0067
* @tc.name: queryCurrentBundleActiveStates_067.
* @tc.desc: Execute queryCurrentBundleActiveStates with promise.
* @tc.size: MEDIUM
* @tc.type: Function
* @tc.level: level 0
*/
it
(
'
queryCurrentBundleActiveStates_067
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
queryCurrentBundleActiveStates_067 start
'
);
let
timer
=
onInit
();
bundlestate
.
queryCurrentBundleActiveStates
(
timer
.
startTime
,
''
).
then
((
data
)
=>
{
console
.
info
(
'
queryCurrentBundleActiveStates_067 promise success result =
'
+
JSON
.
stringify
(
data
));
expect
(
data
).
assertFail
();
}).
catch
((
err
)
=>
{
console
.
info
(
'
queryCurrentBundleActiveStates_067 promise fail result =
'
+
JSON
.
stringify
(
err
.
code
));
expect
(
err
.
code
).
assertLarger
(
0
);
});
done
();
console
.
info
(
'
queryCurrentBundleActiveStates_067 end
'
);
})
/*
* @tc.number: SUB_INTELLITV_JS_BUNDLE_0045
* @tc.name: queryCurrentBundleActiveStates_045.
...
...
@@ -349,6 +395,27 @@ describe('bundlestate', function() {
console
.
info
(
'
queryCurrentBundleActiveStates_045 end
'
);
})
/*
* @tc.number: SUB_INTELLITV_JS_BUNDLE_0068
* @tc.name: queryCurrentBundleActiveStates_068.
* @tc.desc: Execute queryCurrentBundleActiveStates with promise.
* @tc.size: MEDIUM
* @tc.type: Function
* @tc.level: level 0
*/
it
(
'
queryCurrentBundleActiveStates_068
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
queryCurrentBundleActiveStates_068 start
'
);
bundlestate
.
queryCurrentBundleActiveStates
(
true
,
-
1
).
then
((
data
)
=>
{
console
.
info
(
'
queryCurrentBundleActiveStates_068 promise success result =
'
+
JSON
.
stringify
(
data
));
expect
(
data
).
assertFail
();
}).
catch
((
err
)
=>
{
console
.
info
(
'
queryCurrentBundleActiveStates_068 promise fail result =
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
});
done
();
console
.
info
(
'
queryCurrentBundleActiveStates_068 end
'
);
})
/*
* @tc.number: SUB_INTELLITV_JS_BUNDLE_0046
* @tc.name: queryCurrentBundleActiveStates_046.
...
...
@@ -372,6 +439,27 @@ describe('bundlestate', function() {
console
.
info
(
'
queryCurrentBundleActiveStates_046 end
'
);
})
/*
* @tc.number: SUB_INTELLITV_JS_BUNDLE_0069
* @tc.name: queryCurrentBundleActiveStates_069.
* @tc.desc: Execute queryCurrentBundleActiveStates with promise.
* @tc.size: MEDIUM
* @tc.type: Function
* @tc.level: level 0
*/
it
(
'
queryCurrentBundleActiveStates_069
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
queryCurrentBundleActiveStates_069 start
'
);
bundlestate
.
queryCurrentBundleActiveStates
(
10001
,
'
timer.endTime
'
).
then
((
data
)
=>
{
console
.
info
(
'
queryCurrentBundleActiveStates_069 promise success result =
'
+
JSON
.
stringify
(
data
));
expect
(
data
).
assertFail
()
}).
catch
((
err
)
=>
{
console
.
info
(
'
queryCurrentBundleActiveStates_069 promise fail result =
'
+
JSON
.
stringify
(
err
.
code
));
expect
(
err
.
code
).
assertLarger
(
0
);
});
done
();
console
.
info
(
'
queryCurrentBundleActiveStates_069 end
'
);
})
/*
* @tc.number: SUB_INTELLITV_JS_BUNDLE_0047
* @tc.name: queryCurrentBundleActiveStates_047.
...
...
@@ -396,6 +484,28 @@ describe('bundlestate', function() {
console
.
info
(
'
queryCurrentBundleActiveStates_047 end
'
);
})
/*
* @tc.number: SUB_INTELLITV_JS_BUNDLE_0070
* @tc.name: queryCurrentBundleActiveStates_070.
* @tc.desc: Execute queryCurrentBundleActiveStates with promise.
* @tc.size: MEDIUM
* @tc.type: Function
* @tc.level: level 0
*/
it
(
'
queryCurrentBundleActiveStates_070
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
queryCurrentBundleActiveStates_070 start
'
);
let
timer
=
onInit
();
bundlestate
.
queryCurrentBundleActiveStates
(
timer
.
startTime
,
timer
.
startTime
).
then
((
data
)
=>
{
console
.
info
(
'
queryCurrentBundleActiveStates_070 promise success result =
'
+
JSON
.
stringify
(
data
));
expect
(
data
).
assertFail
();
}).
catch
((
err
)
=>
{
console
.
info
(
'
queryCurrentBundleActiveStates_070 promise fail result =
'
+
JSON
.
stringify
(
err
.
code
));
expect
(
err
.
code
).
assertLarger
(
0
);
});
done
();
console
.
info
(
'
queryCurrentBundleActiveStates_070 end
'
);
})
/*
* @tc.number: SUB_INTELLITV_JS_BUNDLE_0048
* @tc.name: queryCurrentBundleActiveStates_048.
...
...
@@ -420,6 +530,28 @@ describe('bundlestate', function() {
console
.
info
(
'
queryCurrentBundleActiveStates_048 end
'
);
})
/*
* @tc.number: SUB_INTELLITV_JS_BUNDLE_0071
* @tc.name: queryCurrentBundleActiveStates_071.
* @tc.desc: Execute queryCurrentBundleActiveStates with promise.
* @tc.size: MEDIUM
* @tc.type: Function
* @tc.level: level 0
*/
it
(
'
queryCurrentBundleActiveStates_071
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
queryCurrentBundleActiveStates_071 start
'
);
let
timer
=
onInit
();
bundlestate
.
queryCurrentBundleActiveStates
(
timer
.
endTime
,
timer
.
startTime
).
then
((
data
)
=>
{
console
.
info
(
'
queryCurrentBundleActiveStates_071 promise success result =
'
+
JSON
.
stringify
(
data
));
expect
(
data
).
assertFail
();
}).
catch
((
err
)
=>
{
console
.
info
(
'
queryCurrentBundleActiveStates_071 promise fail result =
'
+
JSON
.
stringify
(
err
.
code
));
expect
(
err
.
code
).
assertLarger
(
0
);
});
done
();
console
.
info
(
'
queryCurrentBundleActiveStates_071 end
'
);
})
/*
* @tc.number: SUB_INTELLITV_JS_BUNDLE_0049
* @tc.name: queryCurrentBundleActiveStates_049.
...
...
@@ -444,6 +576,28 @@ describe('bundlestate', function() {
console
.
info
(
'
queryCurrentBundleActiveStates_049 end
'
);
})
/*
* @tc.number: SUB_INTELLITV_JS_BUNDLE_0072
* @tc.name: queryCurrentBundleActiveStates_072.
* @tc.desc: Execute queryCurrentBundleActiveStates with promise.
* @tc.size: MEDIUM
* @tc.type: Function
* @tc.level: level 0
*/
it
(
'
queryCurrentBundleActiveStates_072
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
queryCurrentBundleActiveStates_072 start
'
);
let
timer
=
onInit
();
bundlestate
.
queryCurrentBundleActiveStates
(
3.145
,
timer
.
startTime
).
then
((
data
)
=>
{
console
.
info
(
'
queryCurrentBundleActiveStates_072 promise success result =
'
+
JSON
.
stringify
(
data
));
expect
(
data
).
assertInstanceOf
(
'
Array
'
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
queryCurrentBundleActiveStates_072 promise fail result =
'
+
JSON
.
stringify
(
err
.
code
));
expect
(
err
.
code
).
assertLarger
(
0
);
});
done
();
console
.
info
(
'
queryCurrentBundleActiveStates_072 end
'
);
})
/*
* @tc.number: SUB_INTELLITV_JS_BUNDLE_0050
* @tc.name: queryCurrentBundleActiveStates_050.
...
...
@@ -468,6 +622,28 @@ describe('bundlestate', function() {
console
.
info
(
'
queryCurrentBundleActiveStates_050 end
'
);
})
/*
* @tc.number: SUB_INTELLITV_JS_BUNDLE_0073
* @tc.name: queryCurrentBundleActiveStates_073.
* @tc.desc: Execute queryCurrentBundleActiveStates with promise.
* @tc.size: MEDIUM
* @tc.type: Function
* @tc.level: level 0
*/
it
(
'
queryCurrentBundleActiveStates_073
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
queryCurrentBundleActiveStates_073 start
'
);
let
timer
=
onInit
();
bundlestate
.
queryCurrentBundleActiveStates
(
''
,
''
).
then
((
data
)
=>
{
console
.
info
(
'
queryCurrentBundleActiveStates_073 promise success result =
'
+
JSON
.
stringify
(
data
));
expect
(
data
).
assertFail
();
}).
catch
((
err
)
=>
{
console
.
info
(
'
queryCurrentBundleActiveStates_073 promise fail result =
'
+
JSON
.
stringify
(
err
.
code
));
expect
(
err
.
code
).
assertLarger
(
0
);
});
done
();
console
.
info
(
'
queryCurrentBundleActiveStates_073 end
'
);
})
/*
* @tc.number: SUB_INTELLITV_JS_BUNDLE_0051
* @tc.name: queryCurrentBundleActiveStates_051.
...
...
@@ -492,6 +668,28 @@ describe('bundlestate', function() {
console
.
info
(
'
queryCurrentBundleActiveStates_051 end
'
);
})
/*
* @tc.number: SUB_INTELLITV_JS_BUNDLE_0074
* @tc.name: queryCurrentBundleActiveStates_074.
* @tc.desc: Execute queryCurrentBundleActiveStates with promise.
* @tc.size: MEDIUM
* @tc.type: Function
* @tc.level: level 0
*/
it
(
'
queryCurrentBundleActiveStates_074
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
queryCurrentBundleActiveStates_074 start
'
);
let
timer
=
onInit
();
bundlestate
.
queryCurrentBundleActiveStates
(
null
,
null
).
then
((
data
)
=>
{
console
.
info
(
'
queryCurrentBundleActiveStates_074 promise success result =
'
+
JSON
.
stringify
(
data
));
expect
(
data
).
assertFail
();
}).
catch
((
err
)
=>
{
console
.
info
(
'
queryCurrentBundleActiveStates_074 promise fail result =
'
+
JSON
.
stringify
(
err
.
code
));
expect
(
err
.
code
).
assertLarger
(
0
);
});
done
();
console
.
info
(
'
queryCurrentBundleActiveStates_074 end
'
);
})
/*
* @tc.number: SUB_INTELLITV_JS_BUNDLE_0052
* @tc.name: isIdleState_052.
...
...
@@ -606,6 +804,27 @@ describe('bundlestate', function() {
console
.
info
(
'
isIdleState_056 end
'
);
})
/*
* @tc.number: SUB_INTELLITV_JS_BUNDLE_0062
* @tc.name: isIdleState_062.
* @tc.desc: Execute isIdleState with Promise.
* @tc.size: MEDIUM
* @tc.type: Function
* @tc.level: level 0
*/
it
(
'
isIdleState_062
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
isIdleState_062 start
'
);
bundlestate
.
isIdleState
(
123
).
then
((
res
)
=>
{
console
.
info
(
'
isIdleState_062 promise success result =
'
+
JSON
.
stringify
(
res
));
expect
(
res
).
assertFail
();
}).
catch
((
err
)
=>
{
console
.
info
(
'
isIdleState_062 promise fail result =
'
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertLarger
(
0
);
})
done
();
console
.
info
(
'
isIdleState_062 end
'
);
})
/*
* @tc.number: SUB_INTELLITV_JS_BUNDLE_0057
* @tc.name: isIdleState_057.
...
...
@@ -629,6 +848,27 @@ describe('bundlestate', function() {
console
.
info
(
'
isIdleState_057 end
'
);
})
/*
* @tc.number: SUB_INTELLITV_JS_BUNDLE_0063
* @tc.name: isIdleState_063.
* @tc.desc: Execute isIdleState with Promise.
* @tc.size: MEDIUM
* @tc.type: Function
* @tc.level: level 0
*/
it
(
'
isIdleState_063
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
isIdleState_063 start
'
);
bundlestate
.
isIdleState
(
null
).
then
((
res
)
=>
{
console
.
info
(
'
isIdleState_063 promise success result =
'
+
JSON
.
stringify
(
res
));
expect
(
res
).
assertFail
();
}).
catch
((
err
)
=>
{
console
.
info
(
'
isIdleState_063 promise fail result =
'
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertLarger
(
0
);
})
done
();
console
.
info
(
'
isIdleState_063 end
'
);
})
/*
* @tc.number: SUB_INTELLITV_JS_BUNDLE_0058
* @tc.name: isIdleState_058.
...
...
@@ -675,6 +915,27 @@ describe('bundlestate', function() {
console
.
info
(
'
isIdleState_059 end
'
);
})
/*
* @tc.number: SUB_INTELLITV_JS_BUNDLE_0064
* @tc.name: isIdleState_064.
* @tc.desc: Execute isIdleState with Promise.
* @tc.size: MEDIUM
* @tc.type: Function
* @tc.level: level 0
*/
it
(
'
isIdleState_064
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
isIdleState_064 start
'
);
bundlestate
.
isIdleState
(
false
).
then
((
res
)
=>
{
console
.
info
(
'
isIdleState_064 promise success result =
'
+
JSON
.
stringify
(
res
));
expect
(
res
).
assertFail
();
}).
catch
((
err
)
=>
{
console
.
info
(
'
isIdleState_064 promise fail result =
'
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertLarger
(
0
);
})
done
();
console
.
info
(
'
isIdleState_064 end
'
);
})
/*
* @tc.number: SUB_INTELLITV_JS_BUNDLE_0060
* @tc.name: isIdleState_060.
...
...
@@ -697,4 +958,47 @@ describe('bundlestate', function() {
});
console
.
info
(
'
isIdleState_060 end
'
);
})
/*
* @tc.number: SUB_INTELLITV_JS_BUNDLE_0061
* @tc.name: isIdleState_061.
* @tc.desc: Execute isIdleState with Promise.
* @tc.size: MEDIUM
* @tc.type: Function
* @tc.level: level 0
*/
it
(
'
isIdleState_061
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
isIdleState_061 start
'
);
bundlestate
.
isIdleState
(
''
).
then
((
res
)
=>
{
console
.
info
(
'
isIdleState_061 promise success result =
'
+
JSON
.
stringify
(
res
));
expect
(
res
).
assertFail
();
}).
catch
((
err
)
=>
{
console
.
info
(
'
isIdleState_061 promise fail result =
'
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertLarger
(
0
);
})
done
();
console
.
info
(
'
isIdleState_061 end
'
);
})
/*
* @tc.number: SUB_INTELLITV_JS_BUNDLE_065
* @tc.name: isIdleState_065.
* @tc.desc: Execute isIdleState with Promise.
* @tc.size: MEDIUM
* @tc.type: Function
* @tc.level: level 0
*/
it
(
'
isIdleState_065
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
isIdleState_065 start
'
);
bundlestate
.
isIdleState
(
true
).
then
((
res
)
=>
{
console
.
info
(
'
isIdleState_065 promise success result =
'
+
JSON
.
stringify
(
res
));
expect
(
res
).
assertFail
();
}).
catch
((
err
)
=>
{
console
.
info
(
'
isIdleState_065 promise fail result =
'
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertLarger
(
0
);
})
done
();
console
.
info
(
'
isIdleState_065 end
'
);
})
})
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录