Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
aefe5de5
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看板
提交
aefe5de5
编写于
3月 12, 2022
作者:
G
gaoxi785
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update account xts code for release branch
Signed-off-by:
N
gaoxi785
<
gaoxi785@huawei.com
>
上级
e97667db
变更
34
隐藏空白更改
内联
并排
Showing
34 changed file
with
3982 addition
and
8 deletion
+3982
-8
account/appaccount/actsaccounttest/Test.json
account/appaccount/actsaccounttest/Test.json
+3
-2
account/appaccount/actsaccounttest/entry/src/main/js/test/List.test.js
...count/actsaccounttest/entry/src/main/js/test/List.test.js
+1
-0
account/appaccount/actsaccounttest/entry/src/main/js/test/OAuthToken.test.js
...actsaccounttest/entry/src/main/js/test/OAuthToken.test.js
+3385
-0
account/appaccount/actsgetallaccounts/entry/src/main/config.json
.../appaccount/actsgetallaccounts/entry/src/main/config.json
+2
-2
account/appaccount/getallaccessibleaccounts/actsgetallaccessibleaccounts/entry/src/main/config.json
...s/actsgetallaccessibleaccounts/entry/src/main/config.json
+2
-2
account/appaccount/getallaccessibleaccounts/actsgetallaccessiblemultiple/entry/src/main/config.json
...s/actsgetallaccessiblemultiple/entry/src/main/config.json
+2
-2
account/appaccount/sceneProject/BUILD.gn
account/appaccount/sceneProject/BUILD.gn
+1
-0
account/appaccount/sceneProject/actsaccountoauthtoken/BUILD.gn
...nt/appaccount/sceneProject/actsaccountoauthtoken/BUILD.gn
+34
-0
account/appaccount/sceneProject/actsaccountoauthtoken/Test.json
...t/appaccount/sceneProject/actsaccountoauthtoken/Test.json
+3
-0
account/appaccount/sceneProject/actsaccountoauthtoken/entry/src/main/config.json
...eProject/actsaccountoauthtoken/entry/src/main/config.json
+62
-0
account/appaccount/sceneProject/actsaccountoauthtoken/entry/src/main/js/default/app.js
...ct/actsaccountoauthtoken/entry/src/main/js/default/app.js
+22
-0
account/appaccount/sceneProject/actsaccountoauthtoken/entry/src/main/js/default/i18n/en-US.json
...countoauthtoken/entry/src/main/js/default/i18n/en-US.json
+6
-0
account/appaccount/sceneProject/actsaccountoauthtoken/entry/src/main/js/default/i18n/zh-CN.json
...countoauthtoken/entry/src/main/js/default/i18n/zh-CN.json
+6
-0
account/appaccount/sceneProject/actsaccountoauthtoken/entry/src/main/js/default/pages/index/index.css
...authtoken/entry/src/main/js/default/pages/index/index.css
+9
-0
account/appaccount/sceneProject/actsaccountoauthtoken/entry/src/main/js/default/pages/index/index.hml
...authtoken/entry/src/main/js/default/pages/index/index.hml
+5
-0
account/appaccount/sceneProject/actsaccountoauthtoken/entry/src/main/js/default/pages/index/index.js
...oauthtoken/entry/src/main/js/default/pages/index/index.js
+70
-0
account/appaccount/sceneProject/actsaccountoauthtoken/entry/src/main/js/resources/base/element/string.json
...oken/entry/src/main/js/resources/base/element/string.json
+12
-0
account/appaccount/sceneProject/actsaccountoauthtoken/entry/src/main/js/resources/base/media/icon.png
...authtoken/entry/src/main/js/resources/base/media/icon.png
+0
-0
account/appaccount/sceneProject/actsaccountoauthtoken/signature/openharmony_sx.p7b
...roject/actsaccountoauthtoken/signature/openharmony_sx.p7b
+0
-0
account/osaccount/BUILD.gn
account/osaccount/BUILD.gn
+1
-0
account/osaccount/actsosaccountdomaintest/BUILD.gn
account/osaccount/actsosaccountdomaintest/BUILD.gn
+31
-0
account/osaccount/actsosaccountdomaintest/Test.json
account/osaccount/actsosaccountdomaintest/Test.json
+18
-0
account/osaccount/actsosaccountdomaintest/entry/src/main/config.json
...ccount/actsosaccountdomaintest/entry/src/main/config.json
+94
-0
account/osaccount/actsosaccountdomaintest/entry/src/main/js/default/app.js
.../actsosaccountdomaintest/entry/src/main/js/default/app.js
+22
-0
account/osaccount/actsosaccountdomaintest/entry/src/main/js/default/i18n/en-US.json
...countdomaintest/entry/src/main/js/default/i18n/en-US.json
+6
-0
account/osaccount/actsosaccountdomaintest/entry/src/main/js/default/i18n/zh-CN.json
...countdomaintest/entry/src/main/js/default/i18n/zh-CN.json
+6
-0
account/osaccount/actsosaccountdomaintest/entry/src/main/js/default/pages/index/index.css
...omaintest/entry/src/main/js/default/pages/index/index.css
+12
-0
account/osaccount/actsosaccountdomaintest/entry/src/main/js/default/pages/index/index.hml
...omaintest/entry/src/main/js/default/pages/index/index.hml
+8
-0
account/osaccount/actsosaccountdomaintest/entry/src/main/js/default/pages/index/index.js
...domaintest/entry/src/main/js/default/pages/index/index.js
+46
-0
account/osaccount/actsosaccountdomaintest/entry/src/main/js/resources/base/element/string.json
...test/entry/src/main/js/resources/base/element/string.json
+12
-0
account/osaccount/actsosaccountdomaintest/entry/src/main/js/resources/base/media/icon.png
...omaintest/entry/src/main/js/resources/base/media/icon.png
+0
-0
account/osaccount/actsosaccountdomaintest/entry/src/main/js/test/DomainInfo.test.js
...countdomaintest/entry/src/main/js/test/DomainInfo.test.js
+86
-0
account/osaccount/actsosaccountdomaintest/entry/src/main/js/test/List.test.js
...tsosaccountdomaintest/entry/src/main/js/test/List.test.js
+15
-0
account/osaccount/actsosaccountdomaintest/signature/openharmony_sx.p7b
...ount/actsosaccountdomaintest/signature/openharmony_sx.p7b
+0
-0
未找到文件。
account/appaccount/actsaccounttest/Test.json
浏览文件 @
aefe5de5
...
...
@@ -2,7 +2,7 @@
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"
5
00000"
,
"test-timeout"
:
"
30
00000"
,
"package"
:
"com.example.actsaccounttest"
,
"shell-timeout"
:
"60000"
},
...
...
@@ -11,7 +11,8 @@
"test-file-name"
:
[
"ActsAccountTest.hap"
,
"ActsAccountSceneAppAccess.hap"
,
"ActsAccountSceneOnOff.hap"
"ActsAccountSceneOnOff.hap"
,
"ActsAccountOauthtoken.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
...
...
account/appaccount/actsaccounttest/entry/src/main/js/test/List.test.js
浏览文件 @
aefe5de5
...
...
@@ -18,6 +18,7 @@ require('./AppAccess.test.js')
require
(
'
./ExtraInfo.test.js
'
)
require
(
'
./AssociatedData.test.js
'
)
require
(
'
./Credential.test.js
'
)
require
(
'
./OAuthToken.test.js
'
)
require
(
'
./CreatManager.test.js
'
)
require
(
'
./NoPermission.test.js
'
)
require
(
'
./OnOff.js
'
)
\ No newline at end of file
account/appaccount/actsaccounttest/entry/src/main/js/test/OAuthToken.test.js
0 → 100644
浏览文件 @
aefe5de5
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
account/appaccount/actsgetallaccounts/entry/src/main/config.json
浏览文件 @
aefe5de5
...
...
@@ -28,12 +28,12 @@
{
"availableScope"
:
[],
"grantMode"
:
"system_grant"
,
"name"
:
"ohos.permission.GET_A
CCOUNTS_PRIVILEGED
"
"name"
:
"ohos.permission.GET_A
LL_APP_ACCOUNTS
"
}
],
"reqPermissions"
:
[
{
"name"
:
"ohos.permission.GET_A
CCOUNTS_PRIVILEGED
"
,
"name"
:
"ohos.permission.GET_A
LL_APP_ACCOUNTS
"
,
"reason"
:
"ceshi"
},
{
...
...
account/appaccount/getallaccessibleaccounts/actsgetallaccessibleaccounts/entry/src/main/config.json
浏览文件 @
aefe5de5
...
...
@@ -28,12 +28,12 @@
{
"availableScope"
:
[],
"grantMode"
:
"system_grant"
,
"name"
:
"ohos.permission.GET_A
CCOUNTS_PRIVILEGED
"
"name"
:
"ohos.permission.GET_A
LL_APP_ACCOUNTS
"
}
],
"reqPermissions"
:
[
{
"name"
:
"ohos.permission.GET_A
CCOUNTS_PRIVILEGED
"
,
"name"
:
"ohos.permission.GET_A
LL_APP_ACCOUNTS
"
,
"reason"
:
"ceshi"
},
{
...
...
account/appaccount/getallaccessibleaccounts/actsgetallaccessiblemultiple/entry/src/main/config.json
浏览文件 @
aefe5de5
...
...
@@ -28,12 +28,12 @@
{
"availableScope"
:
[],
"grantMode"
:
"system_grant"
,
"name"
:
"ohos.permission.GET_A
CCOUNTS_PRIVILEGED
"
"name"
:
"ohos.permission.GET_A
LL_APP_ACCOUNTS
"
}
],
"reqPermissions"
:
[
{
"name"
:
"ohos.permission.GET_A
CCOUNTS_PRIVILEGED
"
,
"name"
:
"ohos.permission.GET_A
LL_APP_ACCOUNTS
"
,
"reason"
:
"ceshi"
},
{
...
...
account/appaccount/sceneProject/BUILD.gn
浏览文件 @
aefe5de5
...
...
@@ -19,6 +19,7 @@ group("appaccount_scene") {
deps = [
"actsaccountaccessibleFirst:ActsAccountAccessibleFirst",
"actsaccountaccessibleSecond:ActsAccountAccessibleSecond",
"actsaccountoauthtoken:ActsAccountOauthtoken",
"actsaccountsceneaccessible:ActsAccountSceneAccessible",
"actsaccountsceneappaccess:ActsAccountSceneAppAccess",
"actsaccountsceneonoff:ActsAccountSceneOnOff",
...
...
account/appaccount/sceneProject/actsaccountoauthtoken/BUILD.gn
0 → 100644
浏览文件 @
aefe5de5
# 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_hap("ActsAccountOauthtoken") {
hap_profile = "./entry/src/main/config.json"
hap_name = "ActsAccountOauthtoken"
subsystem_name = XTS_SUITENAME
final_hap_path =
"${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap"
testonly = true
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
account/appaccount/sceneProject/actsaccountoauthtoken/Test.json
0 → 100644
浏览文件 @
aefe5de5
{
"description"
:
"Configuration for hjunit demo Tests"
,
}
account/appaccount/sceneProject/actsaccountoauthtoken/entry/src/main/config.json
0 → 100644
浏览文件 @
aefe5de5
{
"app"
:
{
"bundleName"
:
"com.example.actsaccountOauthtoken"
,
"vendor"
:
"example"
,
"version"
:
{
"code"
:
1
,
"name"
:
"1.0"
},
"apiVersion"
:
{
"compatible"
:
4
,
"target"
:
5
,
"releaseType"
:
"Beta1"
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"com.example.actsaccountOauthtoken"
,
"name"
:
".MyApplication"
,
"deviceType"
:
[
"phone"
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
},
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
,
"ohos.account.appAccount.action.oauth"
]
}
],
"name"
:
"com.example.actsaccountOauthtoken.MainAbility"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:mainability_description"
,
"label"
:
"$string:app_name"
,
"type"
:
"service"
,
"visible"
:
true
,
"launchType"
:
"standard"
}
],
"js"
:
[
{
"pages"
:
[
"pages/index/index"
],
"name"
:
"default"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
]
}
}
\ No newline at end of file
account/appaccount/sceneProject/actsaccountoauthtoken/entry/src/main/js/default/app.js
0 → 100644
浏览文件 @
aefe5de5
/*
* 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
(
'
AceApplication onCreate
'
);
},
onDestroy
()
{
console
.
info
(
'
AceApplication onDestroy
'
);
}
};
account/appaccount/sceneProject/actsaccountoauthtoken/entry/src/main/js/default/i18n/en-US.json
0 → 100644
浏览文件 @
aefe5de5
{
"strings"
:
{
"hello"
:
"Hello"
,
"world"
:
"World"
}
}
\ No newline at end of file
account/appaccount/sceneProject/actsaccountoauthtoken/entry/src/main/js/default/i18n/zh-CN.json
0 → 100644
浏览文件 @
aefe5de5
{
"strings"
:
{
"hello"
:
"您好"
,
"world"
:
"世界"
}
}
\ No newline at end of file
account/appaccount/sceneProject/actsaccountoauthtoken/entry/src/main/js/default/pages/index/index.css
0 → 100644
浏览文件 @
aefe5de5
.container
{
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
}
.title
{
font-size
:
100px
;
}
account/appaccount/sceneProject/actsaccountoauthtoken/entry/src/main/js/default/pages/index/index.hml
0 → 100644
浏览文件 @
aefe5de5
<div class="container">
<text class="title">
{{title}}
</text>
</div>
account/appaccount/sceneProject/actsaccountoauthtoken/entry/src/main/js/default/pages/index/index.js
0 → 100644
浏览文件 @
aefe5de5
/*
* 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
appAccount
from
'
@ohos.account.appAccount
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
import
rpc
from
'
@ohos.rpc
'
;
class
MyAuthenticator
extends
appAccount
.
Authenticator
{
authenticate
(
name
,
authType
,
callerBundleName
,
options
,
callback
)
{
var
randNumber
=
Math
.
ceil
(
Math
.
random
()
*
10000
)
var
newTokenData
=
"
service/authenticate/tokenInfo
"
+
randNumber
;
console
.
log
(
"
Service authenticate name:
"
+
name
+
"
, authType:
"
+
authType
+
"
, options:
"
+
JSON
.
stringify
(
options
));
callback
.
onResult
(
0
,
{
"
name
"
:
name
,
"
authType
"
:
authType
,
"
token
"
:
newTokenData
});
}
addAccountImplicitly
(
authType
,
callerBundleName
,
options
,
callback
)
{
console
.
log
(
"
Service addAccountImplicitly authType:
"
+
authType
+
"
callerBundleName:
"
+
callerBundleName
+
"
options:
"
+
JSON
.
stringify
(
options
));
callback
.
onRequestRedirected
({
bundleName
:
"
com.huawei.openharmonyappdemo.service
"
,
abilityName
:
"
com.huawei.openharmonyappdemo.service.settingAbility
"
,
});
}
}
export
default
{
onStart
(
want
)
{
console
.
info
(
'
ServiceAbility onStart
'
);
},
onStop
()
{
console
.
info
(
'
ServiceAbility onStop
'
);
},
onConnect
(
want
)
{
console
.
info
(
'
ServiceAbility onConnect start
'
);
try
{
console
.
info
(
"
ServiceAbility want:
"
+
typeof
(
want
));
console
.
info
(
"
ServiceAbility want:
"
+
JSON
.
stringify
(
want
));
console
.
info
(
"
ServiceAbility want name:
"
+
want
.
bundleName
);
}
catch
(
err
){
console
.
info
(
"
ServiceAbility error:
"
+
err
);
}
console
.
info
(
'
ServiceAbility onConnect start
'
);
return
new
MyAuthenticator
();
},
onReconnect
(
want
)
{
console
.
info
(
'
ServiceAbility onReconnect
'
);
},
onDisconnect
(
want
)
{
console
.
info
(
'
ServiceAbility onDisconnect
'
);
console
.
info
(
"
ServiceAbility want:
"
+
JSON
.
stringify
(
want
));
},
onCommand
(
want
,
startId
)
{
console
.
info
(
'
ServiceAbility onCommand
'
);
console
.
info
(
"
ServiceAbility want:
"
+
JSON
.
stringify
(
want
));
console
.
info
(
"
ServiceAbility startId :
"
+
startId
);
}
};
\ No newline at end of file
account/appaccount/sceneProject/actsaccountoauthtoken/entry/src/main/js/resources/base/element/string.json
0 → 100644
浏览文件 @
aefe5de5
{
"string"
:
[
{
"name"
:
"app_name"
,
"value"
:
"ActsAccountSceneAppAccess"
},
{
"name"
:
"mainability_description"
,
"value"
:
"JS_Phone_Empty Feature Ability"
}
]
}
\ No newline at end of file
account/appaccount/sceneProject/actsaccountoauthtoken/entry/src/main/js/resources/base/media/icon.png
0 → 100644
浏览文件 @
aefe5de5
6.6 KB
account/appaccount/sceneProject/actsaccountoauthtoken/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
aefe5de5
文件已添加
account/osaccount/BUILD.gn
浏览文件 @
aefe5de5
...
...
@@ -17,6 +17,7 @@ group("osaccount_hap") {
testonly = true
if (is_standard_system) {
deps = [
"actsosaccountdomaintest:ActsOsAccountDomainTest",
"actsosaccountpermissiontest:osaccount_permission",
"actsosaccountsystemtest:ActsOsAccountSystemTest",
"actsosaccountthirdpartytest:ActsOsAccountThirdPartyTest",
...
...
account/osaccount/actsosaccountdomaintest/BUILD.gn
0 → 100644
浏览文件 @
aefe5de5
# 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("ActsOsAccountDomainTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsOsAccountDomainTest"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
account/osaccount/actsosaccountdomaintest/Test.json
0 → 100644
浏览文件 @
aefe5de5
{
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"200000"
,
"package"
:
"com.example.actsosaccountdomaintest"
,
"shell-timeout"
:
"60000"
},
"kits"
:
[
{
"test-file-name"
:
[
"ActsOsAccountDomainTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
}
]
}
account/osaccount/actsosaccountdomaintest/entry/src/main/config.json
0 → 100644
浏览文件 @
aefe5de5
{
"app"
:
{
"bundleName"
:
"com.example.actsosaccountdomaintest"
,
"vendor"
:
"example"
,
"version"
:
{
"code"
:
1
,
"name"
:
"1.0"
},
"apiVersion"
:
{
"compatible"
:
4
,
"target"
:
5
,
"releaseType"
:
"Beta1"
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"com.example.actsosaccountdomaintest"
,
"name"
:
".MyApplication"
,
"deviceType"
:
[
"phone"
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
},
"defPermissions"
:
[
{
"availableScope"
:
[],
"grantMode"
:
"system_grant"
,
"name"
:
"ohos.permission.MANAGE_LOCAL_ACCOUNTS"
}
],
"reqPermissions"
:
[
{
"name"
:
"ohos.permission.MANAGE_LOCAL_ACCOUNTS"
,
"reason"
:
"ceshi"
},
{
"name"
:
"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
,
"reason"
:
"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
},
{
"name"
:
"ohos.permission.GET_BUNDLE_INFO"
,
"reason"
:
"need use ohos.permission.GET_BUNDLE_INFO"
},
{
"name"
:
"ohos.permission.CHANGE_ABILITY_ENABLED_STATE"
,
"reason"
:
"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE"
},
{
"name"
:
"ohos.permission.REMOVE_CACHE_FILES"
,
"reason"
:
"need use ohos.permission.REMOVE_CACHE_FILES"
},
{
"name"
:
"ohos.permission.LISTEN_BUNDLE_CHANGE"
,
"reason"
:
"need use ohos.permission.LISTEN_BUNDLE_CHANGE"
}
],
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"name"
:
"com.example.actsosaccountdomaintest.MainAbility"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:mainability_description"
,
"label"
:
"$string:app_name"
,
"type"
:
"page"
,
"visible"
:
true
,
"launchType"
:
"standard"
}
],
"js"
:
[
{
"pages"
:
[
"pages/index/index"
],
"name"
:
"default"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
]
}
}
\ No newline at end of file
account/osaccount/actsosaccountdomaintest/entry/src/main/js/default/app.js
0 → 100644
浏览文件 @
aefe5de5
/*
* 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
(
'
AceApplication onCreate
'
);
},
onDestroy
()
{
console
.
info
(
'
AceApplication onDestroy
'
);
}
};
account/osaccount/actsosaccountdomaintest/entry/src/main/js/default/i18n/en-US.json
0 → 100644
浏览文件 @
aefe5de5
{
"strings"
:
{
"hello"
:
"Hello"
,
"world"
:
"World"
}
}
\ No newline at end of file
account/osaccount/actsosaccountdomaintest/entry/src/main/js/default/i18n/zh-CN.json
0 → 100644
浏览文件 @
aefe5de5
{
"strings"
:
{
"hello"
:
"您好"
,
"world"
:
"世界"
}
}
\ No newline at end of file
account/osaccount/actsosaccountdomaintest/entry/src/main/js/default/pages/index/index.css
0 → 100644
浏览文件 @
aefe5de5
.container
{
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
}
.title
{
font-size
:
100px
;
}
.titleST
{
font-size
:
32px
;
}
\ No newline at end of file
account/osaccount/actsosaccountdomaintest/entry/src/main/js/default/pages/index/index.hml
0 → 100644
浏览文件 @
aefe5de5
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
<text class="titleST">
STActsOsAccountDomainTest
</text>
</div>
account/osaccount/actsosaccountdomaintest/entry/src/main/js/default/pages/index/index.js
0 → 100644
浏览文件 @
aefe5de5
/*
* 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
}
from
'
deccjsunit/index
'
const
injectRef
=
Object
.
getPrototypeOf
(
global
)
||
global
injectRef
.
regeneratorRuntime
=
require
(
'
@babel/runtime/regenerator
'
)
export
default
{
data
:
{
title
:
""
},
onInit
()
{
this
.
title
=
this
.
$t
(
'
strings.world
'
);
},
onShow
()
{
console
.
info
(
'
onShow finish
'
)
const
core
=
Core
.
getInstance
()
const
expectExtend
=
new
ExpectExtend
({
'
id
'
:
'
extend
'
})
core
.
addService
(
'
expect
'
,
expectExtend
)
core
.
init
()
const
configService
=
core
.
getDefaultService
(
'
config
'
)
this
.
timeout
=
30000
;
configService
.
setConfig
(
this
)
require
(
'
../../../test/List.test
'
)
core
.
execute
()
},
onReady
()
{
},
}
\ No newline at end of file
account/osaccount/actsosaccountdomaintest/entry/src/main/js/resources/base/element/string.json
0 → 100644
浏览文件 @
aefe5de5
{
"string"
:
[
{
"name"
:
"app_name"
,
"value"
:
"ActsOsAccountDomainTest"
},
{
"name"
:
"mainability_description"
,
"value"
:
"JS_Phone_Empty Feature Ability"
}
]
}
\ No newline at end of file
account/osaccount/actsosaccountdomaintest/entry/src/main/js/resources/base/media/icon.png
0 → 100644
浏览文件 @
aefe5de5
6.6 KB
account/osaccount/actsosaccountdomaintest/entry/src/main/js/test/DomainInfo.test.js
0 → 100644
浏览文件 @
aefe5de5
/*
* 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
account
from
'
@ohos.account.osAccount
'
const
ERR_OSACCOUNT_SERVICE_INNER_DOMAIN_ALREADY_BIND_ERROR
=
4653103
;
describe
(
'
ActsOsAccountSystemTest
'
,
function
()
{
/**
* @tc.number ActsAccountDomainTest_0100
* @tc.name Test createOsAccountForDomain getOsAccountLocalIdFromDomain pormise
* @tc.desc Test createOsAccountForDomain getOsAccountLocalIdFromDomain API functionality
*/
it
(
'
ActsOsAccountDomainTest_0100
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountDomainTest_0100 start====
"
);
var
osAccountManager
=
account
.
getAccountManager
();
console
.
debug
(
"
====>createosAccountFormDomain start====
"
);
var
osAccountInfo
=
await
osAccountManager
.
createOsAccountForDomain
(
0
,{
domain
:
"
abc
"
,
accountName
:
"
abcdef
"
,
});
var
localId
=
osAccountInfo
.
localId
;
console
.
debug
(
"
====>OsAccountInfo
"
+
JSON
.
stringify
(
osAccountInfo
));
expect
(
osAccountInfo
.
localName
).
assertEqual
(
"
abc/abcdef
"
);
console
.
debug
(
"
====>createosAccountFromDomain end====
"
);
console
.
debug
(
"
====>getOsAccountLocalIdFromDomain start====
"
);
var
Number
=
await
osAccountManager
.
getOsAccountLocalIdFromDomain
({
domain
:
"
abc
"
,
accountName
:
"
abcdef
"
,
});
expect
(
Number
).
assertEqual
(
localId
);
console
.
debug
(
"
====>getOsAccountLocalIdFromDomain end====
"
);
osAccountManager
.
removeOsAccount
(
localId
);
console
.
debug
(
"
====>ActsOsAccountDomainTest_0100 end====
"
);
done
();
});
/**
* @tc.number ActsAccountDomainTest_0200
* @tc.name Test createOsAccountForDomain callback
* @tc.desc Test repeated call createOsAccountForDomain API functionality
*/
it
(
'
ActsOsAccountDomainTest_0200
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountDomainTest_0200 start====
"
);
var
osAccountManager
=
account
.
getAccountManager
();
console
.
debug
(
"
====>createosAccountFormDomain start====
"
);
osAccountManager
.
createOsAccountForDomain
(
0
,{
domain
:
"
def
"
,
accountName
:
"
abcdef
"
,
},
(
err
,
osAccountInfo
)
=>
{
console
.
debug
(
"
====>err
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>OsAccountInfo
"
+
JSON
.
stringify
(
osAccountInfo
));
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
osAccountInfo
.
localName
).
assertEqual
(
"
def/abcdef
"
);
var
localId
=
osAccountInfo
.
localId
;
console
.
debug
(
"
====>createosAccountFormDomain end====
"
);
console
.
debug
(
"
====>createosAccountFormDomain repeat start====
"
);
osAccountManager
.
createOsAccountForDomain
(
0
,{
domain
:
"
def
"
,
accountName
:
"
abcdef
"
,
},
(
err
,
OsAccountInfo
)
=>
{
console
.
debug
(
"
====>createOsAccountFormDomain repeat err :
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
ERR_OSACCOUNT_SERVICE_INNER_DOMAIN_ALREADY_BIND_ERROR
);
console
.
debug
(
"
====>createosAccountFormDomain repeat end====
"
);
osAccountManager
.
removeOsAccount
(
localId
,
(
err
)
=>
{
console
.
debug
(
"
====>removeOsAccount err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
0
);
console
.
debug
(
"
====>ActsOsAccountDomainTest_0200 end====
"
);
done
();
})
});
});
});
});
\ No newline at end of file
account/osaccount/actsosaccountdomaintest/entry/src/main/js/test/List.test.js
0 → 100644
浏览文件 @
aefe5de5
/*
* 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.
*/
require
(
'
./DomainInfo.test.js
'
)
\ No newline at end of file
account/osaccount/actsosaccountdomaintest/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
aefe5de5
文件已添加
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录