未验证 提交 2b691c83 编写于 作者: O openharmony_ci 提交者: Gitee

!2669 适配字幕接口

Merge pull request !2669 from yichengzhao/release
...@@ -19,380 +19,163 @@ describe('AccessibleCaptionConfiguration', function () { ...@@ -19,380 +19,163 @@ describe('AccessibleCaptionConfiguration', function () {
beforeEach(async function (done) { beforeEach(async function (done) {
console.info(`AccessibleCaptionConfiguration: beforeEach starts`); console.info(`AccessibleCaptionConfiguration: beforeEach starts`);
let captionManager = accessibility.getCaptionsManager();
captionManager.off("enableChange");
captionManager.off("styleChange");
done(); done();
}) })
afterEach(async function (done) { afterEach(async function (done) {
console.info(`AccessibleCaptionConfiguration: afterEach starts`); console.info(`AccessibleCaptionConfiguration: afterEach starts`);
let captionManager = accessibility.getCaptionsManager();
captionManager.off("enableChange");
captionManager.off("styleChange");
setTimeout(done, 1000); setTimeout(done, 1000);
}) })
var CaptionsStyle = {
fontFamily: "default",
fontScale: 75,
fontColor: "blue",
fontEdgeType: "none",
backgroundColor: "green",
windowColor: "pink"
}
var StyleTest = {
fontFamily: "monospacedSerif",
fontScale: 99,
fontColor: "red",
fontEdgeType: "uniform",
backgroundColor: "pink",
windowColor: "green"
}
/* /*
* @tc.number CaptionConfiguration_0010 * @tc.number CaptionConfiguration_0010
* @tc.name CaptionConfiguration_0010 * @tc.name CaptionConfiguration_0010
* @tc.desc The parameter input is 'enableChange', test the captionManager.on() function, * @tc.desc The parameter input is 'enableChange', test the captionManager.on() function,
* and return 'enable' * and return undefined
* @tc.size SmallTest * @tc.size SmallTest
* @tc.type User * @tc.type User
*/ */
it('CaptionConfiguration_0010', 0, async function (done) { it('CaptionConfiguration_0010', 0, async function (done) {
console.info('CaptionConfiguration_0010'); console.info('CaptionConfiguration_0010');
let captionManager = accessibility.getCaptionsManager(); let captionManager = accessibility.getCaptionsManager();
captionManager.style = CaptionsStyle;
captionManager.enabled = true;
let stateEventType = 'enableChange';
captionManager.on(stateEventType, (data) => {
expect(data).assertEqual(false);
done();
});
captionManager.enabled = false;
})
/*
* @tc.number CaptionConfiguration_0011
* @tc.name CaptionConfiguration_0011
* @tc.desc The parameter input is 'enableChange', test the captionManager.on() function,
* and return 'enable'
* @tc.size SmallTest
* @tc.type User
*/
it('CaptionConfiguration_0011', 0, async function (done) {
console.info('CaptionConfiguration_0011');
let captionManager = accessibility.getCaptionsManager();
let stateEventType = 'enableChange'; let stateEventType = 'enableChange';
captionManager.off(stateEventType); let ret = captionManager.on(stateEventType, (data) => {});
captionManager.style = CaptionsStyle; expect(ret).assertEqual(undefined);
captionManager.enabled = false; done();
captionManager.on(stateEventType, (data) => {
expect(data).assertEqual(true);
done();
});
captionManager.enabled = true;
}) })
/* /*
* @tc.number CaptionConfiguration_0020 * @tc.number CaptionConfiguration_0020
* @tc.name CaptionConfiguration_0020 * @tc.name CaptionConfiguration_0020
* @tc.desc The parameter input is 'styleChange', test the captionManager.on() function, * @tc.desc The parameter input is 'styleChange', test the captionManager.on() function,
* and return 'style' * and return undefined
* @tc.size SmallTest * @tc.size SmallTest
* @tc.type User * @tc.type User
*/ */
it('CaptionConfiguration_0020', 0, async function (done) { it('CaptionConfiguration_0020', 0, async function (done) {
console.info('CaptionConfiguration_0020'); console.info('CaptionConfiguration_0020');
let captionManager = accessibility.getCaptionsManager(); let captionManager = accessibility.getCaptionsManager();
captionManager.style = CaptionsStyle;
let stateEventType = 'styleChange';
captionManager.on(stateEventType, (data) => {
expect(true).assertEqual(true);
done();
});
captionManager.style = StyleTest;
})
/*
* @tc.number CaptionConfiguration_0021
* @tc.name CaptionConfiguration_0021
* @tc.desc The parameter input is 'styleChange', test the captionManager.on() function,
* and return 'style'
* @tc.size SmallTest
* @tc.type User
*/
it('CaptionConfiguration_0021', 0, async function (done) {
console.info('CaptionConfiguration_0021');
let captionManager = accessibility.getCaptionsManager();
captionManager.style = CaptionsStyle;
let stateEventType = 'styleChange';
captionManager.on(stateEventType, (data) => {
expect(true).assertEqual(true);
done();
});
captionManager.style.fontFamily = "smallCapitals";
})
/*
* @tc.number CaptionConfiguration_0022
* @tc.name CaptionConfiguration_0022
* @tc.desc The parameter input is 'styleChange', test the captionManager.on() function,
* and return 'style'
* @tc.size SmallTest
* @tc.type User
*/
it('CaptionConfiguration_0022', 0, async function (done) {
console.info('CaptionConfiguration_0022');
let captionManager = accessibility.getCaptionsManager();
captionManager.style = CaptionsStyle;
let stateEventType = 'styleChange';
captionManager.on(stateEventType, (data) => {
expect(true).assertEqual(true);
done();
});
captionManager.style.fontScale = 99;
})
/*
* @tc.number CaptionConfiguration_0023
* @tc.name CaptionConfiguration_0023
* @tc.desc The parameter input is 'styleChange', test the captionManager.on() function,
* and return 'style'
* @tc.size SmallTest
* @tc.type User
*/
it('CaptionConfiguration_0023', 0, async function (done) {
console.info('CaptionConfiguration_0023');
let captionManager = accessibility.getCaptionsManager();
captionManager.style = CaptionsStyle;
let stateEventType = 'styleChange';
captionManager.on(stateEventType, (data) => {
expect(true).assertEqual(true);
done();
});
captionManager.style.fontColor = "TmepfontColor";
})
/*
* @tc.number CaptionConfiguration_0024
* @tc.name CaptionConfiguration_0024
* @tc.desc The parameter input is 'styleChange', test the captionManager.on() function,
* and return 'style'
* @tc.size SmallTest
* @tc.type User
*/
it('CaptionConfiguration_0024', 0, async function (done) {
console.info('CaptionConfiguration_0024');
let captionManager = accessibility.getCaptionsManager();
captionManager.style = CaptionsStyle;
let stateEventType = 'styleChange'; let stateEventType = 'styleChange';
captionManager.on(stateEventType, (data) => { let ret = captionManager.on(stateEventType, (data) => {});
expect(true).assertEqual(true); expect(ret).assertEqual(undefined);
done(); done();
});
captionManager.style.fontEdgeType = "dropShadow";
})
/*
* @tc.number CaptionConfiguration_0025
* @tc.name CaptionConfiguration_0025
* @tc.desc The parameter input is 'styleChange', test the captionManager.on() function,
* and return 'style'
* @tc.size SmallTest
* @tc.type User
*/
it('CaptionConfiguration_0025', 0, async function (done) {
console.info('CaptionConfiguration_0025');
let captionManager = accessibility.getCaptionsManager();
captionManager.style = CaptionsStyle;
let stateEventType = 'styleChange';
captionManager.on(stateEventType, (data) => {
expect(true).assertEqual(true);
done();
});
captionManager.style.backgroundColor = "TmepbackgroundColor";
}) })
/*
* @tc.number CaptionConfiguration_0026
* @tc.name CaptionConfiguration_0026
* @tc.desc The parameter input is 'styleChange', test the captionManager.on() function,
* and return 'style'
* @tc.size SmallTest
* @tc.type User
*/
it('CaptionConfiguration_0026', 0, async function (done) {
console.info('CaptionConfiguration_0026');
let captionManager = accessibility.getCaptionsManager();
captionManager.style = CaptionsStyle;
let stateEventType = 'styleChange';
captionManager.on(stateEventType, (data) => {
expect(true).assertEqual(true);
done();
});
captionManager.style.windowColor = "TmepwindowColor";
})
/* /*
* @tc.number CaptionConfiguration_0030 * @tc.number CaptionConfiguration_0030
* @tc.name CaptionConfiguration_0030 * @tc.name CaptionConfiguration_0030
* @tc.desc The parameter input is 'enableChange', test the captionManager.off() function, * @tc.desc The parameter input is '', test the captionManager.on() function,
* and return true * and return undefined
* @tc.size SmallTest * @tc.size SmallTest
* @tc.type User * @tc.type User
*/ */
it('CaptionConfiguration_0030', 0, async function (done) { it('CaptionConfiguration_0030', 0, async function (done) {
console.info('CaptionConfiguration_0030'); console.info('CaptionConfiguration_0030');
let stateEventType = 'enableChange';
let captionManager = accessibility.getCaptionsManager(); let captionManager = accessibility.getCaptionsManager();
captionManager.off(stateEventType); let stateEventType = '';
captionManager.enabled = false; let ret = captionManager.on(stateEventType, (data) => {});
captionManager.on(stateEventType, (data) => { expect(ret).assertEqual(undefined);
let ret = false;
expect(ret).assertEqual(true);
});
let ret = captionManager.off(stateEventType);
captionManager.enabled = true;
expect(true).assertEqual(true);
done(); done();
}) })
/* /*
* @tc.number CaptionConfiguration_0031 * @tc.number CaptionConfiguration_0040
* @tc.name CaptionConfiguration_0031 * @tc.name CaptionConfiguration_0040
* @tc.desc The parameter input is 'enableChange', test the captionManager.off() function, * @tc.desc The parameter input is null, test the captionManager.on() function,
* and return true * and return undefined
* @tc.size SmallTest * @tc.size SmallTest
* @tc.type User * @tc.type User
*/ */
it('CaptionConfiguration_0031', 0, async function (done) { it('CaptionConfiguration_0040', 0, async function (done) {
console.info('CaptionConfiguration_0031'); console.info('CaptionConfiguration_0040');
let stateEventType = 'enableChange';
let captionManager = accessibility.getCaptionsManager(); let captionManager = accessibility.getCaptionsManager();
captionManager.off(stateEventType); let stateEventType = null;
captionManager.enabled = true; let ret = captionManager.on(stateEventType, (data) => {});
captionManager.on(stateEventType, (data) => { expect(ret).assertEqual(undefined);
let ret = false;
expect(ret).assertEqual(true);
});
captionManager.off(stateEventType, (data) => {
expect(data).assertEqual(true);
});
captionManager.enabled = false;
expect(true).assertEqual(true);
done(); done();
}) })
/* /*
* @tc.number CaptionConfiguration_0032 * @tc.number CaptionConfiguration_0050
* @tc.name CaptionConfiguration_0032 * @tc.name CaptionConfiguration_0050
* @tc.desc The parameter input is 'enableChange', test the captionManager.off() function, * @tc.desc The parameter input is 'enableChange', test the captionManager.off() function,
* and return true * and return undefined
* @tc.size SmallTest * @tc.size SmallTest
* @tc.type User * @tc.type User
*/ */
it('CaptionConfiguration_0032', 0, async function (done) { it('CaptionConfiguration_0050', 0, async function (done) {
console.info('CaptionConfiguration_0032'); console.info('CaptionConfiguration_0050');
let stateEventType = 'enableChange';
let captionManager = accessibility.getCaptionsManager(); let captionManager = accessibility.getCaptionsManager();
captionManager.off(stateEventType); let stateEventType = 'enableChange';
captionManager.enabled = true; let ret = captionManager.off(stateEventType, (data) => {});
captionManager.on(stateEventType, (data) => { expect(ret).assertEqual(undefined);
expect(true).assertEqual(true); done();
done();
});
captionManager.off("ERROR", (data) => {
expect(data).assertEqual(false);
done();
});
}) })
/* /*
* @tc.number CaptionConfiguration_0040 * @tc.number CaptionConfiguration_0060
* @tc.name CaptionConfiguration_0040 * @tc.name CaptionConfiguration_0060
* @tc.desc The parameter input is 'styleChange', test the captionManager.off() function, * @tc.desc The parameter input is 'styleChange', test the captionManager.off() function,
* and return true * and return undefined
* @tc.size SmallTest * @tc.size SmallTest
* @tc.type User * @tc.type User
*/ */
it('CaptionConfiguration_0040', 0, async function (done) { it('CaptionConfiguration_0060', 0, async function (done) {
console.info('CaptionConfiguration_0040'); console.info('CaptionConfiguration_0060');
let stateEventType = 'styleChange';
let captionManager = accessibility.getCaptionsManager(); let captionManager = accessibility.getCaptionsManager();
captionManager.off(stateEventType); let stateEventType = 'styleChange';
captionManager.on(stateEventType, (data) => { let ret = captionManager.off(stateEventType, (data) => {});
let ret = false; expect(ret).assertEqual(undefined);
expect(ret).assertEqual(true);
});
captionManager.off(stateEventType);
captionManager.style = StyleTest;
done(); done();
}) })
/* /*
* @tc.number CaptionConfiguration_0041 * @tc.number CaptionConfiguration_0070
* @tc.name CaptionConfiguration_0041 * @tc.name CaptionConfiguration_0070
* @tc.desc The parameter input is 'styleChange', test the captionManager.off() function, * @tc.desc The parameter input is '', test the captionManager.off() function,
* and return true * and return undefined
* @tc.size SmallTest * @tc.size SmallTest
* @tc.type User * @tc.type User
*/ */
it('CaptionConfiguration_0041', 0, async function (done) { it('CaptionConfiguration_0070', 0, async function (done) {
console.info('CaptionConfiguration_0041'); console.info('CaptionConfiguration_0070');
let stateEventType = 'styleChange';
let captionManager = accessibility.getCaptionsManager(); let captionManager = accessibility.getCaptionsManager();
captionManager.off(stateEventType); let stateEventType = '';
captionManager.on(stateEventType, (data) => { let ret = captionManager.off(stateEventType, (data) => {});
let ret = false; expect(ret).assertEqual(undefined);
expect(ret).assertEqual(true);
});
captionManager.off(stateEventType, (data) => {
expect(data.fontFamily).assertEqual(StyleTest.fontFamily);
expect(data.fontScale).assertEqual(StyleTest.fontScale);
expect(data.fontColor).assertEqual(StyleTest.fontColor);
expect(data.fontEdgeType).assertEqual(StyleTest.fontEdgeType);
expect(data.backgroundColor).assertEqual(StyleTest.backgroundColor);
expect(data.windowColor).assertEqual(StyleTest.windowColor);
});
captionManager.style = CaptionsStyle;
done(); done();
}) })
/* /*
* @tc.number CaptionConfiguration_0042 * @tc.number CaptionConfiguration_0080
* @tc.name CaptionConfiguration_0042 * @tc.name CaptionConfiguration_0080
* @tc.desc The parameter input is 'styleChange', test the captionManager.off() function, * @tc.desc The parameter input is null, test the captionManager.off() function,
* and return true * and return undefined
* @tc.size SmallTest * @tc.size SmallTest
* @tc.type User * @tc.type User
*/ */
it('CaptionConfiguration_0042', 0, async function (done) { it('CaptionConfiguration_0080', 0, async function (done) {
console.info('CaptionConfiguration_0042'); console.info('CaptionConfiguration_0080');
let stateEventType = 'styleChange';
let captionManager = accessibility.getCaptionsManager(); let captionManager = accessibility.getCaptionsManager();
captionManager.off(stateEventType); let stateEventType = null;
captionManager.on(stateEventType, (data) => { let ret = captionManager.off(stateEventType, (data) => {});
}); expect(ret).assertEqual(undefined);
captionManager.off("ERROR", (data) => { done();
expect(data).assertEqual(false);
done();
});
}) })
/* /*
* @tc.number CaptionConfiguration_0050 * @tc.number CaptionConfiguration_0090
* @tc.name CaptionConfiguration_0050 * @tc.name CaptionConfiguration_0090
* @tc.desc Test getCaptionsManager() function by modifying fontFamily. * @tc.desc Test captionManager.style.fontFamily function by assigning "default".
* Return CaptionsManager. * captionManager.style.fontFamily will be "default"
* @tc.size SmallTest * @tc.size SmallTest
* @tc.type User * @tc.type User
*/ */
it('CaptionConfiguration_0050', 0, async function (done) { it('CaptionConfiguration_0090', 0, async function (done) {
console.info('CaptionConfiguration_0050'); console.info('CaptionConfiguration_0090');
let captionManager = accessibility.getCaptionsManager(); let captionManager = accessibility.getCaptionsManager();
let fontFamily = "default"; let fontFamily = "default";
captionManager.style.fontFamily = fontFamily; captionManager.style.fontFamily = fontFamily;
...@@ -402,15 +185,15 @@ describe('AccessibleCaptionConfiguration', function () { ...@@ -402,15 +185,15 @@ describe('AccessibleCaptionConfiguration', function () {
}) })
/* /*
* @tc.number CaptionConfiguration_0051 * @tc.number CaptionConfiguration_0100
* @tc.name CaptionConfiguration_0051 * @tc.name CaptionConfiguration_0100
* @tc.desc Test getCaptionsManager() function by modifying fontFamily. * @tc.desc Test captionManager.style.fontFamily function by assigning "monospacedSerif".
* Return CaptionsManager. * captionManager.style.fontFamily will be "monospacedSerif"
* @tc.size SmallTest * @tc.size SmallTest
* @tc.type User * @tc.type User
*/ */
it('CaptionConfiguration_0051', 0, async function (done) { it('CaptionConfiguration_0100', 0, async function (done) {
console.info('CaptionConfiguration_0051'); console.info('CaptionConfiguration_0100');
let captionManager = accessibility.getCaptionsManager(); let captionManager = accessibility.getCaptionsManager();
let fontFamily = "monospacedSerif"; let fontFamily = "monospacedSerif";
captionManager.style.fontFamily = fontFamily; captionManager.style.fontFamily = fontFamily;
...@@ -420,15 +203,15 @@ describe('AccessibleCaptionConfiguration', function () { ...@@ -420,15 +203,15 @@ describe('AccessibleCaptionConfiguration', function () {
}) })
/* /*
* @tc.number CaptionConfiguration_0052 * @tc.number CaptionConfiguration_0110
* @tc.name CaptionConfiguration_0052 * @tc.name CaptionConfiguration_0110
* @tc.desc Test getCaptionsManager() function by modifying fontFamily. * @tc.desc Test captionManager.style.fontFamily function by assigning "serif".
* Return CaptionsManager. * captionManager.style.fontFamily will be "serif"
* @tc.size SmallTest * @tc.size SmallTest
* @tc.type User * @tc.type User
*/ */
it('CaptionConfiguration_0052', 0, async function (done) { it('CaptionConfiguration_0110', 0, async function (done) {
console.info('CaptionConfiguration_0052'); console.info('CaptionConfiguration_0110');
let captionManager = accessibility.getCaptionsManager(); let captionManager = accessibility.getCaptionsManager();
let fontFamily = "serif"; let fontFamily = "serif";
captionManager.style.fontFamily = fontFamily; captionManager.style.fontFamily = fontFamily;
...@@ -438,15 +221,15 @@ describe('AccessibleCaptionConfiguration', function () { ...@@ -438,15 +221,15 @@ describe('AccessibleCaptionConfiguration', function () {
}) })
/* /*
* @tc.number CaptionConfiguration_0053 * @tc.number CaptionConfiguration_0120
* @tc.name CaptionConfiguration_0053 * @tc.name CaptionConfiguration_0120
* @tc.desc Test getCaptionsManager() function by modifying fontFamily. * @tc.desc Test captionManager.style.fontFamily function by assigning "monospacedSansSerif".
* Return CaptionsManager. * captionManager.style.fontFamily will be "monospacedSansSerif"
* @tc.size SmallTest * @tc.size SmallTest
* @tc.type User * @tc.type User
*/ */
it('CaptionConfiguration_0053', 0, async function (done) { it('CaptionConfiguration_0120', 0, async function (done) {
console.info('CaptionConfiguration_0053'); console.info('CaptionConfiguration_0120');
let captionManager = accessibility.getCaptionsManager(); let captionManager = accessibility.getCaptionsManager();
let fontFamily = "monospacedSansSerif"; let fontFamily = "monospacedSansSerif";
captionManager.style.fontFamily = fontFamily; captionManager.style.fontFamily = fontFamily;
...@@ -456,15 +239,15 @@ describe('AccessibleCaptionConfiguration', function () { ...@@ -456,15 +239,15 @@ describe('AccessibleCaptionConfiguration', function () {
}) })
/* /*
* @tc.number CaptionConfiguration_0054 * @tc.number CaptionConfiguration_0130
* @tc.name CaptionConfiguration_0054 * @tc.name CaptionConfiguration_0130
* @tc.desc Test getCaptionsManager() function by modifying fontFamily. * @tc.desc Test captionManager.style.fontFamily function by assigning "sansSerif".
* Return CaptionsManager. * captionManager.style.fontFamily will be "sansSerif"
* @tc.size SmallTest * @tc.size SmallTest
* @tc.type User * @tc.type User
*/ */
it('CaptionConfiguration_0054', 0, async function (done) { it('CaptionConfiguration_0130', 0, async function (done) {
console.info('CaptionConfiguration_0054'); console.info('CaptionConfiguration_0130');
let captionManager = accessibility.getCaptionsManager(); let captionManager = accessibility.getCaptionsManager();
let fontFamily = "sansSerif"; let fontFamily = "sansSerif";
captionManager.style.fontFamily = fontFamily; captionManager.style.fontFamily = fontFamily;
...@@ -474,15 +257,15 @@ describe('AccessibleCaptionConfiguration', function () { ...@@ -474,15 +257,15 @@ describe('AccessibleCaptionConfiguration', function () {
}) })
/* /*
* @tc.number CaptionConfiguration_0055 * @tc.number CaptionConfiguration_0140
* @tc.name CaptionConfiguration_0055 * @tc.name CaptionConfiguration_0140
* @tc.desc Test getCaptionsManager() function by modifying fontFamily. * @tc.desc Test captionManager.style.fontFamily function by assigning "casual".
* Return CaptionsManager. * captionManager.style.fontFamily will be "casual"
* @tc.size SmallTest * @tc.size SmallTest
* @tc.type User * @tc.type User
*/ */
it('CaptionConfiguration_0055', 0, async function (done) { it('CaptionConfiguration_0140', 0, async function (done) {
console.info('CaptionConfiguration_0055'); console.info('CaptionConfiguration_0140');
let captionManager = accessibility.getCaptionsManager(); let captionManager = accessibility.getCaptionsManager();
let fontFamily = "casual"; let fontFamily = "casual";
captionManager.style.fontFamily = fontFamily; captionManager.style.fontFamily = fontFamily;
...@@ -492,15 +275,15 @@ describe('AccessibleCaptionConfiguration', function () { ...@@ -492,15 +275,15 @@ describe('AccessibleCaptionConfiguration', function () {
}) })
/* /*
* @tc.number CaptionConfiguration_0056 * @tc.number CaptionConfiguration_0150
* @tc.name CaptionConfiguration_0056 * @tc.name CaptionConfiguration_0150
* @tc.desc Test getCaptionsManager() function by modifying fontFamily. * @tc.desc Test captionManager.style.fontFamily function by assigning "cursive".
* Return CaptionsManager. * captionManager.style.fontFamily will be "cursive"
* @tc.size SmallTest * @tc.size SmallTest
* @tc.type User * @tc.type User
*/ */
it('CaptionConfiguration_0056', 0, async function (done) { it('CaptionConfiguration_0150', 0, async function (done) {
console.info('CaptionConfiguration_0056'); console.info('CaptionConfiguration_0150');
let captionManager = accessibility.getCaptionsManager(); let captionManager = accessibility.getCaptionsManager();
let fontFamily = "cursive"; let fontFamily = "cursive";
captionManager.style.fontFamily = fontFamily; captionManager.style.fontFamily = fontFamily;
...@@ -510,15 +293,15 @@ describe('AccessibleCaptionConfiguration', function () { ...@@ -510,15 +293,15 @@ describe('AccessibleCaptionConfiguration', function () {
}) })
/* /*
* @tc.number CaptionConfiguration_0057 * @tc.number CaptionConfiguration_0160
* @tc.name CaptionConfiguration_0057 * @tc.name CaptionConfiguration_0160
* @tc.desc Test getCaptionsManager() function by modifying fontFamily. * @tc.desc Test captionManager.style.fontFamily function by assigning "smallCapitals".
* Return CaptionsManager. * captionManager.style.fontFamily will be "smallCapitals"
* @tc.size SmallTest * @tc.size SmallTest
* @tc.type User * @tc.type User
*/ */
it('CaptionConfiguration_0057', 0, async function (done) { it('CaptionConfiguration_0160', 0, async function (done) {
console.info('CaptionConfiguration_0057'); console.info('CaptionConfiguration_0160');
let captionManager = accessibility.getCaptionsManager(); let captionManager = accessibility.getCaptionsManager();
let fontFamily = "smallCapitals"; let fontFamily = "smallCapitals";
captionManager.style.fontFamily = fontFamily; captionManager.style.fontFamily = fontFamily;
...@@ -528,17 +311,17 @@ describe('AccessibleCaptionConfiguration', function () { ...@@ -528,17 +311,17 @@ describe('AccessibleCaptionConfiguration', function () {
}) })
/* /*
* @tc.number CaptionConfiguration_0058 * @tc.number CaptionConfiguration_0170
* @tc.name CaptionConfiguration_0058 * @tc.name CaptionConfiguration_0170
* @tc.desc Test getCaptionsManager() function by modifying fontFamily. * @tc.desc Test captionManager.style.fontFamily function by assigning "".
* Return CaptionsManager. * captionManager.style.fontFamily will be ""
* @tc.size SmallTest * @tc.size SmallTest
* @tc.type User * @tc.type User
*/ */
it('CaptionConfiguration_0058', 0, async function (done) { it('CaptionConfiguration_0170', 0, async function (done) {
console.info('CaptionConfiguration_0058'); console.info('CaptionConfiguration_0170');
let captionManager = accessibility.getCaptionsManager(); let captionManager = accessibility.getCaptionsManager();
let fontFamily = "none"; let fontFamily = "";
captionManager.style.fontFamily = fontFamily; captionManager.style.fontFamily = fontFamily;
let value = captionManager.style.fontFamily; let value = captionManager.style.fontFamily;
expect(value).assertEqual(fontFamily); expect(value).assertEqual(fontFamily);
...@@ -546,35 +329,35 @@ describe('AccessibleCaptionConfiguration', function () { ...@@ -546,35 +329,35 @@ describe('AccessibleCaptionConfiguration', function () {
}) })
/* /*
* @tc.number CaptionConfiguration_0059 * @tc.number CaptionConfiguration_0180
* @tc.name CaptionConfiguration_0059 * @tc.name CaptionConfiguration_0180
* @tc.desc Test getCaptionsManager() function by modifying fontFamily. * @tc.desc Test captionManager.style.fontFamily function by assigning null.
* Return CaptionsManager. * captionManager.style.fontFamily will be ''
* @tc.size SmallTest * @tc.size SmallTest
* @tc.type User * @tc.type User
*/ */
it('CaptionConfiguration_0059', 0, async function (done) { it('CaptionConfiguration_0180', 0, async function (done) {
console.info('CaptionConfiguration_0059'); console.info('CaptionConfiguration_0180');
let captionManager = accessibility.getCaptionsManager(); let captionManager = accessibility.getCaptionsManager();
let fontFamily = ""; let fontFamily = null;
captionManager.style.fontFamily = fontFamily; captionManager.style.fontFamily = fontFamily;
let value = captionManager.style.fontFamily; let value = captionManager.style.fontFamily;
expect(value).assertEqual(fontFamily); expect(value).assertEqual('');
done(); done();
}) })
/* /*
* @tc.number CaptionConfiguration_0060 * @tc.number CaptionConfiguration_0190
* @tc.name CaptionConfiguration_0060 * @tc.name CaptionConfiguration_0190
* @tc.desc Test getCaptionsManager() function by modifying fontScale. * @tc.desc Test captionManager.style.fontScale function by assigning 9007199254740992.
* Return CaptionsManager. * captionManager.style.fontScale will be 0
* @tc.size SmallTest * @tc.size SmallTest
* @tc.type User * @tc.type User
*/ */
it('CaptionConfiguration_0060', 0, async function (done) { it('CaptionConfiguration_0190', 0, async function (done) {
console.info('CaptionConfiguration_0060'); console.info('CaptionConfiguration_0190');
let captionManager = accessibility.getCaptionsManager(); let captionManager = accessibility.getCaptionsManager();
let fontScale =9007199254740992; let fontScale = 9007199254740992;
captionManager.style.fontScale = fontScale; captionManager.style.fontScale = fontScale;
let value = captionManager.style.fontScale; let value = captionManager.style.fontScale;
expect(value).assertEqual(0); expect(value).assertEqual(0);
...@@ -582,107 +365,181 @@ describe('AccessibleCaptionConfiguration', function () { ...@@ -582,107 +365,181 @@ describe('AccessibleCaptionConfiguration', function () {
}) })
/* /*
* @tc.number CaptionConfiguration_0061 * @tc.number CaptionConfiguration_0200
* @tc.name CaptionConfiguration_0061 * @tc.name CaptionConfiguration_0200
* @tc.desc Test getCaptionsManager() function by modifying fontScale. * @tc.desc Test captionManager.style.fontScale function by assigning 1.
* Return CaptionsManager. * captionManager.style.fontScale will be 1
* @tc.size SmallTest
* @tc.type User
*/
it('CaptionConfiguration_0200', 0, async function (done) {
console.info('CaptionConfiguration_0200');
let captionManager = accessibility.getCaptionsManager();
let fontScale = 1;
captionManager.style.fontScale = fontScale;
let value = captionManager.style.fontScale;
expect(value).assertEqual(fontScale);
done();
})
/*
* @tc.number CaptionConfiguration_0210
* @tc.name CaptionConfiguration_0210
* @tc.desc Test captionManager.style.fontScale function by assigning 0.
* captionManager.style.fontScale will be 0
* @tc.size SmallTest * @tc.size SmallTest
* @tc.type User * @tc.type User
*/ */
it('CaptionConfiguration_0061', 0, async function (done) { it('CaptionConfiguration_0210', 0, async function (done) {
console.info('CaptionConfiguration_0061'); console.info('CaptionConfiguration_0210');
let captionManager = accessibility.getCaptionsManager();
let fontScale = 0;
captionManager.style.fontScale = fontScale;
let value = captionManager.style.fontScale;
expect(value).assertEqual(fontScale);
done();
})
/*
* @tc.number CaptionConfiguration_0220
* @tc.name CaptionConfiguration_0220
* @tc.desc Test captionManager.style.fontScale function by assigning -1.
* captionManager.style.fontScale will be -1
* @tc.size SmallTest
* @tc.type User
*/
it('CaptionConfiguration_0220', 0, async function (done) {
console.info('CaptionConfiguration_0220');
let captionManager = accessibility.getCaptionsManager();
let fontScale = -1;
captionManager.style.fontScale = fontScale;
let value = captionManager.style.fontScale;
expect(value).assertEqual(fontScale);
done();
})
/*
* @tc.number CaptionConfiguration_0230
* @tc.name CaptionConfiguration_0230
* @tc.desc Test captionManager.style.fontColor function by assigning "#12345678".
* captionManager.style.fontColor will be "#12345678"
* @tc.size SmallTest
* @tc.type User
*/
it('CaptionConfiguration_0230', 0, async function (done) {
console.info('CaptionConfiguration_0230');
let captionManager = accessibility.getCaptionsManager(); let captionManager = accessibility.getCaptionsManager();
let fontScale =0; let fontColor ="#12345678";
captionManager.style.fontScale = fontScale; captionManager.style.fontColor = fontColor;
let value = captionManager.style.fontScale; let value = captionManager.style.fontColor;
expect(value).assertEqual(fontScale); expect(value).assertEqual(fontColor);
done(); done();
}) })
/* /*
* @tc.number CaptionConfiguration_0062 * @tc.number CaptionConfiguration_0240
* @tc.name CaptionConfiguration_0062 * @tc.name CaptionConfiguration_0240
* @tc.desc Test getCaptionsManager() function by modifying fontScale. * @tc.desc Test captionManager.style.fontColor function by assigning "".
* Return CaptionsManager. * captionManager.style.fontColor will be ""
* @tc.size SmallTest * @tc.size SmallTest
* @tc.type User * @tc.type User
*/ */
it('CaptionConfiguration_0062', 0, async function (done) { it('CaptionConfiguration_0240', 0, async function (done) {
console.info('CaptionConfiguration_0062'); console.info('CaptionConfiguration_0240');
let captionManager = accessibility.getCaptionsManager(); let captionManager = accessibility.getCaptionsManager();
let fontScale =-1; let fontColor ="#";
captionManager.style.fontScale = fontScale; captionManager.style.fontColor = fontColor;
let value = captionManager.style.fontScale; let value = captionManager.style.fontColor;
expect(value).assertEqual(-1); expect(value).assertEqual("#00000000");
done(); done();
}) })
/* /*
* @tc.number CaptionConfiguration_0070 * @tc.number CaptionConfiguration_0250
* @tc.name CaptionConfiguration_0070 * @tc.name CaptionConfiguration_0250
* @tc.desc Test getCaptionsManager() function by modifying fontColor. * @tc.desc Test captionManager.style.fontColor function by assigning null.
* Return CaptionsManager. * captionManager.style.fontColor will be "#00000000"
* @tc.size SmallTest * @tc.size SmallTest
* @tc.type User * @tc.type User
*/ */
it('CaptionConfiguration_0070', 0, async function (done) { it('CaptionConfiguration_0250', 0, async function (done) {
console.info('CaptionConfiguration_0070'); console.info('CaptionConfiguration_0250');
let captionManager = accessibility.getCaptionsManager(); let captionManager = accessibility.getCaptionsManager();
let fontColor ="TmepfontColor"; let fontColor = null;
captionManager.style.fontColor = fontColor; captionManager.style.fontColor = fontColor;
let value = captionManager.style.fontColor; let value = captionManager.style.fontColor;
expect(value).assertEqual(fontColor); expect(value).assertEqual("#00000000");
done(); done();
}) })
/* /*
* @tc.number CaptionConfiguration_0071 * @tc.number CaptionConfiguration_0260
* @tc.name CaptionConfiguration_0071 * @tc.name CaptionConfiguration_0260
* @tc.desc Test getCaptionsManager() function by modifying fontColor. * @tc.desc Test captionManager.style.fontColor function by assigning 0x12345678.
* Return CaptionsManager. * captionManager.style.fontColor will be "#34567812"
* @tc.size SmallTest * @tc.size SmallTest
* @tc.type User * @tc.type User
*/ */
it('CaptionConfiguration_0071', 0, async function (done) { it('CaptionConfiguration_0260', 0, async function (done) {
console.info('CaptionConfiguration_0071'); console.info('CaptionConfiguration_0260');
let captionManager = accessibility.getCaptionsManager(); let captionManager = accessibility.getCaptionsManager();
let fontColor ="none"; let fontColor = 0x12345678;
captionManager.style.fontColor = fontColor; captionManager.style.fontColor = fontColor;
let value = captionManager.style.fontColor; let value = captionManager.style.fontColor;
expect(value).assertEqual(fontColor); expect(value).assertEqual("#34567812");
done(); done();
}) })
/* /*
* @tc.number CaptionConfiguration_0072 * @tc.number CaptionConfiguration_0270
* @tc.name CaptionConfiguration_0072 * @tc.name CaptionConfiguration_0270
* @tc.desc Test getCaptionsManager() function by modifying fontColor. * @tc.desc Test captionManager.style.fontColor function by assigning 0.
* Return CaptionsManager. * captionManager.style.fontColor will be "#00000000"
* @tc.size SmallTest * @tc.size SmallTest
* @tc.type User * @tc.type User
*/ */
it('CaptionConfiguration_0072', 0, async function (done) { it('CaptionConfiguration_0270', 0, async function (done) {
console.info('CaptionConfiguration_0072'); console.info('CaptionConfiguration_0270');
let captionManager = accessibility.getCaptionsManager(); let captionManager = accessibility.getCaptionsManager();
let fontColor =""; let fontColor = 0;
captionManager.style.fontColor = fontColor; captionManager.style.fontColor = fontColor;
let value = captionManager.style.fontColor; let value = captionManager.style.fontColor;
expect(value).assertEqual(fontColor); expect(value).assertEqual("#00000000");
done(); done();
}) })
/* /*
* @tc.number CaptionConfiguration_0080 * @tc.number CaptionConfiguration_0280
* @tc.name CaptionConfiguration_0080 * @tc.name CaptionConfiguration_0280
* @tc.desc Test getCaptionsManager() function by modifying fontEdgeType. * @tc.desc Test captionManager.style.fontColor function by assigning -1.
* Return CaptionsManager. * captionManager.style.fontColor will be "#ffffffff"
* @tc.size SmallTest * @tc.size SmallTest
* @tc.type User * @tc.type User
*/ */
it('CaptionConfiguration_0080', 0, async function (done) { it('CaptionConfiguration_0280', 0, async function (done) {
console.info('CaptionConfiguration_0080'); console.info('CaptionConfiguration_0280');
let captionManager = accessibility.getCaptionsManager(); let captionManager = accessibility.getCaptionsManager();
let fontEdgeType ="none"; let fontColor = -1;
captionManager.style.fontColor = fontColor;
let value = captionManager.style.fontColor;
expect(value).assertEqual("#ffffffff");
done();
})
/*
* @tc.number CaptionConfiguration_0290
* @tc.name CaptionConfiguration_0290
* @tc.desc Test captionManager.style.fontEdgeType function by assigning "none".
* captionManager.style.fontEdgeType will be "none"
* @tc.size SmallTest
* @tc.type User
*/
it('CaptionConfiguration_0290', 0, async function (done) {
console.info('CaptionConfiguration_0290');
let captionManager = accessibility.getCaptionsManager();
let fontEdgeType = "none";
captionManager.style.fontEdgeType = fontEdgeType; captionManager.style.fontEdgeType = fontEdgeType;
let value = captionManager.style.fontEdgeType; let value = captionManager.style.fontEdgeType;
expect(value).assertEqual(fontEdgeType); expect(value).assertEqual(fontEdgeType);
...@@ -690,17 +547,17 @@ describe('AccessibleCaptionConfiguration', function () { ...@@ -690,17 +547,17 @@ describe('AccessibleCaptionConfiguration', function () {
}) })
/* /*
* @tc.number CaptionConfiguration_0081 * @tc.number CaptionConfiguration_0300
* @tc.name CaptionConfiguration_0081 * @tc.name CaptionConfiguration_0300
* @tc.desc Test getCaptionsManager() function by modifying fontEdgeType. * @tc.desc Test captionManager.style.fontEdgeType function by assigning "raised".
* Return CaptionsManager. * captionManager.style.fontEdgeType will be "raised"
* @tc.size SmallTest * @tc.size SmallTest
* @tc.type User * @tc.type User
*/ */
it('CaptionConfiguration_0081', 0, async function (done) { it('CaptionConfiguration_0300', 0, async function (done) {
console.info('CaptionConfiguration_0081'); console.info('CaptionConfiguration_0300');
let captionManager = accessibility.getCaptionsManager(); let captionManager = accessibility.getCaptionsManager();
let fontEdgeType ="raised"; let fontEdgeType = "raised";
captionManager.style.fontEdgeType = fontEdgeType; captionManager.style.fontEdgeType = fontEdgeType;
let value = captionManager.style.fontEdgeType; let value = captionManager.style.fontEdgeType;
expect(value).assertEqual(fontEdgeType); expect(value).assertEqual(fontEdgeType);
...@@ -708,17 +565,17 @@ describe('AccessibleCaptionConfiguration', function () { ...@@ -708,17 +565,17 @@ describe('AccessibleCaptionConfiguration', function () {
}) })
/* /*
* @tc.number CaptionConfiguration_0082 * @tc.number CaptionConfiguration_0310
* @tc.name CaptionConfiguration_0082 * @tc.name CaptionConfiguration_0310
* @tc.desc Test getCaptionsManager() function by modifying fontEdgeType. * @tc.desc Test captionManager.style.fontEdgeType function by assigning "depressed".
* Return CaptionsManager. * captionManager.style.fontEdgeType will be "depressed"
* @tc.size SmallTest * @tc.size SmallTest
* @tc.type User * @tc.type User
*/ */
it('CaptionConfiguration_0082', 0, async function (done) { it('CaptionConfiguration_0310', 0, async function (done) {
console.info('CaptionConfiguration_0082'); console.info('CaptionConfiguration_0310');
let captionManager = accessibility.getCaptionsManager(); let captionManager = accessibility.getCaptionsManager();
let fontEdgeType ="depressed"; let fontEdgeType = "depressed";
captionManager.style.fontEdgeType = fontEdgeType; captionManager.style.fontEdgeType = fontEdgeType;
let value = captionManager.style.fontEdgeType; let value = captionManager.style.fontEdgeType;
expect(value).assertEqual(fontEdgeType); expect(value).assertEqual(fontEdgeType);
...@@ -726,17 +583,17 @@ describe('AccessibleCaptionConfiguration', function () { ...@@ -726,17 +583,17 @@ describe('AccessibleCaptionConfiguration', function () {
}) })
/* /*
* @tc.number CaptionConfiguration_0083 * @tc.number CaptionConfiguration_0320
* @tc.name CaptionConfiguration_0083 * @tc.name CaptionConfiguration_0320
* @tc.desc Test getCaptionsManager() function by modifying fontEdgeType. * @tc.desc Test captionManager.style.fontEdgeType function by assigning "uniform".
* Return CaptionsManager. * captionManager.style.fontEdgeType will be "uniform"
* @tc.size SmallTest * @tc.size SmallTest
* @tc.type User * @tc.type User
*/ */
it('CaptionConfiguration_0083', 0, async function (done) { it('CaptionConfiguration_0320', 0, async function (done) {
console.info('CaptionConfiguration_0083'); console.info('CaptionConfiguration_0320');
let captionManager = accessibility.getCaptionsManager(); let captionManager = accessibility.getCaptionsManager();
let fontEdgeType ="uniform"; let fontEdgeType = "uniform";
captionManager.style.fontEdgeType = fontEdgeType; captionManager.style.fontEdgeType = fontEdgeType;
let value = captionManager.style.fontEdgeType; let value = captionManager.style.fontEdgeType;
expect(value).assertEqual(fontEdgeType); expect(value).assertEqual(fontEdgeType);
...@@ -744,17 +601,17 @@ describe('AccessibleCaptionConfiguration', function () { ...@@ -744,17 +601,17 @@ describe('AccessibleCaptionConfiguration', function () {
}) })
/* /*
* @tc.number CaptionConfiguration_0084 * @tc.number CaptionConfiguration_0330
* @tc.name CaptionConfiguration_0084 * @tc.name CaptionConfiguration_0330
* @tc.desc Test getCaptionsManager() function by modifying fontEdgeType. * @tc.desc Test captionManager.style.fontEdgeType function by assigning "dropShadow".
* Return CaptionsManager. * captionManager.style.fontEdgeType will be "dropShadow"
* @tc.size SmallTest * @tc.size SmallTest
* @tc.type User * @tc.type User
*/ */
it('CaptionConfiguration_0084', 0, async function (done) { it('CaptionConfiguration_0330', 0, async function (done) {
console.info('CaptionConfiguration_0084'); console.info('CaptionConfiguration_0330');
let captionManager = accessibility.getCaptionsManager(); let captionManager = accessibility.getCaptionsManager();
let fontEdgeType ="dropShadow"; let fontEdgeType = "dropShadow";
captionManager.style.fontEdgeType = fontEdgeType; captionManager.style.fontEdgeType = fontEdgeType;
let value = captionManager.style.fontEdgeType; let value = captionManager.style.fontEdgeType;
expect(value).assertEqual(fontEdgeType); expect(value).assertEqual(fontEdgeType);
...@@ -762,17 +619,17 @@ describe('AccessibleCaptionConfiguration', function () { ...@@ -762,17 +619,17 @@ describe('AccessibleCaptionConfiguration', function () {
}) })
/* /*
* @tc.number CaptionConfiguration_0085 * @tc.number CaptionConfiguration_0340
* @tc.name CaptionConfiguration_0085 * @tc.name CaptionConfiguration_0340
* @tc.desc Test getCaptionsManager() function by modifying fontEdgeType. * @tc.desc Test captionManager.style.fontEdgeType function by assigning "".
* Return CaptionsManager. * captionManager.style.fontEdgeType will be ""
* @tc.size SmallTest * @tc.size SmallTest
* @tc.type User * @tc.type User
*/ */
it('CaptionConfiguration_0085', 0, async function (done) { it('CaptionConfiguration_0340', 0, async function (done) {
console.info('CaptionConfiguration_0085'); console.info('CaptionConfiguration_0340');
let captionManager = accessibility.getCaptionsManager(); let captionManager = accessibility.getCaptionsManager();
let fontEdgeType =""; let fontEdgeType = "";
captionManager.style.fontEdgeType = fontEdgeType; captionManager.style.fontEdgeType = fontEdgeType;
let value = captionManager.style.fontEdgeType; let value = captionManager.style.fontEdgeType;
expect(value).assertEqual(fontEdgeType); expect(value).assertEqual(fontEdgeType);
...@@ -780,17 +637,35 @@ describe('AccessibleCaptionConfiguration', function () { ...@@ -780,17 +637,35 @@ describe('AccessibleCaptionConfiguration', function () {
}) })
/* /*
* @tc.number CaptionConfiguration_0090 * @tc.number CaptionConfiguration_0350
* @tc.name CaptionConfiguration_0090 * @tc.name CaptionConfiguration_0350
* @tc.desc Test getCaptionsManager() function by modifying backgroundColor. * @tc.desc Test captionManager.style.fontEdgeType function by assigning null.
* Return CaptionsManager. * captionManager.style.fontEdgeType will be ''
* @tc.size SmallTest * @tc.size SmallTest
* @tc.type User * @tc.type User
*/ */
it('CaptionConfiguration_0090', 0, async function (done) { it('CaptionConfiguration_0350', 0, async function (done) {
console.info('CaptionConfiguration_0090'); console.info('CaptionConfiguration_0350');
let captionManager = accessibility.getCaptionsManager();
let fontEdgeType = null;
captionManager.style.fontEdgeType = fontEdgeType;
let value = captionManager.style.fontEdgeType;
expect(value).assertEqual('');
done();
})
/*
* @tc.number CaptionConfiguration_0360
* @tc.name CaptionConfiguration_0360
* @tc.desc Test captionManager.style.backgroundColor function by assigning "#12345678".
* captionManager.style.backgroundColor will be "#12345678"
* @tc.size SmallTest
* @tc.type User
*/
it('CaptionConfiguration_0360', 0, async function (done) {
console.info('CaptionConfiguration_0360');
let captionManager = accessibility.getCaptionsManager(); let captionManager = accessibility.getCaptionsManager();
let backgroundColor ="TmepbackgroundColor"; let backgroundColor ="#12345678";
captionManager.style.backgroundColor = backgroundColor; captionManager.style.backgroundColor = backgroundColor;
let value = captionManager.style.backgroundColor; let value = captionManager.style.backgroundColor;
expect(value).assertEqual(backgroundColor); expect(value).assertEqual(backgroundColor);
...@@ -798,53 +673,107 @@ describe('AccessibleCaptionConfiguration', function () { ...@@ -798,53 +673,107 @@ describe('AccessibleCaptionConfiguration', function () {
}) })
/* /*
* @tc.number CaptionConfiguration_0091 * @tc.number CaptionConfiguration_0370
* @tc.name CaptionConfiguration_0091 * @tc.name CaptionConfiguration_0370
* @tc.desc Test getCaptionsManager() function by modifying backgroundColor. * @tc.desc Test captionManager.style.backgroundColor function by assigning "".
* Return CaptionsManager. * captionManager.style.backgroundColor will be "#00000000"
* @tc.size SmallTest * @tc.size SmallTest
* @tc.type User * @tc.type User
*/ */
it('CaptionConfiguration_0091', 0, async function (done) { it('CaptionConfiguration_0370', 0, async function (done) {
console.info('CaptionConfiguration_0091'); console.info('CaptionConfiguration_0370');
let captionManager = accessibility.getCaptionsManager(); let captionManager = accessibility.getCaptionsManager();
let backgroundColor ="none"; let backgroundColor = "";
captionManager.style.backgroundColor = backgroundColor; captionManager.style.backgroundColor = backgroundColor;
let value = captionManager.style.backgroundColor; let value = captionManager.style.backgroundColor;
expect(value).assertEqual(backgroundColor); expect(value).assertEqual("#00000000");
done(); done();
}) })
/* /*
* @tc.number CaptionConfiguration_0092 * @tc.number CaptionConfiguration_0380
* @tc.name CaptionConfiguration_0092 * @tc.name CaptionConfiguration_0380
* @tc.desc Test getCaptionsManager() function by modifying backgroundColor. * @tc.desc Test captionManager.style.backgroundColor function by assigning null.
* Return CaptionsManager. * captionManager.style.backgroundColor will be "#00000000"
* @tc.size SmallTest * @tc.size SmallTest
* @tc.type User * @tc.type User
*/ */
it('CaptionConfiguration_0092', 0, async function (done) { it('CaptionConfiguration_0380', 0, async function (done) {
console.info('CaptionConfiguration_0092'); console.info('CaptionConfiguration_0380');
let captionManager = accessibility.getCaptionsManager(); let captionManager = accessibility.getCaptionsManager();
let backgroundColor =""; let backgroundColor = null;
captionManager.style.backgroundColor = backgroundColor; captionManager.style.backgroundColor = backgroundColor;
let value = captionManager.style.backgroundColor; let value = captionManager.style.backgroundColor;
expect(value).assertEqual(backgroundColor); expect(value).assertEqual("#00000000");
done(); done();
}) })
/* /*
* @tc.number CaptionConfiguration_0100 * @tc.number CaptionConfiguration_0390
* @tc.name CaptionConfiguration_0100 * @tc.name CaptionConfiguration_0390
* @tc.desc Test getCaptionsManager() function by modifying windowColor. * @tc.desc Test captionManager.style.backgroundColor function by assigning 0x12345678.
* Return CaptionsManager. * captionManager.style.backgroundColor will be "#34567812"
* @tc.size SmallTest * @tc.size SmallTest
* @tc.type User * @tc.type User
*/ */
it('CaptionConfiguration_0100', 0, async function (done) { it('CaptionConfiguration_0390', 0, async function (done) {
console.info('CaptionConfiguration_0100'); console.info('CaptionConfiguration_0390');
let captionManager = accessibility.getCaptionsManager();
let backgroundColor = 0x12345678;
captionManager.style.backgroundColor = backgroundColor;
let value = captionManager.style.backgroundColor;
expect(value).assertEqual("#34567812");
done();
})
/*
* @tc.number CaptionConfiguration_0400
* @tc.name CaptionConfiguration_0400
* @tc.desc Test captionManager.style.backgroundColor function by assigning 0.
* captionManager.style.backgroundColor will be "#00000000"
* @tc.size SmallTest
* @tc.type User
*/
it('CaptionConfiguration_0400', 0, async function (done) {
console.info('CaptionConfiguration_0400');
let captionManager = accessibility.getCaptionsManager();
let backgroundColor = 0;
captionManager.style.backgroundColor = backgroundColor;
let value = captionManager.style.backgroundColor;
expect(value).assertEqual("#00000000");
done();
})
/*
* @tc.number CaptionConfiguration_0410
* @tc.name CaptionConfiguration_0410
* @tc.desc Test captionManager.style.backgroundColor function by assigning -1.
* captionManager.style.backgroundColor will be "#ffffffff"
* @tc.size SmallTest
* @tc.type User
*/
it('CaptionConfiguration_0410', 0, async function (done) {
console.info('CaptionConfiguration_0410');
let captionManager = accessibility.getCaptionsManager(); let captionManager = accessibility.getCaptionsManager();
let windowColor ="TmepwindowColor"; let backgroundColor = -1;
captionManager.style.backgroundColor = backgroundColor;
let value = captionManager.style.backgroundColor;
expect(value).assertEqual("#ffffffff");
done();
})
/*
* @tc.number CaptionConfiguration_0420
* @tc.name CaptionConfiguration_0420
* @tc.desc Test captionManager.style.windowColor function by assigning "#12345678".
* captionManager.style.windowColor will be "#12345678"
* @tc.size SmallTest
* @tc.type User
*/
it('CaptionConfiguration_0420', 0, async function (done) {
console.info('CaptionConfiguration_0420');
let captionManager = accessibility.getCaptionsManager();
let windowColor ="#12345678";
captionManager.style.windowColor = windowColor; captionManager.style.windowColor = windowColor;
let value = captionManager.style.windowColor; let value = captionManager.style.windowColor;
expect(value).assertEqual(windowColor); expect(value).assertEqual(windowColor);
...@@ -852,89 +781,114 @@ describe('AccessibleCaptionConfiguration', function () { ...@@ -852,89 +781,114 @@ describe('AccessibleCaptionConfiguration', function () {
}) })
/* /*
* @tc.number CaptionConfiguration_0101 * @tc.number CaptionConfiguration_0430
* @tc.name CaptionConfiguration_0101 * @tc.name CaptionConfiguration_0430
* @tc.desc Test getCaptionsManager() function by modifying windowColor. * @tc.desc Test captionManager.style.windowColor function by assigning "".
* Return CaptionsManager. * captionManager.style.windowColor will be ""
* @tc.size SmallTest * @tc.size SmallTest
* @tc.type User * @tc.type User
*/ */
it('CaptionConfiguration_0101', 0, async function (done) { it('CaptionConfiguration_0430', 0, async function (done) {
console.info('CaptionConfiguration_0101'); console.info('CaptionConfiguration_0430');
let captionManager = accessibility.getCaptionsManager(); let captionManager = accessibility.getCaptionsManager();
let windowColor ="none"; let windowColor ="";
captionManager.style.windowColor = windowColor; captionManager.style.windowColor = windowColor;
let value = captionManager.style.windowColor; let value = captionManager.style.windowColor;
expect(value).assertEqual(windowColor); expect(value).assertEqual("#00000000");
done(); done();
}) })
/* /*
* @tc.number CaptionConfiguration_0102 * @tc.number CaptionConfiguration_0440
* @tc.name CaptionConfiguration_0102 * @tc.name CaptionConfiguration_0440
* @tc.desc Test getCaptionsManager() function by modifying windowColor. * @tc.desc Test captionManager.style.windowColor function by assigning null.
* Return CaptionsManager. * captionManager.style.windowColor will be "#00000000"
* @tc.size SmallTest * @tc.size SmallTest
* @tc.type User * @tc.type User
*/ */
it('CaptionConfiguration_0102', 0, async function (done) { it('CaptionConfiguration_0440', 0, async function (done) {
console.info('CaptionConfiguration_0102'); console.info('CaptionConfiguration_0440');
let captionManager = accessibility.getCaptionsManager(); let captionManager = accessibility.getCaptionsManager();
let windowColor =""; let windowColor = null;
captionManager.style.windowColor = windowColor; captionManager.style.windowColor = windowColor;
let value = captionManager.style.windowColor; let value = captionManager.style.windowColor;
expect(value).assertEqual(windowColor); expect(value).assertEqual("#00000000");
done(); done();
}) })
/* /*
* @tc.number CaptionConfiguration_0110 * @tc.number CaptionConfiguration_0450
* @tc.name CaptionConfiguration_0110 * @tc.name CaptionConfiguration_0450
* @tc.desc Test getCaptionsManager() function by modifying style. * @tc.desc Test captionManager.style.windowColor function by assigning 0x12345678.
* Return CaptionsManager. * captionManager.style.windowColor will be "#34567812"
* @tc.size SmallTest * @tc.size SmallTest
* @tc.type User * @tc.type User
*/ */
it('CaptionConfiguration_0110', 0, async function (done) { it('CaptionConfiguration_0450', 0, async function (done) {
console.info('CaptionConfiguration_0110'); console.info('CaptionConfiguration_0450');
let captionManager = accessibility.getCaptionsManager(); let captionManager = accessibility.getCaptionsManager();
let StyleTest = { let windowColor = 0x12345678;
fontFamily: "monospacedSerif", captionManager.style.windowColor = windowColor;
fontScale: 99, let value = captionManager.style.windowColor;
fontColor: "red", expect(value).assertEqual("#34567812");
fontEdgeType: "uniform", done();
backgroundColor: "pink", })
windowColor: "green"
}; /*
captionManager.style = StyleTest; * @tc.number CaptionConfiguration_0460
let value = captionManager.style; * @tc.name CaptionConfiguration_0460
expect(value.fontFamily).assertEqual(StyleTest.fontFamily); * @tc.desc Test captionManager.style.windowColor function by assigning 0.
expect(value.fontScale).assertEqual(StyleTest.fontScale); * captionManager.style.windowColor will be "#00000000"
expect(value.fontColor).assertEqual(StyleTest.fontColor); * @tc.size SmallTest
expect(value.fontEdgeType).assertEqual(StyleTest.fontEdgeType); * @tc.type User
expect(value.backgroundColor).assertEqual(StyleTest.backgroundColor); */
expect(value.windowColor).assertEqual(StyleTest.windowColor); it('CaptionConfiguration_0460', 0, async function (done) {
console.info('CaptionConfiguration_0460');
let captionManager = accessibility.getCaptionsManager();
let windowColor = 0;
captionManager.style.windowColor = windowColor;
let value = captionManager.style.windowColor;
expect(value).assertEqual("#00000000");
done(); done();
}) })
/* /*
* @tc.number CaptionConfiguration_0111 * @tc.number CaptionConfiguration_0470
* @tc.name CaptionConfiguration_0111 * @tc.name CaptionConfiguration_0470
* @tc.desc Test getCaptionsManager() function by modifying style. * @tc.desc Test captionManager.style.windowColor function by assigning -1.
* Return CaptionsManager. * captionManager.style.windowColor will be "#ffffffff"
* @tc.size SmallTest * @tc.size SmallTest
* @tc.type User * @tc.type User
*/ */
it('CaptionConfiguration_0111', 0, async function (done) { it('CaptionConfiguration_0470', 0, async function (done) {
console.info('CaptionConfiguration_0111'); console.info('CaptionConfiguration_0470');
let captionManager = accessibility.getCaptionsManager();
let windowColor = -1;
captionManager.style.windowColor = windowColor;
let value = captionManager.style.windowColor;
expect(value).assertEqual("#ffffffff");
done();
})
/*
* @tc.number CaptionConfiguration_0480
* @tc.name CaptionConfiguration_0480
* @tc.desc Test captionManager.style function by assigning a value.
* Attributes of captionManager.style will be equal to that of this value
* @tc.size SmallTest
* @tc.type User
*/
it('CaptionConfiguration_0480', 0, async function (done) {
console.info('CaptionConfiguration_0480');
let captionManager = accessibility.getCaptionsManager(); let captionManager = accessibility.getCaptionsManager();
let StyleTest = { let StyleTest = {
fontFamily: "default", fontFamily: "monospacedSerif",
fontScale: 75, fontScale: 99,
fontColor: "blue", fontColor: "#12345678",
fontEdgeType: "none", fontEdgeType: "uniform",
backgroundColor: "green", backgroundColor: "#23456789",
windowColor: "pink" windowColor: "#34567890"
}; };
captionManager.style = StyleTest; captionManager.style = StyleTest;
let value = captionManager.style; let value = captionManager.style;
...@@ -947,4 +901,5 @@ describe('AccessibleCaptionConfiguration', function () { ...@@ -947,4 +901,5 @@ describe('AccessibleCaptionConfiguration', function () {
done(); done();
}) })
}) })
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册