提交 ff258d04 编写于 作者: C chengxingzhen

xts-失败用例适配

Signed-off-by: Nchengxingzhen <chengxingzhen@huawei.com>
上级 b82d5746
......@@ -14,11 +14,38 @@
*/
import featureAbility from '@ohos.ability.featureAbility'
import {describe, beforeEach, afterEach, it, expect} from '@ohos/hypium';
import {describe, beforeEach, afterEach, beforeAll, afterAll, it, expect} from '@ohos/hypium';
import Utils from './Utils';
import backgroundTaskManager from '@ohos.backgroundTaskManager';
export default function ContextJsunit() {
describe('faContextTest', function () {
let TAG1 = "SUB_AA_OpenHarmony == faContextTest: ";
let sleepTimeOne = 1000;
let id = undefined;
beforeAll(async (done) => {
console.log(TAG1 + "beforeAll called");
let myReason = 'test FaShowOnLockTest';
let delayInfo = backgroundTaskManager.requestSuspendDelay(myReason, () => {
console.log(TAG1 + "Request suspension delay will time out.");
})
id = delayInfo.requestId;
console.log(TAG1 + "requestId is : " + id);
setTimeout(function () {
console.log(TAG1 + "beforeAll end");
done();
}, sleepTimeOne);
})
afterAll(async (done) => {
console.log(TAG1 + "afterAll called");
backgroundTaskManager.cancelSuspendDelay(id);
setTimeout(function () {
console.log(TAG1 + "afterAll end");
done();
}, sleepTimeOne);
})
beforeEach(async function (done) {
console.info("context before each called");
done()
......
......@@ -12,11 +12,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, it, expect} from '@ohos/hypium';
import { describe, beforeAll, afterAll, it, expect } from '@ohos/hypium';
import Utils from './Utils';
import ability_featureAbility from '@ohos.ability.featureAbility';
import ability_particleAbility from '@ohos.ability.particleAbility';
import abilityManager from "@ohos.application.appManager"
import backgroundTaskManager from '@ohos.backgroundTaskManager';
const TAG_TEST_0100 = ' context_isUpdatingConfigurations_test_0100 ';
const TAG_TEST_0200 = ' context_isUpdatingConfigurations_test_0200 ';
......@@ -33,6 +33,33 @@ const TAG_TEST_0012 = ' context_featureAbility_test_0400 ';
export default function addContextAndAbilityJsunit() {
describe('addContextTest', function () {
let TAG1 = "SUB_AA_OpenHarmony == addContextTest: ";
let sleepTimeOne = 1000;
let id = undefined;
beforeAll(async (done) => {
console.log(TAG1 + "beforeAll called");
let myReason = 'test FaShowOnLockTest';
let delayInfo = backgroundTaskManager.requestSuspendDelay(myReason, () => {
console.log(TAG1 + "Request suspension delay will time out.");
})
id = delayInfo.requestId;
console.log(TAG1 + "requestId is : " + id);
setTimeout(function () {
console.log(TAG1 + "beforeAll end");
done();
}, sleepTimeOne);
})
afterAll(async (done) => {
console.log(TAG1 + "afterAll called");
backgroundTaskManager.cancelSuspendDelay(id);
setTimeout(function () {
console.log(TAG1 + "afterAll end");
done();
}, sleepTimeOne);
})
/*
* @tc.number: context_isUpdatingConfigurations_test_0100
* @tc.name: isUpdatingConfigurations : Obtains whether the configuration of the current ability is changing.
......
......@@ -12,13 +12,40 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, it, expect} from '@ohos/hypium';
import { describe, beforeAll, afterAll, it, expect } from '@ohos/hypium';
import Utils from './Utils';
import ability_featureAbility from '@ohos.ability.featureAbility';
import backgroundTaskManager from '@ohos.backgroundTaskManager';
export default function getHapModuleInfoJsunit() {
describe('getAbilityInfoTest', function () {
let TAG1 = "SUB_AA_OpenHarmony == getAbilityInfoTest: ";
let sleepTimeOne = 1000;
let id = undefined;
beforeAll(async (done) => {
console.log(TAG1 + "beforeAll called");
let myReason = 'test FaShowOnLockTest';
let delayInfo = backgroundTaskManager.requestSuspendDelay(myReason, () => {
console.log(TAG1 + "Request suspension delay will time out.");
})
id = delayInfo.requestId;
console.log(TAG1 + "requestId is : " + id);
setTimeout(function () {
console.log(TAG1 + "beforeAll end");
done();
}, sleepTimeOne);
})
afterAll(async (done) => {
console.log(TAG1 + "afterAll called");
backgroundTaskManager.cancelSuspendDelay(id);
setTimeout(function () {
console.log(TAG1 + "afterAll end");
done();
}, sleepTimeOne);
})
/**
* @tc.number: context_getAbilityInfo_test_0100
* @tc.name: getAbilityInfo:Query the current attributionability details.
......
......@@ -12,12 +12,40 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, it, expect} from '@ohos/hypium';
import { describe, beforeAll, afterAll, it, expect } from '@ohos/hypium';
import Utils from './Utils';
import ability_featureAbility from '@ohos.ability.featureAbility';
import backgroundTaskManager from '@ohos.backgroundTaskManager';
export default function getHapModuleInfoJsunit() {
describe('getAppVersionInfoTest', function () {
let TAG1 = "SUB_AA_OpenHarmony == getAppVersionInfoTest: ";
let sleepTimeOne = 1000;
let id = undefined;
beforeAll(async (done) => {
console.log(TAG1 + "beforeAll called");
let myReason = 'test FaShowOnLockTest';
let delayInfo = backgroundTaskManager.requestSuspendDelay(myReason, () => {
console.log(TAG1 + "Request suspension delay will time out.");
})
id = delayInfo.requestId;
console.log(TAG1 + "requestId is : " + id);
setTimeout(function () {
console.log(TAG1 + "beforeAll end");
done();
}, sleepTimeOne);
})
afterAll(async (done) => {
console.log(TAG1 + "afterAll called");
backgroundTaskManager.cancelSuspendDelay(id);
setTimeout(function () {
console.log(TAG1 + "afterAll end");
done();
}, sleepTimeOne);
})
/**
* @tc.number: context_getAppVersionInfo_test_0100
* @tc.name: getAppVersionInfo:Gets the version information for the application.
......
......@@ -12,12 +12,40 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, it, expect} from '@ohos/hypium';
import { describe, beforeAll, afterAll, it, expect } from '@ohos/hypium';
import Utils from './Utils';
import ability_featureAbility from '@ohos.ability.featureAbility';
import backgroundTaskManager from '@ohos.backgroundTaskManager';
export default function getHapModuleInfoJsunit() {
describe('getApplicationContextTest', function () {
let TAG1 = "SUB_AA_OpenHarmony == getApplicationContextTest: ";
let sleepTimeOne = 1000;
let id = undefined;
beforeAll(async (done) => {
console.log(TAG1 + "beforeAll called");
let myReason = 'test FaShowOnLockTest';
let delayInfo = backgroundTaskManager.requestSuspendDelay(myReason, () => {
console.log(TAG1 + "Request suspension delay will time out.");
})
id = delayInfo.requestId;
console.log(TAG1 + "requestId is : " + id);
setTimeout(function () {
console.log(TAG1 + "beforeAll end");
done();
}, sleepTimeOne);
})
afterAll(async (done) => {
console.log(TAG1 + "afterAll called");
backgroundTaskManager.cancelSuspendDelay(id);
setTimeout(function () {
console.log(TAG1 + "afterAll end");
done();
}, sleepTimeOne);
})
/**
* @tc.number: context_getApplicationContext_test_0100
* @tc.name: getApplicationContext:Gets the application context information.
......
......@@ -12,14 +12,40 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, it, expect} from '@ohos/hypium';
import { describe, beforeAll, afterAll, it, expect } from '@ohos/hypium';
import Utils from './Utils';
import ability_featureAbility from '@ohos.ability.featureAbility';
import backgroundTaskManager from '@ohos.backgroundTaskManager';
export default function getHapModuleInfoJsunit() {
describe('getHapModuleInfoTest', function () {
let TAG1 = "SUB_AA_OpenHarmony == getHapModuleInfoTest: ";
let sleepTimeOne = 1000;
let id = undefined;
beforeAll(async (done) => {
console.log(TAG1 + "beforeAll called");
let myReason = 'test FaShowOnLockTest';
let delayInfo = backgroundTaskManager.requestSuspendDelay(myReason, () => {
console.log(TAG1 + "Request suspension delay will time out.");
})
id = delayInfo.requestId;
console.log(TAG1 + "requestId is : " + id);
setTimeout(function () {
console.log(TAG1 + "beforeAll end");
done();
}, sleepTimeOne);
})
afterAll(async (done) => {
console.log(TAG1 + "afterAll called");
backgroundTaskManager.cancelSuspendDelay(id);
setTimeout(function () {
console.log(TAG1 + "afterAll end");
done();
}, sleepTimeOne);
})
/**
* @tc.number: context_getHapModuleInfo_test_0100
* @tc.name: getHapModuleInfo:Obtains the HapModuleInfo object of the application.
......
......@@ -35,16 +35,6 @@
}
]
}
],
"requestPermissions": [
{
"name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
"reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
},
{
"name":"ohos.permission.START_INVISIBLE_ABILITY",
"reason":"need use ohos.permission.START_INVISIBLE_ABILITY"
}
]
}
}
\ No newline at end of file
......@@ -586,6 +586,7 @@ export default function ApiCoverTest() {
console.info("SUB_AA_FMS_AbilityStage_0100===AbilityStage===" + JSON.stringify(globalThis.stageContext))
console.info("SUB_AA_FMS_AbilityStage_0100===AbilityStage===" + JSON.stringify(globalThis.stageContext.config))
let directions = globalThis.stageContext.config.direction
let pointer = globalThis.stageContext.config.hasPointerDevice
let subscriber = null
let subscribeInfo = {
events: ["AbilityStage_StartAbility"]
......@@ -598,6 +599,7 @@ export default function ApiCoverTest() {
console.info("SUB_AA_FMS_AbilityStage_0100===SubscribeInfoCallback===" + JSON.stringify(data))
expect(data.parameters["config"]).assertEqual(-1)
expect(data.parameters["config"]).assertEqual(directions)
expect(pointer).assertFalse()
commonEvent.unsubscribe(subscriber, UnSubscribeInfoCallback)
await sleep(4000)
done()
......
......@@ -14,7 +14,6 @@
},
"deviceConfig": {
"default": {
"process": "processTestAbility"
}
},
"module": {
......@@ -55,7 +54,6 @@
"label": "$string:app_name",
"type": "page",
"launchType": "singleton",
"process": "processTestAbility",
"permissions": ["ohos.permission.ACCELEROMETER"],
"deviceCapability": ["SystemCapability.Ability.AbilityBase"],
"uri": "uriTest",
......@@ -75,8 +73,7 @@
"launchType": "singleton",
"permissions": ["ohos.permission.ACCELEROMETER"],
"deviceCapability": ["SystemCapability.Ability.AbilityBase"],
"uri": "uriTest",
"process": "processTestAbility"
"uri": "uriTest"
}
],
"reqCapabilities": ["reqCapabilitiesTest1","reqCapabilitiesTest2"],
......@@ -96,36 +93,12 @@
"when": "always"
}
},
{
"name": "ohos.permission.INSTALL_BUNDLE",
"reason": "need use ohos.permission.INSTALL_BUNDLE"
},
{
"name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED",
"reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
},
{
"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"
},
{
"name": "ohos.permission.KEEP_BACKGROUND_RUNNING"
},
{
"name": "ohos.permission.ACCELEROMETER",
"reason":"need use ohos.permission.ACCELEROMETER"
},
{
"name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
"reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
"name": "ohos.permission.KEEP_BACKGROUND_RUNNING"
}
],
"js": [
......
......@@ -905,7 +905,7 @@ describe('ActsFeatureAbilityTest', function () {
// expect(info.labelId).assertEqual(0); //create by DevEco when building HAP.
expect(info.icon).assertEqual("$media:icon");
// expect(info.iconId).assertEqual(0); //create by DevEco when building HAP.
expect(info.process).assertEqual("processTestAbility");
expect(info.process).assertEqual("com.example.actsfeatureabilitytest");
expect(info.supportedModes).assertEqual(0);
expect(info.moduleSourceDirs[0]).assertEqual("/data/app/el1/bundle/public/" +
"com.example.actsfeatureabilitytest/com.example.actsfeatureabilitytest");
......@@ -965,7 +965,7 @@ describe('ActsFeatureAbilityTest', function () {
expect(typeof (info)).assertEqual("object");
expect(typeof (info.processName)).assertEqual("string");
expect(typeof (info.pid)).assertEqual("number");
expect(info.processName).assertEqual("processTestAbility");
expect(info.processName).assertEqual("com.example.actsfeatureabilitytest");
}
/**
......@@ -1158,7 +1158,7 @@ describe('ActsFeatureAbilityTest', function () {
expect(data.icon).assertEqual("$media:icon");
expect(data.moduleName).assertEqual("entry");
expect(data.process).assertEqual("processTestAbility");
expect(data.process).assertEqual("com.example.actsfeatureabilitytest");
expect(data.targetAbility).assertEqual("");
expect(data.backgroundModes).assertEqual(0);
expect(data.isVisible).assertEqual(true);
......@@ -1304,7 +1304,7 @@ describe('ActsFeatureAbilityTest', function () {
function checkProcessName(info) {
console.info("checkProcessName processName : " + info);
expect(typeof (info)).assertEqual("string");
expect(info).assertEqual("processTestAbility");
expect(info).assertEqual("com.example.actsfeatureabilitytest");
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册