Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
3c11f96e
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
3c11f96e
编写于
7月 07, 2022
作者:
O
openharmony_ci
提交者:
Gitee
7月 07, 2022
浏览文件
操作
浏览文件
下载
差异文件
!4156 【resourceschedule】【master】全局资源调度提醒代理模块XTS用例doc描述整改
Merge pull request !4156 from 南先森/rms0706
上级
1d4797a2
faf6567d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
741 addition
and
3218 deletion
+741
-3218
resourceschedule/resourceschedule_standard/deviceusagestatisticsjsunit/src/main/js/default/test/BundleState.test.js
...isticsjsunit/src/main/js/default/test/BundleState.test.js
+0
-506
resourceschedule/resourceschedule_standard/deviceusagestatisticsjsunit/src/main/js/default/test/DeviceUsageStatisticsJsunit.test.js
.../main/js/default/test/DeviceUsageStatisticsJsunit.test.js
+87
-2075
resourceschedule/resourceschedule_standard/reminderagent/src/main/js/default/test/ReminderAgentJs.test.js
...deragent/src/main/js/default/test/ReminderAgentJs.test.js
+654
-637
未找到文件。
resourceschedule/resourceschedule_standard/deviceusagestatisticsjsunit/src/main/js/default/test/BundleState.test.js
浏览文件 @
3c11f96e
...
...
@@ -55,49 +55,6 @@ describe('bundlestate', function() {
console
.
info
(
'
afterEach caled
'
)
})
/*
* @tc.number: SUB_INTELLITV_JS_BUNDLE_0001
* @tc.name: queryAppUsagePriorityGroup_001.
* @tc.desc: Execute queryAppUsagePriorityGroup with callback.
* @tc.size: MEDIUM
* @tc.type: Function
* @tc.level: level 0
*/
it
(
'
queryAppUsagePriorityGroup_001
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
queryAppUsagePriorityGroup_001 start
'
);
bundlestate
.
queryAppUsagePriorityGroup
((
err
,
data
)
=>
{
if
(
err
)
{
console
.
info
(
'
queryAppUsagePriorityGroup_001 callback fail result =
'
+
err
);
}
else
{
console
.
info
(
'
queryAppUsagePriorityGroup_001 callback success result =
'
+
JSON
.
stringify
(
data
));
expect
(
true
).
assertEqual
(
true
)
}
done
();
});
console
.
info
(
'
queryAppUsagePriorityGroup_001 end
'
);
})
/*
* @tc.number: SUB_INTELLITV_JS_BUNDLE_0002
* @tc.name: queryAppUsagePriorityGroup_002.
* @tc.desc: Execute queryAppUsagePriorityGroup with Promise.
* @tc.size: MEDIUM
* @tc.type: Function
* @tc.level: level 0
*/
it
(
'
queryAppUsagePriorityGroup_002
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
queryAppUsagePriorityGroup_002 start
'
);
bundlestate
.
queryAppUsagePriorityGroup
().
then
((
data
)
=>
{
console
.
info
(
'
queryAppUsagePriorityGroup_002 callback success result =
'
+
JSON
.
stringify
(
data
));
expect
(
true
).
assertEqual
(
true
);
done
();
}).
catch
((
err
)
=>
{
console
.
info
(
'
queryAppUsagePriorityGroup_002 callback fail result =
'
+
JSON
.
stringify
(
err
.
code
));
expect
(
err
.
code
).
assertLarger
(
0
);
})
console
.
info
(
'
queryAppUsagePriorityGroup_002 end
'
);
})
/*
* @tc.number: SUB_INTELLITV_JS_BUNDLE_0024
* @tc.name: merge_024.
...
...
@@ -232,469 +189,6 @@ describe('bundlestate', function() {
console
.
info
(
'
merge_028 end
'
);
})
/*
* @tc.number: SUB_INTELLITV_JS_BUNDLE_0041
* @tc.name: queryCurrentBundleActiveStates_041.
* @tc.desc: Execute queryCurrentBundleActiveStates with callback.
* @tc.size: MEDIUM
* @tc.type: Function
* @tc.level: level 0
*/
it
(
'
queryCurrentBundleActiveStates_041
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
queryCurrentBundleActiveStates_041 start
'
);
let
time
=
{
'
begin
'
:
0
,
'
end
'
:
0
};
let
initTime
=
function
()
{
var
now
=
new
Date
().
getTime
();
time
.
begin
=
now
-
86400000
;
time
.
end
=
now
;
};
initTime
();
bundlestate
.
queryCurrentBundleActiveStates
(
time
.
begin
,
time
.
end
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
info
(
'
queryCurrentBundleActiveStates_041 callback fail result =
'
+
err
);
expect
(
data
).
assertFail
();
}
else
{
console
.
info
(
'
queryCurrentBundleActiveStates_041 callback success result =
'
+
JSON
.
stringify
(
data
));
expect
(
data
).
assertInstanceOf
(
'
Array
'
);
}
done
();
});
console
.
info
(
'
queryCurrentBundleActiveStates_041 end
'
);
})
/*
* @tc.number: SUB_INTELLITV_JS_BUNDLE_0042
* @tc.name: queryCurrentBundleActiveStates_042.
* @tc.desc: Execute queryCurrentBundleActiveStates with promise.
* @tc.size: MEDIUM
* @tc.type: Function
* @tc.level: level 0
*/
it
(
'
queryCurrentBundleActiveStates_042
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
queryCurrentBundleActiveStates_042 start
'
);
let
timer
=
onInit
();
bundlestate
.
queryCurrentBundleActiveStates
(
timer
.
startTime
,
timer
.
endTime
).
then
((
data
)
=>
{
console
.
info
(
'
queryCurrentBundleActiveStates_042 promise success result =
'
+
JSON
.
stringify
(
data
));
expect
(
data
).
assertInstanceOf
(
'
Array
'
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
queryCurrentBundleActiveStates_042 promise fail result =
'
+
err
.
code
);
expect
(
data
).
assertFail
();
})
done
();
console
.
info
(
'
queryCurrentBundleActiveStates_042 end
'
);
})
/*
* @tc.number: SUB_INTELLITV_JS_BUNDLE_0043
* @tc.name: queryCurrentBundleActiveStates_043.
* @tc.desc: Execute queryCurrentBundleActiveStates with callback.
* @tc.size: MEDIUM
* @tc.type: Function
* @tc.level: level 0
*/
it
(
'
queryCurrentBundleActiveStates_043
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
queryCurrentBundleActiveStates_043 start
'
);
bundlestate
.
queryCurrentBundleActiveStates
(
true
,
false
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
info
(
'
queryCurrentBundleActiveStates_043 callback fail result =
'
+
JSON
.
stringify
(
err
.
code
));
expect
(
err
.
code
).
assertLarger
(
0
);
}
else
{
console
.
info
(
'
queryCurrentBundleActiveStates_043 callback success result =
'
+
JSON
.
stringify
(
data
));
expect
(
data
).
assertFail
();
}
done
();
});
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.
* @tc.desc: Execute queryCurrentBundleActiveStates with callback.
* @tc.size: MEDIUM
* @tc.type: Function
* @tc.level: level 0
*/
it
(
'
queryCurrentBundleActiveStates_044
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
queryCurrentBundleActiveStates_044 start
'
);
let
timer
=
onInit
();
bundlestate
.
queryCurrentBundleActiveStates
(
timer
.
startTime
,
''
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
info
(
'
queryCurrentBundleActiveStates_044 callback fail result =
'
+
JSON
.
stringify
(
err
.
code
));
expect
(
err
.
code
).
assertLarger
(
0
);
}
else
{
console
.
info
(
'
queryCurrentBundleActiveStates_044 callback success result =
'
+
JSON
.
stringify
(
data
));
expect
(
data
).
assertFail
();
}
done
();
});
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.
* @tc.desc: Execute queryCurrentBundleActiveStates with callback.
* @tc.size: MEDIUM
* @tc.type: Function
* @tc.level: level 0
*/
it
(
'
queryCurrentBundleActiveStates_045
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
queryCurrentBundleActiveStates_045 start
'
);
bundlestate
.
queryCurrentBundleActiveStates
(
true
,
-
1
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
info
(
'
queryCurrentBundleActiveStates_045 callback fail result =
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
}
else
{
console
.
info
(
'
queryCurrentBundleActiveStates_045 callback success result =
'
+
JSON
.
stringify
(
data
));
expect
(
data
).
assertFail
();
}
done
();
});
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.
* @tc.desc: Execute queryCurrentBundleActiveStates with callback.
* @tc.size: MEDIUM
* @tc.type: Function
* @tc.level: level 0
*/
it
(
'
queryCurrentBundleActiveStates_046
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
queryCurrentBundleActiveStates_046 start
'
);
bundlestate
.
queryCurrentBundleActiveStates
(
10001
,
'
timer.endTime
'
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
info
(
'
queryCurrentBundleActiveStates_046 callback fail result =
'
+
JSON
.
stringify
(
err
.
code
));
expect
(
err
.
code
).
assertLarger
(
0
);
}
else
{
console
.
info
(
'
queryCurrentBundleActiveStates_046 callback success result =
'
+
JSON
.
stringify
(
data
));
expect
(
data
).
assertFail
();
}
done
();
});
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.
* @tc.desc: Execute queryCurrentBundleActiveStates with callback.
* @tc.size: MEDIUM
* @tc.type: Function
* @tc.level: level 0
*/
it
(
'
queryCurrentBundleActiveStates_047
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
queryCurrentBundleActiveStates_047 start
'
);
let
timer
=
onInit
();
bundlestate
.
queryCurrentBundleActiveStates
(
timer
.
startTime
,
timer
.
startTime
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
info
(
'
queryCurrentBundleActiveStates_047 callback fail result =
'
+
JSON
.
stringify
(
err
.
code
));
expect
(
err
.
code
).
assertLarger
(
0
);
}
else
{
console
.
info
(
'
queryCurrentBundleActiveStates_047 callback success result =
'
+
JSON
.
stringify
(
data
));
expect
(
data
).
assertFail
();
}
done
();
});
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.
* @tc.desc: Execute queryCurrentBundleActiveStates with callback.
* @tc.size: MEDIUM
* @tc.type: Function
* @tc.level: level 0
*/
it
(
'
queryCurrentBundleActiveStates_048
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
queryCurrentBundleActiveStates_048 start
'
);
let
timer
=
onInit
();
bundlestate
.
queryCurrentBundleActiveStates
(
timer
.
endTime
,
timer
.
startTime
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
info
(
'
queryCurrentBundleActiveStates_048 callback fail result =
'
+
JSON
.
stringify
(
err
.
code
));
expect
(
err
.
code
).
assertLarger
(
0
);
}
else
{
console
.
info
(
'
queryCurrentBundleActiveStates_048 callback success result =
'
+
JSON
.
stringify
(
data
));
expect
(
data
).
assertFail
();
}
done
();
});
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.
* @tc.desc: Execute queryCurrentBundleActiveStates with callback.
* @tc.size: MEDIUM
* @tc.type: Function
* @tc.level: level 0
*/
it
(
'
queryCurrentBundleActiveStates_049
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
queryCurrentBundleActiveStates_049 start
'
);
let
timer
=
onInit
();
bundlestate
.
queryCurrentBundleActiveStates
(
3.145
,
timer
.
startTime
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
info
(
'
queryCurrentBundleActiveStates_049 callback fail result =
'
+
JSON
.
stringify
(
err
.
code
));
expect
(
err
.
code
).
assertLarger
(
0
);
}
else
{
console
.
info
(
'
queryCurrentBundleActiveStates_049 callback success result =
'
+
JSON
.
stringify
(
data
));
expect
(
data
).
assertInstanceOf
(
'
Array
'
);
}
done
();
});
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.
* @tc.desc: Execute queryCurrentBundleActiveStates with callback.
* @tc.size: MEDIUM
* @tc.type: Function
* @tc.level: level 0
*/
it
(
'
queryCurrentBundleActiveStates_050
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
queryCurrentBundleActiveStates_050 start
'
);
let
timer
=
onInit
();
bundlestate
.
queryCurrentBundleActiveStates
(
''
,
''
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
info
(
'
queryCurrentBundleActiveStates_050 callback fail result =
'
+
JSON
.
stringify
(
err
.
code
));
expect
(
err
.
code
).
assertLarger
(
0
);
}
else
{
console
.
info
(
'
queryCurrentBundleActiveStates_050 callback success result =
'
+
JSON
.
stringify
(
data
));
expect
(
data
).
assertFail
();
}
done
();
});
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.
* @tc.desc: Execute queryCurrentBundleActiveStates with callback.
* @tc.size: MEDIUM
* @tc.type: Function
* @tc.level: level 0
*/
it
(
'
queryCurrentBundleActiveStates_051
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
queryCurrentBundleActiveStates_051 start
'
);
let
timer
=
onInit
();
bundlestate
.
queryCurrentBundleActiveStates
(
null
,
null
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
info
(
'
queryCurrentBundleActiveStates_051 callback fail result =
'
+
JSON
.
stringify
(
err
.
code
));
expect
(
err
.
code
).
assertLarger
(
0
);
}
else
{
console
.
info
(
'
queryCurrentBundleActiveStates_051 callback success result =
'
+
JSON
.
stringify
(
data
));
expect
(
data
).
assertFail
();
}
done
();
});
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.
...
...
resourceschedule/resourceschedule_standard/deviceusagestatisticsjsunit/src/main/js/default/test/DeviceUsageStatisticsJsunit.test.js
浏览文件 @
3c11f96e
...
...
@@ -140,102 +140,6 @@ describe("DeviceUsageStatisticsJsTest", function () {
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest005
* @tc.desc: test queryBundleActiveStates promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest005
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest005---------------------------
'
);
let
beginTime
=
0
;
let
endTime
=
20000000000000
;
bundleState
.
queryBundleActiveStates
(
beginTime
,
endTime
).
then
((
res
)
=>
{
console
.
info
(
'
BUNDLE_ACTIVE queryBundleActiveStates promise success.
'
);
expect
(
true
).
assertEqual
(
true
);
}).
catch
((
err
)
=>
{
expect
(
false
).
assertEqual
(
true
);
console
.
info
(
'
BUNDLE_ACTIVE queryBundleActiveStates promise failure.
'
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest006
* @tc.desc: test queryBundleActiveStates callback.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest006
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest006---------------------------
'
);
let
beginTime
=
0
;
let
endTime
=
20000000000000
;
bundleState
.
queryBundleActiveStates
(
beginTime
,
endTime
,
(
err
,
res
)
=>
{
if
(
err
)
{
expect
(
false
).
assertEqual
(
true
);
console
.
info
(
'
BUNDLE_ACTIVE queryBundleActiveStates callback failure.
'
);
}
else
{
console
.
info
(
'
BUNDLE_ACTIVE queryBundleActiveStates callback success.
'
);
expect
(
true
).
assertEqual
(
true
);
}
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest007
* @tc.desc: test queryBundleStateInfos promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest007
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest007---------------------------
'
);
let
beginTime
=
0
;
let
endTime
=
20000000000000
;
bundleState
.
queryBundleStateInfos
(
beginTime
,
endTime
).
then
((
res
)
=>
{
console
.
info
(
'
BUNDLE_ACTIVE queryBundleStateInfos promise success.
'
);
expect
(
true
).
assertEqual
(
true
);
}).
catch
((
err
)
=>
{
expect
(
false
).
assertEqual
(
true
);
console
.
info
(
'
BUNDLE_ACTIVE queryBundleStateInfos promise failure.
'
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest008
* @tc.desc: test queryBundleStateInfos callback.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest008
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest008---------------------------
'
);
let
beginTime
=
0
;
let
endTime
=
20000000000000
;
bundleState
.
queryBundleStateInfos
(
beginTime
,
endTime
,
(
err
,
res
)
=>
{
if
(
err
)
{
expect
(
false
).
assertEqual
(
true
);
console
.
info
(
'
BUNDLE_ACTIVE queryBundleStateInfos callback failure.
'
);
}
else
{
console
.
info
(
'
BUNDLE_ACTIVE queryBundleStateInfos callback success.
'
);
expect
(
true
).
assertEqual
(
true
);
}
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest009
* @tc.desc: test queryCurrentBundleActiveStates promise.
...
...
@@ -284,56 +188,6 @@ describe("DeviceUsageStatisticsJsTest", function () {
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest011
* @tc.desc: test queryBundleStateInfoByInterval promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest011
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest011---------------------------
'
);
let
intervalType
=
0
;
let
beginTime
=
0
;
let
endTime
=
20000000000000
;
bundleState
.
queryBundleStateInfoByInterval
(
intervalType
,
beginTime
,
endTime
).
then
((
res
)
=>
{
console
.
info
(
'
BUNDLE_ACTIVE queryBundleStateInfoByInterval promise success.
'
);
expect
(
true
).
assertEqual
(
true
);
}).
catch
((
err
)
=>
{
expect
(
false
).
assertEqual
(
true
);
console
.
info
(
'
BUNDLE_ACTIVE queryBundleStateInfoByInterval promise failure.
'
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest012
* @tc.desc: test queryBundleStateInfoByInterval callback.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest012
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest012---------------------------
'
);
let
intervalType
=
0
;
let
beginTime
=
0
;
let
endTime
=
20000000000000
;
bundleState
.
queryBundleStateInfoByInterval
(
intervalType
,
beginTime
,
endTime
,
(
err
,
res
)
=>
{
if
(
err
)
{
expect
(
false
).
assertEqual
(
true
);
console
.
info
(
'
BUNDLE_ACTIVE queryBundleStateInfoByInterval callback failure.
'
);
}
else
{
console
.
info
(
'
BUNDLE_ACTIVE queryBundleStateInfoByInterval callback success.
'
);
expect
(
true
).
assertEqual
(
true
);
}
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest013
* @tc.desc: test intervalType BY_OPTIMIZED
...
...
@@ -400,54 +254,20 @@ describe("DeviceUsageStatisticsJsTest", function () {
})
/*
* @tc.name: DeviceUsageStatisticsJsTest018
* @tc.desc: test BundleStateInfo id.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest018
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest018---------------------------
'
);
let
intervalType
=
1
;
let
beginTime
=
1000
;
let
endTime
=
20000000000000
;
bundleState
.
queryBundleStateInfoByInterval
(
intervalType
,
beginTime
,
endTime
,
(
err
,
res
)
=>
{
if
(
err
)
{
expect
(
false
).
assertEqual
(
true
);
}
else
{
expect
(
true
).
assertEqual
(
true
);
if
(
res
===
undefined
)
{
res
=
[{
id
:
1
}];
}
console
.
log
(
'
test BundleStateInfo id :
'
+
res
[
0
].
id
);
}
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest019
* @tc.desc: test BundleStateInfo bundleName.
* @tc.name: DeviceUsageStatisticsJsTest038
* @tc.desc: test bundleState isIdleState promise.
* @tc.type: FUNC
* @tc.require:
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest019
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest019---------------------------
'
);
let
intervalType
=
1
;
let
beginTime
=
100
;
let
endTime
=
20000000000000
;
bundleState
.
queryBundleStateInfoByInterval
(
intervalType
,
beginTime
,
endTime
,
(
err
,
res
)
=>
{
if
(
err
)
{
expect
(
false
).
assertEqual
(
true
);
}
else
{
expect
(
true
).
assertEqual
(
true
);
if
(
res
===
undefined
)
{
res
=
[{
bundleName
:
'
www.explace.com
'
}];
}
console
.
log
(
'
test BundleStateInfo bundleName :
'
+
res
[
0
].
bundleName
)
}
it
(
"
DeviceUsageStatisticsJsTest038
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest038---------------------------
'
);
bundleState
.
isIdleState
(
''
).
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest038 promise success, result=
'
+
res
);
expect
(
res
).
assertEqual
(
false
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest038 promise fail, result=
'
+
JSON
.
stringify
(
err
.
code
));
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
...
...
@@ -456,27 +276,20 @@ describe("DeviceUsageStatisticsJsTest", function () {
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0
20
* @tc.desc: test
BundleStateInfo infosEndTim
e.
* @tc.name: DeviceUsageStatisticsJsTest0
39
* @tc.desc: test
bundleState isIdleState promis
e.
* @tc.type: FUNC
* @tc.require:
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest020
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest020---------------------------
'
);
let
intervalType
=
1
;
let
beginTime
=
1001
;
let
endTime
=
20000000000000
;
bundleState
.
queryBundleStateInfoByInterval
(
intervalType
,
beginTime
,
endTime
,
(
err
,
res
)
=>
{
if
(
err
)
{
expect
(
false
).
assertEqual
(
true
);
}
else
{
expect
(
true
).
assertEqual
(
true
);
if
(
res
===
undefined
)
{
res
=
[{
infosEndTime
:
0
}];
}
console
.
log
(
'
test BundleStateInfo infosEndTime :
'
+
res
[
0
].
infosEndTime
)
}
it
(
"
DeviceUsageStatisticsJsTest039
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest039---------------------------
'
);
bundleState
.
isIdleState
(
12345
).
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest039 promise success, result=
'
+
res
);
expect
(
res
).
assertEqual
(
false
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest039 promise fail, result=
'
+
JSON
.
stringify
(
err
.
code
));
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
...
...
@@ -485,26 +298,20 @@ describe("DeviceUsageStatisticsJsTest", function () {
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0
21
* @tc.desc: test
BundleStateInfo abilityPrevSeenTim
e.
* @tc.name: DeviceUsageStatisticsJsTest0
40
* @tc.desc: test
bundleState isIdleState promis
e.
* @tc.type: FUNC
* @tc.require:
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest021
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest021---------------------------
'
);
let
intervalType
=
1
;
let
beginTime
=
1001
;
let
endTime
=
20000000000000
;
bundleState
.
queryBundleStateInfoByInterval
(
intervalType
,
beginTime
,
endTime
,
(
err
,
res
)
=>
{
if
(
err
)
{
expect
(
false
).
assertEqual
(
true
);
}
else
{
expect
(
true
).
assertEqual
(
true
);
if
(
res
===
undefined
)
{
res
=
[{
abilityPrevSeenTime
:
0
}];
}
console
.
log
(
'
test BundleStateInfo abilityPrevSeenTime :
'
+
res
[
0
].
abilityPrevSeenTime
)
}
it
(
"
DeviceUsageStatisticsJsTest040
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest040---------------------------
'
);
bundleState
.
isIdleState
(
true
).
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest040 promise success, result=
'
+
res
);
expect
(
res
).
assertEqual
(
false
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest040 promise fail, result=
'
+
JSON
.
stringify
(
err
.
code
));
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
...
...
@@ -513,26 +320,20 @@ describe("DeviceUsageStatisticsJsTest", function () {
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0
22
* @tc.desc: test
BundleStateInfo abilitySeenTotalTim
e.
* @tc.name: DeviceUsageStatisticsJsTest0
41
* @tc.desc: test
bundleState isIdleState promis
e.
* @tc.type: FUNC
* @tc.require:
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest022
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest022---------------------------
'
);
let
intervalType
=
1
;
let
beginTime
=
1001
;
let
endTime
=
20000000000000
;
bundleState
.
queryBundleStateInfoByInterval
(
intervalType
,
beginTime
,
endTime
,
(
err
,
res
)
=>
{
if
(
err
)
{
expect
(
false
).
assertEqual
(
true
);
}
else
{
expect
(
true
).
assertEqual
(
true
);
if
(
res
===
undefined
)
{
res
=
[{
abilitySeenTotalTime
:
0
}];
}
console
.
log
(
'
test BundleStateInfo abilitySeenTotalTime :
'
+
res
[
0
].
abilitySeenTotalTime
)
}
it
(
"
DeviceUsageStatisticsJsTest041
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest041---------------------------
'
);
bundleState
.
isIdleState
(
null
).
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest041 promise success, result=
'
+
res
);
expect
(
res
).
assertEqual
(
false
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest041 promise fail, result=
'
+
JSON
.
stringify
(
err
.
code
));
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
...
...
@@ -541,26 +342,20 @@ describe("DeviceUsageStatisticsJsTest", function () {
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0
23
* @tc.desc: test
BundleStateInfo fgAbilityAccessTotalTim
e.
* @tc.name: DeviceUsageStatisticsJsTest0
42
* @tc.desc: test
bundleState isIdleState promis
e.
* @tc.type: FUNC
* @tc.require:
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest023
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest023---------------------------
'
);
let
intervalType
=
1
;
let
beginTime
=
1001
;
let
endTime
=
20000000000000
;
bundleState
.
queryBundleStateInfoByInterval
(
intervalType
,
beginTime
,
endTime
,
(
err
,
res
)
=>
{
if
(
err
)
{
expect
(
false
).
assertEqual
(
true
);
}
else
{
expect
(
true
).
assertEqual
(
true
);
if
(
res
===
undefined
)
{
res
=
[{
fgAbilityAccessTotalTime
:
0
}];
}
console
.
log
(
'
test BundleStateInfo fgAbilityAccessTotalTime :
'
+
res
[
0
].
fgAbilityAccessTotalTime
)
}
it
(
"
DeviceUsageStatisticsJsTest042
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest042---------------------------
'
);
bundleState
.
isIdleState
(
undefined
).
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest042 promise success, result=
'
+
res
);
expect
(
res
).
assertFail
();
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest042 promise fail, result=
'
+
JSON
.
stringify
(
err
.
code
));
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
...
...
@@ -569,1831 +364,48 @@ describe("DeviceUsageStatisticsJsTest", function () {
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0
24
* @tc.desc: test
BundleStateInfo fgAbilityPrevAccessTime
.
* @tc.name: DeviceUsageStatisticsJsTest0
43
* @tc.desc: test
bundleState isIdleState callback
.
* @tc.type: FUNC
* @tc.require:
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest024
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest024---------------------------
'
);
let
intervalType
=
1
;
let
beginTime
=
1001
;
let
endTime
=
20000000000000
;
bundleState
.
queryBundleStateInfoByInterval
(
intervalType
,
beginTime
,
endTime
,
(
err
,
res
)
=>
{
if
(
err
)
{
expect
(
false
).
assertEqual
(
true
);
}
else
{
expect
(
true
).
assertEqual
(
true
);
if
(
res
===
undefined
)
{
res
=
[{
fgAbilityPrevAccessTime
:
0
}];
}
console
.
log
(
'
test BundleStateInfo fgAbilityPrevAccessTime :
'
+
res
[
0
].
fgAbilityPrevAccessTime
)
}
});
it
(
"
DeviceUsageStatisticsJsTest043
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest043---------------------------
'
);
bundleState
.
isIdleState
(
undefined
,
(
err
,
res
)
=>
{
if
(
err
)
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest043 callback fail, result=
'
+
JSON
.
stringify
(
err
.
code
));
expect
(
err
.
code
).
assertLarger
(
0
);
}
else
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest043 callback success, result=
'
+
res
);
expect
(
res
).
assertFail
();
}
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0
25
* @tc.desc: test
BundleStateInfo abilityPrevAccessTime
.
* @tc.name: DeviceUsageStatisticsJsTest0
44
* @tc.desc: test
bundleState isIdleState callback
.
* @tc.type: FUNC
* @tc.require:
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest025
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest025---------------------------
'
);
let
intervalType
=
1
;
let
beginTime
=
1001
;
let
endTime
=
20000000000000
;
bundleState
.
queryBundleStateInfoByInterval
(
intervalType
,
beginTime
,
endTime
,
(
err
,
res
)
=>
{
if
(
err
)
{
expect
(
false
).
assertEqual
(
true
);
}
else
{
expect
(
true
).
assertEqual
(
true
);
if
(
res
===
undefined
)
{
res
=
[{
abilityPrevAccessTime
:
0
}];
}
console
.
log
(
'
test BundleStateInfo abilityPrevAccessTime :
'
+
res
[
0
].
abilityPrevAccessTime
)
}
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest026
* @tc.desc: test BundleStateInfo infosBeginTime.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest026
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest026---------------------------
'
);
let
intervalType
=
1
;
let
beginTime
=
1001
;
let
endTime
=
20000000000000
;
bundleState
.
queryBundleStateInfoByInterval
(
intervalType
,
beginTime
,
endTime
,
(
err
,
res
)
=>
{
if
(
err
)
{
expect
(
false
).
assertEqual
(
true
);
}
else
{
expect
(
true
).
assertEqual
(
true
);
if
(
res
===
undefined
)
{
res
=
[{
infosBeginTime
:
0
}];
}
console
.
log
(
'
test BundleStateInfo infosBeginTime :
'
+
res
[
0
].
infosBeginTime
)
}
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest027
* @tc.desc: test BundleStateInfo abilityInFgTotalTime.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest027
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest027---------------------------
'
);
let
intervalType
=
1
;
let
beginTime
=
1001
;
let
endTime
=
20000000000000
;
bundleState
.
queryBundleStateInfoByInterval
(
intervalType
,
beginTime
,
endTime
,
(
err
,
res
)
=>
{
if
(
err
)
{
expect
(
false
).
assertEqual
(
true
);
}
else
{
expect
(
true
).
assertEqual
(
true
);
if
(
res
===
undefined
)
{
res
=
[{
abilityInFgTotalTime
:
0
}];
}
console
.
log
(
'
test BundleStateInfo abilityInFgTotalTime :
'
+
res
[
0
].
abilityInFgTotalTime
)
}
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest028
* @tc.desc: test BundleActiveState bundleName.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest028
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest028---------------------------
'
);
let
beginTime
=
10
;
let
endTime
=
20000000000000
;
bundleState
.
queryBundleActiveStates
(
beginTime
,
endTime
,
(
err
,
res
)
=>
{
if
(
err
)
{
expect
(
false
).
assertEqual
(
true
);
}
else
{
expect
(
true
).
assertEqual
(
true
);
if
(
res
===
undefined
)
{
res
=
[{
bundleName
:
'
www.baidu.com
'
}];
}
console
.
log
(
'
test BundleActiveState bundleName :
'
+
res
[
0
].
bundleName
)
}
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest029
* @tc.desc: test BundleActiveState stateType.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest029
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest029---------------------------
'
);
let
beginTime
=
10
;
let
endTime
=
20000000000000
;
bundleState
.
queryBundleActiveStates
(
beginTime
,
endTime
,
(
err
,
res
)
=>
{
if
(
err
)
{
expect
(
false
).
assertEqual
(
true
);
}
else
{
expect
(
true
).
assertEqual
(
true
);
if
(
res
===
undefined
)
{
res
=
[{
stateType
:
0
}];
}
console
.
log
(
'
test BundleActiveState stateType :
'
+
res
[
0
].
stateType
)
}
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest030
* @tc.desc: test BundleActiveState stateOccurredTime.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest030
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest030---------------------------
'
);
let
beginTime
=
10
;
let
endTime
=
20000000000000
;
bundleState
.
queryBundleActiveStates
(
beginTime
,
endTime
,
(
err
,
res
)
=>
{
if
(
err
)
{
expect
(
false
).
assertEqual
(
true
);
}
else
{
expect
(
true
).
assertEqual
(
true
);
if
(
res
===
undefined
)
{
res
=
[{
stateOccurredTime
:
0
}];
}
console
.
log
(
'
test BundleActiveState stateOccurredTime :
'
+
res
[
0
].
stateOccurredTime
)
}
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest031
* @tc.desc: test BundleActiveState appUsagePriorityGroup.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest031
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest031---------------------------
'
);
let
beginTime
=
10
;
let
endTime
=
20000000000000
;
bundleState
.
queryBundleActiveStates
(
beginTime
,
endTime
,
(
err
,
res
)
=>
{
if
(
err
)
{
expect
(
false
).
assertEqual
(
true
);
}
else
{
expect
(
true
).
assertEqual
(
true
);
if
(
res
===
undefined
)
{
res
=
[{
appUsagePriorityGroup
:
0
}];
}
console
.
log
(
'
test BundleActiveState appUsagePriorityGroup :
'
+
res
[
0
].
appUsagePriorityGroup
)
}
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest032
* @tc.desc: test BundleActiveState indexOfLink.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest032
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest032---------------------------
'
);
let
beginTime
=
10
;
let
endTime
=
20000000000000
;
bundleState
.
queryBundleActiveStates
(
beginTime
,
endTime
,
(
err
,
res
)
=>
{
if
(
err
)
{
expect
(
false
).
assertEqual
(
true
);
}
else
{
expect
(
true
).
assertEqual
(
true
);
if
(
res
===
undefined
)
{
res
=
[{
indexOfLink
:
'
id
'
}];
}
console
.
log
(
'
test BundleActiveState indexOfLink :
'
+
res
[
0
].
indexOfLink
)
}
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest033
* @tc.desc: test BundleActiveState nameOfClass.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest033
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest033---------------------------
'
);
let
beginTime
=
10
;
let
endTime
=
20000000000000
;
bundleState
.
queryBundleActiveStates
(
beginTime
,
endTime
,
(
err
,
res
)
=>
{
if
(
err
)
{
expect
(
false
).
assertEqual
(
true
);
}
else
{
expect
(
true
).
assertEqual
(
true
);
if
(
res
===
undefined
)
{
res
=
[{
nameOfClass
:
'
BundleStates
'
}];
}
console
.
log
(
'
test BundleActiveState nameOfClass :
'
+
res
[
0
].
nameOfClass
)
}
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest034
* @tc.desc: test BundleActiveinfoResponse BundleStateinfo key.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest034
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest034---------------------------
'
);
let
beginTime
=
10
;
let
endTime
=
20000000000000
;
bundleState
.
queryBundleStateInfos
(
beginTime
,
endTime
).
then
((
res
)
=>
{
expect
(
true
).
assertEqual
(
true
);
let
bundleStateInfo1
=
{
bundleName
:
'
www.explace.com
'
,
abilityPrevAccessTime
:
0
,
abilityInFgTotalTime
:
0
};
let
bundleStateInfo2
=
{
bundleName
:
'
www.baidu.com
'
,
abilityPrevAccessTime
:
1
,
abilityInFgTotalTime
:
1
};
if
(
res
===
undefined
)
{
res
=
[];
res
[
'
www.explace.com
'
]
=
bundleStateInfo1
;
res
[
'
www.baidu.com
'
]
=
bundleStateInfo2
;
for
(
let
k
in
res
)
{
console
.
log
(
'
test BundleStateInfo key :
'
+
k
+
'
,value is :
'
+
JSON
.
stringify
(
res
[
k
]));
}
}
}).
catch
((
err
)
=>
{
expect
(
false
).
assertEqual
(
true
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest035
* @tc.desc: test BundleStateInfo merge.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest035
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest035---------------------------
'
);
let
beginTime
=
1001
;
let
endTime
=
20000000000000
;
bundleState
.
queryBundleStateInfoByInterval
(
0
,
beginTime
,
endTime
,
(
err
,
res
)
=>
{
if
(
err
)
{
expect
(
false
).
assertEqual
(
true
);
}
else
{
expect
(
true
).
assertEqual
(
true
);
if
(
res
===
undefined
)
{
let
bundleStateInfo
=
{
bundleName
:
'
www.explace.com
'
,
abilityPrevAccessTime
:
0
,
abilityInFgTotalTime
:
0
};
res
=
[{
bundleName
:
'
www.explace.com
'
,
abilityPrevAccessTime
:
0
,
abilityInFgTotalTime
:
0
,
merge
:
function
(
toMerge
)
{
return
'
is function,toMerge :
'
+
JSON
.
stringify
(
toMerge
);
}
}]
console
.
log
(
'
test bundleStateInfo merge
'
+
res
[
0
].
merge
(
bundleStateInfo
));
}
else
{
console
.
log
(
'
test bundleStateInfo merge
'
)
}
}
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest036
* @tc.desc: test getRecentlyUsedModules callback.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest036
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest036---------------------------
'
);
let
maxNum
=
1
;
bundleState
.
getRecentlyUsedModules
(
maxNum
,
(
err
,
res
)
=>
{
if
(
err
)
{
console
.
info
(
'
BUNDLE_ACTIVE getRecentlyUsedModules callback failure.
'
);
expect
(
false
).
assertEqual
(
true
);
}
else
{
console
.
info
(
'
BUNDLE_ACTIVE getRecentlyUsedModules callback success.
'
);
expect
(
true
).
assertEqual
(
true
);
}
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest037
* @tc.desc: test getRecentlyUsedModules promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest037
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest037---------------------------
'
);
let
maxNum
=
1
;
bundleState
.
getRecentlyUsedModules
(
maxNum
).
then
((
res
)
=>
{
console
.
info
(
'
BUNDLE_ACTIVE getRecentlyUsedModules promise success.
'
);
expect
(
true
).
assertEqual
(
true
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
BUNDLE_ACTIVE getRecentlyUsedModules promise failure.
'
);
expect
(
false
).
assertEqual
(
true
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest038
* @tc.desc: test bundleState isIdleState promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest038
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest038---------------------------
'
);
bundleState
.
isIdleState
(
''
).
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest038 promise success, result=
'
+
res
);
expect
(
res
).
assertEqual
(
false
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest038 promise fail, result=
'
+
JSON
.
stringify
(
err
.
code
));
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest039
* @tc.desc: test bundleState isIdleState promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest039
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest039---------------------------
'
);
bundleState
.
isIdleState
(
12345
).
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest039 promise success, result=
'
+
res
);
expect
(
res
).
assertEqual
(
false
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest039 promise fail, result=
'
+
JSON
.
stringify
(
err
.
code
));
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest040
* @tc.desc: test bundleState isIdleState promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest040
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest040---------------------------
'
);
bundleState
.
isIdleState
(
true
).
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest040 promise success, result=
'
+
res
);
expect
(
res
).
assertEqual
(
false
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest040 promise fail, result=
'
+
JSON
.
stringify
(
err
.
code
));
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest041
* @tc.desc: test bundleState isIdleState promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest041
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest041---------------------------
'
);
bundleState
.
isIdleState
(
null
).
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest041 promise success, result=
'
+
res
);
expect
(
res
).
assertEqual
(
false
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest041 promise fail, result=
'
+
JSON
.
stringify
(
err
.
code
));
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest042
* @tc.desc: test bundleState isIdleState promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest042
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest042---------------------------
'
);
bundleState
.
isIdleState
(
undefined
).
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest042 promise success, result=
'
+
res
);
expect
(
res
).
assertFail
();
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest042 promise fail, result=
'
+
JSON
.
stringify
(
err
.
code
));
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest043
* @tc.desc: test bundleState isIdleState callback.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest043
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest043---------------------------
'
);
bundleState
.
isIdleState
(
undefined
,
(
err
,
res
)
=>
{
if
(
err
)
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest043 callback fail, result=
'
+
JSON
.
stringify
(
err
.
code
));
expect
(
err
.
code
).
assertLarger
(
0
);
}
else
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest043 callback success, result=
'
+
res
);
expect
(
res
).
assertFail
();
}
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest044
* @tc.desc: test bundleState isIdleState callback.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest044
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest044---------------------------
'
);
bundleState
.
isIdleState
(
null
,
(
err
,
res
)
=>
{
if
(
err
)
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest044 callback fail, result=
'
+
JSON
.
stringify
(
err
.
code
));
expect
(
err
.
code
).
assertLarger
(
0
);
}
else
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest044 callback success, result=
'
+
res
);
expect
(
res
).
assertFail
();
}
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest045
* @tc.desc: test bundleState queryBundleStateInfos callback.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest045
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest045---------------------------
'
);
bundleState
.
queryBundleStateInfos
(
20000000000000
,
123456
,
(
err
,
res
)
=>
{
if
(
err
)
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest045 callback failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
}
else
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest045 callback success, result=
'
+
res
);
expect
(
res
).
assertFail
();
}
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest046
* @tc.desc: test bundleState queryBundleStateInfos callback.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest046
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest046---------------------------
'
);
bundleState
.
queryBundleStateInfos
(
''
,
''
,
(
err
,
res
)
=>
{
if
(
err
)
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest046 callback failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
}
else
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest046 callback success, result=
'
+
res
);
expect
(
res
).
assertFail
();
}
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest047
* @tc.desc: test bundleState queryBundleStateInfos callback.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest047
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest047---------------------------
'
);
bundleState
.
queryBundleStateInfos
(
null
,
true
,
(
err
,
res
)
=>
{
if
(
err
)
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest047 callback failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
}
else
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest047 callback success, result=
'
+
res
);
expect
(
res
).
assertFail
();
}
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest048
* @tc.desc: test bundleState queryBundleStateInfos callback.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest048
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest048---------------------------
'
);
bundleState
.
queryBundleStateInfos
(
0
,
undefined
,
(
err
,
res
)
=>
{
if
(
err
)
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest048 callback failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
}
else
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest048 callback success, result=
'
+
res
);
expect
(
res
).
assertFail
();
}
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest049
* @tc.desc: test bundleState queryBundleStateInfos promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest049
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest049---------------------------
'
);
bundleState
.
queryBundleStateInfos
(
undefined
,
undefined
).
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest049 promise success, result=
'
+
res
);
expect
(
res
).
assertFail
();
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest049 promise failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest050
* @tc.desc: test bundleState queryBundleStateInfos promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest050
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest050---------------------------
'
);
bundleState
.
queryBundleStateInfos
(
null
,
20000000000000
).
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest050 promise success, result=
'
+
res
);
expect
(
res
).
assertFail
();
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest050 promise failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest051
* @tc.desc: test bundleState queryBundleStateInfos promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest051
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest051---------------------------
'
);
bundleState
.
queryBundleStateInfos
(
20000000000000
,
true
).
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest051 promise success, result=
'
+
res
);
expect
(
res
).
assertFail
();
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest051 promise failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest052
* @tc.desc: test bundleState queryBundleStateInfoByInterval promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest052
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest052---------------------------
'
);
bundleState
.
queryBundleStateInfoByInterval
(
1
,
123
,
20000000000000
).
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest052 promise success
'
);
for
(
let
i
=
0
;
i
<
res
.
length
;
i
++
)
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest052 promise success, result
'
+
JSON
.
stringify
(
res
[
i
]));
}
expect
(
res
).
assertInstanceOf
(
'
Array
'
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest052 promise failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest053
* @tc.desc: test bundleState queryBundleStateInfoByInterval promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest053
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest053---------------------------
'
);
bundleState
.
queryBundleStateInfoByInterval
(
2
,
123
,
20000000000000
).
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest053 promise success
'
);
for
(
let
i
=
0
;
i
<
res
.
length
;
i
++
)
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest053 promise success, result
'
+
JSON
.
stringify
(
res
[
i
]));
}
expect
(
res
).
assertInstanceOf
(
'
Array
'
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest053 promise failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest054
* @tc.desc: test bundleState queryBundleStateInfoByInterval promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest054
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest054---------------------------
'
);
bundleState
.
queryBundleStateInfoByInterval
(
3
,
123
,
20000000000000
).
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest054 promise success
'
);
for
(
let
i
=
0
;
i
<
res
.
length
;
i
++
)
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest054 promise success, result
'
+
JSON
.
stringify
(
res
[
i
]));
}
expect
(
res
).
assertInstanceOf
(
'
Array
'
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest054 promise failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest055
* @tc.desc: test bundleState queryBundleStateInfoByInterval promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest055
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest055---------------------------
'
);
bundleState
.
queryBundleStateInfoByInterval
(
4
,
123
,
20000000000000
).
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest055 promise success
'
);
for
(
let
i
=
0
;
i
<
res
.
length
;
i
++
)
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest055 promise success, result
'
+
JSON
.
stringify
(
res
[
i
]));
}
expect
(
res
).
assertInstanceOf
(
'
Array
'
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest055 promise failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest056
* @tc.desc: test bundleState queryBundleStateInfoByInterval promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest056
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest056---------------------------
'
);
bundleState
.
queryBundleStateInfoByInterval
(
4
,
null
,
20000000000000
).
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest056 promise success
'
);
expect
(
res
).
assertFail
();
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest056 promise failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest057
* @tc.desc: test bundleState queryBundleStateInfoByInterval promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest057
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest057---------------------------
'
);
bundleState
.
queryBundleStateInfoByInterval
(
''
,
null
,
true
).
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest057 promise success
'
);
expect
(
res
).
assertFail
();
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest057 promise failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest058
* @tc.desc: test bundleState queryBundleStateInfoByInterval promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest058
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest058---------------------------
'
);
bundleState
.
queryBundleStateInfoByInterval
(
3
,
1234567
,
true
).
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest058 promise success
'
);
expect
(
res
).
assertFail
();
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest058 promise failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest059
* @tc.desc: test bundleState queryBundleStateInfoByInterval promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest059
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest059---------------------------
'
);
bundleState
.
queryBundleStateInfoByInterval
(
6
,
123678
,
20000000600000
).
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest059 promise success
'
);
expect
(
res
).
assertFail
();
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest059 promise failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest060
* @tc.desc: test bundleState queryBundleStateInfoByInterval promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest060
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest060---------------------------
'
);
bundleState
.
queryBundleStateInfoByInterval
(
6
,
123678
,
undefined
).
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest060 promise success
'
);
expect
(
res
).
assertFail
();
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest060 promise failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest061
* @tc.desc: test bundleState queryBundleStateInfoByInterval callback.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest061
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest061---------------------------
'
);
bundleState
.
queryBundleStateInfoByInterval
(
3
,
123678
,
20000000000000
,
(
err
,
res
)
=>
{
if
(
err
)
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest061 callback failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
}
else
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest061 callback success
'
);
expect
(
res
).
assertInstanceOf
(
'
Array
'
);
}
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest062
* @tc.desc: test bundleState queryBundleStateInfoByInterval callback.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest062
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest062---------------------------
'
);
bundleState
.
queryBundleStateInfoByInterval
(
5
,
123678
,
20000000000000
,
(
err
,
res
)
=>
{
if
(
err
)
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest062 callback failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
}
else
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest062 callback success
'
);
expect
(
res
).
assertInstanceOf
(
'
Array
'
);
}
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest063
* @tc.desc: test bundleState queryBundleStateInfoByInterval callback.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest063
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest063---------------------------
'
);
bundleState
.
queryBundleStateInfoByInterval
(
9
,
123678
,
20000000000000
,
(
err
,
res
)
=>
{
if
(
err
)
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest063 callback failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
}
else
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest063 callback success
'
);
expect
(
res
).
assertFail
();
}
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest064
* @tc.desc: test bundleState queryBundleStateInfoByInterval callback.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest064
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest064---------------------------
'
);
bundleState
.
queryBundleStateInfoByInterval
(
2
,
123678
,
null
,
(
err
,
res
)
=>
{
if
(
err
)
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest064 callback failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
}
else
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest064 callback success
'
);
expect
(
res
).
assertFail
();
}
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest065
* @tc.desc: test bundleState queryBundleStateInfoByInterval callback.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest065
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest065---------------------------
'
);
bundleState
.
queryBundleStateInfoByInterval
(
4
,
true
,
20000000000000
,
(
err
,
res
)
=>
{
if
(
err
)
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest065 callback failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
}
else
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest065 callback success
'
);
expect
(
res
).
assertFail
();
}
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest066
* @tc.desc: test bundleState queryBundleStateInfoByInterval callback.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest066
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest066---------------------------
'
);
bundleState
.
queryBundleStateInfoByInterval
(
7
,
0
,
20000000000000
,
(
err
,
res
)
=>
{
if
(
err
)
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest066 callback failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
}
else
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest066 callback success
'
);
expect
(
res
).
assertFail
();
}
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest067
* @tc.desc: test bundleState queryBundleStateInfoByInterval callback.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest067
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest067---------------------------
'
);
bundleState
.
queryBundleStateInfoByInterval
(
20000000000000
,
12345
,
(
err
,
res
)
=>
{
if
(
err
)
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest067 callback failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
}
else
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest067 callback success
'
);
expect
(
res
).
assertFail
();
}
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest068
* @tc.desc: test bundleState queryBundleStateInfoByInterval callback.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest068
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest068---------------------------
'
);
bundleState
.
queryBundleStateInfoByInterval
(
null
,
20000000000000
,
(
err
,
res
)
=>
{
if
(
err
)
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest068 callback failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
}
else
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest068 callback success
'
);
expect
(
res
).
assertFail
();
}
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest069
* @tc.desc: test bundleState queryBundleStateInfos promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest069
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest069---------------------------
'
);
bundleState
.
queryBundleStateInfos
(
null
,
true
).
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest069 promise success
'
);
expect
(
res
).
assertFail
();
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest069 promise failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest070
* @tc.desc: test bundleState queryBundleStateInfos promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest070
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest070---------------------------
'
);
bundleState
.
queryBundleStateInfos
(
12345
,
undefined
).
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest070 promise success
'
);
expect
(
res
).
assertFail
();
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest070 promise failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest071
* @tc.desc: test bundleState queryBundleStateInfos promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest071
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest071---------------------------
'
);
bundleState
.
queryBundleStateInfos
(
'
12345
'
,
'
undefined
'
).
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest071 promise success
'
);
expect
(
res
).
assertFail
();
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest071 promise failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest072
* @tc.desc: test bundleState queryBundleStateInfos promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest072
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest072---------------------------
'
);
bundleState
.
queryBundleStateInfos
(
''
,
''
).
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest072 promise success
'
);
expect
(
res
).
assertFail
();
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest072 promise failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest073
* @tc.desc: test bundleState getRecentlyUsedModules param promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest073
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest073---------------------------
'
);
bundleState
.
getRecentlyUsedModules
(
999
).
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest073 promise success
'
);
expect
(
res
).
assertInstanceOf
(
'
Array
'
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest073 promise failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest074
* @tc.desc: test bundleState getRecentlyUsedModules param promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest074
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest074---------------------------
'
);
bundleState
.
getRecentlyUsedModules
(
1
).
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest074 promise success
'
);
expect
(
res
).
assertInstanceOf
(
'
Array
'
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest074 promise failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest075
* @tc.desc: test bundleState getRecentlyUsedModules param promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest075
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest075---------------------------
'
);
bundleState
.
getRecentlyUsedModules
(
0
).
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest075 promise success
'
);
expect
(
res
).
assertInstanceOf
(
'
Array
'
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest075 promise failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest076
* @tc.desc: test bundleState getRecentlyUsedModules noParam promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest076
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest076---------------------------
'
);
bundleState
.
getRecentlyUsedModules
().
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest076 promise success
'
);
expect
(
res
).
assertInstanceOf
(
'
Array
'
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest076 promise failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest077
* @tc.desc: test bundleState getRecentlyUsedModules noParam callback.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest077
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest077---------------------------
'
);
bundleState
.
getRecentlyUsedModules
(
(
err
,
res
)
=>
{
if
(
err
)
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest077 callback failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
}
else
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest077 promise success
'
);
expect
(
res
).
assertInstanceOf
(
'
Array
'
);
}
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest078
* @tc.desc: test bundleState getRecentlyUsedModules param promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest078
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest078---------------------------
'
);
bundleState
.
getRecentlyUsedModules
(
10
,
(
err
,
res
)
=>
{
if
(
err
)
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest078 callback failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
}
else
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest078 promise success
'
);
for
(
let
i
=
0
;
i
<
res
.
length
;
i
++
)
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest078 promise success
'
+
JSON
.
stringify
(
res
[
i
]));
}
expect
(
res
).
assertInstanceOf
(
'
Array
'
);
}
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest079
* @tc.desc: test bundleState getRecentlyUsedModules param callback.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest079
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest079---------------------------
'
);
bundleState
.
getRecentlyUsedModules
(
10000
,
(
err
,
res
)
=>
{
if
(
err
)
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest079 callback failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
}
else
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest079 promise success
'
+
JSON
.
stringify
(
res
));
expect
(
res
).
assertInstanceOf
(
'
Array
'
);
}
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest080
* @tc.desc: test bundleState getRecentlyUsedModules param callback.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest080
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest080---------------------------
'
);
bundleState
.
getRecentlyUsedModules
(
-
1
,
(
err
,
res
)
=>
{
it
(
"
DeviceUsageStatisticsJsTest044
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest044---------------------------
'
);
bundleState
.
isIdleState
(
null
,
(
err
,
res
)
=>
{
if
(
err
)
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest0
80 callback failed, because:
'
+
err
.
code
);
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest0
44 callback fail, result=
'
+
JSON
.
stringify
(
err
.
code
)
);
expect
(
err
.
code
).
assertLarger
(
0
);
}
else
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest080 promise success
'
+
JSON
.
stringify
(
res
));
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest044 callback success, result=
'
+
res
);
expect
(
res
).
assertFail
();
}
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest081
* @tc.desc: test bundleState getRecentlyUsedModules BundleActiveModuleInfo deviceId promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest081
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest081---------------------------
'
);
bundleState
.
getRecentlyUsedModules
().
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest081 promise success
'
);
for
(
let
i
=
0
;
i
<
res
.
length
;
i
++
)
{
console
.
info
(
'
BUNDLE_ACTIVE DeviceUsageStatisticsJsTest081 BundleActiveModuleInfo deviceId
'
+
JSON
.
stringify
(
res
[
i
].
deviceId
));
}
expect
(
res
).
assertInstanceOf
(
'
Array
'
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest081 promise failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest082
* @tc.desc: test bundleState getRecentlyUsedModules BundleActiveModuleInfo descriptionId promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest082
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest082---------------------------
'
);
bundleState
.
getRecentlyUsedModules
().
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest082 promise success
'
);
for
(
let
i
=
0
;
i
<
res
.
length
;
i
++
)
{
console
.
info
(
'
BUNDLE_ACTIVE DeviceUsageStatisticsJsTest082 BundleActiveModuleInfo descriptionId
'
+
JSON
.
stringify
(
res
[
i
].
descriptionId
));
}
expect
(
res
).
assertInstanceOf
(
'
Array
'
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest082 promise failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest083
* @tc.desc: test bundleState getRecentlyUsedModules BundleActiveModuleInfo moduleName promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest083
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest083---------------------------
'
);
bundleState
.
getRecentlyUsedModules
().
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest083 promise success
'
);
for
(
let
i
=
0
;
i
<
res
.
length
;
i
++
)
{
console
.
info
(
'
BUNDLE_ACTIVE DeviceUsageStatisticsJsTest083 BundleActiveModuleInfo moduleName
'
+
JSON
.
stringify
(
res
[
i
].
moduleName
));
}
expect
(
res
).
assertInstanceOf
(
'
Array
'
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest083 promise failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest084
* @tc.desc: test bundleState getRecentlyUsedModules BundleActiveModuleInfo labelId promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest084
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest084---------------------------
'
);
bundleState
.
getRecentlyUsedModules
().
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest084 promise success
'
);
for
(
let
i
=
0
;
i
<
res
.
length
;
i
++
)
{
console
.
info
(
'
BUNDLE_ACTIVE DeviceUsageStatisticsJsTest084 BundleActiveModuleInfo labelId
'
+
JSON
.
stringify
(
res
[
i
].
labelId
));
}
expect
(
res
).
assertInstanceOf
(
'
Array
'
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest084 promise failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest085
* @tc.desc: test bundleState getRecentlyUsedModules BundleActiveModuleInfo appLabelId promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest085
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest085---------------------------
'
);
bundleState
.
getRecentlyUsedModules
().
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest085 promise success
'
);
for
(
let
i
=
0
;
i
<
res
.
length
;
i
++
)
{
console
.
info
(
'
BUNDLE_ACTIVE DeviceUsageStatisticsJsTest085 BundleActiveModuleInfo appLabelId
'
+
JSON
.
stringify
(
res
[
i
].
appLabelId
));
}
expect
(
res
).
assertInstanceOf
(
'
Array
'
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest085 promise failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest086
* @tc.desc: test bundleState getRecentlyUsedModules BundleActiveModuleInfo abilityLableId promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest086
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest086---------------------------
'
);
bundleState
.
getRecentlyUsedModules
().
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest086 promise success
'
);
for
(
let
i
=
0
;
i
<
res
.
length
;
i
++
)
{
console
.
info
(
'
BUNDLE_ACTIVE BundleActiveModuleInfo abilityLableId
'
+
JSON
.
stringify
(
res
[
i
].
abilityLableId
));
}
expect
(
res
).
assertInstanceOf
(
'
Array
'
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest086 promise failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest087
* @tc.desc: test bundleState getRecentlyUsedModules BundleActiveModuleInfo abilityDescriptionId promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest087
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest087---------------------------
'
);
bundleState
.
getRecentlyUsedModules
().
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest087 promise success
'
);
for
(
let
i
=
0
;
i
<
res
.
length
;
i
++
)
{
console
.
info
(
'
BUNDLE_ACTIVE BundleActiveModuleInfo abilityDescriptionId
'
+
JSON
.
stringify
(
res
[
i
].
abilityDescriptionId
));
}
expect
(
res
).
assertInstanceOf
(
'
Array
'
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest087 promise failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest088
* @tc.desc: test bundleState getRecentlyUsedModules BundleActiveModuleInfo abilityIconId promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest088
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest088---------------------------
'
);
bundleState
.
getRecentlyUsedModules
().
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest088 promise success
'
);
for
(
let
i
=
0
;
i
<
res
.
length
;
i
++
)
{
console
.
info
(
'
BUNDLE_ACTIVE BundleActiveModuleInfo abilityIconId
'
+
JSON
.
stringify
(
res
[
i
].
abilityIconId
));
}
expect
(
res
).
assertInstanceOf
(
'
Array
'
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest088 promise failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest089
* @tc.desc: test bundleState getRecentlyUsedModules BundleActiveModuleInfo launchedCount promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest089
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest089---------------------------
'
);
bundleState
.
getRecentlyUsedModules
().
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest089 promise success
'
);
for
(
let
i
=
0
;
i
<
res
.
length
;
i
++
)
{
console
.
info
(
'
BUNDLE_ACTIVE BundleActiveModuleInfo launchedCount
'
+
JSON
.
stringify
(
res
[
i
].
launchedCount
));
}
expect
(
res
).
assertInstanceOf
(
'
Array
'
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest089 promise failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest090
* @tc.desc: test bundleState getRecentlyUsedModules BundleActiveModuleInfo lastModuleUsedTime promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest090
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest090---------------------------
'
);
bundleState
.
getRecentlyUsedModules
().
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest090 promise success
'
);
for
(
let
i
=
0
;
i
<
res
.
length
;
i
++
)
{
console
.
info
(
'
BUNDLE_ACTIVE BundleActiveModuleInfo lastModuleUsedTime
'
+
JSON
.
stringify
(
res
[
i
].
lastModuleUsedTime
));
}
expect
(
res
).
assertInstanceOf
(
'
Array
'
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest090 promise failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest091
* @tc.desc: test bundleState getRecentlyUsedModules BundleActiveModuleInfo formRecords promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest091
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest091---------------------------
'
);
bundleState
.
getRecentlyUsedModules
().
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest091 promise success
'
);
for
(
let
i
=
0
;
i
<
res
.
length
;
i
++
)
{
console
.
info
(
'
BUNDLE_ACTIVE BundleActiveModuleInfo formRecords
'
+
JSON
.
stringify
(
res
[
i
].
formRecords
));
}
expect
(
res
).
assertInstanceOf
(
'
Array
'
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest091 promise failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest092
* @tc.desc: test bundleState getRecentlyUsedModules BundleActiveFormInfo promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest092
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest092---------------------------
'
);
bundleState
.
getRecentlyUsedModules
().
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest092 promise success
'
);
let
BundleActiveFormInfo
=
res
[
0
].
formRecords
;
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest092 promise BundleActiveFormInfo:
'
+
JSON
.
stringify
(
BundleActiveFormInfo
));
expect
(
BundleActiveFormInfo
).
assertInstanceOf
(
'
Array
'
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest092 promise failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest093
* @tc.desc: test bundleState getRecentlyUsedModules BundleActiveFormInfo formName promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest093
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest093---------------------------
'
);
bundleState
.
getRecentlyUsedModules
().
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest093 promise success
'
);
let
BundleActiveFormInfo
=
res
[
0
].
formRecords
;
expect
(
BundleActiveFormInfo
).
assertInstanceOf
(
'
Array
'
);
console
.
info
(
'
test DeviceUsageStatisticsJsTest093 length:
'
+
BundleActiveFormInfo
.
length
);
if
(
BundleActiveFormInfo
.
length
===
0
)
{
BundleActiveFormInfo
=
[{
formName
:
'
formName
'
}];
}
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest093 promise BundleActiveFormInfo formName:
'
+
BundleActiveFormInfo
[
0
].
formName
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest093 promise failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest094
* @tc.desc: test bundleState getRecentlyUsedModules BundleActiveFormInfo formDimension promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest094
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest094---------------------------
'
);
bundleState
.
getRecentlyUsedModules
().
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest094 promise success
'
);
let
BundleActiveFormInfo
=
res
[
0
].
formRecords
;
if
(
BundleActiveFormInfo
.
length
===
0
)
{
BundleActiveFormInfo
=
[{
formDimension
:
'
formDimension
'
}];
}
console
.
info
(
'
test bundle promise BundleActiveFormInfo formDimension:
'
+
BundleActiveFormInfo
[
0
].
formDimension
);
expect
(
BundleActiveFormInfo
).
assertInstanceOf
(
'
Array
'
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest094 promise failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest095
* @tc.desc: test bundleState getRecentlyUsedModules BundleActiveFormInfo formId promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest095
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest095---------------------------
'
);
bundleState
.
getRecentlyUsedModules
(
10
).
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest095 promise success
'
);
let
BundleActiveFormInfo
=
res
[
0
].
formRecords
;
if
(
BundleActiveFormInfo
.
length
===
0
)
{
BundleActiveFormInfo
=
[{
formId
:
'
formId
'
}];
}
console
.
info
(
'
test bundle promise BundleActiveFormInfo formId:
'
+
BundleActiveFormInfo
[
0
].
formId
);
expect
(
BundleActiveFormInfo
).
assertInstanceOf
(
'
Array
'
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest095 promise failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest096
* @tc.desc: test bundleState getRecentlyUsedModules BundleActiveFormInfo count promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest096
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest096---------------------------
'
);
bundleState
.
getRecentlyUsedModules
().
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest096 promise success
'
);
let
BundleActiveFormInfo
=
res
[
0
].
formRecords
;
if
(
BundleActiveFormInfo
.
length
===
0
)
{
BundleActiveFormInfo
=
[{
count
:
'
count
'
}];
}
console
.
info
(
'
test bundle promise BundleActiveFormInfo count:
'
+
BundleActiveFormInfo
[
0
].
count
);
expect
(
BundleActiveFormInfo
).
assertInstanceOf
(
'
Array
'
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest096 promise failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest097
* @tc.desc: test bundleState getRecentlyUsedModules BundleActiveFormInfo formLastUsedTime promise.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
DeviceUsageStatisticsJsTest097
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------DeviceUsageStatisticsJsTest097---------------------------
'
);
bundleState
.
getRecentlyUsedModules
().
then
((
res
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest097 promise success
'
);
let
BundleActiveFormInfo
=
res
[
0
].
formRecords
;
if
(
BundleActiveFormInfo
.
length
===
0
)
{
BundleActiveFormInfo
=
[{
formLastUsedTime
:
'
formLastUsedTime
'
}];
}
console
.
info
(
'
test bundle promise BundleActiveFormInfo formLastUsedTime:
'
+
BundleActiveFormInfo
[
0
].
formLastUsedTime
);
expect
(
BundleActiveFormInfo
).
assertInstanceOf
(
'
Array
'
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
test bundle DeviceUsageStatisticsJsTest097 promise failed, because:
'
+
err
.
code
);
expect
(
err
.
code
).
assertLarger
(
0
);
});
});
setTimeout
(()
=>
{
done
();
},
500
);
...
...
resourceschedule/resourceschedule_standard/reminderagent/src/main/js/default/test/ReminderAgentJs.test.js
浏览文件 @
3c11f96e
...
...
@@ -57,25 +57,25 @@ describe('ReminderAgentTest', function () {
console
.
info
(
'
start################################start
'
);
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_001
* @tc.name testActionButton001
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_
001
* @tc.name testActionButton
_
001
* @tc.desc test ActionButton title.
*/
it
(
"
testActionButton001
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testActionButton
001---------------------------
'
);
it
(
"
testActionButton
_
001
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testActionButton_
001---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
TRIGGER_TIME_IN_SECONDS
}
reminderAgent
.
publishReminder
(
timer
).
then
((
reminderId
)
=>
{
console
.
log
(
"
reminderId =
"
+
reminderId
);
console
.
info
(
"
reminderId =
"
+
reminderId
);
reminderAgent
.
getValidReminders
().
then
((
reminder
)
=>
{
if
(
reminder
.
length
!==
0
)
{
let
actionButton
=
reminder
[
0
].
actionButton
;
if
(
actionButton
.
length
===
0
)
{
actionButton
=
[{
title
:
'
����ʱ
'
}]
actionButton
=
[{
title
:
'
?????
'
}]
}
console
.
log
(
'
ActionButton title:
'
+
actionButton
[
0
].
title
);
console
.
info
(
'
ActionButton title:
'
+
actionButton
[
0
].
title
);
}
},(
error
)
=>
{
...
...
@@ -88,28 +88,28 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_002
* @tc.name testActionButton002
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_
002
* @tc.name testActionButton
_
002
* @tc.desc test ActionButton
*/
it
(
"
testActionButton002
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testActionButton
002---------------------------
'
);
it
(
"
testActionButton
_
002
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testActionButton_
002---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
TRIGGER_TIME_IN_SECONDS
}
reminderAgent
.
publishReminder
(
timer
).
then
((
reminderId
)
=>
{
console
.
log
(
"
reminderId =
"
+
reminderId
);
console
.
info
(
"
reminderId =
"
+
reminderId
);
reminderAgent
.
getValidReminders
().
then
((
reminder
)
=>
{
if
(
reminder
.
length
!==
0
)
{
let
actionButton
=
reminder
[
0
].
actionButton
;
if
(
actionButton
.
length
===
0
)
{
actionButton
=
[{
type
:
0
}]
}
console
.
log
(
'
ActionButton type:
'
+
actionButton
[
0
].
type
);
console
.
info
(
'
ActionButton type:
'
+
actionButton
[
0
].
type
);
}
else
{
reminder
=
[{
actionButton
:
[{
type
:
1
}]}];
console
.
log
(
'
ActionButton Type:
'
+
reminder
[
0
].
actionButton
[
0
].
type
);
console
.
info
(
'
ActionButton Type:
'
+
reminder
[
0
].
actionButton
[
0
].
type
);
expect
(
true
).
assertTrue
();
}
},(
error
)
=>
{
...
...
@@ -123,12 +123,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_003
* @tc.name testWantAgentAbilityName003
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_
003
* @tc.name testWantAgentAbilityName
_
003
* @tc.desc test wantAgent abilityName
*/
it
(
"
testWantAgentAbilityName003
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testWantAgentAbilityName
003---------------------------
'
);
it
(
"
testWantAgentAbilityName
_
003
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testWantAgentAbilityName_
003---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
4
,
...
...
@@ -138,11 +138,10 @@ describe('ReminderAgentTest', function () {
},
};
reminderAgent
.
publishReminder
(
timer
).
then
((
reminderId
)
=>
{
console
.
log
(
"
reminderId =
"
+
reminderId
);
console
.
info
(
"
reminderId =
"
+
reminderId
);
reminderAgent
.
getValidReminders
((
err
,
reminder
)
=>
{
if
(
reminder
.
length
!==
0
)
{
let
wantAgent
=
reminder
[
0
].
wantAgent
.
abilityName
;
//expect(wantAgent).assertEqual("ohos.samples.jshelloworld.MainAbility");
if
(
wantAgent
==
"
ohos.samples.jshelloworld.MainAbility
"
)
{
expect
(
true
).
assertTrue
();
}
else
{
...
...
@@ -158,33 +157,30 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_004
* @tc.name testMaxScreenWantAgentAbilityName004
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_
004
* @tc.name testMaxScreenWantAgentAbilityName
_
004
* @tc.desc test MaxScreenWantAgent abilityName
*/
it
(
"
testMaxScreenWantAgentAbilityName004
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testMaxScreenWantAgentAbilityName
004---------------------------
'
);
it
(
"
testMaxScreenWantAgentAbilityName
_
004
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testMaxScreenWantAgentAbilityName_
004---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
TRIGGER_TIME_IN_SECONDS
}
reminderAgent
.
publishReminder
(
timer
).
then
((
reminderId
)
=>
{
console
.
log
(
"
reminderId =
"
+
reminderId
);
console
.
info
(
"
reminderId =
"
+
reminderId
);
reminderAgent
.
getValidReminders
().
then
((
reminder
)
=>
{
if
(
reminder
.
length
!==
0
)
{
let
maxScreenWantAgent
=
reminder
[
0
].
maxScreenWantAgent
;
console
.
log
(
'
maxScreenWantAgent abilityName:
'
+
maxScreenWantAgent
.
abilityName
);
console
.
info
(
'
maxScreenWantAgent abilityName:
'
+
maxScreenWantAgent
.
abilityName
);
if
(
maxScreenWantAgent
.
abilityName
===
""
)
{
console
.
log
(
"
maxScreenWantAgent.abilityName value is
"
);
console
.
info
(
"
maxScreenWantAgent.abilityName value is
"
);
expect
(
true
).
assertEqual
(
true
);
}
}
else
{
reminder
=
[{
maxScreenWantAgent
:
{
abilityName
:
'
title.com.oh.phone.MainAbility
'
}}];
//expect(false).assertEqual(false);
}
},(
error
)
=>
{
//expect(false).assertTrue();
});
},(
error
)
=>
{});
});
setTimeout
(()
=>
{
...
...
@@ -193,31 +189,28 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_005
* @tc.name testReminderRequestTitle005
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_
005
* @tc.name testReminderRequestTitle
_
005
* @tc.desc test ReminderRequest title
*/
it
(
"
testReminderRequestTitle005
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderRequestTitle
005---------------------------
'
);
it
(
"
testReminderRequestTitle
_
005
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testReminderRequestTitle_
005---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
TRIGGER_TIME_IN_SECONDS
}
reminderAgent
.
publishReminder
(
timer
).
then
((
reminderId
)
=>
{
console
.
log
(
"
reminderId =
"
+
reminderId
);
console
.
info
(
"
reminderId =
"
+
reminderId
);
reminderAgent
.
getValidReminders
().
then
((
reminder
)
=>
{
if
(
reminder
.
length
!==
0
)
{
let
title
=
reminder
[
0
].
title
;
console
.
log
(
'
ReminderRequest title:
'
+
title
);
expect
(
t
rue
).
assertEqual
(
true
);
console
.
info
(
'
ReminderRequest title:
'
+
title
);
expect
(
t
itle
).
assertEqual
(
""
);
}
else
{
reminder
=
[{
title
:
'
��������
'
}];
console
.
log
(
'
ReminderRequest title:
'
+
reminder
[
0
].
title
);
//expect(false).assertEqual(false);
reminder
=
[{
title
:
'
????????
'
}];
console
.
info
(
'
ReminderRequest title:
'
+
reminder
[
0
].
title
);
}
},(
error
)
=>
{
//expect(false).assertTrue();
});
},(
error
)
=>
{});
});
setTimeout
(()
=>
{
...
...
@@ -226,31 +219,28 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_006
* @tc.name testReminderRequestContent006
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_
006
* @tc.name testReminderRequestContent
_
006
* @tc.desc test ReminderRequest content
*/
it
(
"
testReminderRequestContent006
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderRequestContent
006---------------------------
'
);
it
(
"
testReminderRequestContent
_
006
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testReminderRequestContent_
006---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
TRIGGER_TIME_IN_SECONDS
}
reminderAgent
.
publishReminder
(
timer
).
then
((
reminderId
)
=>
{
console
.
log
(
"
reminderId =
"
+
reminderId
);
console
.
info
(
"
reminderId =
"
+
reminderId
);
reminderAgent
.
getValidReminders
().
then
((
reminder
)
=>
{
if
(
reminder
.
length
!==
0
)
{
let
content
=
reminder
[
0
].
content
;
console
.
log
(
'
ReminderRequest content:
'
+
content
);
expect
(
true
).
assertEqual
(
true
);
console
.
info
(
'
ReminderRequest content:
'
+
content
);
expect
(
content
).
assertEqual
(
""
);
}
else
{
reminder
=
[{
content
:
'
8���ˣ����ϰ���
'
}];
console
.
log
(
'
ReminderRequest content:
'
+
reminder
[
0
].
content
);
//expect(false).assertEqual(false);
reminder
=
[{
content
:
'
8????????????
'
}];
console
.
info
(
'
ReminderRequest content:
'
+
reminder
[
0
].
content
);
}
},(
error
)
=>
{
//expect(false).assertTrue();
});
},(
error
)
=>
{});
});
setTimeout
(()
=>
{
...
...
@@ -259,12 +249,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_007
* @tc.name testReminderRequestType007
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_
007
* @tc.name testReminderRequestType
_
007
* @tc.desc test ReminderRequest LocalDateTime second
*/
it
(
"
testReminderRequestType007
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderRequestType
007---------------------------
'
);
it
(
"
testReminderRequestType
_
007
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testReminderRequestType_
007---------------------------
'
);
let
calendar
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_CALENDAR
,
dateTime
:
{
...
...
@@ -277,8 +267,8 @@ describe('ReminderAgentTest', function () {
}
}
reminderAgent
.
publishReminder
(
calendar
).
then
((
reminderId
)
=>
{
console
.
log
(
"
testReminderRequestType
007 reminderId =
"
+
reminderId
);
expect
(
true
).
assertEqual
(
true
);
console
.
info
(
"
testReminderRequestType_
007 reminderId =
"
+
reminderId
);
expect
(
reminderId
).
assertLarger
(
0
);
});
setTimeout
(()
=>
{
...
...
@@ -287,12 +277,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_008
* @tc.name testReminderRequestType008
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_
008
* @tc.name testReminderRequestType
_
008
* @tc.desc test ReminderRequest ReminderRequestAlarm daysOfWeek
*/
it
(
"
testReminderRequestType008
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderRequestType
008---------------------------
'
);
it
(
"
testReminderRequestType
_
008
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testReminderRequestType_
008---------------------------
'
);
let
alarm
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_ALARM
,
hour
:
7
,
...
...
@@ -301,13 +291,10 @@ describe('ReminderAgentTest', function () {
}
reminderAgent
.
publishReminder
(
alarm
).
then
((
reminderId
)
=>
{
if
(
reminderId
!=
-
1
)
{
console
.
log
(
"
testReminderRequestType
008 reminderId =
"
+
reminderId
);
expect
(
true
).
assertEqual
(
true
);
console
.
info
(
"
testReminderRequestType_
008 reminderId =
"
+
reminderId
);
expect
(
reminderId
).
assertLarger
(
0
);
}
//console.log("reminderId =" + reminderId);
},
error
=>
{
//expect(false).assertTrue();
});
},
error
=>
{});
setTimeout
(()
=>
{
done
();
...
...
@@ -315,11 +302,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_009
* @tc.name testPublishReminderNorFun009
* @tc.desc
Publishes an agent-powered reminder
with the promise function.
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_
009
* @tc.name testPublishReminderNorFun
_
009
* @tc.desc
test reminderId is outo increment
with the promise function.
*/
it
(
'
testPublishReminderNorFun009
'
,
0
,
async
function
(
done
)
{
it
(
'
testPublishReminderNorFun_009
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderNorFun_009---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
TRIGGER_TIME_IN_SECONDS
...
...
@@ -344,11 +332,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_010
* @tc.name testPublishReminderNorFun010
* @tc.desc
Publishes an agent-powered reminder
with the callback function.
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_
010
* @tc.name testPublishReminderNorFun
_
010
* @tc.desc
test reminderId is outo increment
with the callback function.
*/
it
(
'
testPublishReminderNorFun010
'
,
0
,
async
function
(
done
)
{
it
(
'
testPublishReminderNorFun_010
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderNorFun_010---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
TRIGGER_TIME_IN_SECONDS
...
...
@@ -365,11 +354,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_011
* @tc.name testAddNotificationSlotNorFun011
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_
011
* @tc.name testAddNotificationSlotNorFun
_
011
* @tc.desc Adds a reminder notification slot with the callback function.
*/
it
(
'
testAddNotificationSlotNorFun011
'
,
0
,
async
function
(
done
)
{
it
(
'
testAddNotificationSlotNorFun_011
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testAddNotificationSlotNorFun_011---------------------------
'
);
try
{
function
reminderCallback
(
err
,
data
)
{
let
i
=
0
;
...
...
@@ -377,41 +367,43 @@ describe('ReminderAgentTest', function () {
}
reminderAgent
.
addNotificationSlot
(
0
,
reminderCallback
);
}
catch
(
error
)
{
console
.
info
(
'
testAddNotificationSlotNorFun011 slot err.code
'
)
console
.
info
(
'
testAddNotificationSlotNorFun
_
011 slot err.code
'
)
}
done
();
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_012
* @tc.name testAddNotificationSlotNorFun012
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_
012
* @tc.name testAddNotificationSlotNorFun
_
012
* @tc.desc Adds a reminder notification slot with the promise function and null mySlot.
*/
it
(
'
testAddNotificationSlotNorFun012
'
,
0
,
async
function
(
done
)
{
it
(
'
testAddNotificationSlotNorFun_012
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testAddNotificationSlotNorFun_012---------------------------
'
);
let
mySlot
=
null
;
try
{
reminderAgent
.
addNotificationSlot
(
mySlot
,
function
(
err
)
{
if
(
err
==
undefined
)
{
console
.
info
(
'
testAddNotificationSlotNorFun
00
2 execute success
'
);
console
.
info
(
'
testAddNotificationSlotNorFun
_01
2 execute success
'
);
}
else
{
console
.
info
(
'
testAddNotificationSlotNorFun
00
2 execute failed
'
);
console
.
info
(
'
testAddNotificationSlotNorFun
_01
2 execute failed
'
);
}
}).
catch
(
function
(
err
)
{
console
.
info
(
"
testAddNotificationSlotNorFun
00
2 execute catch
"
+
err
.
code
);
console
.
info
(
"
testAddNotificationSlotNorFun
_01
2 execute catch
"
+
err
.
code
);
})
}
catch
(
error
)
{
console
.
info
(
"
testAddNotificationSlotNorFun
00
2 execute try - catch
"
+
error
.
code
);
console
.
info
(
"
testAddNotificationSlotNorFun
_01
2 execute try - catch
"
+
error
.
code
);
let
i
=
0
;
expect
(
0
).
assertEqual
(
i
);
done
();
}})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_013
* @tc.name testAddNotificationSlotNorFun013
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_
013
* @tc.name testAddNotificationSlotNorFun
_
013
* @tc.desc Adds a reminder notification slot with the promise function and mySlot type 3.
*/
it
(
'
testAddNotificationSlotNorFun013
'
,
0
,
async
function
(
done
)
{
it
(
'
testAddNotificationSlotNorFun_013
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testAddNotificationSlotNorFun_013---------------------------
'
);
let
mySlot
=
{
type
:
3
}
...
...
@@ -429,11 +421,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_014
* @tc.name testAddNotificationSlotNorFun014
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_
014
* @tc.name testAddNotificationSlotNorFun
_
014
* @tc.desc Adds a reminder notification slot with the promise function and mySlot more types.
*/
it
(
'
testAddNotificationSlotNorFun014
'
,
0
,
async
function
(
done
)
{
it
(
'
testAddNotificationSlotNorFun_014
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testAddNotificationSlotNorFun_014---------------------------
'
);
let
mySlot0
=
{
type
:
0
}
...
...
@@ -467,11 +460,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_015
* @tc.name testGetValidRemindersNorFun015
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_
015
* @tc.name testGetValidRemindersNorFun
_
015
* @tc.desc Obtains all valid remindeers set by the current application.
*/
it
(
'
testGetValidRemindersNorFun015
'
,
0
,
async
function
(
done
)
{
it
(
'
testGetValidRemindersNorFun_015
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testGetValidRemindersNorFun_015---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
TRIGGER_TIME_IN_SECONDS
...
...
@@ -490,11 +484,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_016
* @tc.name testCancelAllRemindersNorFun016
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_
016
* @tc.name testCancelAllRemindersNorFun
_
016
* @tc.desc test cancel all reminders can cancel all exist reminders
*/
it
(
'
testCancelAllRemindersNorFun016
'
,
0
,
async
function
(
done
)
{
it
(
'
testCancelAllRemindersNorFun_016
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testCancelAllRemindersNorFun_016---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
TRIGGER_TIME_IN_SECONDS
...
...
@@ -513,11 +508,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_017
* @tc.name testCancelRemindersNorFun017
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_
017
* @tc.name testCancelRemindersNorFun
_
017
* @tc.desc test cancelReminder with not exit reminder.
*/
it
(
'
testCancelRemindersNorFun017
'
,
0
,
async
function
(
done
)
{
it
(
'
testCancelRemindersNorFun_017
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testCancelRemindersNorFun_017---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
TRIGGER_TIME_IN_SECONDS
...
...
@@ -546,11 +542,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_018
* @tc.name testCancelRemindersNorFun018
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_
018
* @tc.name testCancelRemindersNorFun
_
018
* @tc.desc test cancel reminder with not exit reminder.
*/
it
(
'
testCancelRemindersNorFun018
'
,
0
,
async
function
(
done
)
{
it
(
'
testCancelRemindersNorFun_018
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testCancelRemindersNorFun_018---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
TRIGGER_TIME_IN_SECONDS
...
...
@@ -579,11 +576,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_019
* @tc.name testCancelRemindersNorFun019
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_
019
* @tc.name testCancelRemindersNorFun
_
019
* @tc.desc test cancel reminder with exist reminder.
*/
it
(
'
testCancelRemindersNorFun019
'
,
0
,
async
function
(
done
)
{
it
(
'
testCancelRemindersNorFun_019
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testCancelRemindersNorFun_019---------------------------
'
);
let
alarm
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_ALARM
,
hour
:
21
,
...
...
@@ -616,11 +614,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_020
* @tc.name testCancelRemindersNorFun020
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_
020
* @tc.name testCancelRemindersNorFun
_
020
* @tc.desc test cancel reminder with exist reminder with the promise function.
*/
it
(
'
testCancelRemindersNorFun020
'
,
0
,
async
function
(
done
)
{
it
(
'
testCancelRemindersNorFun_020
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testCancelRemindersNorFun_020---------------------------
'
);
let
alarm
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_ALARM
,
hour
:
21
,
...
...
@@ -653,11 +652,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_021
* @tc.name testGetValidRemindersNorFun021
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_
021
* @tc.name testGetValidRemindersNorFun
_
021
* @tc.desc test get valid reminders verify all the information is correct.
*/
it
(
'
testGetValidRemindersNorFun021
'
,
0
,
async
function
(
done
)
{
it
(
'
testGetValidRemindersNorFun_021
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testGetValidRemindersNorFun_021---------------------------
'
);
let
alarm
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_ALARM
,
hour
:
21
,
...
...
@@ -683,11 +683,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_022
* @tc.name testGetValidRemindersNorFun022
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_
022
* @tc.name testGetValidRemindersNorFun
_
022
* @tc.desc test get valid reminders verify all the information is correct with the callback function.
*/
it
(
'
testGetValidRemindersNorFun022
'
,
0
,
async
function
(
done
)
{
it
(
'
testGetValidRemindersNorFun_022
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testGetValidRemindersNorFun_022---------------------------
'
);
let
alarm
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_ALARM
,
hour
:
21
,
...
...
@@ -713,11 +714,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_023
* @tc.name testRemo
nveNotificationSlotNorFun
023
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_
023
* @tc.name testRemo
veNotificationSlotNorFun_
023
* @tc.desc test remove notification Slot with not exist slot.
*/
it
(
'
testRemonveNotificationSlotNorFun023
'
,
0
,
async
function
(
done
)
{
it
(
'
testRemoveNotificationSlotNorFun_023
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testRemoveNotificationSlotNorFun_023---------------------------
'
);
function
reminderCallback
(
err
,
data
)
{
let
i
=
0
;
expect
(
0
).
assertEqual
(
i
);
...
...
@@ -727,18 +729,17 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
001
* @tc.name test
ReminderAgentRequest_001
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_024
* @tc.name test
PublishReminderTimer_024
* @tc.desc test timer without reminderType .
*/
it
(
"
test
ReminderAgentRequest_001
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_001
---------------------------
'
);
it
(
"
test
PublishReminderTimer_024
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderTimer_024
---------------------------
'
);
let
timer
=
{
// reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER,
triggerTimeInSeconds
:
10
}
reminderAgent
.
publishReminder
(
timer
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_001
reminderId=
"
+
reminderId
);
console
.
info
(
"
callback,the testPublishReminderTimer_024
reminderId=
"
+
reminderId
);
expect
(
-
1
).
assertEqual
(
reminderId
);
});
...
...
@@ -748,18 +749,17 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
002
* @tc.name test
ReminderAgentRequest_002
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_025
* @tc.name test
PublishReminderTimer_025
* @tc.desc test timer without triggerTimeInSeconds.
*/
it
(
"
test
ReminderAgentRequest_002
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_002
---------------------------
'
);
it
(
"
test
PublishReminderTimer_025
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderTimer_025
---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
// triggerTimeInSeconds: 10
}
reminderAgent
.
publishReminder
(
timer
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_002
reminderId=
"
+
reminderId
);
console
.
info
(
"
callback,the testPublishReminderTimer_025
reminderId=
"
+
reminderId
);
expect
(
-
1
).
assertEqual
(
reminderId
);
});
...
...
@@ -769,18 +769,18 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
003
* @tc.name test
ReminderAgentRequest_003
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_026
* @tc.name test
PublishReminderTimer_026
* @tc.desc test timer triggerTimeInSeconds with wrong parameter.
*/
it
(
"
test
ReminderAgentRequest_003
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_003
---------------------------
'
);
it
(
"
test
PublishReminderTimer_026
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderTimer_026
---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
-
10
}
reminderAgent
.
publishReminder
(
timer
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_003
reminderId=
"
+
reminderId
);
console
.
info
(
"
callback,the testPublishReminderTimer_026
reminderId=
"
+
reminderId
);
expect
(
-
1
).
assertEqual
(
reminderId
);
});
...
...
@@ -790,18 +790,18 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
004
* @tc.name test
ReminderAgentRequest_004
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_027
* @tc.name test
PublishReminderTimer_027
* @tc.desc test timer triggerTimeInSeconds with illegal parameter.
*/
it
(
"
test
ReminderAgentRequest_004
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_004
---------------------------
'
);
it
(
"
test
PublishReminderTimer_027
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderTimer_027
---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
0
}
reminderAgent
.
publishReminder
(
timer
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_004
reminderId=
"
+
reminderId
);
console
.
info
(
"
callback,the testPublishReminderTimer_027
reminderId=
"
+
reminderId
);
expect
(
-
1
).
assertEqual
(
reminderId
);
});
...
...
@@ -811,18 +811,18 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
005
* @tc.name test
ReminderAgentRequest_005
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_028
* @tc.name test
PublishReminderTimer_028
* @tc.desc test timer triggerTimeInSeconds with illegal parameter.
*/
it
(
"
test
ReminderAgentRequest_005
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_005
---------------------------
'
);
it
(
"
test
PublishReminderTimer_028
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderTimer_028
---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
'
fye
'
}
reminderAgent
.
publishReminder
(
timer
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_005
reminderId=
"
+
reminderId
);
console
.
info
(
"
callback,the testPublishReminderTimer_028
reminderId=
"
+
reminderId
);
expect
(
-
1
).
assertEqual
(
reminderId
);
});
...
...
@@ -832,18 +832,18 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
006
* @tc.name test
ReminderAgentRequest_006
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_029
* @tc.name test
PublishReminderTimer_029
* @tc.desc test timer normal parameter,return with callback.
*/
it
(
"
test
ReminderAgentRequest_006
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_006
---------------------------
'
);
it
(
"
test
PublishReminderTimer_029
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderTimer_029
---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
20
}
reminderAgent
.
publishReminder
(
timer
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_006
reminderId=
"
+
reminderId
);
console
.
info
(
"
callback,the testPublishReminderTimer_029
reminderId=
"
+
reminderId
);
expect
(
reminderId
).
assertLarger
(
0
);
});
...
...
@@ -853,18 +853,18 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
007
* @tc.name test
ReminderAgentRequest_007
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_030
* @tc.name test
PublishReminderTimer_030
* @tc.desc test timer normal parameter,return with promise.
*/
it
(
"
test
ReminderAgentRequest_007
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_007
---------------------------
'
);
it
(
"
test
PublishReminderTimer_030
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderTimer_030
---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
20
}
reminderAgent
.
publishReminder
(
timer
).
then
((
reminderId
)
=>
{
console
.
log
(
"
promise,the testReminderAgentRequest_007
reminderId =
"
+
reminderId
);
console
.
info
(
"
promise,the testPublishReminderTimer_030
reminderId =
"
+
reminderId
);
expect
(
reminderId
).
assertLarger
(
0
);
});
...
...
@@ -874,19 +874,18 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
008
* @tc.name test
ReminderAgentRequest_008
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_031
* @tc.name test
PublishReminderAlarm_031
* @tc.desc test alarm without reminderType parameter.
*/
it
(
"
test
ReminderAgentRequest_008
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_008
---------------------------
'
);
it
(
"
test
PublishReminderAlarm_031
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderAlarm_031
---------------------------
'
);
let
alarm
=
{
// reminderType: reminderAgent.ReminderType.REMINDER_TYPE_ALARM,
hour
:
11
,
minute
:
13
}
reminderAgent
.
publishReminder
(
alarm
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
promise,the testReminderAgentRequest_008
reminderId=
"
+
reminderId
);
console
.
info
(
"
promise,the testPublishReminderAlarm_031
reminderId=
"
+
reminderId
);
expect
(
-
1
).
assertEqual
(
reminderId
);
});
...
...
@@ -896,19 +895,18 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
009
* @tc.name test
ReminderAgentRequest_009
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_032
* @tc.name test
PublishReminderAlarm_032
* @tc.desc test alarm without hour parameter.
*/
it
(
"
test
ReminderAgentRequest_009
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_009
---------------------------
'
);
it
(
"
test
PublishReminderAlarm_032
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderAlarm_032
---------------------------
'
);
let
alarm
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_ALARM
,
// hour: 11,
minute
:
13
}
reminderAgent
.
publishReminder
(
alarm
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
promise,the testReminderAgentRequest_009
reminderId=
"
+
reminderId
);
console
.
info
(
"
callback,the testPublishReminderAlarm_032
reminderId=
"
+
reminderId
);
expect
(
-
1
).
assertEqual
(
reminderId
);
});
...
...
@@ -918,19 +916,19 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
010
* @tc.name test
ReminderAgentRequest_010
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_033
* @tc.name test
PublishReminderAlarm_033
* @tc.desc test alarm with illegal hour parameter.
*/
it
(
"
test
ReminderAgentRequest_010
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_010
---------------------------
'
);
it
(
"
test
PublishReminderAlarm_033
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderAlarm_033
---------------------------
'
);
let
alarm
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_ALARM
,
hour
:
"
11
"
,
minute
:
13
}
reminderAgent
.
publishReminder
(
alarm
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
promise,the testReminderAgentRequest_010
reminderId=
"
+
reminderId
);
console
.
info
(
"
callback,the testPublishReminderAlarm_033
reminderId=
"
+
reminderId
);
expect
(
-
1
).
assertEqual
(
reminderId
);
});
...
...
@@ -940,19 +938,19 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
011
* @tc.name test
ReminderAgentRequest_011
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_034
* @tc.name test
PublishReminderAlarm_034
* @tc.desc test alarm hour with illegal parameter 24.
*/
it
(
"
test
ReminderAgentRequest_011
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_011
---------------------------
'
);
it
(
"
test
PublishReminderAlarm_034
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderAlarm_034
---------------------------
'
);
let
alarm
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_ALARM
,
hour
:
24
,
minute
:
13
}
reminderAgent
.
publishReminder
(
alarm
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
promise,the testReminderAgentRequest_011
reminderId=
"
+
reminderId
);
console
.
info
(
"
callback,the testPublishReminderAlarm_034
reminderId=
"
+
reminderId
);
expect
(
-
1
).
assertEqual
(
reminderId
);
});
...
...
@@ -962,19 +960,18 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
012
* @tc.name test
ReminderAgentRequest_012
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_035
* @tc.name test
PublishReminderAlarm_035
* @tc.desc test alarm without minute parameter.
*/
it
(
"
test
ReminderAgentRequest_012
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_012
---------------------------
'
);
it
(
"
test
PublishReminderAlarm_035
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderAlarm_035
---------------------------
'
);
let
alarm
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_ALARM
,
hour
:
11
// minute: 13
}
reminderAgent
.
publishReminder
(
alarm
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
promise,the testReminderAgentRequest_012
reminderId=
"
+
reminderId
);
console
.
info
(
"
callback,the testPublishReminderAlarm_035
reminderId=
"
+
reminderId
);
expect
(
-
1
).
assertEqual
(
reminderId
);
});
...
...
@@ -984,19 +981,19 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
013
* @tc.name test
ReminderAgentRequest_013
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_036
* @tc.name test
PublishReminderAlarmNorFun_036
* @tc.desc test alarm with illegal minute parameter.
*/
it
(
"
test
ReminderAgentRequest_013
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_013
---------------------------
'
);
it
(
"
test
PublishReminderAlarmNorFun_036
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderAlarmNorFun_036
---------------------------
'
);
let
alarm
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_ALARM
,
hour
:
11
,
minute
:
"
13
"
}
reminderAgent
.
publishReminder
(
alarm
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
promise,the testReminderAgentRequest_013
reminderId=
"
+
reminderId
);
console
.
info
(
"
callback,the testPublishReminderAlarmNorFun_036
reminderId=
"
+
reminderId
);
expect
(
-
1
).
assertEqual
(
reminderId
);
});
...
...
@@ -1006,19 +1003,19 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
014
* @tc.name test
ReminderAgentRequest_014
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_037
* @tc.name test
PublishReminderAlarm_037
* @tc.desc test alarm hour with illegal parameter 60.
*/
it
(
"
test
ReminderAgentRequest_014
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_014
---------------------------
'
);
it
(
"
test
PublishReminderAlarm_037
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderAlarm_037
---------------------------
'
);
let
alarm
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_ALARM
,
hour
:
11
,
minute
:
60
}
reminderAgent
.
publishReminder
(
alarm
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
promise,the testReminderAgentRequest_014
reminderId=
"
+
reminderId
);
console
.
info
(
"
callback,the testPublishReminderAlarm_037
reminderId=
"
+
reminderId
);
expect
(
-
1
).
assertEqual
(
reminderId
);
});
...
...
@@ -1028,19 +1025,19 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
015
* @tc.name test
ReminderAgentRequest_015
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_038
* @tc.name test
PublishReminderAlarmFun_038
* @tc.desc test alarm with normal parameter,return with callback.
*/
it
(
"
test
ReminderAgentRequest_015
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_015
---------------------------
'
);
it
(
"
test
PublishReminderAlarmFun_038
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderAlarmFun_038
---------------------------
'
);
let
alarm
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_ALARM
,
hour
:
11
,
minute
:
30
}
reminderAgent
.
publishReminder
(
alarm
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
promise,the testReminderAgentRequest_015
reminderId=
"
+
reminderId
);
console
.
info
(
"
callback,the testPublishReminderAlarmFun_038
reminderId=
"
+
reminderId
);
expect
(
reminderId
).
assertLarger
(
0
);
});
...
...
@@ -1050,19 +1047,19 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
016
* @tc.name test
ReminderAgentRequest_016
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_039
* @tc.name test
PublishReminderAlarmFun_039
* @tc.desc test alarm with normal parameter,return with promise.
*/
it
(
"
test
ReminderAgentRequest_016
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_016
---------------------------
'
);
it
(
"
test
PublishReminderAlarmFun_039
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderAlarmFun_039
---------------------------
'
);
let
alarm
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_ALARM
,
hour
:
11
,
minute
:
30
}
reminderAgent
.
publishReminder
(
alarm
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
promise,the testReminderAgentRequest_016
reminderId=
"
+
reminderId
);
console
.
info
(
"
callback,the testPublishReminderAlarmFun_039
reminderId=
"
+
reminderId
);
expect
(
reminderId
).
assertLarger
(
0
);
});
...
...
@@ -1072,12 +1069,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
017
* @tc.name test
ReminderAgentRequest_017
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_040
* @tc.name test
PublishReminderAlarm_040
* @tc.desc test alarm with illegal daysOfWeek parameter.
*/
it
(
"
test
ReminderAgentRequest_017
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_017
---------------------------
'
);
it
(
"
test
PublishReminderAlarm_040
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderAlarm_040
---------------------------
'
);
let
alarm
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_ALARM
,
hour
:
11
,
...
...
@@ -1085,7 +1082,7 @@ describe('ReminderAgentTest', function () {
daysOfWeek
:
[
8
]
}
reminderAgent
.
publishReminder
(
alarm
).
then
((
reminderId
)
=>
{
console
.
log
(
"
promise,the testReminderAgentRequest_017
reminderId =
"
+
reminderId
);
console
.
info
(
"
promise,the testPublishReminderAlarm_040
reminderId =
"
+
reminderId
);
expect
(
-
1
).
assertEqual
(
reminderId
);
});
...
...
@@ -1095,12 +1092,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
018
* @tc.name test
ReminderAgentRequest_018
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_041
* @tc.name test
PublishReminderAlarm_041
* @tc.desc test alarm with null daysOfWeek parameter.
*/
it
(
"
test
ReminderAgentRequest_018
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_018
---------------------------
'
);
it
(
"
test
PublishReminderAlarm_041
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderAlarm_041
---------------------------
'
);
let
alarm
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_ALARM
,
hour
:
11
,
...
...
@@ -1108,7 +1105,7 @@ describe('ReminderAgentTest', function () {
daysOfWeek
:
[]
}
reminderAgent
.
publishReminder
(
alarm
).
then
((
reminderId
)
=>
{
console
.
log
(
"
promise,the testReminderAgentRequest_018
reminderId =
"
+
reminderId
);
console
.
info
(
"
promise,the testPublishReminderAlarm_041
reminderId =
"
+
reminderId
);
expect
(
reminderId
).
assertLarger
(
0
);
});
...
...
@@ -1118,12 +1115,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
019
* @tc.name test
ReminderAgentRequest_019
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_042
* @tc.name test
PublishReminderCalendar_042
* @tc.desc test calendar without reminderType parameter.
*/
it
(
"
test
ReminderAgentRequest_019
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_019
---------------------------
'
);
it
(
"
test
PublishReminderCalendar_042
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderCalendar_042
---------------------------
'
);
let
calendar
=
{
dateTime
:
{
year
:
2025
,
...
...
@@ -1135,7 +1132,7 @@ describe('ReminderAgentTest', function () {
}
}
reminderAgent
.
publishReminder
(
calendar
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_019
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testPublishReminderCalendar_042
reminderId =
"
+
reminderId
);
expect
(
-
1
).
assertEqual
(
reminderId
);
});
...
...
@@ -1145,16 +1142,15 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
020
* @tc.name test
ReminderAgentRequest_020
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_043
* @tc.name test
PublishReminderCalendar_043
* @tc.desc test calendar without year parameter.
*/
it
(
"
test
ReminderAgentRequest_020
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_020
---------------------------
'
);
it
(
"
test
PublishReminderCalendar_043
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderCalendar_043
---------------------------
'
);
let
calendar
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_CALENDAR
,
dateTime
:
{
// year: 2025,
month
:
7
,
day
:
28
,
hour
:
14
,
...
...
@@ -1163,7 +1159,7 @@ describe('ReminderAgentTest', function () {
}
}
reminderAgent
.
publishReminder
(
calendar
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_020
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testPublishReminderCalendar_043
reminderId =
"
+
reminderId
);
expect
(
-
1
).
assertEqual
(
reminderId
);
});
...
...
@@ -1173,12 +1169,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
021
* @tc.name test
ReminderAgentRequest_021
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_044
* @tc.name test
PublishReminderCalendar_044
* @tc.desc test calendar with illegal year parameter.
*/
it
(
"
test
ReminderAgentRequest_021
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_021
---------------------------
'
);
it
(
"
test
PublishReminderCalendar_044
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderCalendar_044
---------------------------
'
);
let
calendar
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_CALENDAR
,
dateTime
:
{
...
...
@@ -1191,7 +1187,7 @@ describe('ReminderAgentTest', function () {
}
}
reminderAgent
.
publishReminder
(
calendar
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_021
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testPublishReminderCalendar_044
reminderId =
"
+
reminderId
);
expect
(
-
1
).
assertEqual
(
reminderId
);
});
...
...
@@ -1201,17 +1197,16 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
022
* @tc.name test
ReminderAgentRequest_022
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_045
* @tc.name test
PublishReminderCalendar_045
* @tc.desc test calendar without month parameter.
*/
it
(
"
test
ReminderAgentRequest_022
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_022
---------------------------
'
);
it
(
"
test
PublishReminderCalendar_045
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderCalendar_045
---------------------------
'
);
let
calendar
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_CALENDAR
,
dateTime
:
{
year
:
2025
,
// month: 7,
day
:
28
,
hour
:
14
,
minute
:
30
,
...
...
@@ -1219,7 +1214,7 @@ describe('ReminderAgentTest', function () {
}
}
reminderAgent
.
publishReminder
(
calendar
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_022
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testPublishReminderCalendar_045
reminderId =
"
+
reminderId
);
expect
(
-
1
).
assertEqual
(
reminderId
);
});
...
...
@@ -1229,12 +1224,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
023
* @tc.name test
ReminderAgentRequest_023
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_046
* @tc.name test
PublishReminderCalendar_046
* @tc.desc test calendar with illegal month parameter.
*/
it
(
"
test
ReminderAgentRequest_023
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_023
---------------------------
'
);
it
(
"
test
PublishReminderCalendar_046
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderCalendar_046
---------------------------
'
);
let
calendar
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_CALENDAR
,
dateTime
:
{
...
...
@@ -1247,7 +1242,7 @@ describe('ReminderAgentTest', function () {
}
}
reminderAgent
.
publishReminder
(
calendar
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_023
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testPublishReminderCalendar_046
reminderId =
"
+
reminderId
);
expect
(
-
1
).
assertEqual
(
reminderId
);
});
...
...
@@ -1257,12 +1252,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
024
* @tc.name test
ReminderAgentRequest_024
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_047
* @tc.name test
PublishReminderCalendar_047
* @tc.desc test calendar with illegal month parameter 0.
*/
it
(
"
test
ReminderAgentRequest_024
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_024
---------------------------
'
);
it
(
"
test
PublishReminderCalendar_047
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderCalendar_047
---------------------------
'
);
let
calendar
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_CALENDAR
,
dateTime
:
{
...
...
@@ -1275,7 +1270,7 @@ describe('ReminderAgentTest', function () {
}
}
reminderAgent
.
publishReminder
(
calendar
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_024
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testPublishReminderCalendar_047
reminderId =
"
+
reminderId
);
expect
(
-
1
).
assertEqual
(
reminderId
);
});
...
...
@@ -1285,12 +1280,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
025
* @tc.name test
ReminderAgentRequest_025
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_048
* @tc.name test
PublishReminderCalendar_048
* @tc.desc test calendar with illegal month parameter 13.
*/
it
(
"
test
ReminderAgentRequest_025
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_025
---------------------------
'
);
it
(
"
test
PublishReminderCalendar_048
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderCalendar_048
---------------------------
'
);
let
calendar
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_CALENDAR
,
dateTime
:
{
...
...
@@ -1303,7 +1298,7 @@ describe('ReminderAgentTest', function () {
}
}
reminderAgent
.
publishReminder
(
calendar
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_025
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testPublishReminderCalendar_048
reminderId =
"
+
reminderId
);
expect
(
-
1
).
assertEqual
(
reminderId
);
});
...
...
@@ -1313,25 +1308,24 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
026
* @tc.name test
ReminderAgentRequest_026
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_049
* @tc.name test
PublishReminderCalendar_049
* @tc.desc test calendar without day parameter.
*/
it
(
"
test
ReminderAgentRequest_026
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_026
---------------------------
'
);
it
(
"
test
PublishReminderCalendar_049
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderCalendar_049
---------------------------
'
);
let
calendar
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_CALENDAR
,
dateTime
:
{
year
:
2025
,
month
:
5
,
// day: 28,
hour
:
14
,
minute
:
30
,
second
:
50
}
}
reminderAgent
.
publishReminder
(
calendar
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_026
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testPublishReminderCalendar_049
reminderId =
"
+
reminderId
);
expect
(
-
1
).
assertEqual
(
reminderId
);
});
...
...
@@ -1341,12 +1335,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
027
* @tc.name test
ReminderAgentRequest_027
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_050
* @tc.name test
PublishReminderCalendar_050
* @tc.desc test calendar with illegal day parameter.
*/
it
(
"
test
ReminderAgentRequest_027
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_027
---------------------------
'
);
it
(
"
test
PublishReminderCalendar_050
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderCalendar_050
---------------------------
'
);
let
calendar
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_CALENDAR
,
dateTime
:
{
...
...
@@ -1359,7 +1353,7 @@ describe('ReminderAgentTest', function () {
}
}
reminderAgent
.
publishReminder
(
calendar
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_027
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testPublishReminderCalendar_050
reminderId =
"
+
reminderId
);
expect
(
-
1
).
assertEqual
(
reminderId
);
});
...
...
@@ -1369,12 +1363,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
028
* @tc.name test
ReminderAgentRequest_028
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_051
* @tc.name test
PublishReminderCalendar_051
* @tc.desc test calendar with illegal day parameter 0.
*/
it
(
"
test
ReminderAgentRequest_028
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_028
---------------------------
'
);
it
(
"
test
PublishReminderCalendar_051
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderCalendar_051
---------------------------
'
);
let
calendar
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_CALENDAR
,
dateTime
:
{
...
...
@@ -1387,7 +1381,7 @@ describe('ReminderAgentTest', function () {
}
}
reminderAgent
.
publishReminder
(
calendar
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_028
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testPublishReminderCalendar_051
reminderId =
"
+
reminderId
);
expect
(
-
1
).
assertEqual
(
reminderId
);
});
...
...
@@ -1397,12 +1391,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
029
* @tc.name test
ReminderAgentRequest_029
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_052
* @tc.name test
PublishReminderCalendar_052
* @tc.desc test calendar with illegal day parameter 32.
*/
it
(
"
test
ReminderAgentRequest_029
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_029
---------------------------
'
);
it
(
"
test
PublishReminderCalendar_052
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderCalendar_052
---------------------------
'
);
let
calendar
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_CALENDAR
,
dateTime
:
{
...
...
@@ -1415,7 +1409,7 @@ describe('ReminderAgentTest', function () {
}
}
reminderAgent
.
publishReminder
(
calendar
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_029
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testPublishReminderCalendar_052
reminderId =
"
+
reminderId
);
expect
(
-
1
).
assertEqual
(
reminderId
);
});
...
...
@@ -1425,25 +1419,24 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
030
* @tc.name test
ReminderAgentRequest_030
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_053
* @tc.name test
PublishReminderCalendar_053
* @tc.desc test calendar without hour parameter.
*/
it
(
"
test
ReminderAgentRequest_030
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_030
---------------------------
'
);
it
(
"
test
PublishReminderCalendar_053
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderCalendar_053
---------------------------
'
);
let
calendar
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_CALENDAR
,
dateTime
:
{
year
:
2025
,
month
:
5
,
day
:
28
,
// hour: 14,
minute
:
30
,
second
:
50
}
}
reminderAgent
.
publishReminder
(
calendar
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_030
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testPublishReminderCalendar_053
reminderId =
"
+
reminderId
);
expect
(
-
1
).
assertEqual
(
reminderId
);
});
...
...
@@ -1453,12 +1446,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
031
* @tc.name test
ReminderAgentRequest_031
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_054
* @tc.name test
PublishReminderCalendar_054
* @tc.desc test calendar with illegal hour parameter.
*/
it
(
"
test
ReminderAgentRequest_031
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_031
---------------------------
'
);
it
(
"
test
PublishReminderCalendar_054
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderCalendar_054
---------------------------
'
);
let
calendar
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_CALENDAR
,
dateTime
:
{
...
...
@@ -1471,7 +1464,7 @@ describe('ReminderAgentTest', function () {
}
}
reminderAgent
.
publishReminder
(
calendar
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_031
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testPublishReminderCalendar_054
reminderId =
"
+
reminderId
);
expect
(
-
1
).
assertEqual
(
reminderId
);
});
...
...
@@ -1481,12 +1474,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
032
* @tc.name test
ReminderAgentRequest_032
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_055
* @tc.name test
PublishReminderCalendar_055
* @tc.desc test calendar with illegal hour parameter 24.
*/
it
(
"
test
ReminderAgentRequest_032
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_032
---------------------------
'
);
it
(
"
test
PublishReminderCalendar_055
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderCalendar_055
---------------------------
'
);
let
calendar
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_CALENDAR
,
dateTime
:
{
...
...
@@ -1499,7 +1492,7 @@ describe('ReminderAgentTest', function () {
}
}
reminderAgent
.
publishReminder
(
calendar
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_032
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testPublishReminderCalendar_055
reminderId =
"
+
reminderId
);
expect
(
-
1
).
assertEqual
(
reminderId
);
});
...
...
@@ -1509,12 +1502,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
033
* @tc.name test
ReminderAgentRequest_033
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_056
* @tc.name test
PublishReminderCalendar_056
* @tc.desc test calendar without minute parameter.
*/
it
(
"
test
ReminderAgentRequest_033
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_033
---------------------------
'
);
it
(
"
test
PublishReminderCalendar_056
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderCalendar_056
---------------------------
'
);
let
calendar
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_CALENDAR
,
dateTime
:
{
...
...
@@ -1522,12 +1515,11 @@ describe('ReminderAgentTest', function () {
month
:
5
,
day
:
28
,
hour
:
11
,
// minute: 30,
second
:
50
}
}
reminderAgent
.
publishReminder
(
calendar
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_033
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testPublishReminderCalendar_056
reminderId =
"
+
reminderId
);
expect
(
-
1
).
assertEqual
(
reminderId
);
});
...
...
@@ -1537,12 +1529,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
034
* @tc.name test
ReminderAgentRequest_034
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_057
* @tc.name test
PublishReminderCalendar_057
* @tc.desc test calendar with illegal minute parameter.
*/
it
(
"
test
ReminderAgentRequest_034
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_034
---------------------------
'
);
it
(
"
test
PublishReminderCalendar_057
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderCalendar_057
---------------------------
'
);
let
calendar
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_CALENDAR
,
dateTime
:
{
...
...
@@ -1555,7 +1547,7 @@ describe('ReminderAgentTest', function () {
}
}
reminderAgent
.
publishReminder
(
calendar
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_034
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testPublishReminderCalendar_057
reminderId =
"
+
reminderId
);
expect
(
-
1
).
assertEqual
(
reminderId
);
});
...
...
@@ -1565,12 +1557,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
035
* @tc.name test
ReminderAgentRequest_035
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_058
* @tc.name test
PublishReminderCalendar_058
* @tc.desc test calendar with illegal minute parameter 60.
*/
it
(
"
test
ReminderAgentRequest_035
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_035
---------------------------
'
);
it
(
"
test
PublishReminderCalendar_058
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderCalendar_058
---------------------------
'
);
let
calendar
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_CALENDAR
,
dateTime
:
{
...
...
@@ -1583,7 +1575,7 @@ describe('ReminderAgentTest', function () {
}
}
reminderAgent
.
publishReminder
(
calendar
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_035
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testPublishReminderCalendar_058
reminderId =
"
+
reminderId
);
expect
(
-
1
).
assertEqual
(
reminderId
);
});
...
...
@@ -1593,12 +1585,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
036
* @tc.name test
ReminderAgentRequest_036
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_059
* @tc.name test
PublishReminderCalendarFun_059
* @tc.desc test calendar with normal parameter,return with callback.
*/
it
(
"
test
ReminderAgentRequest_036
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_036
---------------------------
'
);
it
(
"
test
PublishReminderCalendarFun_059
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderCalendarFun_059
---------------------------
'
);
let
calendar
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_CALENDAR
,
dateTime
:
{
...
...
@@ -1611,7 +1603,7 @@ describe('ReminderAgentTest', function () {
}
}
reminderAgent
.
publishReminder
(
calendar
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_036
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testPublishReminderCalendarFun_059
reminderId =
"
+
reminderId
);
expect
(
reminderId
).
assertLarger
(
0
);
});
...
...
@@ -1621,12 +1613,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
037
* @tc.name test
ReminderAgentRequest_037
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_060
* @tc.name test
PublishReminderCalendarFun_060
* @tc.desc test calendar with normal parameter,return with promise.
*/
it
(
"
test
ReminderAgentRequest_037
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_037
---------------------------
'
);
it
(
"
test
PublishReminderCalendarFun_060
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderCalendarFun_060
---------------------------
'
);
let
calendar
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_CALENDAR
,
dateTime
:
{
...
...
@@ -1639,7 +1631,7 @@ describe('ReminderAgentTest', function () {
}
}
reminderAgent
.
publishReminder
(
calendar
).
then
((
reminderId
)
=>
{
console
.
log
(
"
promise,the testReminderAgentRequest_037
reminderId =
"
+
reminderId
);
console
.
info
(
"
promise,the testPublishReminderCalendarFun_060
reminderId =
"
+
reminderId
);
expect
(
reminderId
).
assertLarger
(
0
);
});
...
...
@@ -1649,12 +1641,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
038
* @tc.name test
ReminderAgentRequest_038
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_061
* @tc.name test
PublishReminderCalendar_061
* @tc.desc test calendar with illegal repeatMonths parameter 13.
*/
it
(
"
test
ReminderAgentRequest_038
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_038
---------------------------
'
);
it
(
"
test
PublishReminderCalendar_061
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderCalendar_061
---------------------------
'
);
let
calendar
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_CALENDAR
,
dateTime
:
{
...
...
@@ -1668,7 +1660,7 @@ describe('ReminderAgentTest', function () {
repeatMonths
:
[
13
]
}
reminderAgent
.
publishReminder
(
calendar
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_038
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testPublishReminderCalendar_061
reminderId =
"
+
reminderId
);
expect
(
-
1
).
assertEqual
(
reminderId
);
});
...
...
@@ -1678,12 +1670,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
039
* @tc.name test
ReminderAgentRequest_039
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_062
* @tc.name test
PublishReminderCalendar_062
* @tc.desc test calendar with illegal repeatMonths parameter 0.
*/
it
(
"
test
ReminderAgentRequest_039
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_039
---------------------------
'
);
it
(
"
test
PublishReminderCalendar_062
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderCalendar_062
---------------------------
'
);
let
calendar
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_CALENDAR
,
dateTime
:
{
...
...
@@ -1697,7 +1689,7 @@ describe('ReminderAgentTest', function () {
repeatMonths
:
[
0
]
}
reminderAgent
.
publishReminder
(
calendar
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_039
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testPublishReminderCalendar_062
reminderId =
"
+
reminderId
);
expect
(
-
1
).
assertEqual
(
reminderId
);
});
...
...
@@ -1707,12 +1699,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
040
* @tc.name test
ReminderAgentRequest_040
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_063
* @tc.name test
PublishReminderCalendar_063
* @tc.desc test calendar with illegal repeatDays parameter 32.
*/
it
(
"
test
ReminderAgentRequest_040
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_040
---------------------------
'
);
it
(
"
test
PublishReminderCalendar_063
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderCalendar_063
---------------------------
'
);
let
calendar
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_CALENDAR
,
dateTime
:
{
...
...
@@ -1726,7 +1718,7 @@ describe('ReminderAgentTest', function () {
repeatDays
:
[
32
]
}
reminderAgent
.
publishReminder
(
calendar
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_040
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testPublishReminderCalendar_063
reminderId =
"
+
reminderId
);
expect
(
-
1
).
assertEqual
(
reminderId
);
});
...
...
@@ -1736,12 +1728,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
041
* @tc.name test
ReminderAgentRequest_041
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_064
* @tc.name test
PublishReminderCalendar_064
* @tc.desc test calendar with illegal repeatDays parameter 0.
*/
it
(
"
test
ReminderAgentRequest_041
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_041
---------------------------
'
);
it
(
"
test
PublishReminderCalendar_064
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderCalendar_064
---------------------------
'
);
let
calendar
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_CALENDAR
,
dateTime
:
{
...
...
@@ -1755,7 +1747,7 @@ describe('ReminderAgentTest', function () {
repeatDays
:
[
0
]
}
reminderAgent
.
publishReminder
(
calendar
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_041
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testPublishReminderCalendar_064
reminderId =
"
+
reminderId
);
expect
(
-
1
).
assertEqual
(
reminderId
);
});
...
...
@@ -1765,12 +1757,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
042
* @tc.name test
ReminderAgentRequest_042
* @tc.desc test calendar with repeatMonths
、
repeatDays parameter null,return with callback.
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_065
* @tc.name test
PublishReminderCalendar_065
* @tc.desc test calendar with repeatMonths
��
repeatDays parameter null,return with callback.
*/
it
(
"
test
ReminderAgentRequest_042
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_042
---------------------------
'
);
it
(
"
test
PublishReminderCalendar_065
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderCalendar_065
---------------------------
'
);
let
calendar
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_CALENDAR
,
dateTime
:
{
...
...
@@ -1785,7 +1777,7 @@ describe('ReminderAgentTest', function () {
repeatDays
:
[]
}
reminderAgent
.
publishReminder
(
calendar
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_042
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testPublishReminderCalendar_065
reminderId =
"
+
reminderId
);
expect
(
reminderId
).
assertLager
(
0
);
});
...
...
@@ -1795,12 +1787,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
043
* @tc.name test
ReminderAgentRequest_043
* @tc.desc test calendar with repeatMonths
、
repeatDays parameter null,return with promise.
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_066
* @tc.name test
PublishReminderCalendar_066
* @tc.desc test calendar with repeatMonths
��
repeatDays parameter null,return with promise.
*/
it
(
"
test
ReminderAgentRequest_043
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_043
---------------------------
'
);
it
(
"
test
PublishReminderCalendar_066
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderCalendar_066
---------------------------
'
);
let
calendar
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_CALENDAR
,
dateTime
:
{
...
...
@@ -1815,7 +1807,7 @@ describe('ReminderAgentTest', function () {
repeatDays
:
[]
}
reminderAgent
.
publishReminder
(
calendar
).
then
((
reminderId
)
=>
{
console
.
log
(
"
promise,the testReminderAgentRequest_043
reminderId =
"
+
reminderId
);
console
.
info
(
"
promise,the testPublishReminderCalendar_066
reminderId =
"
+
reminderId
);
});
setTimeout
(()
=>
{
...
...
@@ -1824,12 +1816,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
044
* @tc.name test
ReminderAgentRequest_044
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_067
* @tc.name test
GetValidRemindersButton_067
* @tc.desc test actionButton with illegal parameter.
*/
it
(
"
test
ReminderAgentRequest_044
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_044
---------------------------
'
);
it
(
"
test
GetValidRemindersButton_067
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testGetValidRemindersButton_067
---------------------------
'
);
let
alarm
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_ALARM
,
hour
:
11
,
...
...
@@ -1843,19 +1835,20 @@ describe('ReminderAgentTest', function () {
}
reminderAgent
.
cancelAllReminders
((
err
,
data
)
=>
{
reminderAgent
.
publishReminder
(
alarm
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_044
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testGetValidRemindersButton_067
reminderId =
"
+
reminderId
);
});
});
setTimeout
(()
=>
{
reminderAgent
.
getValidReminders
((
err
,
reminder
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_044
reminder length =
"
+
reminder
.
length
);
console
.
info
(
"
callback,the testGetValidRemindersButton_067
reminder length =
"
+
reminder
.
length
);
if
(
reminder
.
length
!==
0
)
{
let
actionButton
=
reminder
[
0
].
actionButton
;
if
(
actionButton
.
length
===
0
)
{
expect
(
0
).
assertEqual
(
actionButton
.
length
);
}
console
.
log
(
"
callback,the testReminderAgentRequest_044 actionButton type:
"
+
actionButton
[
0
].
type
);
console
.
info
(
"
callback,the testGetValidRemindersButton_067 actionButton type:
"
+
actionButton
[
0
].
type
);
}
},(
error
)
=>
{
});
...
...
@@ -1864,38 +1857,38 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
045
* @tc.name test
ReminderAgentRequest_045
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_068
* @tc.name test
GetValidRemindersButton_068
* @tc.desc test actionButton without title.
*/
it
(
"
test
ReminderAgentRequest_045
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_045
---------------------------
'
);
it
(
"
test
GetValidRemindersButton_068
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testGetValidRemindersButton_068
---------------------------
'
);
let
alarm
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_ALARM
,
hour
:
11
,
minute
:
15
,
actionButton
:
[
{
// title: "this is a title",
type
:
0
}
]
}
reminderAgent
.
cancelAllReminders
((
err
,
data
)
=>
{
reminderAgent
.
publishReminder
(
alarm
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_045
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testGetValidRemindersButton_068
reminderId =
"
+
reminderId
);
});
});
setTimeout
(()
=>
{
reminderAgent
.
getValidReminders
((
err
,
reminder
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_045
reminder length =
"
+
reminder
.
length
);
console
.
info
(
"
callback,the testGetValidRemindersButton_068
reminder length =
"
+
reminder
.
length
);
if
(
reminder
.
length
!==
0
)
{
let
actionButton
=
reminder
[
0
].
actionButton
;
if
(
actionButton
.
length
===
0
)
{
expect
(
0
).
assertEqual
(
actionButton
.
length
);
}
console
.
log
(
"
callback,the actionButton title:
"
+
actionButton
[
0
].
title
);
console
.
info
(
"
callback,the testGetValidRemindersButton_068 actionButton title:
"
+
actionButton
[
0
].
title
);
}
},(
error
)
=>
{
});
...
...
@@ -1904,12 +1897,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
046
* @tc.name test
ReminderAgentRequest_046
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_069
* @tc.name test
GetValidRemindersButton_069
* @tc.desc test actionButton with illegal title.
*/
it
(
"
test
ReminderAgentRequest_046
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_046
---------------------------
'
);
it
(
"
test
GetValidRemindersButton_069
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testGetValidRemindersButton_069
---------------------------
'
);
let
alarm
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_ALARM
,
hour
:
11
,
...
...
@@ -1923,19 +1916,20 @@ describe('ReminderAgentTest', function () {
}
reminderAgent
.
cancelAllReminders
((
err
,
data
)
=>
{
reminderAgent
.
publishReminder
(
alarm
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_046
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testGetValidRemindersButton_069
reminderId =
"
+
reminderId
);
});
});
setTimeout
(()
=>
{
reminderAgent
.
getValidReminders
((
err
,
reminder
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_046
reminder length =
"
+
reminder
.
length
);
console
.
info
(
"
callback,the testGetValidRemindersButton_069
reminder length =
"
+
reminder
.
length
);
if
(
reminder
.
length
!==
0
)
{
let
actionButton
=
reminder
[
0
].
actionButton
;
if
(
actionButton
.
length
===
0
)
{
expect
(
0
).
assertEqual
(
actionButton
.
length
);
}
console
.
log
(
"
callback,the actionButton title:
"
+
actionButton
[
0
].
title
);
console
.
info
(
"
callback,the testGetValidRemindersButton_069 actionButton title:
"
+
actionButton
[
0
].
title
);
}
},(
error
)
=>
{
});
...
...
@@ -1944,12 +1938,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
047
* @tc.name test
ReminderAgentRequest_047
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_070
* @tc.name test
GetValidRemindersSnoozTimes_070
* @tc.desc test snoozeTimes with parameter 0.
*/
it
(
"
test
ReminderAgentRequest_047
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_047
---------------------------
'
);
it
(
"
test
GetValidRemindersSnoozTimes_070
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testGetValidRemindersSnoozTimes_070
---------------------------
'
);
let
alarm
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_ALARM
,
hour
:
11
,
...
...
@@ -1958,13 +1952,14 @@ describe('ReminderAgentTest', function () {
}
reminderAgent
.
cancelAllReminders
((
err
,
data
)
=>
{
reminderAgent
.
publishReminder
(
alarm
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_047
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testGetValidRemindersSnoozTimes_070
reminderId =
"
+
reminderId
);
});
});
setTimeout
(()
=>
{
reminderAgent
.
getValidReminders
((
err
,
reminder
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_047 snoozeTimes =
"
+
reminder
[
0
].
snoozeTimes
);
console
.
info
(
"
callback,the testGetValidRemindersSnoozTimes_070 snoozeTimes =
"
+
reminder
[
0
].
snoozeTimes
);
expect
(
reminder
[
0
].
snoozeTimes
).
assertEqual
(
0
);
});
},
500
);
...
...
@@ -1972,12 +1967,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
048
* @tc.name test
ReminderAgentRequest_048
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_071
* @tc.name test
GetValidRemindersSnoozTimes_071
* @tc.desc test snoozeTimes with illegal parameter.
*/
it
(
"
test
ReminderAgentRequest_048
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_048
---------------------------
'
);
it
(
"
test
GetValidRemindersSnoozTimes_071
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testGetValidRemindersSnoozTimes_071
---------------------------
'
);
let
alarm
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_ALARM
,
hour
:
11
,
...
...
@@ -1986,13 +1981,14 @@ describe('ReminderAgentTest', function () {
}
reminderAgent
.
cancelAllReminders
((
err
,
data
)
=>
{
reminderAgent
.
publishReminder
(
alarm
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_048
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testGetValidRemindersSnoozTimes_071
reminderId =
"
+
reminderId
);
});
});
setTimeout
(()
=>
{
reminderAgent
.
getValidReminders
((
err
,
reminder
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_048 snoozeTimes =
"
+
reminder
[
0
].
snoozeTimes
);
console
.
info
(
"
callback,the testGetValidRemindersSnoozTimes_071 snoozeTimes =
"
+
reminder
[
0
].
snoozeTimes
);
expect
(
reminder
[
0
].
snoozeTimes
).
assertEqual
(
0
);
});
},
500
);
...
...
@@ -2000,12 +1996,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
049
* @tc.name test
ReminderAgentRequest_049
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_072
* @tc.name test
GetValidRemindersSnoozTimes_072
* @tc.desc test snoozeTimes with illegal parameter.
*/
it
(
"
test
ReminderAgentRequest_049
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_049
---------------------------
'
);
it
(
"
test
GetValidRemindersSnoozTimes_072
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testGetValidRemindersSnoozTimes_072
---------------------------
'
);
let
alarm
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_ALARM
,
hour
:
11
,
...
...
@@ -2014,13 +2010,14 @@ describe('ReminderAgentTest', function () {
}
reminderAgent
.
cancelAllReminders
((
err
,
data
)
=>
{
reminderAgent
.
publishReminder
(
alarm
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_049
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testGetValidRemindersSnoozTimes_072
reminderId =
"
+
reminderId
);
});
});
setTimeout
(()
=>
{
reminderAgent
.
getValidReminders
((
err
,
reminder
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_049 snoozeTimes =
"
+
reminder
[
0
].
snoozeTimes
);
console
.
info
(
"
callback,the testGetValidRemindersSnoozTimes_072 snoozeTimes =
"
+
reminder
[
0
].
snoozeTimes
);
expect
(
reminder
[
0
].
snoozeTimes
).
assertEqual
(
0
);
});
},
500
);
...
...
@@ -2028,12 +2025,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
050
* @tc.name test
ReminderAgentRequest_050
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_073
* @tc.name test
GetValidRemindersRingDuration_073
* @tc.desc test ringDuration default parameters.
*/
it
(
"
test
ReminderAgentRequest_050
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_050
---------------------------
'
);
it
(
"
test
GetValidRemindersRingDuration_073
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testGetValidRemindersRingDuration_073
---------------------------
'
);
let
alarm
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_ALARM
,
hour
:
11
,
...
...
@@ -2041,13 +2038,14 @@ describe('ReminderAgentTest', function () {
}
reminderAgent
.
cancelAllReminders
((
err
,
data
)
=>
{
reminderAgent
.
publishReminder
(
alarm
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_050
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testGetValidRemindersRingDuration_073
reminderId =
"
+
reminderId
);
});
});
setTimeout
(()
=>
{
reminderAgent
.
getValidReminders
((
err
,
reminder
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_050 ringDuration =
"
+
reminder
[
0
].
ringDuration
);
console
.
info
(
"
callback,the testGetValidRemindersRingDuration_073 ringDuration =
"
+
reminder
[
0
].
ringDuration
);
expect
(
reminder
[
0
].
ringDuration
).
assertEqual
(
1
);
});
},
500
);
...
...
@@ -2055,12 +2053,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
051
* @tc.name test
ReminderAgentRequest_051
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_074
* @tc.name test
GetValidRemindersRingDuration_074
* @tc.desc test ringDuration with illegal parameter.
*/
it
(
"
test
ReminderAgentRequest_051
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_051
---------------------------
'
);
it
(
"
test
GetValidRemindersRingDuration_074
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testGetValidRemindersRingDuration_074
---------------------------
'
);
let
alarm
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_ALARM
,
hour
:
11
,
...
...
@@ -2069,13 +2067,14 @@ describe('ReminderAgentTest', function () {
}
reminderAgent
.
cancelAllReminders
((
err
,
data
)
=>
{
reminderAgent
.
publishReminder
(
alarm
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_051
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testGetValidRemindersRingDuration_074
reminderId =
"
+
reminderId
);
});
});
setTimeout
(()
=>
{
reminderAgent
.
getValidReminders
((
err
,
reminder
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_051 ringDuration =
"
+
reminder
[
0
].
ringDuration
);
console
.
info
(
"
callback,the testGetValidRemindersRingDuration_074 ringDuration =
"
+
reminder
[
0
].
ringDuration
);
expect
(
reminder
[
0
].
ringDuration
).
assertEqual
(
1
);
});
},
500
);
...
...
@@ -2083,12 +2082,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
052
* @tc.name test
ReminderAgentRequest_052
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_075
* @tc.name test
GetValidRemindersRingDuration_075
* @tc.desc test ringDuration with illegal parameter.
*/
it
(
"
test
ReminderAgentRequest_052
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_052
---------------------------
'
);
it
(
"
test
GetValidRemindersRingDuration_075
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testGetValidRemindersRingDuration_075
---------------------------
'
);
let
alarm
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_ALARM
,
hour
:
11
,
...
...
@@ -2097,13 +2096,14 @@ describe('ReminderAgentTest', function () {
}
reminderAgent
.
cancelAllReminders
((
err
,
data
)
=>
{
reminderAgent
.
publishReminder
(
alarm
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_052
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testGetValidRemindersRingDuration_075
reminderId =
"
+
reminderId
);
});
});
setTimeout
(()
=>
{
reminderAgent
.
getValidReminders
((
err
,
reminder
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_052 ringDuration =
"
+
reminder
[
0
].
ringDuration
);
console
.
info
(
"
callback,the testGetValidRemindersRingDuration_075 ringDuration =
"
+
reminder
[
0
].
ringDuration
);
expect
(
reminder
[
0
].
ringDuration
).
assertEqual
(
1
);
});
},
500
);
...
...
@@ -2111,12 +2111,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
053
* @tc.name test
ReminderAgentRequest_053
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_076
* @tc.name test
GetValidRemindersTimeInterval_076
* @tc.desc test timeInterval default parameters.
*/
it
(
"
test
ReminderAgentRequest_053
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_053
---------------------------
'
);
it
(
"
test
GetValidRemindersTimeInterval_076
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testGetValidRemindersTimeInterval_076
---------------------------
'
);
let
alarm
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_ALARM
,
hour
:
11
,
...
...
@@ -2124,13 +2124,14 @@ describe('ReminderAgentTest', function () {
}
reminderAgent
.
cancelAllReminders
((
err
,
data
)
=>
{
reminderAgent
.
publishReminder
(
alarm
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_053
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testGetValidRemindersTimeInterval_076
reminderId =
"
+
reminderId
);
});
});
setTimeout
(()
=>
{
reminderAgent
.
getValidReminders
((
err
,
reminder
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_053 timeInterval =
"
+
reminder
[
0
].
timeInterval
);
console
.
info
(
"
callback,the testGetValidRemindersTimeInterval_076 timeInterval =
"
+
reminder
[
0
].
timeInterval
);
expect
(
reminder
[
0
].
timeInterval
).
assertEqual
(
0
);
});
},
500
);
...
...
@@ -2138,12 +2139,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
054
* @tc.name test
ReminderAgentRequest_054
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_077
* @tc.name test
GetValidRemindersTimeInterval_077
* @tc.desc test timeInterval with illegal parameters.
*/
it
(
"
test
ReminderAgentRequest_054
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_054
---------------------------
'
);
it
(
"
test
GetValidRemindersTimeInterval_077
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testGetValidRemindersTimeInterval_077
---------------------------
'
);
let
alarm
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_ALARM
,
hour
:
11
,
...
...
@@ -2152,13 +2153,14 @@ describe('ReminderAgentTest', function () {
}
reminderAgent
.
cancelAllReminders
((
err
,
data
)
=>
{
reminderAgent
.
publishReminder
(
alarm
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_054
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testGetValidRemindersTimeInterval_077
reminderId =
"
+
reminderId
);
});
});
setTimeout
(()
=>
{
reminderAgent
.
getValidReminders
((
err
,
reminder
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_054 timeInterval =
"
+
reminder
[
0
].
timeInterval
);
console
.
info
(
"
callback,the testGetValidRemindersTimeInterval_077 timeInterval =
"
+
reminder
[
0
].
timeInterval
);
expect
(
reminder
[
0
].
timeInterval
).
assertEqual
(
0
);
});
},
500
);
...
...
@@ -2166,12 +2168,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
055
* @tc.name test
ReminderAgentRequest_055
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_078
* @tc.name test
GetValidRemindersTimeInterval_078
* @tc.desc test timeInterval with illegal parameters.
*/
it
(
"
test
ReminderAgentRequest_055
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_055
---------------------------
'
);
it
(
"
test
GetValidRemindersTimeInterval_078
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testGetValidRemindersTimeInterval_078
---------------------------
'
);
let
alarm
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_ALARM
,
hour
:
11
,
...
...
@@ -2180,13 +2182,14 @@ describe('ReminderAgentTest', function () {
}
reminderAgent
.
cancelAllReminders
((
err
,
data
)
=>
{
reminderAgent
.
publishReminder
(
alarm
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_055
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testGetValidRemindersTimeInterval_078
reminderId =
"
+
reminderId
);
});
});
setTimeout
(()
=>
{
reminderAgent
.
getValidReminders
((
err
,
reminder
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_055 timeInterval =
"
+
reminder
[
0
].
timeInterval
);
console
.
info
(
"
callback,the testGetValidRemindersTimeInterval_078 timeInterval =
"
+
reminder
[
0
].
timeInterval
);
expect
(
reminder
[
0
].
timeInterval
).
assertEqual
(
0
);
});
},
500
);
...
...
@@ -2194,12 +2197,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
056
* @tc.name test
ReminderAgentRequest_056
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_079
* @tc.name test
GetValidRemindersTitle_079
* @tc.desc test title with empty parameters.
*/
it
(
"
test
ReminderAgentRequest_056
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_056
---------------------------
'
);
it
(
"
test
GetValidRemindersTitle_079
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testGetValidRemindersTitle_079
---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
20
,
...
...
@@ -2209,7 +2212,7 @@ describe('ReminderAgentTest', function () {
}
reminderAgent
.
cancelAllReminders
((
err
,
data
)
=>
{
reminderAgent
.
publishReminder
(
timer
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_056
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testGetValidRemindersTitle_079
reminderId =
"
+
reminderId
);
});
});
...
...
@@ -2217,7 +2220,7 @@ describe('ReminderAgentTest', function () {
reminderAgent
.
getValidReminders
((
err
,
reminder
)
=>
{
if
(
reminder
.
length
!==
0
){
let
title
=
reminder
[
0
].
title
;
console
.
log
(
"
callback,the testReminderAgentRequest_056
title is:
"
+
title
);
console
.
info
(
"
callback,the testGetValidRemindersTitle_079
title is:
"
+
title
);
expect
(
title
).
assertEqual
(
''
);
}
});
...
...
@@ -2226,12 +2229,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
057
* @tc.name test
ReminderAgentRequest_057
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_080
* @tc.name test
GetValidRemindersTitle_080
* @tc.desc test title with illegal parameters.
*/
it
(
"
test
ReminderAgentRequest_057
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_057
---------------------------
'
);
it
(
"
test
GetValidRemindersTitle_080
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testGetValidRemindersTitle_080
---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
20
,
...
...
@@ -2241,7 +2244,7 @@ describe('ReminderAgentTest', function () {
}
reminderAgent
.
cancelAllReminders
((
err
,
data
)
=>
{
reminderAgent
.
publishReminder
(
timer
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_057
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testGetValidRemindersTitle_080
reminderId =
"
+
reminderId
);
});
});
...
...
@@ -2249,7 +2252,7 @@ describe('ReminderAgentTest', function () {
reminderAgent
.
getValidReminders
((
err
,
reminder
)
=>
{
if
(
reminder
.
length
!==
0
){
let
title
=
reminder
[
0
].
title
;
console
.
log
(
"
callback,the testReminderAgentRequest_057
title is:
"
+
title
);
console
.
info
(
"
callback,the testGetValidRemindersTitle_080
title is:
"
+
title
);
expect
(
title
).
assertEqual
(
''
);
}
});
...
...
@@ -2258,19 +2261,19 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
058
* @tc.name test
ReminderAgentRequest_058
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_081
* @tc.name test
GetValidRemindersSlotType_081
* @tc.desc test slotType default parameters.
*/
it
(
"
test
ReminderAgentRequest_058
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_058
---------------------------
'
);
it
(
"
test
GetValidRemindersSlotType_081
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testGetValidRemindersSlotType_081
---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
20
}
reminderAgent
.
cancelAllReminders
((
err
,
data
)
=>
{
reminderAgent
.
publishReminder
(
timer
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_058
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testGetValidRemindersSlotType_081
reminderId =
"
+
reminderId
);
});
});
...
...
@@ -2278,7 +2281,7 @@ describe('ReminderAgentTest', function () {
reminderAgent
.
getValidReminders
((
err
,
reminder
)
=>
{
if
(
reminder
.
length
!==
0
){
let
slotType
=
reminder
[
0
].
slotType
;
console
.
log
(
"
callback,the testReminderAgentRequest_058
slotType is:
"
+
slotType
);
console
.
info
(
"
callback,the testGetValidRemindersSlotType_081
slotType is:
"
+
slotType
);
expect
(
slotType
).
assertEqual
(
1
);
}
});
...
...
@@ -2287,12 +2290,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
059
* @tc.name test
ReminderAgentRequest_059
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_082
* @tc.name test
GetValidRemindersSlotType_082
* @tc.desc test slotType with illegal parameter 5.
*/
it
(
"
test
ReminderAgentRequest_059
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_059
---------------------------
'
);
it
(
"
test
GetValidRemindersSlotType_082
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testGetValidRemindersSlotType_082
---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
20
,
...
...
@@ -2300,7 +2303,7 @@ describe('ReminderAgentTest', function () {
}
reminderAgent
.
cancelAllReminders
((
err
,
data
)
=>
{
reminderAgent
.
publishReminder
(
timer
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_059
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testGetValidRemindersSlotType_082
reminderId =
"
+
reminderId
);
});
});
...
...
@@ -2308,7 +2311,7 @@ describe('ReminderAgentTest', function () {
reminderAgent
.
getValidReminders
((
err
,
reminder
)
=>
{
if
(
reminder
.
length
!==
0
){
let
slotType
=
reminder
[
0
].
slotType
;
console
.
log
(
"
callback,the testReminderAgentRequest_059
slotType is:
"
+
slotType
);
console
.
info
(
"
callback,the testGetValidRemindersSlotType_082
slotType is:
"
+
slotType
);
expect
(
slotType
).
assertEqual
(
1
);
}
});
...
...
@@ -2317,12 +2320,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
060
* @tc.name test
ReminderAgentRequest_060
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_083
* @tc.name test
GetValidRemindersPkgName_083
* @tc.desc test pkgName with empty parameters.
*/
it
(
"
test
ReminderAgentRequest_060
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_060
---------------------------
'
);
it
(
"
test
GetValidRemindersPkgName_083
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testGetValidRemindersPkgName_083
---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
20
,
...
...
@@ -2333,7 +2336,7 @@ describe('ReminderAgentTest', function () {
}
reminderAgent
.
cancelAllReminders
((
err
,
data
)
=>
{
reminderAgent
.
publishReminder
(
timer
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_060
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testGetValidRemindersPkgName_083
reminderId =
"
+
reminderId
);
});
});
...
...
@@ -2341,7 +2344,7 @@ describe('ReminderAgentTest', function () {
reminderAgent
.
getValidReminders
((
err
,
reminder
)
=>
{
if
(
reminder
.
length
!==
0
){
let
pkgName
=
reminder
[
0
].
wantAgent
.
pkgName
;
console
.
log
(
"
callback,the testReminderAgentRequest_060
pkgName is:
"
+
pkgName
);
console
.
info
(
"
callback,the testGetValidRemindersPkgName_083
pkgName is:
"
+
pkgName
);
expect
(
pkgName
).
assertEqual
(
""
);
}
});
...
...
@@ -2350,12 +2353,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
061
* @tc.name test
ReminderAgentRequest_061
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_084
* @tc.name test
GetValidRemindersPkgName_084
* @tc.desc test pkgName with illegal parameters.
*/
it
(
"
test
ReminderAgentRequest_061
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_061
---------------------------
'
);
it
(
"
test
GetValidRemindersPkgName_084
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testGetValidRemindersPkgName_084
---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
20
,
...
...
@@ -2366,7 +2369,7 @@ describe('ReminderAgentTest', function () {
}
reminderAgent
.
cancelAllReminders
((
err
,
data
)
=>
{
reminderAgent
.
publishReminder
(
timer
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_061
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testGetValidRemindersPkgName_084
reminderId =
"
+
reminderId
);
});
});
...
...
@@ -2374,7 +2377,7 @@ describe('ReminderAgentTest', function () {
reminderAgent
.
getValidReminders
((
err
,
reminder
)
=>
{
if
(
reminder
.
length
!==
0
){
let
pkgName
=
reminder
[
0
].
wantAgent
.
pkgName
;
console
.
log
(
"
callback,the testReminderAgentRequest_061
pkgName is:
"
+
pkgName
);
console
.
info
(
"
callback,the testGetValidRemindersPkgName_084
pkgName is:
"
+
pkgName
);
expect
(
pkgName
).
assertEqual
(
""
);
}
});
...
...
@@ -2383,12 +2386,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
062
* @tc.name test
ReminderAgentRequest_062
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_085
* @tc.name test
GetValidRemindersAbilityName_085
* @tc.desc test abilityName with empty parameters.
*/
it
(
"
test
ReminderAgentRequest_062
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_062
---------------------------
'
);
it
(
"
test
GetValidRemindersAbilityName_085
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testGetValidRemindersAbilityName_085
---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
20
,
...
...
@@ -2399,7 +2402,7 @@ describe('ReminderAgentTest', function () {
}
reminderAgent
.
cancelAllReminders
((
err
,
data
)
=>
{
reminderAgent
.
publishReminder
(
timer
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_062
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testGetValidRemindersAbilityName_085
reminderId =
"
+
reminderId
);
});
});
...
...
@@ -2407,7 +2410,8 @@ describe('ReminderAgentTest', function () {
reminderAgent
.
getValidReminders
((
err
,
reminder
)
=>
{
if
(
reminder
.
length
!==
0
){
let
abilityName
=
reminder
[
0
].
wantAgent
.
abilityName
;
console
.
log
(
"
callback,the testReminderAgentRequest_062 abilityName is:
"
+
abilityName
);
console
.
info
(
"
callback,the testGetValidRemindersAbilityName_085 abilityName is:
"
+
abilityName
);
expect
(
abilityName
).
assertEqual
(
""
);
}
});
...
...
@@ -2416,12 +2420,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
063
* @tc.name test
ReminderAgentRequest_063
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_086
* @tc.name test
GetValidRemindersAbilityName_086
* @tc.desc test abilityName with illegal parameters.
*/
it
(
"
test
ReminderAgentRequest_063
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_063
---------------------------
'
);
it
(
"
test
GetValidRemindersAbilityName_086
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testGetValidRemindersAbilityName_086
---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
20
,
...
...
@@ -2432,7 +2436,7 @@ describe('ReminderAgentTest', function () {
}
reminderAgent
.
cancelAllReminders
((
err
,
data
)
=>
{
reminderAgent
.
publishReminder
(
timer
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_063
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testGetValidRemindersAbilityName_086
reminderId =
"
+
reminderId
);
});
});
...
...
@@ -2440,7 +2444,8 @@ describe('ReminderAgentTest', function () {
reminderAgent
.
getValidReminders
((
err
,
reminder
)
=>
{
if
(
reminder
.
length
!==
0
){
let
abilityName
=
reminder
[
0
].
wantAgent
.
abilityName
;
console
.
log
(
"
callback,the testReminderAgentRequest_063 abilityName is:
"
+
abilityName
);
console
.
info
(
"
callback,the testGetValidRemindersAbilityName_086 abilityName is:
"
+
abilityName
);
expect
(
abilityName
).
assertEqual
(
""
);
}
});
...
...
@@ -2449,12 +2454,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
064
* @tc.name test
ReminderAgentRequest_064
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_087
* @tc.name test
GetValidRemindersContent_087
* @tc.desc test content with illegal parameters.
*/
it
(
"
test
ReminderAgentRequest_064
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_064
---------------------------
'
);
it
(
"
test
GetValidRemindersContent_087
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testGetValidRemindersContent_087
---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
20
,
...
...
@@ -2462,7 +2467,7 @@ describe('ReminderAgentTest', function () {
}
reminderAgent
.
cancelAllReminders
((
err
,
data
)
=>
{
reminderAgent
.
publishReminder
(
timer
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_064
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testGetValidRemindersContent_087
reminderId =
"
+
reminderId
);
});
});
...
...
@@ -2470,7 +2475,7 @@ describe('ReminderAgentTest', function () {
reminderAgent
.
getValidReminders
((
err
,
reminder
)
=>
{
if
(
reminder
.
length
!==
0
){
let
content
=
reminder
[
0
].
content
;
console
.
log
(
"
callback,the testReminderAgentRequest_064
content is:
"
+
content
);
console
.
info
(
"
callback,the testGetValidRemindersContent_087
content is:
"
+
content
);
expect
(
content
).
assertEqual
(
""
);
}
});
...
...
@@ -2479,12 +2484,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
065
* @tc.name test
ReminderAgentRequest_065
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_088
* @tc.name test
GetValidRemindersContent_088
* @tc.desc test content with illegal parameters.
*/
it
(
"
test
ReminderAgentRequest_065
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_065
---------------------------
'
);
it
(
"
test
GetValidRemindersContent_088
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testGetValidRemindersContent_088
---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
20
,
...
...
@@ -2492,7 +2497,7 @@ describe('ReminderAgentTest', function () {
}
reminderAgent
.
cancelAllReminders
((
err
,
data
)
=>
{
reminderAgent
.
publishReminder
(
timer
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_065
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testGetValidRemindersContent_088
reminderId =
"
+
reminderId
);
});
});
...
...
@@ -2500,7 +2505,7 @@ describe('ReminderAgentTest', function () {
reminderAgent
.
getValidReminders
((
err
,
reminder
)
=>
{
if
(
reminder
.
length
!==
0
){
let
content
=
reminder
[
0
].
content
;
console
.
log
(
"
callback,the testReminderAgentRequest_065
content is:
"
+
content
);
console
.
info
(
"
callback,the testGetValidRemindersContent_088
content is:
"
+
content
);
expect
(
content
).
assertEqual
(
""
);
}
});
...
...
@@ -2509,12 +2514,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
066
* @tc.name test
ReminderAgentRequest_066
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_089
* @tc.name test
GetValidRemindersExpiredContent_089
* @tc.desc test expiredContent with empty parameters.
*/
it
(
"
test
ReminderAgentRequest_066
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_066
---------------------------
'
);
it
(
"
test
GetValidRemindersExpiredContent_089
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testGetValidRemindersExpiredContent_089
---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
20
,
...
...
@@ -2522,7 +2527,7 @@ describe('ReminderAgentTest', function () {
}
reminderAgent
.
cancelAllReminders
((
err
,
data
)
=>
{
reminderAgent
.
publishReminder
(
timer
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_066
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testGetValidRemindersExpiredContent_089
reminderId =
"
+
reminderId
);
});
});
...
...
@@ -2530,7 +2535,8 @@ describe('ReminderAgentTest', function () {
reminderAgent
.
getValidReminders
((
err
,
reminder
)
=>
{
if
(
reminder
.
length
!==
0
){
let
expiredContent
=
reminder
[
0
].
expiredContent
;
console
.
log
(
"
callback,the testReminderAgentRequest_066 expiredContent is:
"
+
expiredContent
);
console
.
info
(
"
callback,the testGetValidRemindersExpiredContent_089 expiredContent is:
"
+
expiredContent
);
expect
(
expiredContent
).
assertEqual
(
""
);
}
});
...
...
@@ -2539,12 +2545,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
067
* @tc.name test
ReminderAgentRequest_067
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_090
* @tc.name test
GetValidRemindersExpiredContent_090
* @tc.desc test expiredContent with illegal parameters.
*/
it
(
"
test
ReminderAgentRequest_067
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_067
---------------------------
'
);
it
(
"
test
GetValidRemindersExpiredContent_090
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testGetValidRemindersExpiredContent_090
---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
20
,
...
...
@@ -2552,7 +2558,7 @@ describe('ReminderAgentTest', function () {
}
reminderAgent
.
cancelAllReminders
((
err
,
data
)
=>
{
reminderAgent
.
publishReminder
(
timer
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_067
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testGetValidRemindersExpiredContent_090
reminderId =
"
+
reminderId
);
});
});
...
...
@@ -2560,7 +2566,8 @@ describe('ReminderAgentTest', function () {
reminderAgent
.
getValidReminders
((
err
,
reminder
)
=>
{
if
(
reminder
.
length
!==
0
){
let
expiredContent
=
reminder
[
0
].
expiredContent
;
console
.
log
(
"
callback,the testReminderAgentRequest_067 expiredContent is:
"
+
expiredContent
);
console
.
info
(
"
callback,the testGetValidRemindersExpiredContent_090 expiredContent is:
"
+
expiredContent
);
expect
(
expiredContent
).
assertEqual
(
""
);
}
});
...
...
@@ -2569,12 +2576,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
068
* @tc.name test
ReminderAgentRequest_068
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_091
* @tc.name test
GetValidRemindersSnoozeContent_091
* @tc.desc test snoozeContent with empty parameters.
*/
it
(
"
test
ReminderAgentRequest_068
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_068
---------------------------
'
);
it
(
"
test
GetValidRemindersSnoozeContent_091
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testGetValidRemindersSnoozeContent_091
---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
20
,
...
...
@@ -2582,7 +2589,7 @@ describe('ReminderAgentTest', function () {
}
reminderAgent
.
cancelAllReminders
((
err
,
data
)
=>
{
reminderAgent
.
publishReminder
(
timer
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_068
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testGetValidRemindersSnoozeContent_091
reminderId =
"
+
reminderId
);
});
});
...
...
@@ -2590,7 +2597,8 @@ describe('ReminderAgentTest', function () {
reminderAgent
.
getValidReminders
((
err
,
reminder
)
=>
{
if
(
reminder
.
length
!==
0
){
let
snoozeContent
=
reminder
[
0
].
snoozeContent
;
console
.
log
(
"
callback,the testReminderAgentRequest_068 snoozeContent is:
"
+
snoozeContent
);
console
.
info
(
"
callback,the testGetValidRemindersSnoozeContent_091 snoozeContent is:
"
+
snoozeContent
);
expect
(
snoozeContent
).
assertEqual
(
""
);
}
});
...
...
@@ -2599,12 +2607,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
069
* @tc.name test
ReminderAgentRequest_069
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_092
* @tc.name test
GetValidRemindersSnoozeContent_092
* @tc.desc test snoozeContent with illegal parameters.
*/
it
(
"
test
ReminderAgentRequest_069
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_069
---------------------------
'
);
it
(
"
test
GetValidRemindersSnoozeContent_092
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testGetValidRemindersSnoozeContent_092
---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
20
,
...
...
@@ -2612,7 +2620,7 @@ describe('ReminderAgentTest', function () {
}
reminderAgent
.
cancelAllReminders
((
err
,
data
)
=>
{
reminderAgent
.
publishReminder
(
timer
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_069
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testGetValidRemindersSnoozeContent_092
reminderId =
"
+
reminderId
);
});
});
...
...
@@ -2620,7 +2628,7 @@ describe('ReminderAgentTest', function () {
reminderAgent
.
getValidReminders
((
err
,
reminder
)
=>
{
if
(
reminder
.
length
!==
0
){
let
snoozeContent
=
reminder
[
0
].
snoozeContent
;
console
.
log
(
"
callback,the testReminderAgentRequest_069
snoozeContent is:
"
+
snoozeContent
);
console
.
info
(
"
callback,the
snoozeContent is:
"
+
snoozeContent
);
expect
(
snoozeContent
).
assertEqual
(
""
);
}
});
...
...
@@ -2629,12 +2637,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
070
* @tc.name test
ReminderAgentRequest_070
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_093
* @tc.name test
GetValidRemindersNotificationId_093
* @tc.desc test notificationId with illegal parameters.
*/
it
(
"
test
ReminderAgentRequest_070
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_070
---------------------------
'
);
it
(
"
test
GetValidRemindersNotificationId_093
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testGetValidRemindersNotificationId_093
---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
20
,
...
...
@@ -2642,7 +2650,7 @@ describe('ReminderAgentTest', function () {
}
reminderAgent
.
cancelAllReminders
((
err
,
data
)
=>
{
reminderAgent
.
publishReminder
(
timer
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_070
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testGetValidRemindersNotificationId_093
reminderId =
"
+
reminderId
);
});
});
...
...
@@ -2650,7 +2658,8 @@ describe('ReminderAgentTest', function () {
reminderAgent
.
getValidReminders
((
err
,
reminder
)
=>
{
if
(
reminder
.
length
!==
0
){
let
notificationId
=
reminder
[
0
].
notificationId
;
console
.
log
(
"
callback,the testReminderAgentRequest_070 notificationId is:
"
+
notificationId
);
console
.
info
(
"
callback,the testGetValidRemindersNotificationId_093 notificationId is:
"
+
notificationId
);
expect
(
notificationId
).
assertEqual
(
0
);
}
});
...
...
@@ -2659,12 +2668,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
071
* @tc.name test
ReminderAgentRequest_071
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_094
* @tc.name test
GetValidRemindersNotificationId_094
* @tc.desc test snoozeContent with illegal parameters.
*/
it
(
"
test
ReminderAgentRequest_071
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_071
---------------------------
'
);
it
(
"
test
GetValidRemindersNotificationId_094
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testGetValidRemindersNotificationId_094
---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
20
,
...
...
@@ -2672,7 +2681,7 @@ describe('ReminderAgentTest', function () {
}
reminderAgent
.
cancelAllReminders
((
err
,
data
)
=>
{
reminderAgent
.
publishReminder
(
timer
,(
err
,
reminderId
)
=>
{
console
.
log
(
"
callback,the testReminderAgentRequest_071
reminderId =
"
+
reminderId
);
console
.
info
(
"
callback,the testGetValidRemindersNotificationId_094
reminderId =
"
+
reminderId
);
});
});
...
...
@@ -2680,7 +2689,8 @@ describe('ReminderAgentTest', function () {
reminderAgent
.
getValidReminders
((
err
,
reminder
)
=>
{
if
(
reminder
.
length
!==
0
){
let
notificationId
=
reminder
[
0
].
notificationId
;
console
.
log
(
"
callback,the testReminderAgentRequest_071 notificationId is:
"
+
notificationId
);
console
.
info
(
"
callback,the testGetValidRemindersNotificationId_094 notificationId is:
"
+
notificationId
);
expect
(
notificationId
).
assertEqual
(
0
);
}
});
...
...
@@ -2689,131 +2699,132 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
072
* @tc.name testReminder
AgentRequest_072
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_095
* @tc.name testReminder
Type_095
* @tc.desc test timer default parameter with 0.
*/
it
(
"
testReminder
AgentRequest_072
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_072
---------------------------
'
);
it
(
"
testReminder
Type_095
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testReminderType_095
---------------------------
'
);
let
timer
=
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
;
expect
(
timer
).
assertEqual
(
0
);
done
();
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
073
* @tc.name testReminder
AgentRequest_073
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_096
* @tc.name testReminder
Type_096
* @tc.desc test calendar default parameter with 1.
*/
it
(
"
testReminder
AgentRequest_073
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_073
---------------------------
'
);
it
(
"
testReminder
Type_096
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testReminderType_096
---------------------------
'
);
let
calendar
=
reminderAgent
.
ReminderType
.
REMINDER_TYPE_CALENDAR
;
expect
(
calendar
).
assertEqual
(
1
);
done
();
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
074
* @tc.name testReminder
AgentRequest_074
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_097
* @tc.name testReminder
Type_097
* @tc.desc test alarm default parameter with 2.
*/
it
(
"
testReminder
AgentRequest_074
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_074
---------------------------
'
);
it
(
"
testReminder
Type_097
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testReminderType_097
---------------------------
'
);
let
alarm
=
reminderAgent
.
ReminderType
.
REMINDER_TYPE_ALARM
;
expect
(
alarm
).
assertEqual
(
2
);
done
();
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
075
* @tc.name test
ReminderAgentRequest_075
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_098
* @tc.name test
ActionButtonType_098
* @tc.desc test button close default parameter with 0.
*/
it
(
"
test
ReminderAgentRequest_075
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_075
---------------------------
'
);
it
(
"
test
ActionButtonType_098
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testActionButtonType_098
---------------------------
'
);
let
button
=
reminderAgent
.
ActionButtonType
.
ACTION_BUTTON_TYPE_CLOSE
;
expect
(
button
).
assertEqual
(
0
);
done
();
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
076
* @tc.name test
ReminderAgentRequest_076
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_099
* @tc.name test
ActionButtonType_099
* @tc.desc test button snooze default parameter with 1.
*/
it
(
"
test
ReminderAgentRequest_076
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_076
---------------------------
'
);
it
(
"
test
ActionButtonType_099
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testActionButtonType_099
---------------------------
'
);
let
button
=
reminderAgent
.
ActionButtonType
.
ACTION_BUTTON_TYPE_SNOOZE
;
expect
(
button
).
assertEqual
(
1
);
done
();
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
077
* @tc.name test
ReminderAgentRequest_077
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_0100
* @tc.name test
NotificationSlotType_0100
* @tc.desc test UNKNOWN_TYPE default parameter with 0.
*/
it
(
"
test
ReminderAgentRequest_077
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_077
---------------------------
'
);
it
(
"
test
NotificationSlotType_0100
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testNotificationSlotType_0100
---------------------------
'
);
let
type
=
notification
.
SlotType
.
UNKNOWN_TYPE
;
expect
(
type
).
assertEqual
(
0
);
done
();
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
078
* @tc.name test
ReminderAgentRequest_078
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_0101
* @tc.name test
NotificationSlotType_0101
* @tc.desc test SOCIAL_COMMUNICATION default parameter with 1.
*/
it
(
"
test
ReminderAgentRequest_078
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_078
---------------------------
'
);
it
(
"
test
NotificationSlotType_0101
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testNotificationSlotType_0101
---------------------------
'
);
let
type
=
notification
.
SlotType
.
SOCIAL_COMMUNICATION
;
expect
(
type
).
assertEqual
(
1
);
done
();
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
079
* @tc.name test
ReminderAgentRequest_079
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_0102
* @tc.name test
NotificationSlotType_0102
* @tc.desc test SERVICE.INFORMATION default parameter with 2.
*/
it
(
"
test
ReminderAgentRequest_079
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_079
---------------------------
'
);
it
(
"
test
NotificationSlotType_0102
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testNotificationSlotType_0102
---------------------------
'
);
let
type
=
notification
.
SlotType
.
SERVICE_INFORMATION
;
expect
(
type
).
assertEqual
(
2
);
done
();
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
080
* @tc.name test
ReminderAgentRequest_080
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_0103
* @tc.name test
NotificationSlotType_0103
* @tc.desc test CONTENT_INFORMATION default parameter with 3.
*/
it
(
"
test
ReminderAgentRequest_080
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_080
---------------------------
'
);
it
(
"
test
NotificationSlotType_0103
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testNotificationSlotType_0103
---------------------------
'
);
let
type
=
notification
.
SlotType
.
CONTENT_INFORMATION
;
expect
(
type
).
assertEqual
(
3
);
done
();
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
081
* @tc.name test
ReminderAgentRequest_081
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_0104
* @tc.name test
NotificationSlotType_0104
* @tc.desc test OTHER_TYPES default parameter with 65535.
*/
it
(
"
test
ReminderAgentRequest_081
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderAgentRequest_081
---------------------------
'
);
it
(
"
test
NotificationSlotType_0104
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testNotificationSlotType_0104
---------------------------
'
);
let
type
=
notification
.
SlotType
.
OTHER_TYPES
;
expect
(
type
).
assertEqual
(
65535
);
done
();
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
024
* @tc.name testRemo
nveNotificationSlotNorFun024
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_0105
* @tc.name testRemo
veNotificationSlotNorFun_0105
* @tc.desc test remove notification Slot with not exist slot with the promise function.
*/
it
(
'
testRemonveNotificationSlotNorFun024
'
,
0
,
async
function
(
done
)
{
it
(
'
testRemoveNotificationSlotNorFun_0105
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testRemoveNotificationSlotNorFun_0105---------------------------
'
);
let
promise
=
new
Promise
((
resolve
,
reject
)
=>
{
reminderAgent
.
removeNotificationSlot
(
1
).
then
(()
=>
{
resolve
();
...
...
@@ -2829,11 +2840,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
025
* @tc.name testRemo
nveNotificationSlotNorFun025
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_0106
* @tc.name testRemo
veNotificationSlotNorFun_0106
* @tc.desc test remove notification Slot with exist slot.
*/
it
(
'
testRemonveNotificationSlotNorFun025
'
,
0
,
async
function
(
done
)
{
it
(
'
testRemoveNotificationSlotNorFun_0106
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testRemoveNotificationSlotNorFun_0106---------------------------
'
);
let
tarRemoveSlot
=
{
type
:
1
}
...
...
@@ -2846,11 +2858,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
026
* @tc.name testRemo
nveNotificationSlotNorFun026
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_0107
* @tc.name testRemo
veNotificationSlotNorFun_0107
* @tc.desc test remove notification Slot with exist slot with the promise function.
*/
it
(
'
testRemonveNotificationSlotNorFun026
'
,
0
,
async
function
(
done
)
{
it
(
'
testRemoveNotificationSlotNorFun_0107
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testRemoveNotificationSlotNorFun_0107---------------------------
'
);
let
tarRemoveSlot
=
{
type
:
1
}
...
...
@@ -2863,11 +2876,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
027
* @tc.name testGetValidRemindersNorFun
027
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_0108
* @tc.name testGetValidRemindersNorFun
_0108
* @tc.desc test get valid reminders with promise function.
*/
it
(
'
testGetValidRemindersNorFun027
'
,
0
,
async
function
(
done
)
{
it
(
'
testGetValidRemindersNorFun_0108
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testGetValidRemindersNorFun_0108---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
3
...
...
@@ -2882,11 +2896,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
028
* @tc.name testGetValidRemindersNorFun
028
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_0109
* @tc.name testGetValidRemindersNorFun
_0109
* @tc.desc test get valid reminders with the callback function.
*/
it
(
'
testGetValidRemindersNorFun028
'
,
0
,
async
function
(
done
)
{
it
(
'
testGetValidRemindersNorFun_0109
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testGetValidRemindersNorFun_0109---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
3
...
...
@@ -2901,52 +2916,50 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
029
* @tc.name testPublishReminderNorAlarmFun
029
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_0110
* @tc.name testPublishReminderNorAlarmFun
_0110
* @tc.desc test publish reminder with a nomal alarm promise function.
*/
it
(
'
testPublishReminderNorAlarmFun029
'
,
0
,
async
function
(
done
)
{
it
(
'
testPublishReminderNorAlarmFun_0110
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderNorAlarmFun_0110---------------------------
'
);
let
alarm
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_ALARM
,
hour
:
21
,
minute
:
14
}
reminderAgent
.
publishReminder
(
alarm
).
then
((
reminderId
)
=>
{
if
(
reminderId
)
{
let
i
=
0
;
expect
(
0
).
assertEqual
(
i
);
}
console
.
info
(
"
promise the testPublishReminderNorAlarmFun_0110 remiderId =
"
+
reminderId
);
expect
(
reminderId
).
assertLarger
(
0
);
});
done
();
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
030
* @tc.name testPublishReminderNorAlarmFun
030
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_0111
* @tc.name testPublishReminderNorAlarmFun
_0111
* @tc.desc test publish reminder with a nomal alarm callback function.
*/
it
(
'
testPublishReminderNorAlarmFun030
'
,
0
,
async
function
(
done
)
{
it
(
'
testPublishReminderNorAlarmFun_0111
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderNorAlarmFun_0111---------------------------
'
);
let
alarm
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_ALARM
,
hour
:
2
1
,
hour
:
2
0
,
minute
:
14
}
function
reminderCallback
(
err
,
reminderId
)
{
if
(
reminderId
)
{
let
i
=
0
;
expect
(
0
).
assertEqual
(
i
);
}
}
reminderAgent
.
publishReminder
(
alarm
,
reminderCallback
);
reminderAgent
.
publishReminder
(
alarm
,
(
err
,
reminderId
)
=>
{
console
.
info
(
"
callback the testPublishReminderNorAlarmFun_0111 remiderId =
"
+
reminderId
);
expect
(
reminderId
).
assertLarger
(
0
);
});
done
();
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
031
* @tc.name testPublishReminderAbNorFun
031
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_0112
* @tc.name testPublishReminderAbNorFun
_0112
* @tc.desc test publish reminder with max number limit of each application.
*/
it
(
'
testPublishReminderAbNorFun031
'
,
0
,
async
function
(
done
)
{
it
(
'
testPublishReminderAbNorFun_0112
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderAbNorFun_0112---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
TRIGGER_TIME_IN_SECONDS
...
...
@@ -2975,11 +2988,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
032
* @tc.name testReminderTypeCalendarFun
032
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_0113
* @tc.name testReminderTypeCalendarFun
_0113
* @tc.desc test cancelAllReminders can cancel all exist reminders with type of calendar.
*/
it
(
'
testReminderTypeCalendarFun032
'
,
0
,
async
function
(
done
)
{
it
(
'
testReminderTypeCalendarFun_0113
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testReminderTypeCalendarFun_0113---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
100
...
...
@@ -3007,11 +3021,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
033
* @tc.name testPublishReminderTypeCalendarFun
033
* @tc.desc test pulish reminders with type of calendar.
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_0114
* @tc.name testPublishReminderTypeCalendarFun
_0114
* @tc.desc test pu
b
lish reminders with type of calendar.
*/
it
(
'
testReminderTypeCalendarFun033
'
,
0
,
async
function
(
done
)
{
it
(
'
testPublishReminderTypeCalendarFun_0114
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testPublishReminderTypeCalendarFun_0114---------------------------
'
);
let
calendar
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_CALENDAR
,
dateTime
:
{
...
...
@@ -3054,47 +3069,49 @@ describe('ReminderAgentTest', function () {
reminderAgent
.
publishReminder
(
calendar
).
then
((
reminderId
)
=>
{
reminderAgent
.
getValidReminders
().
then
((
reminders
)
=>
{
for
(
let
i
=
0
;
i
<
reminders
.
length
;
i
++
)
{
console
.
log
(
"
getValidReminders =
"
+
JSON
.
stringify
(
reminders
[
i
]));
console
.
log
(
"
getValidReminders, reminderType =
"
+
reminders
[
i
].
reminderType
);
console
.
info
(
"
getValidReminders =
"
+
JSON
.
stringify
(
reminders
[
i
]));
console
.
info
(
"
getValidReminders, reminderType =
"
+
reminders
[
i
].
reminderType
);
for
(
let
j
=
0
;
j
<
reminders
[
i
].
actionButton
.
length
;
j
++
)
{
console
.
log
(
"
getValidReminders, actionButton.title =
"
+
reminders
[
i
].
actionButton
[
j
].
title
);
console
.
log
(
"
getValidReminders, actionButton.type =
"
+
reminders
[
i
].
actionButton
[
j
].
type
);
console
.
info
(
"
getValidReminders, actionButton.title =
"
+
reminders
[
i
].
actionButton
[
j
].
title
);
console
.
info
(
"
getValidReminders, actionButton.type =
"
+
reminders
[
i
].
actionButton
[
j
].
type
);
}
console
.
log
(
"
getValidReminders, wantAgent.pkgName =
"
+
reminders
[
i
].
wantAgent
.
pkgName
);
console
.
log
(
"
getValidReminders, wantAgent.abilityName =
"
+
reminders
[
i
].
wantAgent
.
abilityName
);
console
.
log
(
"
getValidReminders, maxScreenWantAgent.pkgName =
"
+
reminders
[
i
].
maxScreenWantAgent
.
pkgName
);
console
.
log
(
"
getValidReminders, maxScreenWantAgent.abilityName =
"
+
reminders
[
i
].
maxScreenWantAgent
.
abilityName
);
console
.
info
(
"
getValidReminders, wantAgent.pkgName =
"
+
reminders
[
i
].
wantAgent
.
pkgName
);
console
.
info
(
"
getValidReminders, wantAgent.abilityName =
"
+
reminders
[
i
].
wantAgent
.
abilityName
);
console
.
info
(
"
getValidReminders, maxScreenWantAgent.pkgName =
\
"
+
reminders
[
i
].
maxScreenWantAgent
.
pkgName
);
console
.
info
(
"
getValidReminders, maxScreenWantAgent.abilityName =
\
"
+
reminders
[
i
].
maxScreenWantAgent
.
abilityName
);
expect
(
reminders
[
i
].
ringDuration
).
assertEqual
(
5
);
console
.
log
(
"
getValidReminders, ringDuration =
"
+
reminders
[
i
].
ringDuration
);
console
.
info
(
"
getValidReminders, ringDuration =
"
+
reminders
[
i
].
ringDuration
);
expect
(
reminders
[
i
].
snoozeTimes
).
assertEqual
(
2
);
console
.
log
(
"
getValidReminders, snoozeTimes =
"
+
reminders
[
i
].
snoozeTimes
);
console
.
log
(
"
getValidReminders, timeInterval =
"
+
reminders
[
i
].
timeInterval
);
console
.
info
(
"
getValidReminders, snoozeTimes =
"
+
reminders
[
i
].
snoozeTimes
);
console
.
info
(
"
getValidReminders, timeInterval =
"
+
reminders
[
i
].
timeInterval
);
expect
(
reminders
[
i
].
title
).
assertEqual
(
"
this is title
"
);
console
.
log
(
"
getValidReminders, title =
"
+
reminders
[
i
].
title
);
console
.
info
(
"
getValidReminders, title =
"
+
reminders
[
i
].
title
);
expect
(
reminders
[
i
].
content
).
assertEqual
(
"
this is content
"
);
console
.
log
(
"
getValidReminders, content =
"
+
reminders
[
i
].
content
);
console
.
info
(
"
getValidReminders, content =
"
+
reminders
[
i
].
content
);
expect
(
reminders
[
i
].
expiredContent
).
assertEqual
(
"
this reminder has expired
"
);
console
.
log
(
"
getValidReminders, expiredContent =
"
+
reminders
[
i
].
expiredContent
);
console
.
info
(
"
getValidReminders, expiredContent =
"
+
reminders
[
i
].
expiredContent
);
expect
(
reminders
[
i
].
snoozeContent
).
assertEqual
(
"
remind later
"
);
console
.
log
(
"
getValidReminders, snoozeContent =
"
+
reminders
[
i
].
snoozeContent
);
console
.
info
(
"
getValidReminders, snoozeContent =
"
+
reminders
[
i
].
snoozeContent
);
expect
(
reminders
[
i
].
notificationId
).
assertEqual
(
100
);
console
.
log
(
"
getValidReminders, notificationId =
"
+
reminders
[
i
].
notificationId
);
console
.
log
(
"
getValidReminders, slotType =
"
+
reminders
[
i
].
slotType
);
console
.
info
(
"
getValidReminders, notificationId =
"
+
reminders
[
i
].
notificationId
);
console
.
info
(
"
getValidReminders, slotType =
"
+
reminders
[
i
].
slotType
);
}
})
});
done
();
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
036
* @tc.name testActionButtonType
036
* @tc.desc test acton butto type type = 0.
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_0115
* @tc.name testActionButtonType
_0115
* @tc.desc test act
i
on butto type type = 0.
*/
it
(
"
testActionButtonType
036
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testActionButtonType036
---------------------------
'
);
it
(
"
testActionButtonType
_0115
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testActionButtonType_0115
---------------------------
'
);
let
type1
=
reminderAgent
.
ActionButtonType
.
ACTION_BUTTON_TYPE_CLOSE
;
console
.
log
(
type1
+
typeof
(
type1
));
console
.
info
(
type1
+
typeof
(
type1
));
if
(
type1
==
0
)
{
expect
(
true
).
assertTrue
();
}
else
{
...
...
@@ -3104,14 +3121,14 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
037
* @tc.name testActionButtonType
038
* @tc.desc test act
on butto type type = 0
.
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_
API_0116
* @tc.name testActionButtonType
_0116
* @tc.desc test act
ion butto type type = 1
.
*/
it
(
"
testActionButtonType
037
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testActionButtonType037
---------------------------
'
);
it
(
"
testActionButtonType
_0116
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------testActionButtonType_0116
---------------------------
'
);
let
type1
=
reminderAgent
.
ActionButtonType
.
ACTION_BUTTON_TYPE_SNOOZE
;
console
.
log
(
type1
+
typeof
(
type1
));
console
.
info
(
type1
+
typeof
(
type1
));
if
(
type1
==
1
)
{
expect
(
true
).
assertTrue
();
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录