diff --git a/aafwk/aafwk_standard/BUILD.gn b/aafwk/aafwk_standard/BUILD.gn
index b1d2f499156a2d79c05b8304bce6667f8409f227..eb7367e7f3b3ca44580911810e04ceda3789c5f6 100644
--- a/aafwk/aafwk_standard/BUILD.gn
+++ b/aafwk/aafwk_standard/BUILD.gn
@@ -21,6 +21,7 @@ group("aafwk_standard") {
"context:context",
"featureability:featureability",
"formmanager:formmanager",
+ "setshowonlockscreen:setshowonlockscreen",
"want:want",
#"verifypermission:verifypermission"
diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js b/aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
index 4afcf7dd1d135e46268d232390e5128ad44ba515..c48788205e4b56c63d440e4d726fb2d30f22fe11 100644
--- a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
+++ b/aafwk/aafwk_standard/abilitymanager/actsamscallbackfifthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
@@ -159,7 +159,7 @@ describe('ActsAmsCallBackFifthScene', function () {
expect(info[i].uid).assertLarger(0);
expect(typeof (info[i].lastMemoryLevel)).assertEqual("number");
- expect(info[i].lastMemoryLevel).assertEqual(-1);
+ expect(info[i].lastMemoryLevel).assertEqual(1);
expect(typeof (info[i].weight)).assertEqual("number");
expect(info[i].weight).assertEqual(-1);
diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/test/MangerAbilityJsunit.test.js b/aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
index c24102920dabb67c16a539ce0347b3adf88c531a..2d2ba0a541ee2a461e17726ffe9edfed8f55c623 100644
--- a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
+++ b/aafwk/aafwk_standard/abilitymanager/actsamscallbackfirstscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
@@ -130,7 +130,7 @@ describe('ActsAmsCallBackFirstScene', function () {
expect(info[i].uid).assertLarger(0);
expect(typeof (info[i].lastMemoryLevel)).assertEqual("number");
- expect(info[i].lastMemoryLevel).assertEqual(-1);
+ expect(info[i].lastMemoryLevel).assertEqual(1);
expect(typeof (info[i].weight)).assertEqual("number");
expect(info[i].weight).assertEqual(-1);
diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js b/aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
index d13ab2163067f05a6eb977da266609a32a923425..b42940afbabc72aa47f1d7bf85db79f22085f461 100644
--- a/aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
+++ b/aafwk/aafwk_standard/abilitymanager/actsamscallbackfourthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
@@ -175,7 +175,7 @@ describe('ActsAmsCallBackFourthScene', function () {
expect(info[i].uid).assertLarger(0);
expect(typeof (info[i].lastMemoryLevel)).assertEqual("number");
- expect(info[i].lastMemoryLevel).assertEqual(-1);
+ expect(info[i].lastMemoryLevel).assertEqual(1);
expect(typeof (info[i].weight)).assertEqual("number");
expect(info[i].weight).assertEqual(-1);
diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/test/MangerAbilityJsunit.test.js b/aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
index 601cccc28876182aea4ba8475e94ca6a2fdb4dd9..5d6dfb6d790207adef1cf100e5d71f1d375d9763 100644
--- a/aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
+++ b/aafwk/aafwk_standard/abilitymanager/actsamscallbacksecondscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
@@ -145,7 +145,7 @@ describe('ActsAmsCallBackSecondScene', function () {
expect(info[i].uid).assertLarger(0);
expect(typeof (info[i].lastMemoryLevel)).assertEqual("number");
- expect(info[i].lastMemoryLevel).assertEqual(-1);
+ expect(info[i].lastMemoryLevel).assertEqual(1);
expect(typeof (info[i].weight)).assertEqual("number");
expect(info[i].weight).assertEqual(-1);
diff --git a/aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/test/MangerAbilityJsunit.test.js b/aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
index fcc044b49cb4cbcfe976771289b4c9aa308c8233..667ec2cd49e9d64e16847dc170e4d0095a98bc7a 100644
--- a/aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
+++ b/aafwk/aafwk_standard/abilitymanager/actsamscallbackthirdscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
@@ -156,7 +156,7 @@ describe('ActsAmsCallBackThirdScene', function () {
expect(info[i].uid).assertLarger(0);
expect(typeof (info[i].lastMemoryLevel)).assertEqual("number");
- expect(info[i].lastMemoryLevel).assertEqual(-1);
+ expect(info[i].lastMemoryLevel).assertEqual(1);
expect(typeof (info[i].weight)).assertEqual("number");
expect(info[i].weight).assertEqual(-1);
diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/Test.json b/aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/Test.json
index ddef007937b0bed0425e88daa176ab3f40884ba1..0cc038c3d6b4b8db3e350b803d961a156f4fff82 100644
--- a/aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/Test.json
+++ b/aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/Test.json
@@ -10,6 +10,7 @@
{
"test-file-name": [
"ActsAmsTestFifthSceneTest.hap",
+ "simulateFAbilityFir.hap",
"simulateFAbilitySed.hap",
"verifyIAbility.hap"
],
diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js b/aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
index fe0cea293d02b5f136067c17c1fb9e322205a4e8..2d83e7c369c9f7dcab32a58dc2609c197b47f383 100644
--- a/aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
+++ b/aafwk/aafwk_standard/abilitymanager/actsamstestfifthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
@@ -177,7 +177,7 @@ describe('ActsAmsTestFifthScene', function () {
expect(info[i].uid).assertLarger(0);
expect(typeof (info[i].lastMemoryLevel)).assertEqual("number");
- expect(info[i].lastMemoryLevel).assertEqual(-1);
+ expect(info[i].lastMemoryLevel).assertEqual(1);
expect(typeof (info[i].weight)).assertEqual("number");
expect(info[i].weight).assertEqual(-1);
diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/js/test/MangerAbilityJsunit.test.js b/aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
index 514d70aa61843e0151a0cc0c609dde00794cd16c..0c42a8b3c4a93ab85c027cd7594edd12e39976fc 100644
--- a/aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
+++ b/aafwk/aafwk_standard/abilitymanager/actsamstestfirstscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
@@ -137,7 +137,7 @@ describe('ActsAmsTestFirstScene', function () {
expect(info[i].uid).assertLarger(0);
expect(typeof (info[i].lastMemoryLevel)).assertEqual("number");
- expect(info[i].lastMemoryLevel).assertEqual(-1);
+ expect(info[i].lastMemoryLevel).assertEqual(1);
expect(typeof (info[i].weight)).assertEqual("number");
expect(info[i].weight).assertEqual(-1);
diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js b/aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
index 81406386255ccd6a65d5bdc86daedca5889e128e..ef4442f8099d49d457f1da28bc34c959df4356a0 100644
--- a/aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
+++ b/aafwk/aafwk_standard/abilitymanager/actsamstestfourthscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
@@ -197,7 +197,7 @@ describe('ActsAmsTestFourthScene', function () {
expect(info[i].uid).assertLarger(0);
expect(typeof (info[i].lastMemoryLevel)).assertEqual("number");
- expect(info[i].lastMemoryLevel).assertEqual(-1);
+ expect(info[i].lastMemoryLevel).assertEqual(1);
expect(typeof (info[i].weight)).assertEqual("number");
expect(info[i].weight).assertEqual(-1);
diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/js/test/MangerAbilityJsunit.test.js b/aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
index 1cb33a656873dc2769fc1ca264f12774c5748ac8..26a568cbbacc0cfbc86f5a1dd09d6acfed2cfa90 100644
--- a/aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
+++ b/aafwk/aafwk_standard/abilitymanager/actsamstestsecondscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
@@ -157,7 +157,7 @@ describe('ActsAmsTestSecondScene', function () {
expect(info[i].uid).assertLarger(0);
expect(typeof (info[i].lastMemoryLevel)).assertEqual("number");
- expect(info[i].lastMemoryLevel).assertEqual(-1);
+ expect(info[i].lastMemoryLevel).assertEqual(1);
expect(typeof (info[i].weight)).assertEqual("number");
expect(info[i].weight).assertEqual(-1);
diff --git a/aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/js/test/MangerAbilityJsunit.test.js b/aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
index 7a1e76af2e26be21201836f7c8c81081ef077778..a60004b65cdeaf39a58e63f30a7ceb041adcb527 100644
--- a/aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
+++ b/aafwk/aafwk_standard/abilitymanager/actsamstestthirdscene/entry/src/main/js/test/MangerAbilityJsunit.test.js
@@ -175,7 +175,7 @@ describe('ActsAmsTestThirdScene', function () {
expect(info[i].uid).assertLarger(0);
expect(typeof (info[i].lastMemoryLevel)).assertEqual("number");
- expect(info[i].lastMemoryLevel).assertEqual(-1);
+ expect(info[i].lastMemoryLevel).assertEqual(1);
expect(typeof (info[i].weight)).assertEqual("number");
expect(info[i].weight).assertEqual(-1);
diff --git a/aafwk/aafwk_standard/setshowonlockscreen/BUILD.gn b/aafwk/aafwk_standard/setshowonlockscreen/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..a555b04872abb9078e7be470a7e126c9329f67ac
--- /dev/null
+++ b/aafwk/aafwk_standard/setshowonlockscreen/BUILD.gn
@@ -0,0 +1,24 @@
+# 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("setshowonlockscreen") {
+ testonly = true
+ if (is_standard_system) {
+ deps = [
+ "setshowonlock:setshowonlock",
+ "showsethown:showsethown",
+ ]
+ }
+}
diff --git a/aafwk/aafwk_standard/setshowonlockscreen/setshowonlock/BUILD.gn b/aafwk/aafwk_standard/setshowonlockscreen/setshowonlock/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..828d0750c67d42c3c4227c8b25eca0bb1fb2d656
--- /dev/null
+++ b/aafwk/aafwk_standard/setshowonlockscreen/setshowonlock/BUILD.gn
@@ -0,0 +1,31 @@
+# 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("setshowonlock") {
+ hap_profile = "./entry/src/main/config.json"
+ deps = [
+ ":hjs_demo_js_assets",
+ ":hjs_demo_resources",
+ ]
+ certificate_profile = "./signature/openharmony_sx.p7b"
+ hap_name = "setshowonlock"
+}
+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"
+}
diff --git a/aafwk/aafwk_standard/setshowonlockscreen/setshowonlock/Test.json b/aafwk/aafwk_standard/setshowonlockscreen/setshowonlock/Test.json
new file mode 100644
index 0000000000000000000000000000000000000000..26909f2889de98a479f076f87725fed805c7a343
--- /dev/null
+++ b/aafwk/aafwk_standard/setshowonlockscreen/setshowonlock/Test.json
@@ -0,0 +1,4 @@
+{
+ "description": "Configuration for hjunit demo Tests",
+}
+
diff --git a/aafwk/aafwk_standard/setshowonlockscreen/setshowonlock/entry/src/main/config.json b/aafwk/aafwk_standard/setshowonlockscreen/setshowonlock/entry/src/main/config.json
new file mode 100644
index 0000000000000000000000000000000000000000..360ce6d06366bb4b27f9ce7b9f782a3e2792803f
--- /dev/null
+++ b/aafwk/aafwk_standard/setshowonlockscreen/setshowonlock/entry/src/main/config.json
@@ -0,0 +1,61 @@
+{
+ "app": {
+ "bundleName": "com.example.setshowonlock",
+ "vendor": "example",
+ "version": {
+ "code": 1,
+ "name": "1.0"
+ },
+ "apiVersion": {
+ "compatible": 4,
+ "target": 5,
+ "releaseType": "Beta1"
+ }
+ },
+ "deviceConfig": {},
+ "module": {
+ "package": "com.example.setshowonlock",
+ "name": ".MyApplication",
+ "deviceType": [
+ "phone"
+ ],
+ "distro": {
+ "deliveryWithInstall": true,
+ "moduleName": "entry",
+ "moduleType": "entry"
+ },
+ "abilities": [
+ {
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ],
+ "name": "com.example.setshowonlock.MainAbility",
+ "icon": "$media:icon",
+ "description": "$string:mainability_description",
+ "label": "$string:app_name",
+ "type": "page",
+ "launchType": "standard",
+ "visible": true
+ }
+ ],
+ "js": [
+ {
+ "pages": [
+ "pages/index/index"
+ ],
+ "name": "default",
+ "window": {
+ "designWidth": 720,
+ "autoDesignWidth": false
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/aafwk/aafwk_standard/setshowonlockscreen/setshowonlock/entry/src/main/js/default/app.js b/aafwk/aafwk_standard/setshowonlockscreen/setshowonlock/entry/src/main/js/default/app.js
new file mode 100644
index 0000000000000000000000000000000000000000..2a68c1992145a976957d7dcdd69a7e9c2e8e9877
--- /dev/null
+++ b/aafwk/aafwk_standard/setshowonlockscreen/setshowonlock/entry/src/main/js/default/app.js
@@ -0,0 +1,22 @@
+/*
+ * 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');
+ }
+};
diff --git a/aafwk/aafwk_standard/setshowonlockscreen/setshowonlock/entry/src/main/js/default/i18n/en-US.json b/aafwk/aafwk_standard/setshowonlockscreen/setshowonlock/entry/src/main/js/default/i18n/en-US.json
new file mode 100644
index 0000000000000000000000000000000000000000..e63c70d978a3a53be988388c87182f81785e170c
--- /dev/null
+++ b/aafwk/aafwk_standard/setshowonlockscreen/setshowonlock/entry/src/main/js/default/i18n/en-US.json
@@ -0,0 +1,6 @@
+{
+ "strings": {
+ "hello": "Hello",
+ "world": "World"
+ }
+}
\ No newline at end of file
diff --git a/aafwk/aafwk_standard/setshowonlockscreen/setshowonlock/entry/src/main/js/default/i18n/zh-CN.json b/aafwk/aafwk_standard/setshowonlockscreen/setshowonlock/entry/src/main/js/default/i18n/zh-CN.json
new file mode 100644
index 0000000000000000000000000000000000000000..de6ee5748322f44942c1b003319d8e66c837675f
--- /dev/null
+++ b/aafwk/aafwk_standard/setshowonlockscreen/setshowonlock/entry/src/main/js/default/i18n/zh-CN.json
@@ -0,0 +1,6 @@
+{
+ "strings": {
+ "hello": "您好",
+ "world": "世界"
+ }
+}
\ No newline at end of file
diff --git a/aafwk/aafwk_standard/setshowonlockscreen/setshowonlock/entry/src/main/js/default/pages/index/index.css b/aafwk/aafwk_standard/setshowonlockscreen/setshowonlock/entry/src/main/js/default/pages/index/index.css
new file mode 100644
index 0000000000000000000000000000000000000000..6fda792753f2e15f22b529c7b90a82185b2770bf
--- /dev/null
+++ b/aafwk/aafwk_standard/setshowonlockscreen/setshowonlock/entry/src/main/js/default/pages/index/index.css
@@ -0,0 +1,9 @@
+.container {
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+}
+
+.title {
+ font-size: 100px;
+}
diff --git a/aafwk/aafwk_standard/setshowonlockscreen/setshowonlock/entry/src/main/js/default/pages/index/index.hml b/aafwk/aafwk_standard/setshowonlockscreen/setshowonlock/entry/src/main/js/default/pages/index/index.hml
new file mode 100644
index 0000000000000000000000000000000000000000..f64b040a5ae394dbaa5e185e1ecd4f4556b92184
--- /dev/null
+++ b/aafwk/aafwk_standard/setshowonlockscreen/setshowonlock/entry/src/main/js/default/pages/index/index.hml
@@ -0,0 +1,5 @@
+
+
+ {{ $t('strings.hello') }} {{ title }}
+
+
diff --git a/aafwk/aafwk_standard/setshowonlockscreen/setshowonlock/entry/src/main/js/default/pages/index/index.js b/aafwk/aafwk_standard/setshowonlockscreen/setshowonlock/entry/src/main/js/default/pages/index/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..4c0a566cee5031ec60dcd19ee04f19e0432e33dc
--- /dev/null
+++ b/aafwk/aafwk_standard/setshowonlockscreen/setshowonlock/entry/src/main/js/default/pages/index/index.js
@@ -0,0 +1,46 @@
+/*
+ * 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 featureAbility from '@ohos.ability.featureAbility'
+export default {
+ data: {
+ title: ""
+ },
+ onInit() {
+ this.title = this.$t('strings.world');
+
+ featureAbility.setShowOnLockScreen(false,(error, data) => {
+ console.log('FeatureAbilityTestCallBack ACTS_setShowOnLockScreen_0100 Called.' + ' error ' + error.code )
+ });
+ console.log('ZLM-----onClick1 end');
+ },
+
+ onStart(want){
+
+ this.title = this.$t('strings.world');
+
+ featureAbility.setShowOnLockScreen(false,(error, data) => {
+ console.log('FeatureAbilityTestCallBack ACTS_setShowOnLockScreen_0100 Called.' + ' error ' + error.code )
+ });
+ console.log('ZLM-----onClick1 end');
+ },
+ onShow(){
+ this.title = this.$t('strings.world');
+
+ featureAbility.setShowOnLockScreen(false,(error, data) => {
+ console.log('FeatureAbilityTestCallBack ACTS_setShowOnLockScreen_0100 Called.' + ' error ' + error.code )
+ });
+ console.log('ZLM-----onClick1 end');
+ }
+}
diff --git a/aafwk/aafwk_standard/setshowonlockscreen/setshowonlock/entry/src/main/js/resources/base/element/string.json b/aafwk/aafwk_standard/setshowonlockscreen/setshowonlock/entry/src/main/js/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..7d05253caf78df35bca24351d536c15da41334ab
--- /dev/null
+++ b/aafwk/aafwk_standard/setshowonlockscreen/setshowonlock/entry/src/main/js/resources/base/element/string.json
@@ -0,0 +1,12 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "setShowOnLock"
+ },
+ {
+ "name": "mainability_description",
+ "value": "JS_Phone_Empty Feature Ability"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/aafwk/aafwk_standard/setshowonlockscreen/setshowonlock/entry/src/main/js/resources/base/media/icon.png b/aafwk/aafwk_standard/setshowonlockscreen/setshowonlock/entry/src/main/js/resources/base/media/icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c
Binary files /dev/null and b/aafwk/aafwk_standard/setshowonlockscreen/setshowonlock/entry/src/main/js/resources/base/media/icon.png differ
diff --git a/aafwk/aafwk_standard/setshowonlockscreen/setshowonlock/signature/openharmony_sx.p7b b/aafwk/aafwk_standard/setshowonlockscreen/setshowonlock/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..9be1e98fa4c0c28ca997ed660112fa16b194f0f5
Binary files /dev/null and b/aafwk/aafwk_standard/setshowonlockscreen/setshowonlock/signature/openharmony_sx.p7b differ
diff --git a/aafwk/aafwk_standard/setshowonlockscreen/showsethown/BUILD.gn b/aafwk/aafwk_standard/setshowonlockscreen/showsethown/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..9f6b06effd03173851777e189cf5d403e0d7e7e3
--- /dev/null
+++ b/aafwk/aafwk_standard/setshowonlockscreen/showsethown/BUILD.gn
@@ -0,0 +1,31 @@
+# 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("showsethown") {
+ hap_profile = "./entry/src/main/config.json"
+ deps = [
+ ":hjs_demo_js_assets",
+ ":hjs_demo_resources",
+ ]
+ certificate_profile = "./signature/openharmony_sx.p7b"
+ hap_name = "showsethown"
+}
+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"
+}
diff --git a/aafwk/aafwk_standard/setshowonlockscreen/showsethown/Test.json b/aafwk/aafwk_standard/setshowonlockscreen/showsethown/Test.json
new file mode 100644
index 0000000000000000000000000000000000000000..26909f2889de98a479f076f87725fed805c7a343
--- /dev/null
+++ b/aafwk/aafwk_standard/setshowonlockscreen/showsethown/Test.json
@@ -0,0 +1,4 @@
+{
+ "description": "Configuration for hjunit demo Tests",
+}
+
diff --git a/aafwk/aafwk_standard/setshowonlockscreen/showsethown/entry/src/main/config.json b/aafwk/aafwk_standard/setshowonlockscreen/showsethown/entry/src/main/config.json
new file mode 100644
index 0000000000000000000000000000000000000000..c690cfc435322401cef1e35c1a46b646b69d5f3e
--- /dev/null
+++ b/aafwk/aafwk_standard/setshowonlockscreen/showsethown/entry/src/main/config.json
@@ -0,0 +1,61 @@
+{
+ "app": {
+ "bundleName": "com.example.showsethown",
+ "vendor": "example",
+ "version": {
+ "code": 1,
+ "name": "1.0"
+ },
+ "apiVersion": {
+ "compatible": 4,
+ "target": 5,
+ "releaseType": "Beta1"
+ }
+ },
+ "deviceConfig": {},
+ "module": {
+ "package": "com.example.showsethown",
+ "name": ".MyApplication",
+ "deviceType": [
+ "phone"
+ ],
+ "distro": {
+ "deliveryWithInstall": true,
+ "moduleName": "entry",
+ "moduleType": "entry"
+ },
+ "abilities": [
+ {
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ],
+ "name": "com.example.showsethown.MainAbility",
+ "icon": "$media:icon",
+ "description": "$string:mainability_description",
+ "label": "$string:app_name",
+ "type": "page",
+ "launchType": "standard",
+ "visible":true
+ }
+ ],
+ "js": [
+ {
+ "pages": [
+ "pages/index/index"
+ ],
+ "name": "default",
+ "window": {
+ "designWidth": 720,
+ "autoDesignWidth": false
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/aafwk/aafwk_standard/setshowonlockscreen/showsethown/entry/src/main/js/default/app.js b/aafwk/aafwk_standard/setshowonlockscreen/showsethown/entry/src/main/js/default/app.js
new file mode 100644
index 0000000000000000000000000000000000000000..2a68c1992145a976957d7dcdd69a7e9c2e8e9877
--- /dev/null
+++ b/aafwk/aafwk_standard/setshowonlockscreen/showsethown/entry/src/main/js/default/app.js
@@ -0,0 +1,22 @@
+/*
+ * 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');
+ }
+};
diff --git a/aafwk/aafwk_standard/setshowonlockscreen/showsethown/entry/src/main/js/default/i18n/en-US.json b/aafwk/aafwk_standard/setshowonlockscreen/showsethown/entry/src/main/js/default/i18n/en-US.json
new file mode 100644
index 0000000000000000000000000000000000000000..e63c70d978a3a53be988388c87182f81785e170c
--- /dev/null
+++ b/aafwk/aafwk_standard/setshowonlockscreen/showsethown/entry/src/main/js/default/i18n/en-US.json
@@ -0,0 +1,6 @@
+{
+ "strings": {
+ "hello": "Hello",
+ "world": "World"
+ }
+}
\ No newline at end of file
diff --git a/aafwk/aafwk_standard/setshowonlockscreen/showsethown/entry/src/main/js/default/i18n/zh-CN.json b/aafwk/aafwk_standard/setshowonlockscreen/showsethown/entry/src/main/js/default/i18n/zh-CN.json
new file mode 100644
index 0000000000000000000000000000000000000000..de6ee5748322f44942c1b003319d8e66c837675f
--- /dev/null
+++ b/aafwk/aafwk_standard/setshowonlockscreen/showsethown/entry/src/main/js/default/i18n/zh-CN.json
@@ -0,0 +1,6 @@
+{
+ "strings": {
+ "hello": "您好",
+ "world": "世界"
+ }
+}
\ No newline at end of file
diff --git a/aafwk/aafwk_standard/setshowonlockscreen/showsethown/entry/src/main/js/default/pages/index/index.css b/aafwk/aafwk_standard/setshowonlockscreen/showsethown/entry/src/main/js/default/pages/index/index.css
new file mode 100644
index 0000000000000000000000000000000000000000..6fda792753f2e15f22b529c7b90a82185b2770bf
--- /dev/null
+++ b/aafwk/aafwk_standard/setshowonlockscreen/showsethown/entry/src/main/js/default/pages/index/index.css
@@ -0,0 +1,9 @@
+.container {
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+}
+
+.title {
+ font-size: 100px;
+}
diff --git a/aafwk/aafwk_standard/setshowonlockscreen/showsethown/entry/src/main/js/default/pages/index/index.hml b/aafwk/aafwk_standard/setshowonlockscreen/showsethown/entry/src/main/js/default/pages/index/index.hml
new file mode 100644
index 0000000000000000000000000000000000000000..f64b040a5ae394dbaa5e185e1ecd4f4556b92184
--- /dev/null
+++ b/aafwk/aafwk_standard/setshowonlockscreen/showsethown/entry/src/main/js/default/pages/index/index.hml
@@ -0,0 +1,5 @@
+
+
+ {{ $t('strings.hello') }} {{ title }}
+
+
diff --git a/aafwk/aafwk_standard/setshowonlockscreen/showsethown/entry/src/main/js/default/pages/index/index.js b/aafwk/aafwk_standard/setshowonlockscreen/showsethown/entry/src/main/js/default/pages/index/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..e8014499e68088a7be95c1ef31d19b6cd67d9dde
--- /dev/null
+++ b/aafwk/aafwk_standard/setshowonlockscreen/showsethown/entry/src/main/js/default/pages/index/index.js
@@ -0,0 +1,48 @@
+/*
+ * 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 featureAbility from '@ohos.ability.featureAbility'
+export default {
+ data: {
+ title: ""
+ },
+ onInit() {
+ this.title = this.$t('strings.world');
+
+ featureAbility.setShowOnLockScreen(true,(error, data) => {
+ console.log('FeatureAbilityTestCallBack ACTS_setShowOnLockScreen_0100 Called.' + ' error ' + error.code )
+ });
+ console.log('ZLM-----onClick1 end');
+ },
+
+ onStart(want){
+
+ this.title = this.$t('strings.world');
+
+ featureAbility.setShowOnLockScreen(true,(error, data) => {
+ console.log('FeatureAbilityTestCallBack ACTS_setShowOnLockScreen_0100 Called.' + ' error ' + error.code )
+ });
+ console.log('ZLM-----onClick1 end');
+ },
+ onShow(){
+ this.title = this.$t('strings.world');
+
+ featureAbility.setShowOnLockScreen(true,(error, data) => {
+ console.log('FeatureAbilityTestCallBack ACTS_setShowOnLockScreen_0100 Called.' + ' error ' + error.code )
+ });
+ console.log('ZLM-----onClick1 end');
+ }
+ }
+
+
diff --git a/aafwk/aafwk_standard/setshowonlockscreen/showsethown/entry/src/main/js/resources/base/element/string.json b/aafwk/aafwk_standard/setshowonlockscreen/showsethown/entry/src/main/js/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..6b50e75dd0b544b418dc3b99093d15a6ab314105
--- /dev/null
+++ b/aafwk/aafwk_standard/setshowonlockscreen/showsethown/entry/src/main/js/resources/base/element/string.json
@@ -0,0 +1,12 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "ShowSetHOWN"
+ },
+ {
+ "name": "mainability_description",
+ "value": "JS_Phone_Empty Feature Ability"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/aafwk/aafwk_standard/setshowonlockscreen/showsethown/entry/src/main/js/resources/base/media/icon.png b/aafwk/aafwk_standard/setshowonlockscreen/showsethown/entry/src/main/js/resources/base/media/icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c
Binary files /dev/null and b/aafwk/aafwk_standard/setshowonlockscreen/showsethown/entry/src/main/js/resources/base/media/icon.png differ
diff --git a/aafwk/aafwk_standard/setshowonlockscreen/showsethown/signature/openharmony_sx.p7b b/aafwk/aafwk_standard/setshowonlockscreen/showsethown/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..9be1e98fa4c0c28ca997ed660112fa16b194f0f5
Binary files /dev/null and b/aafwk/aafwk_standard/setshowonlockscreen/showsethown/signature/openharmony_sx.p7b differ
diff --git a/appexecfwk/ams_standard/fwkdataaccessor/Test.json b/appexecfwk/ams_standard/fwkdataaccessor/Test.json
index 2bdcc82b5b02045d6dd1e4910cfc61e0c1236844..5d6bddcf3b4ad86236117daf1351a208e68f3405 100644
--- a/appexecfwk/ams_standard/fwkdataaccessor/Test.json
+++ b/appexecfwk/ams_standard/fwkdataaccessor/Test.json
@@ -9,32 +9,11 @@
"kits": [
{
"test-file-name": [
- "FWKDataAccessor.hap"
-
+ "FWKDataAccessor.hap",
+ "amsStDataAbility.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
- },
- {
- "type": "ShellKit",
- "run-command": [
- "remount",
- "mkdir /data/test"
- ]
- },
- {
- "type": "PushKit",
- "push": [
- "./resource/appexecfwk/amsStDataAbility.hap->/data/test/amsStDataAbility.hap"
- ]
-
- },
- {
- "type": "ShellKit",
- "run-command": [
- "chmod 644 /data/test/*.hap",
- "bm install -p /data/test/amsStDataAbility.hap"
- ]
- }
+ }
]
}
diff --git a/appexecfwk/ams_standard/fwkdataaccessor/entry/src/main/js/test/DataAbilityHelperJsSt.test.js b/appexecfwk/ams_standard/fwkdataaccessor/entry/src/main/js/test/DataAbilityHelperJsSt.test.js
index 09615e477b85b20bdb36f4cc19693b0a2c997edd..6bf56224918a9d4413ff60c10697135ff74d076c 100644
--- a/appexecfwk/ams_standard/fwkdataaccessor/entry/src/main/js/test/DataAbilityHelperJsSt.test.js
+++ b/appexecfwk/ams_standard/fwkdataaccessor/entry/src/main/js/test/DataAbilityHelperJsSt.test.js
@@ -13,7 +13,7 @@
* limitations under the License.
*/
import featureAbility from '@ohos.ability.featureAbility'
-import ohos_data_ability from '@ohos.data.dataability'
+import ohosDataAbility from '@ohos.data.dataability'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
@@ -21,7 +21,7 @@ describe('ActsDataAbilityHelperTest', function () {
let dataAbilityUri = ("dataability:///com.ix.VerifyActDataAbility");
let dataAbilityUri2 = ("dataability:///com.ix.VerifyActDataAbility2");
let DAHelper;
- let g_setTimeout = 5000
+ let gSetTimeout = 500
beforeAll(async (done) => {
console.debug('= ACTS_beforeAll ====" + dataAbilityUri)
try {
var abilityHelper = featureAbility.acquireDataAbilityHelper(dataAbilityUri)
- console.log('ACTS_AcquireDataAbilityHelper_0100 abilityHelper ====>: ' + abilityHelper + " ,JSON. " + JSON.stringify(abilityHelper))
+ console.log('ACTS_AcquireDataAbilityHelper_0100 abilityHelper ====>: '
+ + abilityHelper + " ,JSON. " + JSON.stringify(abilityHelper))
expect(typeof (abilityHelper)).assertEqual("object");
} catch (err) {
console.error('=ACTS_GetDataAbilityHelper_0100 acquireDataAbilityHelper catch(err)====>:' + err);
@@ -68,7 +70,8 @@ describe('ActsDataAbilityHelperTest', function () {
console.log('ACTS_AcquireDataAbilityHelper_0200====: ' + abilityHelper + " ,JSON. " + JSON.stringify(abilityHelper))
+ console.log('ACTS_AcquireDataAbilityHelper_0200 abilityHelper ====>: '
+ + abilityHelper + " ,JSON. " + JSON.stringify(abilityHelper))
if (JSON.stringify(abilityHelper) == 'undefined' || JSON.stringify(abilityHelper) == 'null')
expect(true).assertTrue();
else
@@ -116,7 +119,7 @@ describe('ActsDataAbilityHelperTest', function () {
setTimeout(function () {
console.log('setTimeout function====<');
- }, g_setTimeout);
+ }, gSetTimeout);
console.log('ACTS_Insert_0100==== {
console.debug("=ACTS_Query_0400 query err,data=======>"
- + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;") + " , " + data);
+ + ("json err【") + JSON.stringify(err) + (" 】json data【")
+ + JSON.stringify(data) + (" 】;") + " , " + data);
expect(typeof (data)).assertEqual("object");
ret = true
done();
@@ -550,7 +554,7 @@ describe('ActsDataAbilityHelperTest', function () {
}
setTimeout(function () {
console.log('setTimeout function====<');
- }, g_setTimeout);
+ }, gSetTimeout);
console.log('ACTS_Query_0400====: ' + DAHelper)
try {
let valueBucketNull = {};
- let predicates = new ohos_data_ability.DataAbilityPredicates();
+ let predicates = new ohosDataAbility.DataAbilityPredicates();
console.debug("=ACTS_Update_0100 predicates====>"
+ ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates);
DAHelper.update(
@@ -582,17 +586,17 @@ describe('ActsDataAbilityHelperTest', function () {
}).catch((err) => {
console.debug("=ACTS_Update_0100 catch err ====>"
+ ("json err 【") + JSON.stringify(err) + (" 】 "));
- ret = false
+ expect(false).assertTrue();
done();
});
} catch (err) {
console.error('=ACTS_Update_0100 catch(err)====>:' + err);
- ret = false
+ expect(false).assertTrue();
done();
}
setTimeout(function () {
console.log('setTimeout function====<');
- }, g_setTimeout);
+ }, gSetTimeout);
console.log('ACTS_Update_0100===="
+ ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates);
await DAHelper.update(
@@ -624,12 +628,12 @@ describe('ActsDataAbilityHelperTest', function () {
);
} catch (err) {
console.error('=ACTS_Update_0200 catch(err)====>:' + err);
- ret = false
+ expect(false).assertTrue();
done();
}
setTimeout(function () {
console.log('setTimeout function====<');
- }, g_setTimeout);
+ }, gSetTimeout);
console.log('ACTS_Update_0200====: ' + DAHelper)
const valueBucket = { "name": "ACTS_Update_0300_roe1", "age": 21, "salary": 20.5, }
try {
- let predicates = new ohos_data_ability.DataAbilityPredicates();
+ let predicates = new ohosDataAbility.DataAbilityPredicates();
predicates.equalTo('contact_id', 1);
predicates.limitAs(10);
predicates.orderByAsc("order_by_class");
@@ -677,7 +681,7 @@ describe('ActsDataAbilityHelperTest', function () {
}
setTimeout(function () {
console.log('setTimeout function====<');
- }, g_setTimeout);
+ }, gSetTimeout);
console.log('ACTS_Update_0300====: ' + DAHelper)
const valueBucket = { "name": "ACTS_Update_0400_roe1", "age": 21, "salary": 20.5, }
try {
- let predicates = new ohos_data_ability.DataAbilityPredicates();
+ let predicates = new ohosDataAbility.DataAbilityPredicates();
predicates.equalTo('contact_id', 1);
predicates.limitAs(10);
predicates.orderByAsc("order_by_class");
@@ -720,7 +724,7 @@ describe('ActsDataAbilityHelperTest', function () {
}
setTimeout(function () {
console.log('setTimeout function====<');
- }, g_setTimeout);
+ }, gSetTimeout);
console.log('ACTS_Update_0400====: ' + DAHelper)
try {
- let predicates = new ohos_data_ability.DataAbilityPredicates();
+ let predicates = new ohosDataAbility.DataAbilityPredicates();
console.debug("=ACTS_Delete_0100 predicates====>"
+ ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates);
DAHelper.delete(
@@ -750,17 +754,17 @@ describe('ActsDataAbilityHelperTest', function () {
}).catch((err) => {
console.debug("=ACTS_Delete_0100 catch err ====>"
+ ("json err 【") + JSON.stringify(err) + (" 】 "));
- ret = false
+ expect(false).assertTrue();
done();
});
} catch (err) {
console.error('=ACTS_Delete_0100 catch(err)====>:' + err);
- ret = false
+ expect(false).assertTrue();
done();
}
setTimeout(function () {
console.log('setTimeout function====<');
- }, g_setTimeout);
+ }, gSetTimeout);
console.log('ACTS_Delete_0100====: ' + DAHelper)
try {
- let predicates = new ohos_data_ability.DataAbilityPredicates();
+ let predicates = new ohosDataAbility.DataAbilityPredicates();
console.debug("=ACTS_Delete_0200 predicates====>"
+ ("json predicates 【") + JSON.stringify(predicates) + (" 】") + " , " + predicates);
await DAHelper.delete(
@@ -792,12 +796,12 @@ describe('ActsDataAbilityHelperTest', function () {
);
} catch (err) {
console.error('=ACTS_Delete_0200 catch(err)====>:' + err);
- ret = false
+ expect(false).assertTrue();
done();
}
setTimeout(function () {
console.log('setTimeout function====<');
- }, g_setTimeout);
+ }, gSetTimeout);
console.log('ACTS_Delete_0200====: ' + DAHelper)
try {
- let predicates = new ohos_data_ability.DataAbilityPredicates();
+ let predicates = new ohosDataAbility.DataAbilityPredicates();
predicates.equalTo('contact_id', 1);
predicates.limitAs(10);
predicates.orderByAsc("order_by_class");
@@ -882,7 +886,7 @@ describe('ActsDataAbilityHelperTest', function () {
}
setTimeout(function () {
console.log('setTimeout function====<');
- }, g_setTimeout);
+ }, gSetTimeout);
console.log('ACTS_Delete_0400====: ' + data.length);
for (var i = 0; i < data.length; i++) {
expect(typeof (data[i])).assertEqual("string");
- console.log('=ACTS_GetFileTypes_0200 for data ====>: ' + err.code + " data[" + i + "]: " + data[i]);
+ console.log('=ACTS_GetFileTypes_0200 for data ====>: ' + err.code +
+ " data[" + i + "]: " + data[i]);
expect(data[i]).assertEqual("");
}
ret = true
@@ -966,7 +971,7 @@ describe('ActsDataAbilityHelperTest', function () {
}
setTimeout(function () {
console.log('setTimeout function====<');
- }, g_setTimeout);
+ }, gSetTimeout);
console.log('ACTS_GetFileTypes_0200====: ' + data.length);
for (var i = 0; i < data.length; i++) {
expect(typeof (data[i])).assertEqual("string");
- console.log('=ACTS_GetFileTypes_0600 for errCode ====>: ' + err.code + " data[" + i + "]: " + data[i]);
+ console.log('=ACTS_GetFileTypes_0600 for errCode ====>: ' + err.code +
+ " data[" + i + "]: " + data[i]);
expect(data[i]).assertEqual("");
}
ret = true
@@ -1134,7 +1141,7 @@ describe('ActsDataAbilityHelperTest', function () {
}
setTimeout(function () {
console.log('setTimeout function====<');
- }, g_setTimeout);
+ }, gSetTimeout);
console.log('ACTS_GetFileTypes_0600===="
+ ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;"));
expect(typeof (data)).assertEqual("number");
- console.log('DataAbilityHelper ACTS_OpenFile_0700 OpenFile asyncCallback errCode ====>: ' + err.code + " data: " + data);
+ console.log('DataAbilityHelper ACTS_OpenFile_0700 OpenFile asyncCallback errCode ====>: '
+ + err.code + " data: " + data);
ret = true
done();
},
@@ -1469,7 +1482,7 @@ describe('ActsDataAbilityHelperTest', function () {
}
setTimeout(function () {
console.log('setTimeout function====<');
- }, g_setTimeout);
+ }, gSetTimeout);
console.log('ACTS_OpenFile_0700===="
+ ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;"));
expect(typeof (data)).assertEqual("number");
- console.log('DataAbilityHelper ACTS_OpenFile_0800 OpenFile asyncCallback errCode ====>: ' + err.code + " data: " + data);
+ console.log('DataAbilityHelper ACTS_OpenFile_0800 OpenFile asyncCallback errCode ====>: '
+ + err.code + " data: " + data);
ret = true
done();
},
@@ -1505,7 +1519,7 @@ describe('ActsDataAbilityHelperTest', function () {
}
setTimeout(function () {
console.log('setTimeout function====<');
- }, g_setTimeout);
+ }, gSetTimeout);
console.log('ACTS_OpenFile_0800===="
+ ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;"));
expect(typeof (data)).assertEqual("number");
- console.log('DataAbilityHelper ACTS_OpenFile_0900 OpenFile asyncCallback errCode ====>: ' + err.code + " data: " + data);
+ console.log('DataAbilityHelper ACTS_OpenFile_0900 OpenFile asyncCallback errCode ====>: '
+ + err.code + " data: " + data);
ret = true
done();
},
@@ -1541,7 +1556,7 @@ describe('ActsDataAbilityHelperTest', function () {
}
setTimeout(function () {
console.log('setTimeout function====<');
- }, g_setTimeout);
+ }, gSetTimeout);
console.log('ACTS_OpenFile_0900===="
+ ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;"));
expect(typeof (data)).assertEqual("number");
- console.log('DataAbilityHelper ACTS_OpenFile_1000 OpenFile asyncCallback errCode ====>: ' + err.code + " data: " + data);
+ console.log('DataAbilityHelper ACTS_OpenFile_1000 OpenFile asyncCallback errCode ====>: '
+ + err.code + " data: " + data);
ret = true
done();
},
@@ -1577,7 +1593,7 @@ describe('ActsDataAbilityHelperTest', function () {
}
setTimeout(function () {
console.log('setTimeout function====<');
- }, g_setTimeout);
+ }, gSetTimeout);
console.log('ACTS_OpenFile_1000==== {
+ if (err.code != 0) {
+ console.debug("=ACTS_OnOff_0100 err=======>"
+ + ("err【") + JSON.stringify(err) + (" 】") + " , " + err);
+ expect(false).assertTrue();
+ DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback_0100);
+ done();
+ } else {
+ currentAlertTimeout = setTimeout(() => {
+ console.debug('ACTS_OnOff_0100====< else true');
+ done();
+ }, gSetTimeout);
+ }
+ }
+ );
+ }
+ } catch (err) {
+ console.error('=ACTS_OnOff_0100 catch(err)====>:' + err);
+ expect(false).assertTrue();
+ done();
+ }
+ console.log('ACTS_OnOff_0100====");
+ expect(false).assertTrue();
+ clearTimeout(currentAlertTimeout);
+ done();
+ }
+ DAHelper.on("dataChange", dataAbilityUri, onAsyncCallback_0200);
+
+ DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback_0200);
+
+ setTimeout(mySetTimeout, gSetTimeout);
+ function mySetTimeout() {
+ DAHelper.notifyChange(
+ dataAbilityUri,
+ (err) => {
+ if (err.code != 0) {
+ console.debug("=ACTS_OnOff_0200 err=======>"
+ + ("err【") + JSON.stringify(err) + (" 】") + " , " + err);
+ expect(false).assertTrue();
+ done();
+ } else {
+ currentAlertTimeout = setTimeout(() => {
+ console.debug('ACTS_OnOff_0200====:' + err);
+ expect(false).assertTrue();
+ done();
+ }
+ console.log('ACTS_OnOff_0200====" + caller);
+ if (flagCallback01 == 1 && flagCallback02 == 1 && flagCallback03 == 1) {
+ clearTimeout(currentAlertTimeout);
+ DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback0301);
+ DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback0302);
+ DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback0303);
+ done();
+ } else {
+ if (caller == "notifyChange") {
+ currentAlertTimeout = setTimeout(() => {
+ console.debug('ACTS_OnOff_0300==== {
+ expect(err.code).assertEqual(0);
+ waitDone("notifyChange");
+ }
+ );
+ }
+ } catch (err) {
+ console.error('=ACTS_OnOff_0300 catch(err)====>:' + err);
+ expect(false).assertTrue();
+ done();
+ }
+ console.log('ACTS_OnOff_0300===="
+ + ("json flagCallback02【") + JSON.stringify(flagCallback02) + (" 】") + " , " + flagCallback02);
+ expect(false).assertTrue();
+ clearTimeout(currentAlertTimeout);
+ done();
+ }
+ function onAsyncCallback0403(err) {
+ expect(err.code).assertEqual(0);
+ flagCallback03++;
+ waitDone("onAsyncCallback0403");
+ }
+ function waitDone(caller) {
+ console.debug("=ACTS_OnOff_0400 caller ====>" + caller);
+ if (flagCallback01 == 1 && flagCallback02 == 0 && flagCallback03 == 1) {
+ clearTimeout(currentAlertTimeout);
+ DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback0401);
+ DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback0403);
+ done();
+ } else {
+ if (caller == "notifyChange") {
+ currentAlertTimeout = setTimeout(() => {
+ console.debug('ACTS_OnOff_0400==== {
+ expect(err.code).assertEqual(0);
+ waitDone("notifyChange");
+ }
+ );
+ }
+ } catch (err) {
+ console.error('=ACTS_OnOff_0400 catch(err)====>:' + err);
+ expect(false).assertTrue();
+ done();
+ }
+ console.log('ACTS_OnOff_0400===="
+ + ("json err【") + JSON.stringify(err) + (" 】") + " , " + err);
+ expect(false).assertTrue();
+ clearTimeout(currentAlertTimeout);
+ done();
+ }
+ function onAsyncCallback0502(err) {
+ console.debug("=ACTS_OnOff_0500 err ====>"
+ + ("json err【") + JSON.stringify(err) + (" 】") + " , " + err);
+ expect(false).assertTrue();
+ clearTimeout(currentAlertTimeout);
+ done();
+ }
+ function onAsyncCallback0503(err) {
+ console.debug("=ACTS_OnOff_0500 err ====>"
+ + ("json err") + JSON.stringify(err) + (" 】") + " , " + err);
+ expect(false).assertTrue();
+ clearTimeout(currentAlertTimeout);
+ done();
+ }
+ try {
+ expect(typeof (DAHelper)).assertEqual("object");
+
+ DAHelper.on("dataChange", dataAbilityUri, onAsyncCallback0501);
+ DAHelper.on("dataChange", dataAbilityUri, onAsyncCallback0502);
+ DAHelper.on("dataChange", dataAbilityUri, onAsyncCallback0503);
+
+ DAHelper.off("dataChange", dataAbilityUri);
+
+ setTimeout(mySetTimeout, gSetTimeout);
+ function mySetTimeout() {
+ DAHelper.notifyChange(
+ dataAbilityUri,
+ (err) => {
+ if (err.code != 0) {
+ console.debug("=ACTS_OnOff_0500 err=======>"
+ + ("err【") + JSON.stringify(err) + (" 】") + " , " + err);
+ expect(false).assertTrue();
+ clearTimeout(currentAlertTimeout);
+ DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback_0100);
+ done();
+ } else {
+ currentAlertTimeout = setTimeout(() => {
+ console.debug('ACTS_OnOff_0500====:' + err);
+ expect(false).assertTrue();
+ done();
+ }
+ console.log('ACTS_OnOff_0500====" + caller);
+ if (flagCallback01 == 2) {
+ clearTimeout(currentAlertTimeout);
+ DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback_0600);
+ DAHelper2.off("dataChange", dataAbilityUri2, onAsyncCallback_0600);
+ done();
+ } else {
+ if (caller == "notifyChange") {
+ currentAlertTimeout = setTimeout(() => {
+ console.debug('ACTS_OnOff_0600==== {
+ if (err.code != 0) {
+ console.debug("=ACTS_OnOff_0600 err=======>"
+ + ("err【") + JSON.stringify(err) + (" 】") + " , " + err);
+ expect(false).assertTrue();
+ DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback_0600);
+ DAHelper2.off("dataChange", dataAbilityUri2, onAsyncCallback_0600);
+ done();
+ } else {
+ DAHelper2.notifyChange(
+ dataAbilityUri2,
+ (err) => {
+ if (err.code != 0) {
+ console.debug("=ACTS_OnOff_0600 err=======>"
+ + ("err【") + JSON.stringify(err) + (" 】") + " , " + err);
+ expect(false).assertTrue();
+ DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback_0600);
+ DAHelper2.off("dataChange", dataAbilityUri2, onAsyncCallback_0600);
+ done();
+ } else {
+ waitDone("notifyChange");
+ }
+ }
+ );
+ }
+ }
+ );
+ }
+ } catch (err) {
+ console.error('=ACTS_OnOff_0600 catch(err)====>:' + err);
+ expect(false).assertTrue();
+ done();
+ }
+ console.log('ACTS_OnOff_0600==== {
+ if (err.code != 0) {
+ console.debug("=ACTS_OnOff_0700 err=======>"
+ + ("err【") + JSON.stringify(err) + (" 】") + " , " + err);
+ expect(false).assertTrue();
+ DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback_0700);
+ DAHelper2.off("dataChange", dataAbilityUri2, onAsyncCallback_0700);
+ done();
+ } else {
+ DAHelper2.notifyChange(
+ dataAbilityUri2,
+ (err) => {
+ if (err.code != 0) {
+ console.debug("=ACTS_OnOff_0700 err=======>"
+ + ("err【") + JSON.stringify(err) + (" 】") + " , " + err);
+ expect(false).assertTrue();
+ DAHelper.off("dataChange", dataAbilityUri, onAsyncCallback_0700);
+ DAHelper2.off("dataChange", dataAbilityUri2, onAsyncCallback_0700);
+ done();
+ } else {
+ currentAlertTimeout = setTimeout(() => {
+ done();
+ }, gSetTimeout);
+ }
+ }
+ );
+ }
+ }
+ );
+ }
+ } catch (err) {
+ console.error('=ACTS_OnOff_0700 catch(err)====>:' + err);
+ expect(false).assertTrue();
+ done();
+ }
+ console.log('ACTS_OnOff_0700==== {
console.debug("=ACTS_ExecuteBatch_Insert_0400 executeBatch err,data====>"
- + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;") + data.length);
+ + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data)
+ + (" 】;") + data.length);
expect(err.code).assertEqual(0);
done();
}
@@ -2113,7 +2578,8 @@ describe('ActsDataAbilityHelperTest', function () {
],
(err, data) => {
console.debug("=ACTS_ExecuteBatch_Insert_0500 executeBatch err,data====>"
- + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;") + data.length);
+ + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data)
+ + (" 】;") + data.length);
expect(err.code).assertEqual(0);
done();
}
@@ -2165,7 +2631,8 @@ describe('ActsDataAbilityHelperTest', function () {
],
(err, data) => {
console.debug("=ACTS_ExecuteBatch_Insert_0600 executeBatch err,data====>"
- + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;") + data.length);
+ + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data)
+ + (" 】;") + data.length);
expect(err.code).assertEqual(0);
done();
}
@@ -2194,7 +2661,7 @@ describe('ActsDataAbilityHelperTest', function () {
"salary": 200.5,
"blobType": "u8",
}
- let predicates = new ohos_data_ability.DataAbilityPredicates();
+ let predicates = new ohosDataAbility.DataAbilityPredicates();
predicates.equalTo('contact_id', 1);
predicates.limitAs(10);
predicates.orderByAsc("order_by_class");
@@ -2251,7 +2718,7 @@ describe('ActsDataAbilityHelperTest', function () {
"salary": 200.5,
"blobType": "u8",
}
- let predicates = new ohos_data_ability.DataAbilityPredicates();
+ let predicates = new ohosDataAbility.DataAbilityPredicates();
predicates.equalTo('name', "ACTS_ExecuteBatch_Update_0200_rose");
predicates.limitAs(10);
predicates.orderByAsc("order_by_class");
@@ -2317,7 +2784,7 @@ describe('ActsDataAbilityHelperTest', function () {
"salary": 200.5,
"blobType": "u8",
}
- let predicates = new ohos_data_ability.DataAbilityPredicates();
+ let predicates = new ohosDataAbility.DataAbilityPredicates();
predicates.equalTo('contact_id', 1);
predicates.limitAs(10);
predicates.orderByAsc("order_by_class");
@@ -2383,7 +2850,7 @@ describe('ActsDataAbilityHelperTest', function () {
"salary": 200.5,
"blobType": "u8",
}
- let predicates = new ohos_data_ability.DataAbilityPredicates();
+ let predicates = new ohosDataAbility.DataAbilityPredicates();
predicates.equalTo('contact_id', 1);
predicates.limitAs(10);
predicates.orderByAsc("order_by_class");
@@ -2403,10 +2870,12 @@ describe('ActsDataAbilityHelperTest', function () {
],
(err, data) => {
console.debug("=ACTS_ExecuteBatch_Update_0400 executeBatch err,data====>"
- + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;") + data.length);
+ + ("json err【") + JSON.stringify(err) + (" 】json data【")
+ + JSON.stringify(data) + (" 】;") + data.length);
expect(true).assertTrue();
for (var i = 0; i < data.length; i++) {
- console.debug('=ACTS_ExecuteBatch_Update_0400 for data[' + i + '].count ====>: ' + data[i].count)
+ console.debug('=ACTS_ExecuteBatch_Update_0400 for data[' + i + '].count ====>: '
+ + data[i].count)
expect(data[i].count).assertEqual(1);
}
done();
@@ -2436,7 +2905,7 @@ describe('ActsDataAbilityHelperTest', function () {
"salary": 200.5,
"blobType": "u8",
}
- let predicates = new ohos_data_ability.DataAbilityPredicates();
+ let predicates = new ohosDataAbility.DataAbilityPredicates();
predicates.equalTo('contact_id', 1);
predicates.limitAs(10);
predicates.orderByAsc("order_by_class");
@@ -2465,10 +2934,12 @@ describe('ActsDataAbilityHelperTest', function () {
],
(err, data) => {
console.debug("=ACTS_ExecuteBatch_Update_0500 executeBatch err,data====>"
- + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;") + data.length);
+ + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data)
+ + (" 】;") + data.length);
expect(true).assertTrue();
for (var i = 0; i < data.length; i++) {
- console.debug('=ACTS_ExecuteBatch_Update_0300 for data[' + i + '].count ====>: ' + data[i].count)
+ console.debug('=ACTS_ExecuteBatch_Update_0300 for data[' + i + '].count ====>: '
+ + data[i].count)
expect(data[i].count).assertEqual(1);
}
done();
@@ -2498,7 +2969,7 @@ describe('ActsDataAbilityHelperTest', function () {
"salary": 200.5,
"blobType": "u8",
}
- let predicates = new ohos_data_ability.DataAbilityPredicates();
+ let predicates = new ohosDataAbility.DataAbilityPredicates();
predicates.equalTo('contact_id', 1);
predicates.limitAs(10);
predicates.orderByAsc("order_by_class");
@@ -2527,10 +2998,12 @@ describe('ActsDataAbilityHelperTest', function () {
],
(err, data) => {
console.debug("=ACTS_ExecuteBatch_Update_0600 executeBatch err,data====>"
- + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;") + data.length);
+ + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data)
+ + (" 】;") + data.length);
expect(true).assertTrue();
for (var i = 0; i < data.length; i++) {
- console.debug('=ACTS_ExecuteBatch_Update_0300 for data[' + i + '].count ====>: ' + data[i].count)
+ console.debug('=ACTS_ExecuteBatch_Update_0300 for data[' + i + '].count ====>: '
+ + data[i].count)
expect(data[i].count).assertEqual(1);
}
done();
@@ -2560,7 +3033,7 @@ describe('ActsDataAbilityHelperTest', function () {
"salary": 200.5,
"blobType": "u8",
}
- let predicates = new ohos_data_ability.DataAbilityPredicates();
+ let predicates = new ohosDataAbility.DataAbilityPredicates();
predicates.equalTo('contact_id', 1);
predicates.limitAs(10);
predicates.orderByAsc("order_by_class");
@@ -2617,7 +3090,7 @@ describe('ActsDataAbilityHelperTest', function () {
"salary": 200.5,
"blobType": "u8",
}
- let predicates = new ohos_data_ability.DataAbilityPredicates();
+ let predicates = new ohosDataAbility.DataAbilityPredicates();
predicates.equalTo('contact_id', 1);
predicates.limitAs(10);
predicates.orderByAsc("order_by_class");
@@ -2683,7 +3156,7 @@ describe('ActsDataAbilityHelperTest', function () {
"salary": 200.5,
"blobType": "u8",
}
- let predicates = new ohos_data_ability.DataAbilityPredicates();
+ let predicates = new ohosDataAbility.DataAbilityPredicates();
predicates.equalTo('contact_id', 1);
predicates.limitAs(10);
predicates.orderByAsc("order_by_class");
@@ -2749,7 +3222,7 @@ describe('ActsDataAbilityHelperTest', function () {
"salary": 200.5,
"blobType": "u8",
}
- let predicates = new ohos_data_ability.DataAbilityPredicates();
+ let predicates = new ohosDataAbility.DataAbilityPredicates();
predicates.equalTo('contact_id', 1);
predicates.limitAs(10);
predicates.orderByAsc("order_by_class");
@@ -2769,10 +3242,12 @@ describe('ActsDataAbilityHelperTest', function () {
],
(err, data) => {
console.debug("=ACTS_ExecuteBatch_Assert_0400 executeBatch err,data====>"
- + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;") + data.length);
+ + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data)
+ + (" 】;") + data.length);
expect(true).assertTrue();
for (var i = 0; i < data.length; i++) {
- console.debug('=ACTS_ExecuteBatch_Assert_0400 for data[' + i + '].count ====>: ' + data[i].count)
+ console.debug('=ACTS_ExecuteBatch_Assert_0400 for data[' + i + '].count ====>: '
+ + data[i].count)
expect(data[i].count).assertEqual(1);
}
done();
@@ -2802,7 +3277,7 @@ describe('ActsDataAbilityHelperTest', function () {
"salary": 200.5,
"blobType": "u8",
}
- let predicates = new ohos_data_ability.DataAbilityPredicates();
+ let predicates = new ohosDataAbility.DataAbilityPredicates();
predicates.equalTo('contact_id', 1);
predicates.limitAs(10);
predicates.orderByAsc("order_by_class");
@@ -2831,10 +3306,12 @@ describe('ActsDataAbilityHelperTest', function () {
],
(err, data) => {
console.debug("=ACTS_ExecuteBatch_Assert_0500 executeBatch err,data====>"
- + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;") + data.length);
+ + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data)
+ + (" 】;") + data.length);
expect(true).assertTrue();
for (var i = 0; i < data.length; i++) {
- console.debug('=ACTS_ExecuteBatch_Assert_0500 for data[' + i + '].count ====>: ' + data[i].count)
+ console.debug('=ACTS_ExecuteBatch_Assert_0500 for data[' + i + '].count ====>: '
+ + data[i].count)
expect(data[i].count).assertEqual(1);
}
done();
@@ -2864,7 +3341,7 @@ describe('ActsDataAbilityHelperTest', function () {
"salary": 200.5,
"blobType": "u8",
}
- let predicates = new ohos_data_ability.DataAbilityPredicates();
+ let predicates = new ohosDataAbility.DataAbilityPredicates();
predicates.equalTo('contact_id', 1);
predicates.limitAs(10);
predicates.orderByAsc("order_by_class");
@@ -2893,10 +3370,12 @@ describe('ActsDataAbilityHelperTest', function () {
],
(err, data) => {
console.debug("=ACTS_ExecuteBatch_Assert_0600 executeBatch err,data====>"
- + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;") + data.length);
+ + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data)
+ + (" 】;") + data.length);
expect(true).assertTrue();
for (var i = 0; i < data.length; i++) {
- console.debug('=ACTS_ExecuteBatch_Assert_0600 for data[' + i + '].count ====>: ' + data[i].count)
+ console.debug('=ACTS_ExecuteBatch_Assert_0600 for data[' + i + '].count ====>: '
+ + data[i].count)
expect(data[i].count).assertEqual(1);
}
done();
@@ -2926,7 +3405,7 @@ describe('ActsDataAbilityHelperTest', function () {
"salary": 200.5,
"blobType": "u8",
}
- let predicates = new ohos_data_ability.DataAbilityPredicates();
+ let predicates = new ohosDataAbility.DataAbilityPredicates();
predicates.equalTo('contact_id', 1);
predicates.limitAs(10);
predicates.orderByAsc("order_by_class");
@@ -2983,7 +3462,7 @@ describe('ActsDataAbilityHelperTest', function () {
"salary": 200.5,
"blobType": "u8",
}
- let predicates = new ohos_data_ability.DataAbilityPredicates();
+ let predicates = new ohosDataAbility.DataAbilityPredicates();
predicates.equalTo('contact_id', 1);
predicates.limitAs(10);
predicates.orderByAsc("order_by_class");
@@ -3049,7 +3528,7 @@ describe('ActsDataAbilityHelperTest', function () {
"salary": 200.5,
"blobType": "u8",
}
- let predicates = new ohos_data_ability.DataAbilityPredicates();
+ let predicates = new ohosDataAbility.DataAbilityPredicates();
predicates.equalTo('contact_id', 1);
predicates.limitAs(10);
predicates.orderByAsc("order_by_class");
@@ -3115,7 +3594,7 @@ describe('ActsDataAbilityHelperTest', function () {
"salary": 200.5,
"blobType": "u8",
}
- let predicates = new ohos_data_ability.DataAbilityPredicates();
+ let predicates = new ohosDataAbility.DataAbilityPredicates();
predicates.equalTo('contact_id', 1);
predicates.limitAs(10);
predicates.orderByAsc("order_by_class");
@@ -3135,10 +3614,12 @@ describe('ActsDataAbilityHelperTest', function () {
],
(err, data) => {
console.debug("=ACTS_ExecuteBatch_Delete_0400 executeBatch err,data====>"
- + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;") + data.length);
+ + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data)
+ + (" 】;") + data.length);
expect(true).assertTrue();
for (var i = 0; i < data.length; i++) {
- console.debug('=ACTS_ExecuteBatch_Delete_0400 for data[' + i + '].count ====>: ' + data[i].count)
+ console.debug('=ACTS_ExecuteBatch_Delete_0400 for data[' + i + '].count ====>: '
+ + data[i].count)
expect(data[i].count).assertEqual(1);
}
done();
@@ -3168,7 +3649,7 @@ describe('ActsDataAbilityHelperTest', function () {
"salary": 200.5,
"blobType": "u8",
}
- let predicates = new ohos_data_ability.DataAbilityPredicates();
+ let predicates = new ohosDataAbility.DataAbilityPredicates();
predicates.equalTo('contact_id', 1);
predicates.limitAs(10);
predicates.orderByAsc("order_by_class");
@@ -3197,10 +3678,12 @@ describe('ActsDataAbilityHelperTest', function () {
],
(err, data) => {
console.debug("=ACTS_ExecuteBatch_Delete_0500 executeBatch err,data====>"
- + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;") + data.length);
+ + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data)
+ + (" 】;") + data.length);
expect(true).assertTrue();
for (var i = 0; i < data.length; i++) {
- console.debug('=ACTS_ExecuteBatch_Delete_0500 for data[' + i + '].count ====>: ' + data[i].count)
+ console.debug('=ACTS_ExecuteBatch_Delete_0500 for data[' + i + '].count ====>: '
+ + data[i].count)
expect(data[i].count).assertEqual(1);
}
done();
@@ -3230,7 +3713,7 @@ describe('ActsDataAbilityHelperTest', function () {
"salary": 200.5,
"blobType": "u8",
}
- let predicates = new ohos_data_ability.DataAbilityPredicates();
+ let predicates = new ohosDataAbility.DataAbilityPredicates();
predicates.equalTo('contact_id', 1);
predicates.limitAs(10);
predicates.orderByAsc("order_by_class");
@@ -3259,10 +3742,12 @@ describe('ActsDataAbilityHelperTest', function () {
],
(err, data) => {
console.debug("=ACTS_ExecuteBatch_Delete_0600 executeBatch err,data====>"
- + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;") + data.length);
+ + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data)
+ + (" 】;") + data.length);
expect(true).assertTrue();
for (var i = 0; i < data.length; i++) {
- console.debug('=ACTS_ExecuteBatch_Delete_0600 for data[' + i + '].count ====>: ' + data[i].count)
+ console.debug('=ACTS_ExecuteBatch_Delete_0600 for data[' + i + '].count ====>: '
+ + data[i].count)
expect(data[i].count).assertEqual(1);
}
done();
@@ -3292,7 +3777,7 @@ describe('ActsDataAbilityHelperTest', function () {
"salary": 200.5,
"blobType": "u8",
}
- let predicates = new ohos_data_ability.DataAbilityPredicates();
+ let predicates = new ohosDataAbility.DataAbilityPredicates();
predicates.equalTo('contact_id', 1);
predicates.limitAs(10);
predicates.orderByAsc("order_by_class");
@@ -3376,7 +3861,7 @@ describe('ActsDataAbilityHelperTest', function () {
"salary": 200.5,
"blobType": "u8",
}
- let predicates = new ohos_data_ability.DataAbilityPredicates();
+ let predicates = new ohosDataAbility.DataAbilityPredicates();
predicates.equalTo('contact_id', 1);
predicates.limitAs(10);
predicates.orderByAsc("order_by_class");
@@ -3423,7 +3908,8 @@ describe('ActsDataAbilityHelperTest', function () {
],
(err, data) => {
console.debug("=ACTS_ExecuteBatch_0200 executeBatch err,data====>"
- + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;") + data.length);
+ + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data)
+ + (" 】;") + data.length);
expect(true).assertTrue();
for (var i = 0; i < data.length; i++) {
console.debug('=ACTS_ExecuteBatch_0200 for data[' + i + '].count ====>: ' + data[i].count)
@@ -3456,7 +3942,7 @@ describe('ActsDataAbilityHelperTest', function () {
"salary": 200.5,
"blobType": "u8",
}
- let predicates = new ohos_data_ability.DataAbilityPredicates();
+ let predicates = new ohosDataAbility.DataAbilityPredicates();
predicates.equalTo('contact_id', 1);
predicates.limitAs(10);
predicates.orderByAsc("order_by_class");
@@ -3576,7 +4062,7 @@ describe('ActsDataAbilityHelperTest', function () {
"salary": 200.5,
"blobType": "u8",
}
- let predicates = new ohos_data_ability.DataAbilityPredicates();
+ let predicates = new ohosDataAbility.DataAbilityPredicates();
predicates.equalTo('contact_id', 1);
predicates.limitAs(10);
predicates.orderByAsc("order_by_class");
@@ -3659,7 +4145,8 @@ describe('ActsDataAbilityHelperTest', function () {
],
(err, data) => {
console.debug("=ACTS_ExecuteBatch_0400 executeBatch err,data====>"
- + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data) + (" 】;") + data.length);
+ + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data)
+ + (" 】;") + data.length);
expect(true).assertTrue();
for (var i = 0; i < data.length; i++) {
console.debug('=ACTS_ExecuteBatch_0400 for data[' + i + '].count ====>: ' + data[i].count)
diff --git a/appexecfwk/ams_standard/fwkdataaccessor/hap/amsStDataAbility.hap b/appexecfwk/ams_standard/fwkdataaccessor/hap/amsStDataAbility.hap
new file mode 100644
index 0000000000000000000000000000000000000000..a3b5384320ea49717968f6e8d5d5e88963b4e436
Binary files /dev/null and b/appexecfwk/ams_standard/fwkdataaccessor/hap/amsStDataAbility.hap differ
diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/entry/src/main/js/test/ActsBmsCheckPermissionTest.test.js b/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/entry/src/main/js/test/ActsBmsCheckPermissionTest.test.js
index 8b6233adcce80efb679e4fb53a4bfa2938f73aeb..41f3067eaea02fe8733af60865333d2801ce92c1 100644
--- a/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/entry/src/main/js/test/ActsBmsCheckPermissionTest.test.js
+++ b/appexecfwk/bundle_standard/bundlemanager/actsbmscheckpermissiontest/entry/src/main/js/test/ActsBmsCheckPermissionTest.test.js
@@ -31,7 +31,7 @@ describe('ActsBmsCheckPermissionTest', function () {
it('bms_checkPermission_0100', 0, async function (done) {
console.info('=====================bms_checkPermission_0100==================');
var data = await bundle.checkPermission(BUNDLE_NAME, PERMISSION_ONE)
- expect(data).assertEqual(0);
+ expect(data).assertEqual(bundle.GrantStatus.PERMISSION_GRANTED);
done();
})
@@ -44,7 +44,7 @@ describe('ActsBmsCheckPermissionTest', function () {
console.info('=====================bms_checkPermission_0200==================');
await bundle.checkPermission(BUNDLE_NAME, PERMISSION_ONE, (err, data) => {
expect(err.code).assertEqual(0);
- expect(data).assertEqual(0);
+ expect(data).assertEqual(bundle.GrantStatus.PERMISSION_GRANTED);
done();
})
})
@@ -58,7 +58,7 @@ describe('ActsBmsCheckPermissionTest', function () {
it('bms_checkPermission_0300', 0, async function (done) {
console.info('=====================bms_checkPermission_0300==================');
var data = await bundle.checkPermission('', PERMISSION_ONE)
- expect(data).assertEqual(-1);
+ expect(data).assertEqual(bundle.GrantStatus.PERMISSION_DENIED);
done();
})
@@ -72,7 +72,7 @@ describe('ActsBmsCheckPermissionTest', function () {
console.info('=====================bms_checkPermission_0400==================');
await bundle.checkPermission('', PERMISSION_ONE, (err, data) => {
expect(err.code).assertEqual(-1);
- expect(data).assertEqual(-1);
+ expect(data).assertEqual(bundle.GrantStatus.PERMISSION_DENIED);
done();
})
})
@@ -86,7 +86,7 @@ describe('ActsBmsCheckPermissionTest', function () {
it('bms_checkPermission_0500', 0, async function (done) {
console.info('=====================bms_checkPermission_0500==================');
var data = await bundle.checkPermission(BUNDLE_NAME, '')
- expect(data).assertEqual(-1);
+ expect(data).assertEqual(bundle.GrantStatus.PERMISSION_DENIED);
done();
})
@@ -100,7 +100,7 @@ describe('ActsBmsCheckPermissionTest', function () {
console.info('=====================bms_checkPermission_0600==================');
await bundle.checkPermission(BUNDLE_NAME, '', (err, data) => {
expect(err.code).assertEqual(-1);
- expect(data).assertEqual(-1);
+ expect(data).assertEqual(bundle.GrantStatus.PERMISSION_DENIED);
done();
})
})
@@ -114,7 +114,7 @@ describe('ActsBmsCheckPermissionTest', function () {
it('bms_checkPermission_0700', 0, async function (done) {
console.info('=====================bms_checkPermission_0700==================');
var data = await bundle.checkPermission(BUNDLE_NAME, '@\n,. 。测试@abc1^%12345')
- expect(data).assertEqual(-1);
+ expect(data).assertEqual(bundle.GrantStatus.PERMISSION_DENIED);
done();
})
@@ -128,7 +128,7 @@ describe('ActsBmsCheckPermissionTest', function () {
console.info('=====================bms_checkPermission_0800==================');
await bundle.checkPermission(BUNDLE_NAME, '@\n,. 。测试@abc1^%12345', (err, data) => {
expect(err.code).assertEqual(-1);
- expect(data).assertEqual(-1);
+ expect(data).assertEqual(bundle.GrantStatus.PERMISSION_DENIED);
done();
})
})
@@ -142,7 +142,7 @@ describe('ActsBmsCheckPermissionTest', function () {
it('bms_checkPermission_0900', 0, async function (done) {
console.info('=====================bms_checkPermission_0900==================');
var data = await bundle.checkPermission('@\n,. 。测试@abc1^%12345', PERMISSION_ONE)
- expect(data).assertEqual(-1);
+ expect(data).assertEqual(bundle.GrantStatus.PERMISSION_DENIED);
done();
})
@@ -156,7 +156,7 @@ describe('ActsBmsCheckPermissionTest', function () {
console.info('=====================bms_checkPermission_1000==================');
await bundle.checkPermission('@\n,. 。测试@abc1^%12345', PERMISSION_ONE, (err, data) => {
expect(err.code).assertEqual(-1);
- expect(data).assertEqual(-1);
+ expect(data).assertEqual(bundle.GrantStatus.PERMISSION_DENIED);
done();
})
})
@@ -174,7 +174,7 @@ describe('ActsBmsCheckPermissionTest', function () {
permissionName += 'test';
}
var data = await bundle.checkPermission(BUNDLE_NAME, permissionName)
- expect(data).assertEqual(-1);
+ expect(data).assertEqual(bundle.GrantStatus.PERMISSION_DENIED);
done();
})
@@ -192,7 +192,7 @@ describe('ActsBmsCheckPermissionTest', function () {
}
await bundle.checkPermission(BUNDLE_NAME, permissionName, (err, data) => {
expect(err.code).assertEqual(-1);
- expect(data).assertEqual(-1);
+ expect(data).assertEqual(bundle.GrantStatus.PERMISSION_DENIED);
done();
})
})
@@ -210,7 +210,7 @@ describe('ActsBmsCheckPermissionTest', function () {
bundleName += 'test';
}
var data = await bundle.checkPermission(bundleName, PERMISSION_ONE)
- expect(data).assertEqual(-1);
+ expect(data).assertEqual(bundle.GrantStatus.PERMISSION_DENIED);
done();
})
@@ -228,7 +228,7 @@ describe('ActsBmsCheckPermissionTest', function () {
}
await bundle.checkPermission(bundleName, PERMISSION_ONE, (err, data) => {
expect(err.code).assertEqual(-1);
- expect(data).assertEqual(-1);
+ expect(data).assertEqual(bundle.GrantStatus.PERMISSION_DENIED);
done();
})
})
@@ -242,7 +242,7 @@ describe('ActsBmsCheckPermissionTest', function () {
it('bms_checkPermission_1500', 0, async function (done) {
console.info('=====================bms_checkPermission_1500==================');
var data = await bundle.checkPermission(BUNDLE_NAME, PERMISSION_TWO)
- expect(data).assertEqual(0);
+ expect(data).assertEqual(bundle.GrantStatus.PERMISSION_GRANTED);
done();
})
@@ -256,7 +256,7 @@ describe('ActsBmsCheckPermissionTest', function () {
console.info('=====================bms_checkPermission_1600==================');
await bundle.checkPermission(BUNDLE_NAME, PERMISSION_TWO, (err, data) => {
expect(err.code).assertEqual(0);
- expect(data).assertEqual(0);
+ expect(data).assertEqual(bundle.GrantStatus.PERMISSION_GRANTED);
done();
})
})
diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/test/ActsBmsModuleUsageRecordTest.test.js b/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/test/ActsBmsModuleUsageRecordTest.test.js
index 872b839bc235373007c077fa7e922e8940411068..1d993924299a7b70f4bdbc2948535b38fcb9d314 100644
--- a/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/test/ActsBmsModuleUsageRecordTest.test.js
+++ b/appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/test/ActsBmsModuleUsageRecordTest.test.js
@@ -183,7 +183,7 @@ describe('ActsBmsModuleUsageRecordTest', function () {
*/
it('bms_getModuleUsageRecordTest_0300', 0, async function (done) {
console.debug('=====================bms_getModuleUsageRecordTest_0300==================');
- bundle.getModuleUsageRecords(RECORD_COUNT + NUM_TWO, (err, data) => {
+ bundle.getModuleUsageRecords(RECORD_COUNT + NUM_TEN, (err, data) => {
expect(err.code).assertEqual(0);
checkModuleUsageRecord(data);
var result = checkIsExist(data, BUNDLE_NAME);
@@ -208,7 +208,7 @@ describe('ActsBmsModuleUsageRecordTest', function () {
*/
it('bms_getModuleUsageRecordTest_0400', 0, async function (done) {
console.debug('=====================bms_getModuleUsageRecordTest_0400==================');
- var records = await bundle.getModuleUsageRecords(RECORD_COUNT + NUM_TWO);
+ var records = await bundle.getModuleUsageRecords(RECORD_COUNT + NUM_TEN);
checkModuleUsageRecord(records);
var result = checkIsExist(records, BUNDLE_NAME);
expect(result).assertTrue();