Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
065e8aab
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看板
未验证
提交
065e8aab
编写于
2月 12, 2022
作者:
O
openharmony_ci
提交者:
Gitee
2月 12, 2022
浏览文件
操作
浏览文件
下载
差异文件
!1893 【全局资源调度】【master】增加用例
Merge pull request !1893 from niebk/kernel_lite_20220212_1
上级
82dd9fee
8b63d3d9
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
126 addition
and
8 deletion
+126
-8
resourceschedule/resourceschedule_standard/backgroundtaskmanager/src/main/js/default/test/BackgroundTaskMagrJs.test.js
...ger/src/main/js/default/test/BackgroundTaskMagrJs.test.js
+126
-8
resourceschedule/resourceschedule_standard/backgroundtaskmanager/src/main/js/default/test/List.test.js
...ckgroundtaskmanager/src/main/js/default/test/List.test.js
+0
-0
未找到文件。
resourceschedule/resourceschedule_standard/backgroundtaskmanager/src/main/js/default/test/BackgroundTaskMagrJs.test.js
100644 → 100755
浏览文件 @
065e8aab
...
...
@@ -18,7 +18,6 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
describe
(
"
TransientTaskJsTest
"
,
function
()
{
beforeAll
(
function
()
{
/*
* @tc.setup: setup invoked before all testcases
*/
...
...
@@ -26,7 +25,6 @@ describe("TransientTaskJsTest", function () {
})
afterAll
(
function
()
{
/*
* @tc.teardown: teardown invoked after all testcases
*/
...
...
@@ -34,7 +32,6 @@ describe("TransientTaskJsTest", function () {
})
beforeEach
(
function
()
{
/*
* @tc.setup: setup invoked before each testcases
*/
...
...
@@ -42,7 +39,6 @@ describe("TransientTaskJsTest", function () {
})
afterEach
(
function
()
{
/*
* @tc.teardown: teardown invoked after each testcases
*/
...
...
@@ -50,13 +46,135 @@ describe("TransientTaskJsTest", function () {
})
/*
* @tc.name:TransientTaskJsTest001
* @tc.desc:verify app info is not null
* @tc.name: TransientTaskJsTest001
* @tc.desc: test request a suspend delay
* @tc.type: FUNC
* @tc.require: AR000GH86K AR000GH86N AR000GH86L
*/
it
(
"
TransientTaskJsTest001
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------TransientTaskJsTest001---------------------------
'
);
function
callback
()
{}
var
info
=
backgroundTaskManager
.
requestSuspendDelay
(
"
test
"
,
callback
);
if
(
info
.
requestId
!=
-
1
)
{
console
.
info
(
'
TransientTaskJsTest001 backgroundTaskManager success, requestId:
'
+
info
.
requestId
);
expect
(
true
).
assertTrue
();
backgroundTaskManager
.
cancelSuspendDelay
(
info
.
requestId
)
}
else
{
expect
(
false
).
assertTrue
();
}
done
();
})
/*
* @tc.name: TransientTaskJsTest002
* @tc.desc: test transient task more than three
* @tc.type: FUNC
* @tc.require: AR000GH86K AR000GH86L AR000GH86N
*/
it
(
"
TransientTaskJsTest002
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------TransientTaskJsTest002---------------------------
'
);
function
callback
()
{}
var
info1
=
backgroundTaskManager
.
requestSuspendDelay
(
"
test
"
,
callback
);
var
info2
=
backgroundTaskManager
.
requestSuspendDelay
(
"
test
"
,
callback
);
var
info3
=
backgroundTaskManager
.
requestSuspendDelay
(
"
test
"
,
callback
);
var
info4
=
backgroundTaskManager
.
requestSuspendDelay
(
"
test
"
,
callback
);
if
(
info4
.
requestId
==
-
1
)
{
console
.
info
(
'
TransientTaskJsTest002 backgroundTaskManager more than three
'
);
expect
(
true
).
assertTrue
();
backgroundTaskManager
.
cancelSuspendDelay
(
info1
.
requestId
);
backgroundTaskManager
.
cancelSuspendDelay
(
info2
.
requestId
);
backgroundTaskManager
.
cancelSuspendDelay
(
info3
.
requestId
);
}
else
{
expect
(
false
).
assertTrue
();
}
done
();
})
/*
* @tc.name: TransientTaskJsTest003
* @tc.desc: test getRemainingDelayTime Promise
* @tc.type: FUNC
* @tc.require: AR000GH86M AR000GH860 AR000GH86L
*/
it
(
"
TransientTaskJsTest003
"
,
0
,
async
function
(
done
)
{
function
callback
()
{}
var
info
=
backgroundTaskManager
.
requestSuspendDelay
(
"
test
"
,
callback
);
if
(
info
.
requestId
!=
-
1
)
{
console
.
info
(
'
TransientTaskJsTest003 backgroundTaskManager success, requestId:
'
+
info
.
requestId
);
expect
(
true
).
assertTrue
();
}
else
{
expect
(
false
).
assertTrue
();
done
();
}
backgroundTaskManager
.
getRemainingDelayTime
(
info
.
requestId
)
.
then
(
data
=>
{
console
.
info
(
'
TransientTaskJsTest003 backgroundTaskManager success, delaytime:
'
+
data
);
expect
(
true
).
assertTrue
();
backgroundTaskManager
.
cancelSuspendDelay
(
info
.
requestId
);
})
.
catch
(
error
=>
{
console
.
info
(
'
TransientTaskJsTest003 backgroundTaskManager error
'
);
expect
(
false
).
assertTrue
();
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: TransientTaskJsTest004
* @tc.desc: test getRemainingDelayTime Callback
* @tc.type: FUNC
* @tc.require: AR000GH86M AR000GH860 AR000GH86L
*/
it
(
"
TransientTaskJsTest004
"
,
0
,
async
function
(
done
)
{
function
callback
()
{}
var
info
=
backgroundTaskManager
.
requestSuspendDelay
(
"
test
"
,
callback
);
if
(
info
.
requestId
!=
-
1
)
{
console
.
info
(
'
TransientTaskJsTest004 backgroundTaskManager success, requestId:
'
+
info
.
requestId
);
expect
(
true
).
assertTrue
();
}
else
{
expect
(
false
).
assertTrue
();
done
();
}
backgroundTaskManager
.
getRemainingDelayTime
(
info
.
requestId
,
(
err
,
res
)
=>
{
if
(
err
.
data
===
0
)
{
console
.
info
(
'
TransientTaskJsTest004 backgroundTaskManager success, delaytime:
'
+
res
);
expect
(
true
).
assertTrue
();
}
else
{
console
.
info
(
'
TransientTaskJsTest004 backgroundTaskManager error
'
);
expect
(
false
).
assertTrue
();
}
backgroundTaskManager
.
cancelSuspendDelay
(
info
.
requestId
)
});
setTimeout
(()
=>
{
done
();
},
500
);
})
/*
* @tc.name: TransientTaskJsTest005
* @tc.desc: test request a suspend delay
* @tc.type: FUNC
* @tc.require:
Issue Number
* @tc.require:
AR000GH86K AR000GH86N AR000GH86L
*/
it
(
"
TransientTaskJsTest001
"
,
0
,
function
()
{
it
(
"
TransientTaskJsTest005
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------TransientTaskJsTest005---------------------------
'
);
function
callback
()
{}
var
info
=
backgroundTaskManager
.
requestSuspendDelay
(
"
test
"
,
callback
);
if
(
info
.
actualDealyTime
!=
-
1
)
{
console
.
info
(
'
TransientTaskJsTest001 backgroundTaskManager success, actualDealyTime:
'
+
info
.
actualDealyTime
);
expect
(
true
).
assertTrue
();
backgroundTaskManager
.
cancelSuspendDelay
(
info
.
requestId
)
}
else
{
expect
(
false
).
assertTrue
();
}
done
();
})
})
resourceschedule/resourceschedule_standard/backgroundtaskmanager/src/main/js/default/test/List.test.js
100644 → 100755
浏览文件 @
065e8aab
文件模式从 100644 更改为 100755
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录