Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
e8f40779
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看板
未验证
提交
e8f40779
编写于
5月 10, 2022
作者:
O
openharmony_ci
提交者:
Gitee
5月 10, 2022
浏览文件
操作
浏览文件
下载
差异文件
!3136 XTS错误用例下库
Merge pull request !3136 from chengxingzhen/OpenHarmony-3.1-Release
上级
b19fe924
2eaad3b4
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
0 addition
and
253 deletion
+0
-253
aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js
...ytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js
+0
-230
aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/test/StartAbilityJsunit.test.js
...itytest/entry/src/main/js/test/StartAbilityJsunit.test.js
+0
-23
未找到文件。
aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js
浏览文件 @
e8f40779
...
...
@@ -1127,236 +1127,6 @@ describe('ActsFeatureAbilityTest', function () {
);
})
/**
* @tc.number: ACTS_StartAbilityForResult_0100
* @tc.name: StartAbilityForResult : Start other ability for result.
* @tc.desc: Check the return value of the interface (by Promise)
*/
it
(
'
ACTS_StartAbilityForResult_0100
'
,
0
,
async
function
(
done
)
{
var
promise
=
await
featureAbility
.
startAbilityForResult
(
{
want
:
{
action
:
"
action.system.home
"
,
entities
:
[
"
entity.system.home
"
],
type
:
"
MIMETYPE
"
,
options
:
{
// indicates the grant to perform read operations on the URI
authReadUriPermission
:
true
,
// indicates the grant to perform write operations on the URI
authWriteUriPermission
:
true
,
// support forward intent result to origin ability
abilityForwardResult
:
true
,
// used for marking the ability start-up is triggered by continuation
abilityContinuation
:
true
,
// specifies whether a component does not belong to ohos
notOhosComponent
:
true
,
// specifies whether an ability is started
abilityFormEnabled
:
true
,
// indicates the grant for possible persisting on the URI.
authPersistableUriPermission
:
true
,
// indicates the grant for possible persisting on the URI.
authPrefixUriPermission
:
true
,
// support distributed scheduling system start up multiple devices
abilitySliceMultiDevice
:
true
,
// indicates that an ability using the service template is started regardless of whether the
// host application has been started.
startForegroundAbility
:
true
,
// install the specified ability if it's not installed.
installOnDemand
:
true
,
// return result to origin ability slice
abilitySliceForwardResult
:
true
,
// install the specified ability with background mode if it's not installed.
installWithBackgroundMode
:
true
},
deviceId
:
""
,
bundleName
:
"
com.example.startabilityforresult
"
,
abilityName
:
"
com.example.startabilityforresult.MainAbility
"
,
uri
:
""
}
}
);
console
.
info
(
'
====> ACTS_StartAbilityForResult_0100 start ability=====>
'
+
JSON
.
stringify
(
promise
))
checkOnAbilityResult
(
promise
);
done
();
})
function
checkOnAbilityResult
(
data
)
{
expect
(
typeof
(
data
)).
assertEqual
(
"
object
"
);
expect
(
typeof
(
data
.
resultCode
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
want
.
action
)).
assertEqual
(
"
string
"
);
expect
(
Array
.
isArray
(
data
.
want
.
entities
)).
assertEqual
(
true
);
expect
(
typeof
(
data
.
want
.
type
)).
assertEqual
(
"
string
"
);
expect
(
typeof
(
data
.
want
.
deviceId
)).
assertEqual
(
"
string
"
);
expect
(
typeof
(
data
.
want
.
bundleName
)).
assertEqual
(
"
string
"
);
expect
(
typeof
(
data
.
want
.
abilityName
)).
assertEqual
(
"
string
"
);
expect
(
typeof
(
data
.
want
.
uri
)).
assertEqual
(
"
string
"
);
console
.
info
(
'
featureAbilityTest onAbilityResult asyncCallback success : *************
'
);
console
.
info
(
'
resultCode :
'
+
data
.
resultCode
);
console
.
info
(
'
want.action :
'
+
data
.
want
.
action
);
console
.
info
(
'
want.entities.length :
'
+
data
.
want
.
entities
.
length
);
for
(
var
j
=
0
;
j
<
data
.
want
.
entities
.
length
;
j
++
)
{
console
.
info
(
'
want.entities :
'
+
data
.
want
.
entities
[
j
]);
}
console
.
info
(
'
want.type :
'
+
data
.
want
.
type
);
console
.
info
(
'
want.bundleName :
'
+
data
.
want
.
bundleName
);
console
.
info
(
'
want.abilityName :
'
+
data
.
want
.
abilityName
);
console
.
info
(
'
want.uri :
'
+
data
.
want
.
uri
);
}
/**
* @tc.number: ACTS_HasWindowFocus_0200
* @tc.name: HasWindowFocus : Checks whether the main window of this ability has window focus
* @tc.desc: Check the return value of the interface (by Promise)
*/
it
(
'
ACTS_HasWindowFocus_0200
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
====>ACTS_HasWindowFocus_0200 start=====>
'
)
featureAbility
.
startAbility
(
{
want
:
{
bundleName
:
"
com.example.getcallingbundlepromisetest
"
,
abilityName
:
"
com.example.getcallingbundlepromisetest.MainAbility
"
,
},
},
(
err
,
data
)
=>
{
console
.
info
(
'
====>ACTS_HasWindowFocus_0200 startAbility err:
'
+
JSON
.
stringify
(
err
))
setTimeout
(
async
function
()
{
console
.
info
(
'
====>ACTS_HasWindowFocus_0200 =====>
'
)
var
info
=
await
featureAbility
.
hasWindowFocus
();
console
.
info
(
'
====>ACTS_HasWindowFocus_0200 info
'
+
info
);
expect
(
info
).
assertEqual
(
false
);
done
();
},
TIMEOUT
)
}
);
})
/**
* @tc.number: ACTS_HasWindowFocus_0400
* @tc.name: HasWindowFocus : Checks whether the main window of this ability has window focus
* @tc.desc: Check the return value of the interface (by AsyncCallback)
*/
it
(
'
ACTS_HasWindowFocus_0400
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
====>ACTS_HasWindowFocus_0400 start=====>
'
)
featureAbility
.
startAbility
(
{
want
:
{
bundleName
:
"
com.example.getcallingbundlepromisetest
"
,
abilityName
:
"
com.example.getcallingbundlepromisetest.MainAbility
"
,
},
},
(
err
,
data
)
=>
{
console
.
info
(
'
====>ACTS_HasWindowFocus_0400 startAbility err:
'
+
JSON
.
stringify
(
err
))
setTimeout
(
async
function
()
{
console
.
info
(
'
====> ACTS_HasWindowFocus_0400 =====>
'
)
featureAbility
.
hasWindowFocus
(
(
error
,
data
)
=>
{
console
.
log
(
"
ACTS_HasWindowFocus_0400 asyncCallback code:
"
+
error
.
code
+
"
data:
"
+
data
)
expect
(
error
.
code
).
assertEqual
(
0
);
expect
(
data
).
assertEqual
(
false
);
done
();
});
},
TIMEOUT
)
}
);
})
/**
* @tc.number: ACTS_TerminateAbility_0100
* @tc.name: TerminateAbility : Destroys ability
* @tc.desc: Check the return value of the interface (by Promise)
*/
it
(
'
ACTS_TerminateAbility_0100
'
,
0
,
async
function
(
done
)
{
var
Subscriber
;
let
id
;
let
events
=
new
Map
();
function
SubscribeCallBack
(
err
,
data
)
{
clearTimeout
(
id
);
events
.
set
(
data
.
event
,
0
);
console
.
debug
(
"
====>Subscribe CallBack data:====>
"
+
JSON
.
stringify
(
data
));
if
(
events
.
size
>
1
)
{
checkResult
();
}
else
{
expect
(
events
.
has
(
"
ACTS_TerminateAbility_0100_CommonEvent
"
)
||
events
.
has
(
"
ACTS_TerminateAbility_0100_Return
"
)).
assertTrue
();
}
}
commonEvent
.
createSubscriber
(
subscriberInfo_ACTS_TerminateAbility_0100
).
then
(
async
(
data
)
=>
{
console
.
debug
(
"
====>Create Subscriber====>
"
);
Subscriber
=
data
;
await
commonEvent
.
subscribe
(
Subscriber
,
SubscribeCallBack
);
})
function
UnSubscribeCallback
()
{
console
.
debug
(
"
====>UnSubscribe CallBack====>
"
);
done
();
}
function
timeout
()
{
expect
().
assertFail
();
console
.
debug
(
'
ACTS_TerminateAbility_0100=====timeout======
'
);
commonEvent
.
unsubscribe
(
Subscriber
,
UnSubscribeCallback
)
done
();
}
function
checkResult
()
{
console
.
debug
(
'
==========ACTS_TerminateAbility_0100==========checkResult
'
);
expect
(
events
.
has
(
"
ACTS_TerminateAbility_0100_CommonEvent
"
)).
assertTrue
();
expect
(
events
.
has
(
"
ACTS_TerminateAbility_0100_Return
"
)).
assertTrue
();
commonEvent
.
unsubscribe
(
Subscriber
,
UnSubscribeCallback
)
done
();
}
id
=
setTimeout
(
timeout
,
START_ABILITY_TIMEOUT
);
var
promise
=
featureAbility
.
startAbility
(
{
want
:
{
action
:
"
action.system.home
"
,
entities
:
[
"
entity.system.home
"
],
type
:
"
MIMETYPE
"
,
options
:
{
// indicates the grant to perform read operations on the URI
authReadUriPermission
:
true
,
// indicates the grant to perform write operations on the URI
authWriteUriPermission
:
true
,
// support forward intent result to origin ability
abilityForwardResult
:
true
,
// used for marking the ability start-up is triggered by continuation
abilityContinuation
:
true
,
// specifies whether a component does not belong to ohos
notOhosComponent
:
true
,
// specifies whether an ability is started
abilityFormEnabled
:
true
,
// indicates the grant for possible persisting on the URI.
authPersistableUriPermission
:
true
,
// indicates the grant for possible persisting on the URI.
authPrefixUriPermission
:
true
,
// support distributed scheduling system start up multiple devices
abilitySliceMultiDevice
:
true
,
// indicates that an ability using the service template is started regardless of whether the
// host application has been started.
startForegroundAbility
:
true
,
// install the specified ability if it's not installed.
installOnDemand
:
true
,
// return result to origin ability slice
abilitySliceForwardResult
:
true
,
// install the specified ability with background mode if it's not installed.
installWithBackgroundMode
:
true
},
deviceId
:
""
,
bundleName
:
"
com.example.terminateabilitytest
"
,
abilityName
:
"
com.example.terminateabilitytest.MainAbility
"
,
uri
:
""
},
}
);
expect
(
typeof
(
promise
)).
assertEqual
(
"
object
"
);
})
/**
* @tc.number: ACTS_TerminateAbility_0200
* @tc.name: TerminateAbility : Destroys ability
...
...
aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/test/StartAbilityJsunit.test.js
浏览文件 @
e8f40779
...
...
@@ -62,29 +62,6 @@ describe('ConnectAbilityTest', function () {
})
})
/*
* @tc.number: SUB_AA_JsApi_StartAbility_0500
* @tc.name: testAbility0500.
* @tc.desc: startAbility-want-configuration bundleName and abilityName+deviceId error.
*/
it
(
"
SUB_AA_JsApi_StartAbility_0500
"
,
0
,
async
function
(
done
)
{
let
parameter
=
{
'
want
'
:
{
'
deviceId
'
:
'
123123
'
,
'
bundleName
'
:
bundleName
,
'
abilityName
'
:
mainAbilityName
}
}
await
featureAbility
.
startAbility
(
parameter
).
then
((
data
)
=>
{
console
.
log
(
'
testAbility0500 data:
'
+
JSON
.
stringify
(
data
))
expect
().
assertFail
()
}).
catch
((
error
)
=>
{
console
.
log
(
'
testAbility0500 error:
'
+
JSON
.
stringify
(
error
))
expect
(
errCode2
).
assertEqual
(
error
.
code
)
})
done
()
})
/*
* @tc.number: SUB_AA_JsApi_Ability_0400
* @tc.name: testAbility0400.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录