Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
7d08e5f8
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,发现更多精彩内容 >>
未验证
提交
7d08e5f8
编写于
3月 05, 2022
作者:
O
openharmony_ci
提交者:
Gitee
3月 05, 2022
浏览文件
操作
浏览文件
下载
差异文件
!2203 新增启动取消前台应用用例
Merge pull request !2203 from chengxingzhen/master
上级
81979d52
ff06411c
变更
21
展开全部
隐藏空白更改
内联
并排
Showing
21 changed file
with
390 addition
and
1476 deletion
+390
-1476
aafwk/aafwk_standard/BUILD.gn
aafwk/aafwk_standard/BUILD.gn
+0
-1
aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/config.json
...ability/actsfeatureabilitytest/entry/src/main/config.json
+12
-0
aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js
...ytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js
+378
-1
aafwk/aafwk_standard/stage/BUILD.gn
aafwk/aafwk_standard/stage/BUILD.gn
+0
-21
aafwk/aafwk_standard/stage/stage_extension_service/BUILD.gn
aafwk/aafwk_standard/stage/stage_extension_service/BUILD.gn
+0
-32
aafwk/aafwk_standard/stage/stage_extension_service/Test.json
aafwk/aafwk_standard/stage/stage_extension_service/Test.json
+0
-18
aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/config.json
.../stage/stage_extension_service/entry/src/main/config.json
+0
-84
aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/AbilityStage.ts
...tage_extension_service/entry/src/main/ets/AbilityStage.ts
+0
-24
aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/MainAbility/MainAbility.ts
...ion_service/entry/src/main/ets/MainAbility/MainAbility.ts
+0
-51
aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/MainAbility/app.ets
..._extension_service/entry/src/main/ets/MainAbility/app.ets
+0
-22
aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/MainAbility/pages/index.ets
...on_service/entry/src/main/ets/MainAbility/pages/index.ets
+0
-66
aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/MainAbility/pages/second.ets
...n_service/entry/src/main/ets/MainAbility/pages/second.ets
+0
-43
aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/ServiceAbility/ServiceAbility.ts
...rvice/entry/src/main/ets/ServiceAbility/ServiceAbility.ts
+0
-43
aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/ServiceAbility/service.ts
...sion_service/entry/src/main/ets/ServiceAbility/service.ts
+0
-25
aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts
...ice/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts
+0
-65
aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/ServiceAbility2/service.ts
...ion_service/entry/src/main/ets/ServiceAbility2/service.ts
+0
-25
aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/test/ExtensionTest.test.ets
...on_service/entry/src/main/ets/test/ExtensionTest.test.ets
+0
-913
aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/test/List.test.ets
...e_extension_service/entry/src/main/ets/test/List.test.ets
+0
-22
aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/resources/base/element/string.json
...service/entry/src/main/resources/base/element/string.json
+0
-20
aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/resources/base/media/icon.png
...sion_service/entry/src/main/resources/base/media/icon.png
+0
-0
aafwk/aafwk_standard/stage/stage_extension_service/signature/openharmony_sx.p7b
...tage/stage_extension_service/signature/openharmony_sx.p7b
+0
-0
未找到文件。
aafwk/aafwk_standard/BUILD.gn
浏览文件 @
7d08e5f8
...
...
@@ -51,7 +51,6 @@ group("aafwk_standard") {
"serviceability/stserviceabilityserver:amsStServiceAilityServer",
"serviceability/stserviceabilityserversecond:ActsAmsStServiceAilityServerSecondTest",
"setshowonlockscreen:setshowonlockscreen",
"stage:stage",
"want:want",
]
}
...
...
aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/config.json
浏览文件 @
7d08e5f8
...
...
@@ -30,6 +30,7 @@
},
"abilities"
:
[
{
"visible"
:
true
,
"skills"
:
[
{
"entities"
:
[
...
...
@@ -41,6 +42,9 @@
]
}
],
"backgroundModes"
:
[
"dataTransfer"
],
"name"
:
"com.example.actsfeatureabilitytest.MainAbility"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:mainability_description"
,
...
...
@@ -56,6 +60,11 @@
],
"reqCapabilities"
:
[
"reqCapabilitiesTest1"
,
"reqCapabilitiesTest2"
],
"description"
:
"descriptionTest"
,
"defPermissions"
:
[
{
"name"
:
"ohos.permission.KEEP_BACKGROUND_RUNNING"
}
],
"reqPermissions"
:
[
{
"name"
:
"ohos.permission.CAMERA"
,
...
...
@@ -85,6 +94,9 @@
{
"name"
:
"ohos.permission.LISTEN_BUNDLE_CHANGE"
,
"reason"
:
"need use ohos.permission.LISTEN_BUNDLE_CHANGE"
},
{
"name"
:
"ohos.permission.KEEP_BACKGROUND_RUNNING"
}
],
"js"
:
[
...
...
aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js
浏览文件 @
7d08e5f8
...
...
@@ -16,7 +16,10 @@ import featureAbility from '@ohos.ability.featureAbility'
import
wantconstant
from
'
@ohos.ability.wantConstant
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
import
commonEvent
from
'
@ohos.commonEvent
'
import
wantConstant
from
'
@ohos.ability.wantConstant
'
import
notification
from
'
@ohos.notification
'
;
import
wantAgent
from
'
@ohos.wantAgent
'
;
import
particleAbility
from
'
@ohos.ability.particleAbility
'
import
backgroundTaskManager
from
'
@ohos.backgroundTaskManager
'
const
START_ABILITY_TIMEOUT
=
4000
;
const
TERMINATE_ABILITY_TIMEOUT
=
1000
;
...
...
@@ -82,6 +85,380 @@ var subscriberInfo_ACTS_GetCallingBundle_0100 = {
describe
(
'
ActsFeatureAbilityTest
'
,
function
()
{
beforeAll
(
function
()
{
/*
* @tc.setup: setup invoked before all testcases
*/
console
.
info
(
'
beforeAll called
'
)
})
afterAll
(
function
()
{
/*
* @tc.teardown: teardown invoked after all testcases
*/
console
.
info
(
'
afterAll called
'
)
})
beforeEach
(
function
()
{
/*
* @tc.setup: setup invoked before each testcases
*/
console
.
info
(
'
beforeEach called
'
)
})
afterEach
(
function
()
{
/*
* @tc.teardown: teardown invoked after each testcases
*/
console
.
info
(
'
afterEach called
'
)
particleAbility
.
cancelBackgroundRunning
();
setTimeout
(()
=>
{},
500
);
backgroundTaskManager
.
stopBackgroundRunning
(
featureAbility
.
getContext
());
setTimeout
(()
=>
{},
500
);
})
/*
* @tc.name:Acts_ContinuousTask_0100
* @tc.desc:verify new startBackgroundrunning interface promise mode work properly
* @tc.type: FUNC
* @tc.require: SR000GGT7U AR000GH6ER AR000GH6EM AR000GH6EN AR000GH6EO
*/
it
(
"
Acts_ContinuousTask_0100
"
,
0
,
async
function
(
done
)
{
console
.
log
(
"
Acts_ContinuousTask_0100 start
"
);
let
wantAgentInfo
=
{
wants
:
[
{
bundleName
:
"
com.example.actsfeatureabilitytest
"
,
abilityName
:
"
com.example.actsfeatureabilitytest.MainAbility
"
}
],
operationType
:
2
,
requestCode
:
0
,
wantAgentFlags
:
[
3
]
};
wantAgent
.
getWantAgent
(
wantAgentInfo
).
then
((
data
)
=>
{
backgroundTaskManager
.
startBackgroundRunning
(
featureAbility
.
getContext
(),
backgroundTaskManager
.
BackgroundMode
.
DATA_TRANSFER
,
data
).
then
(()
=>
{
console
.
log
(
"
Acts_ContinuousTask_0100 startBackgroundRunning success
"
);
expect
(
true
).
assertTrue
();
setTimeout
(()
=>
{
done
();
},
500
);
}).
catch
((
err
)
=>
{
expect
(
false
).
assertTrue
();
console
.
log
(
"
Acts_ContinuousTask_0100 startBackgroundRunning failure
"
);
setTimeout
(()
=>
{
done
();
},
500
);
});
});
})
/*
* @tc.name:Acts_ContinuousTask_0200
* @tc.desc:verify new startBackgroundrunning interface callback mode work properly
* @tc.type: FUNC
* @tc.require: SR000GGT7T AR000GH6ER AR000GH6EP AR000GJ9PR AR000GH6G8
*/
it
(
"
Acts_ContinuousTask_0200
"
,
0
,
async
function
(
done
)
{
console
.
log
(
"
Acts_ContinuousTask_0200 start
"
);
function
conTaskCallback
(
err
,
data
)
{
if
(
err
)
{
console
.
info
(
'
Acts_ContinuousTask_0200 startBackgroundRunning failed
'
);
expect
(
false
).
assertTrue
();
}
else
{
console
.
info
(
'
Acts_ContinuousTask_0200 startBackgroundRunning succeed
'
);
expect
(
true
).
assertTrue
();
}
setTimeout
(()
=>
{
done
();
},
500
);
}
let
wantAgentInfo
=
{
wants
:
[
{
bundleName
:
"
com.example.actsfeatureabilitytest
"
,
abilityName
:
"
com.example.actsfeatureabilitytest.MainAbility
"
}
],
operationType
:
2
,
requestCode
:
0
,
wantAgentFlags
:
[
3
]
};
wantAgent
.
getWantAgent
(
wantAgentInfo
).
then
((
data
)
=>
{
backgroundTaskManager
.
startBackgroundRunning
(
featureAbility
.
getContext
(),
backgroundTaskManager
.
BackgroundMode
.
DATA_TRANSFER
,
data
,
conTaskCallback
);
});
})
/*
* @tc.name:Acts_ContinuousTask_0300
* @tc.desc:verify old startBackgroundrunning interface promise mode work properly
* @tc.type: FUNC
* @tc.require: SR000GGT7V AR000GH6ER AR000GH6EM AR000GH6G9 AR000GH56K
*/
it
(
"
Acts_ContinuousTask_0300
"
,
0
,
async
function
(
done
)
{
console
.
log
(
"
Acts_ContinuousTask_0300 start
"
);
let
wantAgentInfo
=
{
wants
:
[
{
bundleName
:
"
com.example.actsfeatureabilitytest
"
,
abilityName
:
"
com.example.actsfeatureabilitytest.MainAbility
"
}
],
operationType
:
2
,
requestCode
:
0
,
wantAgentFlags
:
[
3
]
};
wantAgent
.
getWantAgent
(
wantAgentInfo
).
then
((
data
)
=>
{
let
basicContent
=
{
title
:
"
title
"
,
text
:
"
text
"
};
let
notificationContent
=
{
contentType
:
notification
.
ContentType
.
NOTIFICATION_CONTENT_BASIC_TEXT
,
normal
:
basicContent
};
let
request
=
{
content
:
notificationContent
,
wantAgent
:
data
}
let
id
=
1
;
particleAbility
.
startBackgroundRunning
(
id
,
request
).
then
((
data
)
=>
{
console
.
log
(
"
Acts_ContinuousTask_0300 startBackgroundRunning success
"
);
expect
(
true
).
assertTrue
();
setTimeout
(()
=>
{
done
();
},
500
);
}).
catch
((
err
)
=>
{
expect
(
false
).
assertTrue
();
console
.
log
(
"
Acts_ContinuousTask_0300 startBackgroundRunning failure
"
);
setTimeout
(()
=>
{
done
();
},
500
);
});
});
})
/*
* @tc.name:Acts_ContinuousTask_0400
* @tc.desc:verify old startBackgroundrunning interface callback mode work properly
* @tc.type: FUNC
* @tc.require: SR000GGT81 AR000GH6ER AR000GH6EM AR000GH6G9 AR000GH6ET
*/
it
(
"
Acts_ContinuousTask_0400
"
,
0
,
async
function
(
done
)
{
console
.
log
(
"
Acts_ContinuousTask_0400 start
"
);
function
conTaskCallback
(
err
,
data
)
{
if
(
err
)
{
console
.
info
(
'
Acts_ContinuousTask_0400 startBackgroundRunning failure
'
);
expect
(
false
).
assertTrue
();
}
else
{
console
.
info
(
'
Acts_ContinuousTask_0400 startBackgroundRunning success
'
);
expect
(
true
).
assertTrue
();
}
setTimeout
(()
=>
{
done
();
},
500
);
}
let
wantAgentInfo
=
{
wants
:
[
{
bundleName
:
"
com.example.actsfeatureabilitytest
"
,
abilityName
:
"
com.example.actsfeatureabilitytest.MainAbility
"
}
],
operationType
:
2
,
requestCode
:
0
,
wantAgentFlags
:
[
3
]
};
wantAgent
.
getWantAgent
(
wantAgentInfo
).
then
((
data
)
=>
{
let
basicContent
=
{
title
:
"
title
"
,
text
:
"
text
"
};
let
notificationContent
=
{
contentType
:
notification
.
ContentType
.
NOTIFICATION_CONTENT_BASIC_TEXT
,
normal
:
basicContent
};
let
request
=
{
content
:
notificationContent
,
wantAgent
:
data
}
let
id
=
1
;
particleAbility
.
startBackgroundRunning
(
id
,
request
,
conTaskCallback
);
});
})
/*
* @tc.name:Acts_ContinuousTask_0500
* @tc.desc:verify new api stopBackgroundrunning interface promise mode work properly
* @tc.type: FUNC
* @tc.require: SR000GGT7U AR000GH6ES AR000GH6EM AR000GH6EN AR000GH6EO
*/
it
(
"
Acts_ContinuousTask_0500
"
,
0
,
async
function
(
done
)
{
console
.
log
(
"
Acts_ContinuousTask_0500 start
"
);
let
wantAgentInfo
=
{
wants
:
[
{
bundleName
:
"
com.example.actsfeatureabilitytest
"
,
abilityName
:
"
com.example.actsfeatureabilitytest.MainAbility
"
}
],
operationType
:
2
,
requestCode
:
0
,
wantAgentFlags
:
[
3
]
};
wantAgent
.
getWantAgent
(
wantAgentInfo
).
then
((
data
)
=>
{
backgroundTaskManager
.
startBackgroundRunning
(
featureAbility
.
getContext
(),
backgroundTaskManager
.
BackgroundMode
.
DATA_TRANSFER
,
data
).
then
((
data
)
=>
{
backgroundTaskManager
.
stopBackgroundRunning
(
featureAbility
.
getContext
()).
then
((
data
)
=>
{
console
.
log
(
"
Acts_ContinuousTask_0500 cancelBackgroundRunning success
"
);
expect
(
true
).
assertTrue
();
setTimeout
(()
=>
{
done
();
},
500
);
}).
catch
((
err
)
=>
{
expect
(
false
).
assertTrue
();
console
.
log
(
"
Acts_ContinuousTask_0500 cancelBackgroundRunning failure
"
);
setTimeout
(()
=>
{
done
();
},
500
);
});
})
});
})
/*
* @tc.name:Acts_ContinuousTask_0600
* @tc.desc:verify new api stopBackgroundrunning interface callback mode work properly
* @tc.type: FUNC
* @tc.require: SR000GGT7T AR000GH6ES AR000GH6EP AR000GJ9PR AR000GH6G8
*/
it
(
"
Acts_ContinuousTask_0600
"
,
0
,
async
function
(
done
)
{
console
.
log
(
"
Acts_ContinuousTask_0600 start
"
);
function
conTaskCallback
(
err
,
data
)
{
if
(
err
)
{
console
.
info
(
'
Acts_ContinuousTask_0600 startBackgroundRunning failure
'
);
expect
(
false
).
assertTrue
();
}
else
{
console
.
info
(
'
Acts_ContinuousTask_0600 startBackgroundRunning success
'
);
expect
(
true
).
assertTrue
();
}
setTimeout
(()
=>
{
done
();
},
500
);
}
let
wantAgentInfo
=
{
wants
:
[
{
bundleName
:
"
com.example.actsfeatureabilitytest
"
,
abilityName
:
"
com.example.actsfeatureabilitytest.MainAbility
"
}
],
operationType
:
2
,
requestCode
:
0
,
wantAgentFlags
:
[
3
]
};
wantAgent
.
getWantAgent
(
wantAgentInfo
).
then
((
data
)
=>
{
backgroundTaskManager
.
startBackgroundRunning
(
featureAbility
.
getContext
(),
backgroundTaskManager
.
BackgroundMode
.
DATA_TRANSFER
,
data
).
then
((
data
)
=>
{
backgroundTaskManager
.
stopBackgroundRunning
(
featureAbility
.
getContext
(),
conTaskCallback
);
})
});
})
/*
* @tc.name:Acts_ContinuousTask_0700
* @tc.desc:verify old api cancelBackgroundrunning interface promise mode work properly
* @tc.type: FUNC
* @tc.require: SR000GGT7V AR000GH6ES AR000GH6EM AR000GH6G9 AR000GH56K
*/
it
(
"
Acts_ContinuousTask_0700
"
,
0
,
async
function
(
done
)
{
console
.
log
(
"
Acts_ContinuousTask_0700 start
"
);
let
wantAgentInfo
=
{
wants
:
[
{
bundleName
:
"
com.example.actsfeatureabilitytest
"
,
abilityName
:
"
com.example.actsfeatureabilitytest.MainAbility
"
}
],
operationType
:
2
,
requestCode
:
0
,
wantAgentFlags
:
[
3
]
};
await
wantAgent
.
getWantAgent
(
wantAgentInfo
).
then
((
data
)
=>
{
particleAbility
.
startBackgroundRunning
(
data
);
setTimeout
(()
=>
{
},
500
);
});
particleAbility
.
cancelBackgroundRunning
().
then
(()
=>
{
console
.
log
(
"
Acts_ContinuousTask_0700 cancelBackgroundRunning success
"
);
expect
(
true
).
assertTrue
();
setTimeout
(()
=>
{
done
();
},
500
);
}).
catch
(
(
err
)
=>
{
expect
(
false
).
assertTrue
();
console
.
log
(
"
Acts_ContinuousTask_0700 cancelBackgroundRunning failure
"
);
setTimeout
(()
=>
{
done
();
},
500
);
});
})
/*
* @tc.name:Acts_ContinuousTask_0800
* @tc.desc:verify old cancelBackgroundrunning interface callback mode work properly
* @tc.type: FUNC
* @tc.require: SR000GGT81 AR000GH6ES AR000GH6EM AR000GH6G9 AR000GH6ET
*/
it
(
"
Acts_ContinuousTask_0800
"
,
0
,
async
function
(
done
)
{
console
.
log
(
"
Acts_ContinuousTask_0800 start
"
);
function
conTaskCallback
(
err
,
data
)
{
if
(
err
)
{
console
.
info
(
'
Acts_ContinuousTask_0800 startBackgroundRunning failure
'
);
expect
(
false
).
assertTrue
();
}
else
{
console
.
info
(
'
Acts_ContinuousTask_0800 startBackgroundRunning success
'
);
expect
(
true
).
assertTrue
();
}
setTimeout
(()
=>
{
done
();
},
500
);
}
let
wantAgentInfo
=
{
wants
:
[
{
bundleName
:
"
com.example.actsfeatureabilitytest
"
,
abilityName
:
"
com.example.actsfeatureabilitytest.MainAbility
"
}
],
operationType
:
2
,
requestCode
:
0
,
wantAgentFlags
:
[
3
]
};
await
wantAgent
.
getWantAgent
(
wantAgentInfo
).
then
((
data
)
=>
{
particleAbility
.
startBackgroundRunning
(
data
);
setTimeout
(()
=>
{
},
500
);
});
particleAbility
.
cancelBackgroundRunning
(
conTaskCallback
);
})
/**
* @tc.number: ACTS_wantConstant_0100
* @tc.name: wantConstant : Check specific enum
...
...
aafwk/aafwk_standard/stage/BUILD.gn
已删除
100755 → 0
浏览文件 @
81979d52
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
group("stage") {
testonly = true
if (is_standard_system) {
deps = [ "stage_extension_service:StageExtensionServiceTest" ]
}
}
aafwk/aafwk_standard/stage/stage_extension_service/BUILD.gn
已删除
100755 → 0
浏览文件 @
81979d52
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("StageExtensionServiceTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":stage_extension_service_assets",
":stage_extension_service_resources",
]
ets2abc = true
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsStageExtensionServiceTest"
}
ohos_js_assets("stage_extension_service_assets") {
source_dir = "./entry/src/main/ets/MainAbility"
}
ohos_resources("stage_extension_service_resources") {
sources = [ "./entry/src/main/resources" ]
hap_profile = "./entry/src/main/config.json"
}
aafwk/aafwk_standard/stage/stage_extension_service/Test.json
已删除
100755 → 0
浏览文件 @
81979d52
{
"description"
:
"Configuration for serviceExtension Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"600000"
,
"package"
:
"com.example.serviceextension"
,
"shell-timeout"
:
"60000"
},
"kits"
:
[
{
"test-file-name"
:
[
"ActsStageExtensionServiceTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
}
]
}
aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/config.json
已删除
100755 → 0
浏览文件 @
81979d52
{
"app"
:
{
"bundleName"
:
"com.example.serviceextension"
,
"vendor"
:
"example"
,
"version"
:
{
"code"
:
1000000
,
"name"
:
"1.0.0"
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"com.example.serviceextension"
,
"name"
:
".MyApplication"
,
"mainAbility"
:
".MainAbility"
,
"srcPath"
:
""
,
"deviceType"
:
[
"phone"
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
,
"installationFree"
:
false
},
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"orientation"
:
"unspecified"
,
"visible"
:
true
,
"srcPath"
:
"MainAbility"
,
"name"
:
".MainAbility"
,
"srcLanguage"
:
"ets"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:description_mainability"
,
"formsEnabled"
:
false
,
"label"
:
"$string:entry_MainAbility"
,
"type"
:
"page"
,
"launchType"
:
"standard"
},
{
"srcPath"
:
"ServiceAbility"
,
"name"
:
".ServiceAbility"
,
"icon"
:
"$media:icon"
,
"srcLanguage"
:
"ets"
,
"description"
:
"$string:description_serviceability"
,
"type"
:
"service"
},
{
"srcPath"
:
"ServiceAbility2"
,
"name"
:
".ServiceAbility2"
,
"icon"
:
"$media:icon"
,
"srcLanguage"
:
"ets"
,
"description"
:
"$string:description_serviceability2"
,
"type"
:
"service"
}
],
"js"
:
[
{
"mode"
:
{
"syntax"
:
"ets"
,
"type"
:
"pageAbility"
},
"pages"
:
[
"pages/index"
,
"pages/second"
],
"name"
:
".MainAbility"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
]
}
}
\ No newline at end of file
aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/AbilityStage.ts
已删除
100755 → 0
浏览文件 @
81979d52
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
AbilityStage
from
"
@ohos.application.AbilityStage
"
export
default
class
MyAbilityStage
extends
AbilityStage
{
onCreate
()
{
console
.
log
(
"
MyAbilityStage onCreate
"
)
globalThis
.
stageOnCreateRun
=
1
;
globalThis
.
stageContext
=
this
.
context
;
globalThis
.
lifeCycleList
=
[];
}
}
aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/MainAbility/MainAbility.ts
已删除
100755 → 0
浏览文件 @
81979d52
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
Ability
from
'
@ohos.application.Ability
'
export
default
class
MainAbility
extends
Ability
{
onCreate
(
want
,
launchParam
)
{
// Ability is creating, initialize resources for this ability
console
.
log
(
"
MainAbility onCreate
"
)
globalThis
.
abilityWant
=
want
;
}
onDestroy
()
{
// Ability is destroying, release resources for this ability
console
.
log
(
"
MainAbility onDestroy
"
)
}
onWindowStageCreate
(
windowStage
)
{
// Main window is created, set main page for this ability
console
.
log
(
"
MainAbility onWindowStageCreate
"
)
globalThis
.
abilityContext
=
this
.
context
windowStage
.
setUIContent
(
this
.
context
,
"
pages/index
"
,
null
)
}
onWindowStageDestroy
()
{
// Main window is destroyed, release UI related resources
console
.
log
(
"
MainAbility onWindowStageDestroy
"
)
}
onForeground
()
{
// Ability has brought to foreground
console
.
log
(
"
MainAbility onForeground
"
)
}
onBackground
()
{
// Ability has back to background
console
.
log
(
"
MainAbility onBackground
"
)
}
};
aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/MainAbility/app.ets
已删除
100755 → 0
浏览文件 @
81979d52
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export default {
onCreate() {
console.info('Application onCreate')
},
onDestroy() {
console.info('Application onDestroy')
},
}
aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/MainAbility/pages/index.ets
已删除
100755 → 0
浏览文件 @
81979d52
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import file from '@system.file';
import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index.ets"
import testsuite from "../../test/List.test.ets"
@Entry
@Component
struct Index {
aboutToAppear() {
console.info("start run testcase!!!!")
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
const reportExtend = new ReportExtend(file)
core.addService('report', reportExtend)
core.init()
core.subscribeEvent('task', reportExtend)
const configService = core.getDefaultService('config')
console.info('parameters---->' + JSON.stringify(globalThis.abilityWant.parameters))
configService.setConfig(globalThis.abilityWant.parameters)
testsuite(globalThis.abilityContext)
core.execute()
}
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text('Hello World 111!')
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(25)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
})
}
.width('100%')
.height('100%')
}
}
aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/MainAbility/pages/second.ets
已删除
100755 → 0
浏览文件 @
81979d52
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import router from '@system.router';
@Entry
@Component
struct Second {
private content: string = "Second Page"
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text(`${this.content}`)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('back to index')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
router.back()
})
}
.width('100%')
.height('100%')
}
}
aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/ServiceAbility/ServiceAbility.ts
已删除
100755 → 0
浏览文件 @
81979d52
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
ServiceExtension
from
"
@ohos.application.ServiceExtension
"
export
default
class
MyServiceAbility
extends
ServiceExtension
{
onCreate
(
want
){
console
.
log
(
'
MyApplication.MyServiceExtension onCreate
'
+
JSON
.
stringify
(
want
));
globalThis
.
extensionContext
=
this
.
context
;
}
onDestroy
(){
console
.
log
(
'
[MyApplication] MyServiceExtension onDestroy
'
);
}
onRequest
(
want
,
startId
){
console
.
log
(
'
[MyApplication] MyServiceExtension onRequest
'
+
JSON
.
stringify
(
want
)
+
JSON
.
stringify
(
startId
));
}
onConnect
(
want
){
console
.
log
(
'
[MyApplication] MyServiceExtension onConnect
'
+
JSON
.
stringify
(
want
));
}
onDisconnect
(
want
){
console
.
log
(
'
[MyApplication] MyServiceExtension onConnect
'
+
JSON
.
stringify
(
want
));
}
onReconnect
(
want
){
console
.
log
(
'
[MyApplication] MyServiceExtension onConnect
'
+
JSON
.
stringify
(
want
));
}
}
aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/ServiceAbility/service.ts
已删除
100755 → 0
浏览文件 @
81979d52
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export
default
{
onStart
()
{
console
.
info
(
'
ServiceAbility onStart
'
);
},
onStop
()
{
console
.
info
(
'
ServiceAbility onStop
'
);
},
onCommand
(
want
,
startId
)
{
console
.
info
(
'
ServiceAbility onCommand
'
);
}
};
aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts
已删除
100755 → 0
浏览文件 @
81979d52
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
ServiceExtension
from
"
@ohos.application.ServiceExtension
"
export
default
class
MyServiceAbility
extends
ServiceExtension
{
onCreate
(
want
){
console
.
log
(
'
ServiceAbility2 onCreate
'
+
JSON
.
stringify
(
want
));
globalThis
.
extensionContext2
=
this
.
context
;
globalThis
.
lifeCycleList
.
push
(
'
ServiceAbility2_onCreate
'
);
console
.
log
(
'
ServiceAbility2 lifeCycleList is
'
+
JSON
.
stringify
(
globalThis
.
lifeCycleList
));
}
onDestroy
(){
console
.
log
(
'
ServiceAbility2 onDestroy
'
);
globalThis
.
lifeCycleList
.
push
(
'
ServiceAbility2_onDestroy
'
);
console
.
log
(
'
ServiceAbility2 lifeCycleList is
'
+
JSON
.
stringify
(
globalThis
.
lifeCycleList
));
}
onRequest
(
want
,
startId
){
console
.
log
(
'
ServiceAbility2 onRequest
'
+
JSON
.
stringify
(
want
)
+
JSON
.
stringify
(
startId
));
globalThis
.
lifeCycleList
.
push
(
'
ServiceAbility2_onRequest
'
);
globalThis
.
startId2
=
startId
;
globalThis
.
serviceWant2
=
want
;
console
.
log
(
"
ServiceAbility2 serviceWant2 is
"
+
JSON
.
stringify
(
globalThis
.
serviceWant2
));
console
.
log
(
'
ServiceAbility2 lifeCycleList is
'
+
JSON
.
stringify
(
globalThis
.
lifeCycleList
));
setTimeout
(()
=>
{
this
.
context
.
terminateSelf
().
then
((
data
)
=>
{
console
.
log
(
"
ServiceAbility2 terminateSelf data:
"
+
JSON
.
stringify
(
data
))
}).
catch
((
error
)
=>
{
console
.
log
(
"
ServiceAbility2 terminateSelf error:
"
+
JSON
.
stringify
(
error
))
});
},
1000
);
}
onConnect
(
want
){
console
.
log
(
'
ServiceAbility2 onConnect
'
+
JSON
.
stringify
(
want
));
globalThis
.
lifeCycleList
.
push
(
'
ServiceAbility2_onConnect
'
);
console
.
log
(
'
ServiceAbility2 lifeCycleList is
'
+
JSON
.
stringify
(
globalThis
.
lifeCycleList
));
}
onDisconnect
(
want
){
console
.
log
(
'
ServiceAbility2 onDisconnect
'
+
JSON
.
stringify
(
want
));
globalThis
.
lifeCycleList
.
push
(
'
ServiceAbility2_onDisconnect
'
);
console
.
log
(
'
ServiceAbility2 lifeCycleList is
'
+
JSON
.
stringify
(
globalThis
.
lifeCycleList
));
}
onReconnect
(
want
){
console
.
log
(
'
ServiceAbility2 onReconnect
'
+
JSON
.
stringify
(
want
));
globalThis
.
lifeCycleList
.
push
(
'
ServiceAbility2_onReconnect
'
);
console
.
log
(
'
ServiceAbility2 lifeCycleList is
'
+
JSON
.
stringify
(
globalThis
.
lifeCycleList
));
}
}
aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/ServiceAbility2/service.ts
已删除
100755 → 0
浏览文件 @
81979d52
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export
default
{
onStart
()
{
console
.
info
(
'
ServiceAbility onStart
'
);
},
onStop
()
{
console
.
info
(
'
ServiceAbility onStop
'
);
},
onCommand
(
want
,
startId
)
{
console
.
info
(
'
ServiceAbility onCommand
'
);
}
};
aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/test/ExtensionTest.test.ets
已删除
100755 → 0
浏览文件 @
81979d52
此差异已折叠。
点击以展开。
aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/ets/test/List.test.ets
已删除
100755 → 0
浏览文件 @
81979d52
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permisrsions and
* limitations under the License.
*/
import ExtensionTest from './ExtensionTest.test.ets'
export default function testsuite(context) {
ExtensionTest(context)
}
\ No newline at end of file
aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/resources/base/element/string.json
已删除
100755 → 0
浏览文件 @
81979d52
{
"string"
:
[
{
"name"
:
"entry_MainAbility"
,
"value"
:
"entry_MainAbility"
},
{
"name"
:
"description_mainability"
,
"value"
:
"eTS_Empty Ability"
},
{
"name"
:
"description_serviceability"
,
"value"
:
"hap sample empty service"
},
{
"name"
:
"description_serviceability2"
,
"value"
:
"hap sample empty service"
}
]
}
\ No newline at end of file
aafwk/aafwk_standard/stage/stage_extension_service/entry/src/main/resources/base/media/icon.png
已删除
100755 → 0
浏览文件 @
81979d52
6.6 KB
aafwk/aafwk_standard/stage/stage_extension_service/signature/openharmony_sx.p7b
已删除
100755 → 0
浏览文件 @
81979d52
文件已删除
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录