未验证 提交 542a4eb5 编写于 作者: O openharmony_ci 提交者: Gitee

!5476 修改无障碍XTS功能测试用例

Merge pull request !5476 from Mupceet/release_0915_xts_master
...@@ -38,7 +38,6 @@ export default function abilityTest() { ...@@ -38,7 +38,6 @@ export default function abilityTest() {
prompt.showToast({ prompt.showToast({
message: 'CASE All End' message: 'CASE All End'
}) })
disableAll(LOG_PREFIX + ' disableAll ')
done() done()
}) })
/** /**
......
/*
* Copyright (c) 2022 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 commonEvent from '@ohos.commonEvent'
import AccessibilityExtensionAbility from '@ohos.application.AccessibilityExtensionAbility'
const logTag = "[xtsLog]"
class ServiceExtAbility extends AccessibilityExtensionAbility {
onConnect() {
const context = this.context;
console.info(logTag + "AccessibilityAll onAbilityConnected");
var commonEventSubscribeInfo = {
events: ["on_assist_change", "execute_accessibility_event"]
}
function subscriberCallback(err, data) {
console.info(logTag + "AccessibilityALLD subscriberCallback start");
console.info(logTag + "AccessibilityALLD receive event err:" + JSON.stringify(err));
console.info(logTag + "AccessibilityALLD receive event data:" + JSON.stringify(data));
console.info(logTag + "AccessibilityALLD subscriberCallback end");
}
var subscriber
commonEvent.createSubscriber(commonEventSubscribeInfo).then(function (data) {
console.info(logTag + " AccessibilityALLD createSubscriber Start====")
subscriber = data;
commonEvent.subscribe(subscriber, subscriberCallback);
console.info(logTag + " AccessibilityALLD createSubscriber End====")
})
console.info(logTag + " AccessibilityALLD onShow End====")
}
onAccessibilityEvent(accessibilityEvent) {
printAccessibilityEvent(accessibilityEvent);
return true;
}
onKeyEvent(keyEvent) {
console.info(" onKeyEvent");
console.info(logTag + "onKeyEvent KeyInterception AccessibilityAllD: " + JSON.stringify(keyEvent));
return true;
}
}
const printAccessibilityEvent = (accessibilityEvent) => {
console.info(logTag + "AccessibilityAllD onAccessibilityEvent Start");
console.info(logTag + "AccessibilityAllD onAccessibilityEvent accessibilityEvent=" + JSON.stringify(accessibilityEvent));
console.info(logTag + "AccessibilityAllD onAccessibilityEvent End");
}
export default ServiceExtAbility
...@@ -18,6 +18,14 @@ import accessibility from '@ohos.accessibility'; ...@@ -18,6 +18,14 @@ import accessibility from '@ohos.accessibility';
import config from '@ohos.accessibility.config'; import config from '@ohos.accessibility.config';
const LOG = "[xtsLog]" const LOG = "[xtsLog]"
const START_TIMEOUT = 5000; const START_TIMEOUT = 5000;
var backList = []
let subScriber = undefined;
let registerOn = false;
const callbackData = (data) => {
console.info(LOG + " captionsManager on res = " + JSON.stringify(data))
registerOn = true
}
const CaptionConfigurationOn = (logTag, captionType) => { const CaptionConfigurationOn = (logTag, captionType) => {
let captionsManager = accessibility.getCaptionsManager(); let captionsManager = accessibility.getCaptionsManager();
...@@ -25,11 +33,7 @@ const CaptionConfigurationOn = (logTag, captionType) => { ...@@ -25,11 +33,7 @@ const CaptionConfigurationOn = (logTag, captionType) => {
console.info(logTag + " captionsManager is undefined"); console.info(logTag + " captionsManager is undefined");
return; return;
} }
captionsManager.on(captionType, (res) => { captionsManager.on(captionType, callbackData);
console.info(logTag + " captionsManager on " + captionType + " res: " + JSON.stringify(res));
onbackList.push(logTag + "_on_success")
console.info(logTag + "_on_success");
});
} }
const CaptionConfigurationOff = (logTag, captionType) => { const CaptionConfigurationOff = (logTag, captionType) => {
...@@ -38,37 +42,32 @@ const CaptionConfigurationOff = (logTag, captionType) => { ...@@ -38,37 +42,32 @@ const CaptionConfigurationOff = (logTag, captionType) => {
console.info(logTag + " captionsManager is undefined"); console.info(logTag + " captionsManager is undefined");
return; return;
} }
captionsManager.off(captionType, (res) => { captionsManager.off(captionType, callbackData);
console.info(logTag + " captionsManager off " + captionType + " res: " + JSON.stringify(res)); }
});
const CaptionConfigurationOffAll = (logTag, captionType) => {
let captionsManager = accessibility.getCaptionsManager();
if (!captionsManager) {
console.info(logTag + " captionsManager is undefined");
return;
}
captionsManager.off(captionType);
} }
const captionOn = (logTag, caseName) => { const captionOn = (logTag, caseName) => {
config.captions.on((res) => { config.captions.on(callbackData);
console.info(logTag + " captionOn res = " + JSON.stringify(res));
console.info(logTag + "_on_success");
onbackList.push(caseName + "_on_success")
});
} }
const captionOff = (logTag, captionType) => { const captionOff = (logTag, captionType) => {
config.captions.off((res) => { config.captions.off(callbackData);
console.info(logTag + " caption off " + captionType + " res: " + JSON.stringify(res));
});
} }
const captionStyleOn = (logTag, caseName) => { const captionStyleOn = (logTag, caseName) => {
config.captionsStyle.on((res) => { config.captionsStyle.on(callbackData);
console.info(logTag + " captionsStyle On res = " + JSON.stringify(res));
console.info(logTag + "_on_success");
onbackList.push(caseName + "_on_success")
});
} }
const captionStyleOff = (logTag, captionType) => { const captionStyleOff = (logTag, captionType) => {
config.captionsStyle.off((res) => { config.captionsStyle.off(callbackData);
console.info(logTag + " captionsStyle off " + captionType + " res: " + JSON.stringify(res));
});
} }
const excuteCase = (caseNamePara) => { const excuteCase = (caseNamePara) => {
...@@ -83,16 +82,15 @@ const excuteCase = (caseNamePara) => { ...@@ -83,16 +82,15 @@ const excuteCase = (caseNamePara) => {
} }
commonEvent.publish("on_target_change", commonEventPublishData, publishCallback); commonEvent.publish("on_target_change", commonEventPublishData, publishCallback);
} }
var backList = []
let subScriber = undefined;
var onbackList = []
export default function CaptionConfigurationTest() { export default function CaptionConfigurationTest() {
describe('ActsCaptionConfigurationTest', function () { describe('ActsCaptionConfigurationTest', function () {
beforeEach(async function (done) { beforeEach(async function (done) {
console.info(LOG + 'ActsCaptionConfigurationTest: beforeEach'); console.info(LOG + 'ActsCaptionConfigurationTest: beforeEach');
setTimeout(() => { setTimeout(() => {
backList = []
done(); done();
}, 3000); }, 1000);
}); });
beforeAll(async function (done) { beforeAll(async function (done) {
console.info(LOG + 'ActsCaptionConfigurationTest: beforeAll'); console.info(LOG + 'ActsCaptionConfigurationTest: beforeAll');
...@@ -124,13 +122,14 @@ export default function CaptionConfigurationTest() { ...@@ -124,13 +122,14 @@ export default function CaptionConfigurationTest() {
}); });
/** /**
* @tc.number: CaptionConfiguration_0010 * @tc.number: CaptionConfiguration_0270
* @tc.name: Call api:getcaptionsmanager() to set the caption parameter. * @tc.name: Call api:getcaptionsmanager() to set the caption parameter.
* @tc.desc: Call api:getcaptionsmanager() to set the caption parameter. * @tc.desc: Call api:getcaptionsmanager() to set the caption parameter.
*/ */
it('CaptionConfiguration_0010', 1, async function (done) { it('CaptionConfiguration_0270', 1, async function (done) {
const caseName = "CaptionConfiguration_0010"; const caseName = "CaptionConfiguration_0270";
const logF = LOG + caseName; const logF = LOG + caseName;
registerOn = false;
setTimeout(() => { setTimeout(() => {
CaptionConfigurationOn(caseName, 'enableChange') CaptionConfigurationOn(caseName, 'enableChange')
}, 1000); }, 1000);
...@@ -139,117 +138,110 @@ export default function CaptionConfigurationTest() { ...@@ -139,117 +138,110 @@ export default function CaptionConfigurationTest() {
}, 3000); }, 3000);
setTimeout(() => { setTimeout(() => {
var isSucceedTarget: boolean = false; var isSucceedTarget: boolean = false;
var isSucceedOnBack: boolean = false;
if (backList.indexOf(caseName + '_on_target_change_extra_success') !== -1) { if (backList.indexOf(caseName + '_on_target_change_extra_success') !== -1) {
isSucceedTarget = true; isSucceedTarget = true;
} }
if (onbackList.indexOf(caseName + '_on_success') !== -1) { expect(isSucceedTarget).assertEqual(true);
isSucceedOnBack = true; expect(registerOn).assertEqual(true);
} console.info(logF + ' isSucceed : ' + (isSucceedTarget));
expect(isSucceedTarget && isSucceedOnBack).assertEqual(true); CaptionConfigurationOff(caseName, 'enableChange')
console.info(logF + ' isSucceed : ' + (isSucceedTarget && isSucceedOnBack));
done(); done();
}, 8000); }, 8000);
}); });
/** /**
* @tc.number: CaptionConfiguration_0020 * @tc.number: CaptionConfiguration_0280
* @tc.name: Call api:getcaptionsmanager() to set the caption parameter. * @tc.name: Call api:getcaptionsmanager() to set the caption parameter.
* @tc.desc: Call api:getcaptionsmanager() to set the caption parameter. * @tc.desc: Call api:getcaptionsmanager() to set the caption parameter.
*/ */
it('CaptionConfiguration_0020', 1, async function (done) { it('CaptionConfiguration_0280', 1, async function (done) {
const caseName = "CaptionConfiguration_0020"; const caseName = "CaptionConfiguration_0280";
const logF = LOG + caseName; const logF = LOG + caseName;
registerOn = false;
CaptionConfigurationOn(caseName, 'styleChange') CaptionConfigurationOn(caseName, 'styleChange')
setTimeout(() => { setTimeout(() => {
excuteCase(caseName); excuteCase(caseName);
}, 3000); }, 3000);
setTimeout(() => { setTimeout(() => {
var isSucceedTarget: boolean = false; var isSucceedTarget: boolean = false;
var isSucceedOnBack: boolean = false;
if (backList.indexOf(caseName + '_on_target_change_extra_success') !== -1) { if (backList.indexOf(caseName + '_on_target_change_extra_success') !== -1) {
isSucceedTarget = true; isSucceedTarget = true;
} }
if (onbackList.indexOf(caseName + '_on_success') !== -1) { expect(isSucceedTarget).assertEqual(true);
isSucceedOnBack = true; expect(registerOn).assertEqual(true);
} console.info(logF + ' isSucceed : ' + (isSucceedTarget));
expect(isSucceedTarget && isSucceedOnBack).assertEqual(true); CaptionConfigurationOffAll(caseName, 'styleChange')
console.info(logF + ' isSucceed : ' + (isSucceedTarget && isSucceedOnBack));
done(); done();
}, 8000); }, 8000);
}); });
/** /**
* @tc.number: CaptionConfiguration_0030 * @tc.number: CaptionConfiguration_0290
* @tc.name: Call api:getcaptionsmanager() to set the caption parameter. * @tc.name: Call api:getcaptionsmanager() to set the caption parameter.
* @tc.desc: Call api:getcaptionsmanager() to set the caption parameter. * @tc.desc: Call api:getcaptionsmanager() to set the caption parameter.
*/ */
it('CaptionConfiguration_0030', 1, async function (done) { it('CaptionConfiguration_0290', 1, async function (done) {
const caseName = "CaptionConfiguration_0030"; const caseName = "CaptionConfiguration_0290";
const logF = LOG + caseName; const logF = LOG + caseName;
registerOn = false;
setTimeout(() => { setTimeout(() => {
CaptionConfigurationOn(caseName, 'enableChange'); CaptionConfigurationOn(caseName, 'enableChange');
}, 1000); }, 1000);
setTimeout(() => { setTimeout(() => {
CaptionConfigurationOff(caseName, 'enableChange') CaptionConfigurationOff(caseName, 'enableChange')
setTimeout(() => {
excuteCase(caseName);
}, 3000);
}, 2000); }, 2000);
setTimeout(() => {
excuteCase(caseName);
}, 3000);
setTimeout(() => { setTimeout(() => {
var isSucceedTarget: boolean = false; var isSucceedTarget: boolean = false;
var isSucceedOnBack: boolean = false;
if (backList.indexOf(caseName + '_on_target_change_extra_success') !== -1) { if (backList.indexOf(caseName + '_on_target_change_extra_success') !== -1) {
isSucceedTarget = true; isSucceedTarget = true;
} }
if (onbackList.indexOf(caseName + '_on_success') == -1) { expect(isSucceedTarget).assertEqual(true);
isSucceedOnBack = true; expect(registerOn).assertEqual(false);
} console.info(logF + ' isSucceed : ' + (isSucceedTarget));
expect(isSucceedTarget && isSucceedOnBack).assertEqual(true);
console.info(logF + ' isSucceed : ' + (isSucceedTarget && isSucceedOnBack));
done(); done();
}, 8000); }, 8000);
}); });
/** /**
* @tc.number: CaptionConfiguration_0040 * @tc.number: CaptionConfiguration_0300
* @tc.name: Call api:getcaptionsmanager() to set the caption parameter. * @tc.name: Call api:getcaptionsmanager() to set the caption parameter.
* @tc.desc: Call api:getcaptionsmanager() to set the caption parameter. * @tc.desc: Call api:getcaptionsmanager() to set the caption parameter.
*/ */
it('CaptionConfiguration_0040', 1, async function (done) { it('CaptionConfiguration_0300', 1, async function (done) {
const caseName = "CaptionConfiguration_0040"; const caseName = "CaptionConfiguration_0300";
const logF = LOG + caseName; const logF = LOG + caseName;
registerOn = false;
setTimeout(() => { setTimeout(() => {
CaptionConfigurationOn(caseName, 'styleChange'); CaptionConfigurationOn(caseName, 'styleChange');
}, 1000); }, 1000);
setTimeout(() => { setTimeout(() => {
CaptionConfigurationOff(caseName, 'styleChange') CaptionConfigurationOff(caseName, 'styleChange')
setTimeout(() => {
excuteCase(caseName);
}, 3000);
}, 2000); }, 2000);
setTimeout(() => {
excuteCase(caseName);
}, 3000);
setTimeout(() => { setTimeout(() => {
var isSucceedTarget: boolean = false; var isSucceedTarget: boolean = false;
var isSucceedOnBack: boolean = false;
if (backList.indexOf(caseName + '_on_target_change_extra_success') !== -1) { if (backList.indexOf(caseName + '_on_target_change_extra_success') !== -1) {
isSucceedTarget = true; isSucceedTarget = true;
} }
if (onbackList.indexOf(caseName + '_on_success') == -1) { expect(isSucceedTarget).assertEqual(true);
isSucceedOnBack = true; expect(registerOn).assertEqual(false);
} console.info(logF + ' isSucceed : ' + (isSucceedTarget));
expect(isSucceedTarget && isSucceedOnBack).assertEqual(true);
console.info(logF + ' isSucceed : ' + (isSucceedTarget && isSucceedOnBack));
done(); done();
}, 8000); }, 8000);
}); });
/** /**
* @tc.number: CaptionConfiguration_0050 * @tc.number: CaptionConfiguration_0310
* @tc.name: Call api:getcaptionsmanager() to set the caption parameter. * @tc.name: Call api:getcaptionsmanager() to set the caption parameter.
* @tc.desc: Call api:getcaptionsmanager() to set the caption parameter. * @tc.desc: Call api:getcaptionsmanager() to set the caption parameter.
*/ */
it('CaptionConfiguration_0050', 1, async function (done) { it('CaptionConfiguration_0310', 1, async function (done) {
const caseName = "CaptionConfiguration_0050"; const caseName = "CaptionConfiguration_0310";
const logF = LOG + caseName; const logF = LOG + caseName;
setTimeout(() => { setTimeout(() => {
excuteCase(caseName); excuteCase(caseName);
...@@ -266,12 +258,12 @@ export default function CaptionConfigurationTest() { ...@@ -266,12 +258,12 @@ export default function CaptionConfigurationTest() {
}); });
/** /**
* @tc.number: CaptionConfiguration_0060 * @tc.number: CaptionConfiguration_0320
* @tc.name: Call api:getcaptionsmanager() to set the caption parameter. * @tc.name: Call api:getcaptionsmanager() to set the caption parameter.
* @tc.desc: Call api:getcaptionsmanager() to set the caption parameter. * @tc.desc: Call api:getcaptionsmanager() to set the caption parameter.
*/ */
it('CaptionConfiguration_0060', 1, async function (done) { it('CaptionConfiguration_0320', 1, async function (done) {
const caseName = "CaptionConfiguration_0060"; const caseName = "CaptionConfiguration_0320";
const logF = LOG + caseName; const logF = LOG + caseName;
setTimeout(() => { setTimeout(() => {
excuteCase(caseName); excuteCase(caseName);
...@@ -288,12 +280,12 @@ export default function CaptionConfigurationTest() { ...@@ -288,12 +280,12 @@ export default function CaptionConfigurationTest() {
}); });
/** /**
* @tc.number: CaptionConfiguration_0070 * @tc.number: CaptionConfiguration_0330
* @tc.name: Call api:getcaptionsmanager() to set the caption parameter. * @tc.name: Call api:getcaptionsmanager() to set the caption parameter.
* @tc.desc: Call api:getcaptionsmanager() to set the caption parameter. * @tc.desc: Call api:getcaptionsmanager() to set the caption parameter.
*/ */
it('CaptionConfiguration_0070', 1, async function (done) { it('CaptionConfiguration_0330', 1, async function (done) {
const caseName = "CaptionConfiguration_0070"; const caseName = "CaptionConfiguration_0330";
const logF = LOG + caseName; const logF = LOG + caseName;
setTimeout(() => { setTimeout(() => {
excuteCase(caseName); excuteCase(caseName);
...@@ -310,12 +302,12 @@ export default function CaptionConfigurationTest() { ...@@ -310,12 +302,12 @@ export default function CaptionConfigurationTest() {
}); });
/** /**
* @tc.number: CaptionConfiguration_0080 * @tc.number: CaptionConfiguration_0340
* @tc.name: Call api:getcaptionsmanager() to set the caption parameter. * @tc.name: Call api:getcaptionsmanager() to set the caption parameter.
* @tc.desc: Call api:getcaptionsmanager() to set the caption parameter. * @tc.desc: Call api:getcaptionsmanager() to set the caption parameter.
*/ */
it('CaptionConfiguration_0080', 1, async function (done) { it('CaptionConfiguration_0340', 1, async function (done) {
const caseName = "CaptionConfiguration_0080"; const caseName = "CaptionConfiguration_0340";
const logF = LOG + caseName; const logF = LOG + caseName;
setTimeout(() => { setTimeout(() => {
excuteCase(caseName); excuteCase(caseName);
...@@ -405,6 +397,7 @@ export default function CaptionConfigurationTest() { ...@@ -405,6 +397,7 @@ export default function CaptionConfigurationTest() {
it('CaptionConfiguration_0120', 1, async function (done) { it('CaptionConfiguration_0120', 1, async function (done) {
const caseName = "CaptionConfiguration_0120"; const caseName = "CaptionConfiguration_0120";
const logF = LOG + caseName; const logF = LOG + caseName;
registerOn = false;
setTimeout(() => { setTimeout(() => {
CaptionConfigurationOn(caseName, undefined); CaptionConfigurationOn(caseName, undefined);
}, 1000); }, 1000);
...@@ -413,15 +406,12 @@ export default function CaptionConfigurationTest() { ...@@ -413,15 +406,12 @@ export default function CaptionConfigurationTest() {
}, 2000); }, 2000);
setTimeout(() => { setTimeout(() => {
var isSucceedTarget: boolean = false; var isSucceedTarget: boolean = false;
var isSucceedOnBack: boolean = false; if (backList.indexOf(caseName + '_on_target_change_extra_success') != -1) {
if (backList.indexOf(caseName + '_on_target_change_extra_success') == -1) {
isSucceedTarget = true; isSucceedTarget = true;
} }
if (onbackList.indexOf(caseName + '_on_success') == -1) { expect(isSucceedTarget).assertEqual(true);
isSucceedOnBack = true; expect(registerOn).assertEqual(false);
} console.info(logF + ' isSucceed : ' + (isSucceedTarget));
expect(isSucceedTarget && isSucceedOnBack).assertEqual(true);
console.info(logF + ' isSucceed : ' + (isSucceedTarget && isSucceedOnBack));
done(); done();
}, 8000); }, 8000);
}); });
...@@ -456,23 +446,22 @@ export default function CaptionConfigurationTest() { ...@@ -456,23 +446,22 @@ export default function CaptionConfigurationTest() {
it('CaptionConfiguration_0140', 1, async function (done) { it('CaptionConfiguration_0140', 1, async function (done) {
const caseName = "CaptionConfiguration_0140"; const caseName = "CaptionConfiguration_0140";
const logF = LOG + caseName; const logF = LOG + caseName;
registerOn = false;
setTimeout(() => { setTimeout(() => {
captionOn(logF, caseName) captionOn(logF, caseName);
}, 1000); }, 1000);
setTimeout(() => { setTimeout(() => {
excuteCase(caseName); excuteCase(caseName);
}, 3000); }, 3000);
setTimeout(() => { setTimeout(() => {
var isSucceedTarget: boolean = false; var isSucceedTarget: boolean = false;
var isSucceedOnBack: boolean = false;
if (backList.indexOf(caseName + '_on_target_change_extra_success') !== -1) { if (backList.indexOf(caseName + '_on_target_change_extra_success') !== -1) {
isSucceedTarget = true; isSucceedTarget = true;
} }
if (onbackList.indexOf(caseName + '_on_success') !== -1) { expect(isSucceedTarget).assertEqual(true);
isSucceedOnBack = true; expect(registerOn).assertEqual(true);
} console.info(logF + ' isSucceed : ' + (isSucceedTarget));
expect(isSucceedTarget && isSucceedOnBack).assertEqual(true); captionOff(logF, caseName);
console.info(logF + ' isSucceed : ' + (isSucceedTarget && isSucceedOnBack));
done(); done();
}, 8000); }, 8000);
}); });
...@@ -485,21 +474,20 @@ export default function CaptionConfigurationTest() { ...@@ -485,21 +474,20 @@ export default function CaptionConfigurationTest() {
it('CaptionConfiguration_0150', 1, async function (done) { it('CaptionConfiguration_0150', 1, async function (done) {
const caseName = "CaptionConfiguration_0150"; const caseName = "CaptionConfiguration_0150";
const logF = LOG + caseName; const logF = LOG + caseName;
captionStyleOn(logF, caseName) registerOn = false;
captionStyleOn(logF, caseName);
setTimeout(() => { setTimeout(() => {
excuteCase(caseName); excuteCase(caseName);
}, 3000); }, 3000);
setTimeout(() => { setTimeout(() => {
var isSucceedTarget: boolean = false; var isSucceedTarget: boolean = false;
var isSucceedOnBack: boolean = false;
if (backList.indexOf(caseName + '_on_target_change_extra_success') !== -1) { if (backList.indexOf(caseName + '_on_target_change_extra_success') !== -1) {
isSucceedTarget = true; isSucceedTarget = true;
} }
if (onbackList.indexOf(caseName + '_on_success') !== -1) { expect(isSucceedTarget).assertEqual(true);
isSucceedOnBack = true; expect(registerOn).assertEqual(true);
} console.info(logF + ' isSucceed : ' + (isSucceedTarget));
expect(isSucceedTarget && isSucceedOnBack).assertEqual(true); config.captionsStyle.off();
console.info(logF + ' isSucceed : ' + (isSucceedTarget && isSucceedOnBack));
done(); done();
}, 8000); }, 8000);
}); });
...@@ -512,26 +500,24 @@ export default function CaptionConfigurationTest() { ...@@ -512,26 +500,24 @@ export default function CaptionConfigurationTest() {
it('CaptionConfiguration_0160', 1, async function (done) { it('CaptionConfiguration_0160', 1, async function (done) {
const caseName = "CaptionConfiguration_0160"; const caseName = "CaptionConfiguration_0160";
const logF = LOG + caseName; const logF = LOG + caseName;
registerOn = false;
setTimeout(() => { setTimeout(() => {
captionOn(logF, caseName) captionOn(logF, caseName)
}, 1000); }, 1000);
setTimeout(() => { setTimeout(() => {
captionOff(logF, caseName) captionOff(logF, caseName)
setTimeout(() => {
excuteCase(caseName);
}, 3000);
}, 2000); }, 2000);
setTimeout(() => {
excuteCase(caseName);
}, 3000);
setTimeout(() => { setTimeout(() => {
var isSucceedTarget: boolean = false; var isSucceedTarget: boolean = false;
var isSucceedOnBack: boolean = false;
if (backList.indexOf(caseName + '_on_target_change_extra_success') !== -1) { if (backList.indexOf(caseName + '_on_target_change_extra_success') !== -1) {
isSucceedTarget = true; isSucceedTarget = true;
} }
if (onbackList.indexOf(caseName + '_on_success') == -1) { expect(isSucceedTarget).assertEqual(true);
isSucceedOnBack = true; expect(registerOn).assertEqual(false);
} console.info(logF + ' isSucceed : ' + (isSucceedTarget));
expect(isSucceedTarget && isSucceedOnBack).assertEqual(true);
console.info(logF + ' isSucceed : ' + (isSucceedTarget && isSucceedOnBack));
done(); done();
}, 8000); }, 8000);
}); });
...@@ -544,26 +530,25 @@ export default function CaptionConfigurationTest() { ...@@ -544,26 +530,25 @@ export default function CaptionConfigurationTest() {
it('CaptionConfiguration_0170', 1, async function (done) { it('CaptionConfiguration_0170', 1, async function (done) {
const caseName = "CaptionConfiguration_0170"; const caseName = "CaptionConfiguration_0170";
const logF = LOG + caseName; const logF = LOG + caseName;
registerOn = false;
setTimeout(() => { setTimeout(() => {
captionStyleOn(logF, caseName); captionStyleOn(logF, caseName);
}, 1000); }, 1000);
setTimeout(() => { setTimeout(() => {
captionStyleOff(logF, caseName) captionStyleOff(logF, caseName)
setTimeout(() => {
excuteCase(caseName);
}, 3000);
}, 2000); }, 2000);
setTimeout(() => {
excuteCase(caseName);
}, 3000);
setTimeout(() => { setTimeout(() => {
var isSucceedTarget: boolean = false; var isSucceedTarget: boolean = false;
var isSucceedOnBack: boolean = false;
if (backList.indexOf(caseName + '_on_target_change_extra_success') !== -1) { if (backList.indexOf(caseName + '_on_target_change_extra_success') !== -1) {
isSucceedTarget = true; isSucceedTarget = true;
} }
if (onbackList.indexOf(caseName + '_on_success') == -1) { expect(isSucceedTarget).assertEqual(true);
isSucceedOnBack = true; expect(registerOn).assertEqual(false);
} console.info(logF + ' isSucceed : ' + (isSucceedTarget));
expect(isSucceedTarget && isSucceedOnBack).assertEqual(true);
console.info(logF + ' isSucceed : ' + (isSucceedTarget && isSucceedOnBack));
done(); done();
}, 8000); }, 8000);
}); });
...@@ -741,7 +726,5 @@ export default function CaptionConfigurationTest() { ...@@ -741,7 +726,5 @@ export default function CaptionConfigurationTest() {
done(); done();
}, 8000); }, 8000);
}); });
}) })
} }
...@@ -33,21 +33,6 @@ ...@@ -33,21 +33,6 @@
] ]
} }
], ],
"extensionAbilities": [
{
"name": "ServiceExtAbility",
"srcEntrance": "./ets/ServiceExtAbility/ServiceExtAbility.ts",
"label": "$string:entry_desc",
"description": "$string:entry_desc",
"type": "accessibility",
"metadata": [
{
"name": "ohos.accessibleability",
"resource": "$profile:accessibility_config"
}
],
"permissions": ["ohos.permission.GET_BUNDLE_INFO"]
}],
"requestPermissions": [ "requestPermissions": [
{ {
"name": "ohos.permission.SYSTEM_FLOAT_WINDOW", "name": "ohos.permission.SYSTEM_FLOAT_WINDOW",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册