From 34ccbf270aaaccd7ab5779a3be860126d1c09c0c Mon Sep 17 00:00:00 2001 From: zhoujun62 Date: Tue, 20 Sep 2022 16:07:35 +0800 Subject: [PATCH] XTS ActsAmsNewWantTest and ActsfwkDataAccessorTest fail Signed-off-by: zhoujun62 --- .../entry/src/main/ets/TestDataAbility/data.ts | 4 ++-- .../entry/src/main/ets/TestDataAbility2/data.ts | 4 ++-- .../entry/src/main/ets/TestDataAbility3/data.ts | 4 ++-- .../entry/src/main/ets/MainAbility/MainAbility.ts | 10 ++++++++++ .../entry/src/main/ets/MainAbility/MainAbility.ts | 10 ++++++++++ .../entry/src/main/ets/MainAbility/MainAbility.ts | 10 ++++++++++ .../entry/src/main/ets/SecondAbility/SecondAbility.ts | 10 ++++++++++ 7 files changed, 46 insertions(+), 6 deletions(-) diff --git a/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility/data.ts b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility/data.ts index 1a20eee46..622c50ba4 100644 --- a/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility/data.ts +++ b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility/data.ts @@ -12,8 +12,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import dataAbility from '@ohos.data.dataAbility' import featureAbility from '@ohos.ability.featureAbility' +import dataAbility from '@ohos.data.dataAbility' import fileio from '@ohos.fileio' import dataRdb from '@ohos.data.rdb' @@ -251,4 +251,4 @@ export default { } callback("success", uri); } -}; \ No newline at end of file +}; diff --git a/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility2/data.ts b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility2/data.ts index f84642cbb..4906d9e39 100644 --- a/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility2/data.ts +++ b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility2/data.ts @@ -12,8 +12,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import dataAbility from '@ohos.data.dataAbility' import featureAbility from '@ohos.ability.featureAbility' +import dataAbility from '@ohos.data.dataAbility' import fileio from '@ohos.fileio' import dataRdb from '@ohos.data.rdb' @@ -251,4 +251,4 @@ export default { } callback("success", uri); } -}; \ No newline at end of file +}; diff --git a/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility3/data.ts b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility3/data.ts index 554b74066..e6a8ac729 100644 --- a/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility3/data.ts +++ b/ability/ability_runtime/actsfwkdataaccessortest/actsdataabilityrelyhap/entry/src/main/ets/TestDataAbility3/data.ts @@ -12,8 +12,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import dataAbility from '@ohos.data.dataAbility' import featureAbility from '@ohos.ability.featureAbility' +import dataAbility from '@ohos.data.dataAbility' import fileio from '@ohos.fileio' import dataRdb from '@ohos.data.rdb' @@ -213,4 +213,4 @@ export default { } callback("success", uri); } -}; \ No newline at end of file +}; diff --git a/ability/ability_runtime/newwant/actsnewwantarelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/newwant/actsnewwantarelyhap/entry/src/main/ets/MainAbility/MainAbility.ts index 950088fc2..9962ff55d 100644 --- a/ability/ability_runtime/newwant/actsnewwantarelyhap/entry/src/main/ets/MainAbility/MainAbility.ts +++ b/ability/ability_runtime/newwant/actsnewwantarelyhap/entry/src/main/ets/MainAbility/MainAbility.ts @@ -16,6 +16,15 @@ import Ability from '@ohos.application.Ability' import commonEvent from '@ohos.commonEvent' +function sleep(delay) { + let start = new Date().getTime(); + while (true) { + if (new Date().getTime() - start > delay) { + break; + } + } +} + export default class MainAbility extends Ability { onCreate(want, launchParam) { // Ability is creating, initialize resources for this ability @@ -48,6 +57,7 @@ export default class MainAbility extends Ability { } onForeground() { + sleep(1000) // Ability has brought to foreground console.log("ACTS_NewWant MainAbility onForeground") if (globalThis.abilityWant.action == 'startHapC') { diff --git a/ability/ability_runtime/newwant/actsnewwantbrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/newwant/actsnewwantbrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts index 70dd29e22..8e74ecba1 100644 --- a/ability/ability_runtime/newwant/actsnewwantbrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts +++ b/ability/ability_runtime/newwant/actsnewwantbrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts @@ -16,6 +16,15 @@ import Ability from '@ohos.application.Ability' import commonEvent from '@ohos.commonEvent' +function sleep(delay) { + let start = new Date().getTime(); + while (true) { + if (new Date().getTime() - start > delay) { + break; + } + } +} + export default class MainAbility extends Ability { onCreate(want, launchParam) { // Ability is creating, initialize resources for this ability @@ -48,6 +57,7 @@ export default class MainAbility extends Ability { } onForeground() { + sleep(1000) // Ability has brought to foreground console.log("ACTS_NewWant MainAbility onForeground") if (globalThis.abilityWant.action == 'startHapB') { diff --git a/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts index 8dbd22aa9..153190f2b 100644 --- a/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts +++ b/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/MainAbility/MainAbility.ts @@ -16,6 +16,15 @@ import Ability from '@ohos.application.Ability' import commonEvent from '@ohos.commonEvent' +function sleep(delay) { + let start = new Date().getTime(); + while (true) { + if (new Date().getTime() - start > delay) { + break; + } + } +} + export default class MainAbility extends Ability { onCreate(want, launchParam) { // Ability is creating, initialize resources for this ability @@ -48,6 +57,7 @@ export default class MainAbility extends Ability { } onForeground() { + sleep(1000) // Ability has brought to foreground console.log("ACTS_NewWant MainAbility onForeground") if (globalThis.abilityWant.action == 'startStandard0400') { diff --git a/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/SecondAbility/SecondAbility.ts b/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/SecondAbility/SecondAbility.ts index 9f0688daa..3faed4fc1 100644 --- a/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/SecondAbility/SecondAbility.ts +++ b/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/SecondAbility/SecondAbility.ts @@ -16,6 +16,15 @@ import Ability from '@ohos.application.Ability' import commonEvent from '@ohos.commonEvent' +function sleep(delay) { + let start = new Date().getTime(); + while (true) { + if (new Date().getTime() - start > delay) { + break; + } + } +} + export default class SecondAbility extends Ability { onCreate(want, launchParam) { @@ -48,6 +57,7 @@ export default class SecondAbility extends Ability { } onForeground() { + sleep(1000) // Ability has brought to foreground var connId; console.log("ACTS_NewWant SecondAbility onForeground") -- GitLab