Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
ca18f0ab
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看板
未验证
提交
ca18f0ab
编写于
8月 18, 2023
作者:
O
openharmony_ci
提交者:
Gitee
8月 18, 2023
浏览文件
操作
浏览文件
下载
差异文件
!9781 补充common下uiextensioncontext
Merge pull request !9781 from kirl75/master
上级
cd2e1eb7
09abde89
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
138 addition
and
2 deletion
+138
-2
ability/ability_runtime/actssystemapitest/entry/src/main/ets/test/AppManager.test.ets
...systemapitest/entry/src/main/ets/test/AppManager.test.ets
+117
-0
ability/ability_runtime/actsuiextensiontest/uiextensionprovider/entry/src/main/ets/UIExtensionAbility/UIExtAbility.ts
...der/entry/src/main/ets/UIExtensionAbility/UIExtAbility.ts
+2
-1
ability/ability_runtime/actsuiextensiontest/uiextensionprovider/entry/src/main/ets/pages/index.ets
...st/uiextensionprovider/entry/src/main/ets/pages/index.ets
+19
-1
未找到文件。
ability/ability_runtime/actssystemapitest/entry/src/main/ets/test/AppManager.test.ets
浏览文件 @
ca18f0ab
...
@@ -242,5 +242,122 @@ export default function appManagerTest() {
...
@@ -242,5 +242,122 @@ export default function appManagerTest() {
done();
done();
})
})
})
})
/**
* @tc.number: System_API_Test_App_Manager_1100
* @tc.name: callback form GetProcessMemoryByPid system interface interception test
* @tc.desc: Test the third-party application call GetProcessMemoryByPid will be blocked
* @tc.level 3
*/
it('System_API_Test_App_Manager_1100',0, function (done) {
let TAG = 'System_API_Test_App_Manager_1100';
let pid = 0;
appManager.getProcessMemoryByPid(pid, (err) => {
console.log(TAG + " err.code: " + err.code);
expect(err.code).assertEqual(ERROR_CODE);
done();
});
})
/**
* @tc.number: System_API_Test_App_Manager_1200
* @tc.name: promise form GetProcessMemoryByPid system interface interception test
* @tc.desc: Test the third-party application call GetProcessMemoryByPid will be blocked
* @tc.level 3
*/
it('System_API_Test_App_Manager_1200',0, function (done) {
let TAG = 'System_API_Test_App_Manager_1200';
let pid = 0;
appManager.getProcessMemoryByPid(pid)
.then(err => {
console.log(TAG + ` err->${JSON.stringify(err)}`);
expect().assertFail();
done();
})
.catch(err => {
console.log(TAG + " err.code: " + err.code);
expect(err.code).assertEqual(ERROR_CODE);
done();
})
})
/**
* @tc.number: System_API_Test_App_Manager_1300
* @tc.name: callback form getRunningProcessInfoByBundleName system interface interception test
* @tc.desc: Test the third-party application call getRunningProcessInfoByBundleName will be blocked
* @tc.level 3
*/
it('System_API_Test_App_Manager_1300',0, function (done) {
let TAG = 'System_API_Test_App_Manager_1300';
let bundleName = "com.ohos.application";
appManager.getRunningProcessInfoByBundleName(bundleName, (err) => {
console.log(TAG + " err.code: " + err.code);
expect(err.code).assertEqual(ERROR_CODE);
done();
});
})
/**
* @tc.number: System_API_Test_App_Manager_1400
* @tc.name: promise form getRunningProcessInfoByBundleName system interface interception test
* @tc.desc: Test the third-party application call getRunningProcessInfoByBundleName will be blocked
* @tc.level 3
*/
it('System_API_Test_App_Manager_1400',0, function (done) {
let TAG = 'System_API_Test_App_Manager_1400';
let bundleName = "com.ohos.application";
appManager.getRunningProcessInfoByBundleName(bundleName)
.then(err => {
console.log(TAG + ` err->${JSON.stringify(err)}`);
expect().assertFail();
done();
})
.catch(err => {
console.log(TAG + " err.code: " + err.code);
expect(err.code).assertEqual(ERROR_CODE);
done();
})
})
/**
* @tc.number: System_API_Test_App_Manager_1500
* @tc.name: callback form getRunningProcessInfoByBundleName system interface interception test
* @tc.desc: Test the third-party application call getRunningProcessInfoByBundleName will be blocked
* @tc.level 3
*/
it('System_API_Test_App_Manager_1500',0, function (done) {
let TAG = 'System_API_Test_App_Manager_1500';
let bundleName = "com.ohos.application";
let userId = 100;
appManager.getRunningProcessInfoByBundleName(bundleName, userId, (err) => {
console.log(TAG + " err.code: " + err.code);
expect(err.code).assertEqual(ERROR_CODE);
done();
});
})
/**
* @tc.number: System_API_Test_App_Manager_1600
* @tc.name: promise form getRunningProcessInfoByBundleName system interface interception test
* @tc.desc: Test the third-party application call getRunningProcessInfoByBundleName will be blocked
* @tc.level 3
*/
it('System_API_Test_App_Manager_1600',0, function (done) {
let TAG = 'System_API_Test_App_Manager_1600';
let bundleName = "com.ohos.application";
let userId = 100;
appManager.getRunningProcessInfoByBundleName(bundleName, userId)
.then(err => {
console.log(TAG + ` err->${JSON.stringify(err)}`);
expect().assertFail();
done();
})
.catch(err => {
console.log(TAG + " err.code: " + err.code);
expect(err.code).assertEqual(ERROR_CODE);
done();
})
})
})
})
}
}
\ No newline at end of file
ability/ability_runtime/actsuiextensiontest/uiextensionprovider/entry/src/main/ets/UIExtensionAbility/UIExtAbility.ts
浏览文件 @
ca18f0ab
...
@@ -15,12 +15,13 @@
...
@@ -15,12 +15,13 @@
import
UIExtensionAbility
from
'
@ohos.app.ability.UIExtensionAbility
'
import
UIExtensionAbility
from
'
@ohos.app.ability.UIExtensionAbility
'
import
Logger
from
'
../model/Logger
'
import
Logger
from
'
../model/Logger
'
import
common
from
'
@ohos.app.ability.common
'
;
const
TAG
:
string
=
'
[UIExtAbility]
'
const
TAG
:
string
=
'
[UIExtAbility]
'
export
default
class
UIExtAbility
extends
UIExtensionAbility
{
export
default
class
UIExtAbility
extends
UIExtensionAbility
{
onCreate
()
{
onCreate
()
{
Logger
.
log
(
TAG
,
`UIExtAbility onCreate`
)
Logger
.
log
(
TAG
,
`UIExtAbility onCreate`
)
let
UiExtensionContext
:
common
.
UIExtensionContext
=
this
.
context
;
}
}
onForeground
()
{
onForeground
()
{
...
...
ability/ability_runtime/actsuiextensiontest/uiextensionprovider/entry/src/main/ets/pages/index.ets
浏览文件 @
ca18f0ab
...
@@ -16,7 +16,8 @@
...
@@ -16,7 +16,8 @@
import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSession'
import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSession'
import commonEventManager from '@ohos.commonEventManager'
import commonEventManager from '@ohos.commonEventManager'
import Logger from '../model/Logger'
import Logger from '../model/Logger'
import common from '@ohos.app.ability.common';
let context= getContext(this) as common.UIExtensionContext;
const TAG: string = '[UIExtAbility]'
const TAG: string = '[UIExtAbility]'
const sleepTimeOne = 1000;
const sleepTimeOne = 1000;
...
@@ -29,6 +30,23 @@ struct Index {
...
@@ -29,6 +30,23 @@ struct Index {
private session: UIExtensionContentSession = storage.get<UIExtensionContentSession>('session');
private session: UIExtensionContentSession = storage.get<UIExtensionContentSession>('session');
aboutToAppear() {
aboutToAppear() {
let options = {
parameters: {
cacheDir: context.cacheDir,
tempDir: context.tempDir,
filesDir: context.filesDir,
databaseDir: context.databaseDir,
preferencesDir: context.preferencesDir,
bundleCodeDir: context.bundleCodeDir,
distributedFilesDir: context.distributedFilesDir,
stageMode: context.stageMode,
area: context.area,
eventHub: context.eventHub
}
}
commonEventManager.publish('0100_UIExtensionAbilityContext', options, (err) => {
console.log('SUB_AA_Extension_UIServiceExtensionAbility_Context_0100 commonEventManager 0100_UIExtensionAbilityContext');
})
let appearEvent = 'ACTS_UIExtension_AboutToAppear';
let appearEvent = 'ACTS_UIExtension_AboutToAppear';
let terminateSelfWithResultEvent = 'ACTS_UIExtension_TerminateSelfWithResult';
let terminateSelfWithResultEvent = 'ACTS_UIExtension_TerminateSelfWithResult';
let sendDataEvent = 'ACTS_UIExtension_SendData';
let sendDataEvent = 'ACTS_UIExtension_SendData';
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录