Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
82061e02
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看板
未验证
提交
82061e02
编写于
6月 21, 2022
作者:
O
openharmony_ci
提交者:
Gitee
6月 21, 2022
浏览文件
操作
浏览文件
下载
差异文件
!3650 新增api接口xts用例补充
Merge pull request !3650 from qigongming/master_0621
上级
23c2f10a
2bc5a22a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
336 addition
and
4 deletion
+336
-4
resourceschedule/resourceschedule_standard/deviceusagestatisticsjsunit/src/main/js/default/test/BundleState.test.js
...isticsjsunit/src/main/js/default/test/BundleState.test.js
+12
-4
resourceschedule/resourceschedule_standard/deviceusagestatisticsjsunit/src/main/js/default/test/DeviceUsageStatisticsJsunit.test.js
.../main/js/default/test/DeviceUsageStatisticsJsunit.test.js
+324
-0
未找到文件。
resourceschedule/resourceschedule_standard/deviceusagestatisticsjsunit/src/main/js/default/test/BundleState.test.js
浏览文件 @
82061e02
...
@@ -711,7 +711,11 @@ describe('bundlestate', function() {
...
@@ -711,7 +711,11 @@ describe('bundlestate', function() {
expect
(
err
.
code
).
assertLarger
(
0
);
expect
(
err
.
code
).
assertLarger
(
0
);
}
else
{
}
else
{
console
.
info
(
'
isIdleState_052 callback success result =
'
+
JSON
.
stringify
(
res
));
console
.
info
(
'
isIdleState_052 callback success result =
'
+
JSON
.
stringify
(
res
));
expect
(
res
).
assertFalse
();
if
(
res
)
{
expect
(
res
).
assertTrue
();
}
else
{
expect
(
res
).
assertFalse
();
}
}
}
done
();
done
();
});
});
...
@@ -735,7 +739,7 @@ describe('bundlestate', function() {
...
@@ -735,7 +739,7 @@ describe('bundlestate', function() {
}
else
{
}
else
{
console
.
info
(
'
isIdleState_053 callback success result =
'
+
JSON
.
stringify
(
res
));
console
.
info
(
'
isIdleState_053 callback success result =
'
+
JSON
.
stringify
(
res
));
expect
(
res
).
assertInstanceOf
(
'
Boolean
'
);
expect
(
res
).
assertInstanceOf
(
'
Boolean
'
);
}
}
;
done
();
done
();
});
});
console
.
info
(
'
isIdleState_053 end
'
);
console
.
info
(
'
isIdleState_053 end
'
);
...
@@ -753,11 +757,15 @@ describe('bundlestate', function() {
...
@@ -753,11 +757,15 @@ describe('bundlestate', function() {
console
.
info
(
'
isIdleState_054 start
'
);
console
.
info
(
'
isIdleState_054 start
'
);
bundlestate
.
isIdleState
(
bundleName
).
then
((
data
)
=>
{
bundlestate
.
isIdleState
(
bundleName
).
then
((
data
)
=>
{
console
.
info
(
'
isIdleState_054 promise success result =
'
+
JSON
.
stringify
(
data
));
console
.
info
(
'
isIdleState_054 promise success result =
'
+
JSON
.
stringify
(
data
));
expect
(
data
).
assertFalse
();
if
(
res
)
{
expect
(
res
).
assertTrue
();
}
else
{
expect
(
res
).
assertFalse
();
};
done
();
done
();
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
info
(
'
isIdleState_054 promise fail result =
'
+
JSON
.
stringify
(
err
.
code
));
console
.
info
(
'
isIdleState_054 promise fail result =
'
+
JSON
.
stringify
(
err
.
code
));
expect
(
err
.
code
).
assert
Larger
(
0
);
expect
(
err
.
code
).
assert
Undefined
(
);
done
();
done
();
})
})
console
.
info
(
'
isIdleState_054 end
'
);
console
.
info
(
'
isIdleState_054 end
'
);
...
...
resourceschedule/resourceschedule_standard/deviceusagestatisticsjsunit/src/main/js/default/test/DeviceUsageStatisticsJsunit.test.js
浏览文件 @
82061e02
...
@@ -2397,4 +2397,328 @@ describe("DeviceUsageStatisticsJsTest", function () {
...
@@ -2397,4 +2397,328 @@ describe("DeviceUsageStatisticsJsTest", function () {
done
();
done
();
},
500
);
},
500
);
})
})
/*
* @tc.name: DeviceUsageStatisticsJsTest098
* @tc.desc: test bundleState setBundleGroup bundleName newGroup promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest098
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest098---------------------------
'
);
let
bundleName
=
"
ohos.sample.shopping
"
;
let
newGroup
=
bundleState
.
GroupType
.
ACTIVE_GROUP_DAILY
;
bundleState
.
setBundleGroup
(
bundleName
,
newGroup
).
then
(
()
=>
{
console
.
log
(
'
test DeviceUsageStatisticsJsTest098 promise succeeded.
'
);
expect
(
true
).
assertEqual
(
true
);
}).
catch
(
err
=>
{
console
.
log
(
'
test DeviceUsageStatisticsJsTest098 promise failed. because:
'
+
err
.
code
);
expect
(
false
).
assertEqual
(
true
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest099
* @tc.desc: test bundleState setBundleGroup bundleName newGroup callback.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest099
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest099---------------------------
'
);
let
bundleName
=
"
ohos.sample.shopping
"
;
let
newGroup
=
bundleState
.
GroupType
.
ACTIVE_GROUP_FIXED
;
bundleState
.
setBundleGroup
(
bundleName
,
newGroup
,
(
err
)
=>
{
if
(
err
)
{
console
.
log
(
'
test DeviceUsageStatisticsJsTest099 callback failed. because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertEqual
(
true
);
}
else
{
console
.
log
(
'
test DeviceUsageStatisticsJsTest099 callback succeeded. result:
'
);
expect
(
true
).
assertEqual
(
true
);
}
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0100
* @tc.desc: test bundleState onBundleGroupChanged callback promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest0100
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest0100---------------------------
'
);
let
onBundleGroupChanged
=
(
err
,
res
)
=>
{
console
.
log
(
'
test DeviceUsageStatisticsJsTest0100 callback success.
'
);
console
.
log
(
'
test DeviceUsageStatisticsJsTest0100 result oldGroup is :
'
+
res
.
oldGroup
);
console
.
log
(
'
test DeviceUsageStatisticsJsTest0100 result newGroup is :
'
+
res
.
newGroup
);
console
.
log
(
'
test DeviceUsageStatisticsJsTest0100 result changeReason is :
'
+
res
.
newGroup
);
console
.
log
(
'
test DeviceUsageStatisticsJsTest0100 result userId is :
'
+
res
.
userId
);
console
.
log
(
'
test DeviceUsageStatisticsJsTest0100 result bundleName is :
'
+
res
.
bundleName
);
};
bundleState
.
registerGroupCallBack
(
onBundleGroupChanged
).
then
(
()
=>
{
console
.
log
(
'
test DeviceUsageStatisticsJsTest0100 promise succeeded.
'
);
expect
(
true
).
assertEqual
(
true
);
}).
catch
(
err
=>
{
console
.
log
(
'
test DeviceUsageStatisticsJsTest0100 promise failed.
'
);
expect
(
false
).
assertEqual
(
true
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0102
* @tc.desc: test bundleState unRegisterGroupCallBack promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest0102
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest0102---------------------------
'
);
bundleState
.
unRegisterGroupCallBack
().
then
(
()
=>
{
console
.
log
(
'
test DeviceUsageStatisticsJsTest0102 promise succeeded.
'
);
expect
(
true
).
assertEqual
(
true
);
}).
catch
(
err
=>
{
console
.
log
(
'
test DeviceUsageStatisticsJsTest0102 promise failed. because:
'
+
err
.
code
);
expect
(
false
).
assertEqual
(
true
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0101
* @tc.desc: test bundleState setBundleGroup callback.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest0101
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest0101---------------------------
'
);
let
onBundleGroupChanged
=
(
err
,
res
)
=>
{
console
.
log
(
'
test DeviceUsageStatisticsJsTest0101 callback success.
'
);
console
.
log
(
'
test DeviceUsageStatisticsJsTest0101 result oldGroup is :
'
+
res
.
oldGroup
);
console
.
log
(
'
test DeviceUsageStatisticsJsTest0101 result newGroup is :
'
+
res
.
newGroup
);
console
.
log
(
'
test DeviceUsageStatisticsJsTest0101 result changeReason is :
'
+
res
.
newGroup
);
console
.
log
(
'
test DeviceUsageStatisticsJsTest0101 result userId is :
'
+
res
.
userId
);
console
.
log
(
'
test DeviceUsageStatisticsJsTest0101 result bundleName is :
'
+
res
.
bundleName
);
};
bundleState
.
registerGroupCallBack
(
onBundleGroupChanged
,
(
err
)
=>
{
if
(
err
)
{
console
.
log
(
'
test DeviceUsageStatisticsJsTest0101 callback failed,
'
);
expect
(
false
).
assertEqual
(
true
);
}
else
{
console
.
log
(
'
test DeviceUsageStatisticsJsTest0101 callback success.
'
);
expect
(
true
).
assertEqual
(
true
);
}
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0103
* @tc.desc: test bundleState unRegisterGroupCallBack callback.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest0103
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest0103---------------------------
'
);
bundleState
.
unRegisterGroupCallBack
((
err
)
=>
{
if
(
err
)
{
console
.
log
(
'
test DeviceUsageStatisticsJsTest0103 callback failed. because:
'
+
err
.
code
);
expect
(
false
).
assertEqual
(
false
);
}
else
{
console
.
log
(
'
test DeviceUsageStatisticsJsTest0103 callback success.
'
);
expect
(
true
).
assertEqual
(
true
);
}
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0104
* @tc.desc: test bundleState queryBundleActiveEventStates promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest0104
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest0104---------------------------
'
);
bundleState
.
queryBundleActiveEventStates
(
0
,
20000000000000
).
then
(
res
=>
{
console
.
log
(
'
test DeviceUsageStatisticsJsTest0104 promise success.
'
);
console
.
log
(
'
test DeviceUsageStatisticsJsTest0104 promise result
'
+
JSON
.
stringify
(
res
));
expect
(
res
).
assertInstanceOf
(
'
Array
'
);
}).
catch
(
err
=>
{
console
.
log
(
'
test DeviceUsageStatisticsJsTest0104 promise failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertFalse
();
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0105
* @tc.desc: test bundleState queryBundleActiveEventStates callback.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest0105
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest0105---------------------------
'
);
bundleState
.
queryBundleActiveEventStates
(
0
,
20000000000000
,
(
err
,
res
)
=>
{
if
(
err
)
{
console
.
log
(
'
test DeviceUsageStatisticsJsTest0105 callback failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertFalse
();
}
else
{
console
.
log
(
'
test DeviceUsageStatisticsJsTest0105 callback success.
'
);
console
.
log
(
'
test DeviceUsageStatisticsJsTest0105 callback result
'
+
JSON
.
stringify
(
res
));
expect
(
res
).
assertInstanceOf
(
'
Array
'
);
}
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0106
* @tc.desc: test bundleState queryAppNotificationNumber promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest0106
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest0106---------------------------
'
);
bundleState
.
queryAppNotificationNumber
(
0
,
20000000000000
).
then
(
res
=>
{
console
.
log
(
'
test DeviceUsageStatisticsJsTest0106 promise success.
'
);
console
.
log
(
'
test DeviceUsageStatisticsJsTest0106 promise result
'
+
JSON
.
stringify
(
res
));
expect
(
res
).
assertInstanceOf
(
'
Array
'
);
}).
catch
(
err
=>
{
console
.
log
(
'
test DeviceUsageStatisticsJsTest0106 promise failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertFalse
();
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0107
* @tc.desc: test bundleState queryAppNotificationNumber callback.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest0107
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest0107---------------------------
'
);
bundleState
.
queryAppNotificationNumber
(
0
,
20000000000000
,
(
err
,
res
)
=>
{
if
(
err
)
{
console
.
log
(
'
test DeviceUsageStatisticsJsTest0107 callback failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertFalse
();
}
else
{
console
.
log
(
'
test DeviceUsageStatisticsJsTest0107 callback success.
'
);
console
.
log
(
'
test DeviceUsageStatisticsJsTest0107 callback result
'
+
JSON
.
stringify
(
res
));
expect
(
res
).
assertInstanceOf
(
'
Array
'
);
}
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0108
* @tc.desc: test bundleState GroupType constant
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest0108
"
,
0
,
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest0108---------------------------
'
);
let
value1
=
bundleState
.
GroupType
.
ACTIVE_GROUP_ALIVE
;
expect
(
value1
).
assertEqual
(
10
)
done
();
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0109
* @tc.desc: test bundleState GroupType constant
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest0109
"
,
0
,
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest0109---------------------------
'
);
let
value1
=
bundleState
.
GroupType
.
ACTIVE_GROUP_DAILY
;
expect
(
value1
).
assertEqual
(
20
)
done
();
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0110
* @tc.desc: test bundleState GroupType constant
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest0110
"
,
0
,
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest0110---------------------------
'
);
let
value1
=
bundleState
.
GroupType
.
ACTIVE_GROUP_FIXED
;
expect
(
value1
).
assertEqual
(
30
)
done
();
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0111
* @tc.desc: test bundleState GroupType constant
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest0111
"
,
0
,
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest0111---------------------------
'
);
let
value1
=
bundleState
.
GroupType
.
ACTIVE_GROUP_RARE
;
expect
(
value1
).
assertEqual
(
40
)
done
();
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0112
* @tc.desc: test bundleState GroupType constant
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest0112
"
,
0
,
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest0112---------------------------
'
);
let
value1
=
bundleState
.
GroupType
.
ACTIVE_GROUP_LIMIT
;
expect
(
value1
).
assertEqual
(
50
)
done
();
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0113
* @tc.desc: test bundleState GroupType constant
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest0113
"
,
0
,
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest0113---------------------------
'
);
let
value1
=
bundleState
.
GroupType
.
ACTIVE_GROUP_NEVER
;
expect
(
value1
).
assertEqual
(
60
)
done
();
})
})
})
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录