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

!4961 【OpenHarmony 3.2.6.2】【RK3568】【ToD】【输入法框架】【上传下载】【主题】用例名称修正为规范名称

Merge pull request !4961 from zeng_xingdong/master
...@@ -12,16 +12,16 @@ ...@@ -12,16 +12,16 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import inputmethohJsunit from './InputmethohJsunit.test.ets'; import inputMethodJSUnit from './inputMethodJSUnit.ets';
import inputmethodEngineJsunit from './InputmethodEngineJsunit.test.ets'; import inputMethodEngineJSUnit from './inputMethodEngineJSUnit.ets';
import inputRequestJsunit from './InputRequestJsunit.test.ets'; import inputRequestJSUnit from './inputRequestJSUnit.ets';
import requestJsunit from './RequestJsunit.test.ets'; import requestJSUnit from './requestJSUnit.ets';
import requestDownloadJsunit from './RequestDownloadTaskJsunit.test.ets'; import requestDownloadJSUnit from './requestDownloadJSUnit.ets';
export default function testsuite() { export default function testsuite() {
inputmethohJsunit(); inputMethodJSUnit();
inputmethodEngineJsunit(); inputMethodEngineJSUnit();
inputRequestJsunit(); inputRequestJSUnit();
requestDownloadJsunit(); requestDownloadJSUnit();
requestJsunit(); requestJSUnit();
} }
\ No newline at end of file
...@@ -57,10 +57,10 @@ export default class Utils { ...@@ -57,10 +57,10 @@ export default class Utils {
} }
static async drags(downX, downY, upX, upY, steps, drag) { static async drags(downX, downY, upX, upY, steps, drag) {
var xStep; let xStep;
var yStep; let yStep;
var swipeSteps; let swipeSteps;
var ret; let ret;
xStep = 0; xStep = 0;
yStep = 0; yStep = 0;
ret = false; ret = false;
...@@ -71,7 +71,7 @@ export default class Utils { ...@@ -71,7 +71,7 @@ export default class Utils {
xStep = (upX - downX) / swipeSteps; xStep = (upX - downX) / swipeSteps;
yStep = (upY - downY) / swipeSteps; yStep = (upY - downY) / swipeSteps;
console.info('move step is: ' + 'xStep: ' + xStep + ' yStep: ' + yStep) console.info('move step is: ' + 'xStep: ' + xStep + ' yStep: ' + yStep)
var downPonit: TouchObject = { let downPonit: TouchObject = {
id: 1, id: 1,
x: downX, x: downX,
y: downY, y: downY,
...@@ -83,8 +83,8 @@ export default class Utils { ...@@ -83,8 +83,8 @@ export default class Utils {
if (drag) { if (drag) {
await this.sleep(500) await this.sleep(500)
} }
for (var i = 1;i <= swipeSteps; i++) { for (let i = 1;i <= swipeSteps; i++) {
var movePoint: TouchObject = { let movePoint: TouchObject = {
id: 1, id: 1,
x: downX + (xStep * i), x: downX + (xStep * i),
y: downY + (yStep * i), y: downY + (yStep * i),
...@@ -101,7 +101,7 @@ export default class Utils { ...@@ -101,7 +101,7 @@ export default class Utils {
if (drag) { if (drag) {
await this.sleep(100) await this.sleep(100)
} }
var upPoint: TouchObject = { let upPoint: TouchObject = {
id: 1, id: 1,
x: upX, x: upX,
y: upY, y: upY,
......
...@@ -19,12 +19,12 @@ import Utils from './Utils'; ...@@ -19,12 +19,12 @@ import Utils from './Utils';
import router from '@system.router'; import router from '@system.router';
import events_emitter from '@ohos.events.emitter'; import events_emitter from '@ohos.events.emitter';
export default function inputMethodEngineJsunit() { export default function inputMethodEngineJSUnit() {
describe('appInfoTest_input_1', function () { describe('appInfoTest_input_1', function () {
var mKeyboardDelegate = null; let mKeyboardDelegate = null;
var inputMethodEngineObject = inputMethodEngine.getInputMethodEngine(); let inputMethodEngineObject = inputMethodEngine.getInputMethodEngine();
var textInputClient = null; let textInputClient = null;
var kbController = null; let kbController = null;
console.info("************* inputMethodEngine Test start*************"); console.info("************* inputMethodEngine Test start*************");
beforeEach(async function (done) { beforeEach(async function (done) {
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'hypium/index'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'hypium/index';
import inputMethod from '@ohos.inputmethod'; import inputMethod from '@ohos.inputmethod';
export default function settingUiJsunit() { export default function inputMethodJSUnit() {
describe('appInfoTest_input_2', function () { describe('appInfoTest_input_2', function () {
console.info("************* settings Test start*************"); console.info("************* settings Test start*************");
it('inputmethoh_test_001', 0, async function (done) { it('inputmethoh_test_001', 0, async function (done) {
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
import {describe, it, expect} from 'hypium/index'; import {describe, it, expect} from 'hypium/index';
import request from '@ohos.request'; import request from '@ohos.request';
export default function inputRequestJsunit() { export default function inputRequestJSUnit() {
describe('inputRequestTest', function () { describe('inputRequestTest', function () {
console.log("************* request Test start*************"); console.log("************* request Test start*************");
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
import {describe, it, expect} from "deccjsunit/index.ets"; import {describe, it, expect} from "deccjsunit/index.ets";
import request from '@ohos.request'; import request from '@ohos.request';
export default function requestDownloadJsunit() { export default function requestDownloadJSUnit() {
describe('requestDownloadTest', function () { describe('requestDownloadTest', function () {
let downloadConfig = { let downloadConfig = {
url: "www.baidu.com" url: "www.baidu.com"
...@@ -32,10 +32,10 @@ export default function requestDownloadJsunit() { ...@@ -32,10 +32,10 @@ export default function requestDownloadJsunit() {
header: 'HTTP', header: 'HTTP',
method: 'post', method: 'post',
files: file, files: file,
data: 'jason/xml' data: 'json/xml'
}; };
var receivedSize; let receivedSize;
var totalSize; let totalSize;
console.log("************* settings Test start*************"); console.log("************* settings Test start*************");
/** /**
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
import {describe, it, expect} from "deccjsunit/index.ets"; import {describe, it, expect} from "deccjsunit/index.ets";
import request from '@ohos.request'; import request from '@ohos.request';
export default function requestJsunit() { export default function requestJSUnit() {
describe('requestTest', function () { describe('requestTest', function () {
/** /**
......
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
* limitations under the License. * limitations under the License.
*/ */
import uploadRequestJsunitTest from './uploadCallbackXTSJsunitTest'; import uploadRequestJSUnitTest from './uploadCallbackXTSJSUnitTest';
export default function testsuite() { export default function testsuite() {
uploadRequestJsunitTest() uploadRequestJSUnitTest()
} }
\ No newline at end of file
...@@ -27,7 +27,7 @@ function sleep(ms) { ...@@ -27,7 +27,7 @@ function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms)); return new Promise(resolve => setTimeout(resolve, ms));
} }
function getUploadConfig(fileurl){ function getUploadConfig(fileURL){
let File = { let File = {
filename: 'test', // When multipart is submitted, the file name in the request header. filename: 'test', // When multipart is submitted, the file name in the request header.
name: 'test', // When multipart is submitted, the name of the form item. The default is file. name: 'test', // When multipart is submitted, the name of the form item. The default is file.
...@@ -52,74 +52,74 @@ function getUploadConfig(fileurl){ ...@@ -52,74 +52,74 @@ function getUploadConfig(fileurl){
} }
//upload公共方法 //upload公共方法
function publicupload(UploadConfig){ function publicUpload(UploadConfig){
console.info(`Testupdate UploadConfig ${JSON.stringify(UploadConfig)}`) console.info(`TestUpdate UploadConfig ${JSON.stringify(UploadConfig)}`)
return new Promise(function(resolve, reject) { return new Promise(function(resolve, reject) {
request.upload(UploadConfig, (err, data) => { request.upload(UploadConfig, (err, data) => {
console.info("Testupdate publiconprogress Updatetask =" + JSON.stringify(data)); console.info("TestUpdate publicOnProgress UpdateTask =" + JSON.stringify(data));
resolve(data); resolve(data);
}) })
}) })
} }
//onprogress公共方法 //OnProgress公共方法
function publiconprogress(Updatetask, Type){ function publicOnProgress(UpdateTask, Type){
return new Promise(function(resolve, reject) { return new Promise(function(resolve, reject) {
Updatetask.on(Type, function(data1 ,data2){ UpdateTask.on(Type, function(data1 ,data2){
let progress = { let progress = {
uploadedSize : data1, uploadedSize : data1,
totalSize : data2 totalSize : data2
} }
console.info("Testupdate publiconprogress uploadedSize =" + data1); console.info("TestUpdate publicOnProgress uploadedSize =" + data1);
console.info("Testupdate publiconprogress totalSize =" + data2); console.info("TestUpdate publicOnProgress totalSize =" + data2);
resolve(progress); resolve(progress);
}) })
}) })
} }
//offprogress公共方法 //OffProgress公共方法
function publicoffprogress(Updatetask, Type){ function publicOffProgress(UpdateTask, Type){
return new Promise(function(resolve, reject) { return new Promise(function(resolve, reject) {
Updatetask.off(Type, function(data1 ,data2){ UpdateTask.off(Type, function(data1 ,data2){
let progress = { let progress = {
uploadedSize : data1, uploadedSize : data1,
totalSize : data2 totalSize : data2
} }
console.info("Testupdate publicoffprogress uploadedSize =" + data1); console.info("TestUpdate publicOffProgress uploadedSize =" + data1);
console.info("Testupdate publicoffprogress totalSize =" + data2); console.info("TestUpdate publicOffProgress totalSize =" + data2);
resolve(progress); resolve(progress);
}) })
}) })
} }
//其他on公共方法 //其他on公共方法
function publicon(Updatetask, Type){ function publicOn(UpdateTask, Type){
return new Promise(function(resolve, reject) { return new Promise(function(resolve, reject) {
Updatetask.on(Type, function(data){ UpdateTask.on(Type, function(data){
console.info("Testupdate publicon =" + data); console.info("TestUpdate publicOn =" + data);
resolve(data); resolve(data);
}) })
}) })
} }
//其他off公共方法 //其他off公共方法
function publicoff(Updatetask, Type){ function publicOff(UpdateTask, Type){
return new Promise(function(resolve, reject) { return new Promise(function(resolve, reject) {
Updatetask.off(Type, function(data){ UpdateTask.off(Type, function(data){
console.info("Testupdate publicoff =" + data); console.info("TestUpdate publicOff =" + data);
resolve(data); resolve(data);
}) })
}) })
} }
//remove公共方法 //remove公共方法
function publicremove(Updatetask){ function publicRemove(UpdateTask){
return new Promise(function(resolve, reject) { return new Promise(function(resolve, reject) {
Updatetask.remove((err,data) => { UpdateTask.remove((err,data) => {
console.info("Testupdate publicremove =" + data); console.info("TestUpdate publicRemove =" + data);
resolve(data); resolve(data);
}) })
}) })
} }
export{publicupload,publicon,publicoff,publicremove,publiconprogress,publicoffprogress,getUploadConfig,sleep} export{publicUpload,publicOn,publicOff,publicRemove,publicOnProgress,publicOffProgress,getUploadConfig,sleep}
\ No newline at end of file \ No newline at end of file
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
import request from '@ohos.request'; import request from '@ohos.request';
import * as pubfun from './Publicfunction.ets' import * as pubFun from './publicFunction.ets'
var typeProgress = 'progress'; var typeProgress = 'progress';
var typeHeaderReceive = 'headerReceive'; var typeHeaderReceive = 'headerReceive';
...@@ -23,7 +23,7 @@ var typeFail = 'fail'; ...@@ -23,7 +23,7 @@ var typeFail = 'fail';
let uploadTask; let uploadTask;
let file7url = 'internal://cache/test.txt'; let file7url = 'internal://cache/test.txt';
export default function uploadRequestJsunitTest() { export default function uploadRequestJSUnitTest() {
describe('UploadTest', function () { describe('UploadTest', function () {
beforeAll(function () { beforeAll(function () {
console.info('beforeAll: Prerequisites at the test suite level, ' + console.info('beforeAll: Prerequisites at the test suite level, ' +
...@@ -43,159 +43,159 @@ export default function uploadRequestJsunitTest() { ...@@ -43,159 +43,159 @@ export default function uploadRequestJsunitTest() {
}) })
/* /*
* @tc.number : InitUploadtaskCallback001 * @tc.number : SUB_MISC_REQUEST_API_UploadTask_0001
* @tc.name : Use getEntries get the value by mixing the string key * @tc.name : Use getEntries get the value by mixing the string key
* @tc.desc : Mixed strings value can be obtained correctly * @tc.desc : Mixed strings value can be obtained correctly
* @tc.size : MediumTest * @tc.size : MediumTest
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('InitUploadtaskCallback001', 0, async function (done) { it('SUB_MISC_REQUEST_API_UploadTask_0001', 0, async function (done) {
try { try {
console.info("Testupdate before getuploadconfig"); console.info("TestUpdate before getUploadConfig");
let UploadConfig = pubfun.getUploadConfig(file7url) let UploadConfig = pubFun.getUploadConfig(file7url)
console.info("Testupdate before upload UploadConfig = " + JSON.stringify(UploadConfig)); console.info("TestUpdate before upload UploadConfig = " + JSON.stringify(UploadConfig));
console.info("Testupdate before upload"); console.info("TestUpdate before upload");
await pubfun.publicupload(UploadConfig).then((data) => { await pubFun.publicUpload(UploadConfig).then((data) => {
console.info("Testupdate going upload uploadTask = " + data); console.info("TestUpdate going upload uploadTask = " + data);
uploadTask = data; uploadTask = data;
expect(true).assertEqual((data != undefined) || (data != "") || (data != {})); expect(true).assertEqual((data != undefined) || (data != "") || (data != {}));
done(); done();
}).catch((err) => { }).catch((err) => {
console.info("InitUploadtaskCallback001 fail 1" + JSON.stringify(err)); console.info("SUB_MISC_REQUEST_API_UploadTask_0001 fail 1" + JSON.stringify(err));
expect(err).assertFail(); expect(err).assertFail();
done(); done();
}) })
} catch (e) { } catch (e) {
console.info("InitUploadtaskCallback001 fail 2" + JSON.stringify(e)); console.info("SUB_MISC_REQUEST_API_UploadTask_0001 fail 2" + JSON.stringify(e));
expect(e).assertFail(); expect(e).assertFail();
done(); done();
} }
}) })
/* /*
* @tc.number : SwitchOnProgressCallback001 * @tc.number : SUB_MISC_REQUEST_API_OnProgress_0001
* @tc.name : Use getEntries get the value by mixing the string key * @tc.name : Use getEntries get the value by mixing the string key
* @tc.desc : Mixed strings value can be obtained correctly * @tc.desc : Mixed strings value can be obtained correctly
* @tc.size : MediumTest * @tc.size : MediumTest
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('SwitchOnProgressCallback001', 0, async function (done) { it('SUB_MISC_REQUEST_API_OnProgress_0001', 0, async function (done) {
try { try {
pubfun.publiconprogress(uploadTask, typeProgress); pubFun.publicOnProgress(uploadTask, typeProgress);
expect(true).assertEqual(0 == 0); expect(true).assertEqual(0 == 0);
done(); done();
} catch (err) { } catch (err) {
console.info("Testupdate SwitchOnProgressCallback001 catch err " + JSON.stringify(err)); console.info("TestUpdate SUB_MISC_REQUEST_API_OnProgress_0001 catch err " + JSON.stringify(err));
expect(err).assertFail(); expect(err).assertFail();
done(); done();
} }
}); });
/* /*
* @tc.number : SwitchOffProgressCallback001 * @tc.number : SUB_MISC_REQUEST__OffProgress_0001
* @tc.name : Use getEntries get the value by mixing the string key * @tc.name : Use getEntries get the value by mixing the string key
* @tc.desc : Mixed strings value can be obtained correctly * @tc.desc : Mixed strings value can be obtained correctly
* @tc.size : MediumTest * @tc.size : MediumTest
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('SwitchOffProgressCallback001', 0, async function (done) { it('SUB_MISC_REQUEST_OffProgress_0001', 0, async function (done) {
try { try {
pubfun.publiconprogress(uploadTask, typeProgress); pubFun.publicOnProgress(uploadTask, typeProgress);
expect(true).assertEqual(0 == 0); expect(true).assertEqual(0 == 0);
await pubfun.publicoffprogress(uploadTask, typeProgress).then((data) => { await pubFun.publicOffProgress(uploadTask, typeProgress).then((data) => {
console.info("SwitchOffProgressCallback001 data" + JSON.stringify(data)); console.info("SUB_MISC_REQUEST_OffProgress_0001 data" + JSON.stringify(data));
expect(7).assertEqual(data["totalSize"]); expect(7).assertEqual(data["totalSize"]);
done(); done();
}).catch((err) => { }).catch((err) => {
console.info("SwitchOffProgressCallback001 fail 2" + JSON.stringify(err)); console.info("SUB_MISC_REQUEST_OffProgress_0001 fail 2" + JSON.stringify(err));
expect(err).assertFail(); expect(err).assertFail();
done(); done();
}) })
} catch (e) { } catch (e) {
console.info("SwitchOffProgressCallback001 fail 3" + JSON.stringify(e)); console.info("SUB_MISC_REQUEST_OffProgress_0001 fail 3" + JSON.stringify(e));
expect(e).assertFail(); expect(e).assertFail();
done(); done();
} }
}) })
/* /*
* @tc.number : SwitchOnFailCallback001 * @tc.number : SUB_MISC_REQUEST_OnFail_0001
* @tc.name : Use getEntries get the value by mixing the string key * @tc.name : Use getEntries get the value by mixing the string key
* @tc.desc : Mixed strings value can be obtained correctly * @tc.desc : Mixed strings value can be obtained correctly
* @tc.size : MediumTest * @tc.size : MediumTest
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('SwitchOnFailCallback001', 0, async function (done) { it('SUB_MISC_REQUEST_OnFail_0001', 0, async function (done) {
try { try {
await pubfun.publicon(uploadTask, typeFail).then((data) => { await pubFun.publicOn(uploadTask, typeFail).then((data) => {
console.info("SwitchOnFailCallback001 data " + data); console.info("SUB_MISC_REQUEST_OnFail_0001 data " + data);
expect(5).assertEqual(data); expect(5).assertEqual(data);
done(); done();
}).catch((err) => { }).catch((err) => {
console.info("SwitchOnFailCallback001 fail 2" + JSON.stringify(err)); console.info("SUB_MISC_REQUEST_OnFail_0001 fail 2" + JSON.stringify(err));
expect(err).assertFail(); expect(err).assertFail();
done(); done();
}) })
} catch (e) { } catch (e) {
console.info("SwitchOnFailCallback001 fail 3" + JSON.stringify(e)); console.info("SUB_MISC_REQUEST_OnFail_0001 fail 3" + JSON.stringify(e));
expect(e).assertFail(); expect(e).assertFail();
done(); done();
} }
}) })
/* /*
* @tc.number : SwitchOffFailCallback001 * @tc.number : SUB_MISC_REQUEST_OffFail_0001
* @tc.name : Use getEntries get the value by mixing the string key * @tc.name : Use getEntries get the value by mixing the string key
* @tc.desc : Mixed strings value can be obtained correctly * @tc.desc : Mixed strings value can be obtained correctly
* @tc.size : MediumTest * @tc.size : MediumTest
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('SwitchOffFailCallback001', 0, async function (done) { it('SUB_MISC_REQUEST_OffFail_0001', 0, async function (done) {
try { try {
await pubfun.publicon(uploadTask, typeFail) await pubFun.publicOn(uploadTask, typeFail)
await pubfun.publicoff(uploadTask, typeFail).then((data) => { await pubFun.publicOff(uploadTask, typeFail).then((data) => {
console.info("SwitchOffFailCallback001 data " + data); console.info("SUB_MISC_REQUEST_OffFail_0001 data " + data);
expect(5).assertEqual(data); expect(5).assertEqual(data);
done(); done();
}).catch((err) => { }).catch((err) => {
console.info("SwitchOffFailCallback001 fail 2" + JSON.stringify(err)); console.info("SUB_MISC_REQUEST_OffFail_0001 fail 2" + JSON.stringify(err));
done(); done();
expect(err).assertFail(); expect(err).assertFail();
}) })
} catch (e) { } catch (e) {
console.info("SwitchOffFailCallback001 fail 3" + JSON.stringify(e)); console.info("SUB_MISC_REQUEST_OffFail_0001 fail 3" + JSON.stringify(e));
expect(e).assertFail(); expect(e).assertFail();
done(); done();
} }
}) })
/* /*
* @tc.number : RemoveCallback001 * @tc.number : SUB_MISC_REQUEST_RmvCB_0001
* @tc.name : Use getEntries get the value by mixing the string key * @tc.name : Use getEntries get the value by mixing the string key
* @tc.desc : Mixed strings value can be obtained correctly * @tc.desc : Mixed strings value can be obtained correctly
* @tc.size : MediumTest * @tc.size : MediumTest
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('RemoveCallback001', 0, async function (done) { it('SUB_MISC_REQUEST_RmvCB_0001', 0, async function (done) {
try { try {
await pubfun.publicremove(uploadTask).then((data) => { await pubFun.publicRemove(uploadTask).then((data) => {
console.info("RemoveCallback001 data " + data); console.info("SUB_MISC_REQUEST_RmvCB_0001 data " + data);
expect(true).assertEqual(data); expect(true).assertEqual(data);
done(); done();
}).catch((err) => { }).catch((err) => {
console.info("RemoveCallback001 fail 2" + JSON.stringify(err)); console.info("SUB_MISC_REQUEST_RmvCB_0001 fail 2" + JSON.stringify(err));
expect(err).assertFail(); expect(err).assertFail();
done(); done();
}) })
} catch (e) { } catch (e) {
console.info("RemoveCallback001 fail 3" + JSON.stringify(e)); console.info("SUB_MISC_REQUEST_RmvCB_0001 fail 3" + JSON.stringify(e));
expect(e).assertFail(); expect(e).assertFail();
done(); done();
} }
......
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
...@@ -23,8 +23,8 @@ export default function ScreenLockPromiseTest(){ ...@@ -23,8 +23,8 @@ export default function ScreenLockPromiseTest(){
console.info("-----------------------ScreenlockPromiseTest is starting-----------------------"); console.info("-----------------------ScreenlockPromiseTest is starting-----------------------");
function sleep(numberMillis) { function sleep(numberMillis) {
var now = new Date(); let now = new Date();
var exitTime = now.getTime() + numberMillis; let exitTime = now.getTime() + numberMillis;
while (true) { while (true) {
now = new Date(); now = new Date();
if (now.getTime() > exitTime) if (now.getTime() > exitTime)
...@@ -33,134 +33,144 @@ export default function ScreenLockPromiseTest(){ ...@@ -33,134 +33,144 @@ export default function ScreenLockPromiseTest(){
} }
/* /*
* @tc.number ScreenLock_Test_Promise_0100 * @tc.number SUB_MISC_THEME_screenLock_API_Promise_001
* @tc.name Set to locked screen, query the lock screen state is locked state * @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Function test * @tc.desc Test ScreenLock API functionality.
* @tc.level 0 * @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/ */
it("ScreenLock_Test_Promise_0100", 0, async function (done) { it("SUB_MISC_THEME_screenLock_API_Promise_001", 0, async function (done) {
console.info("------------------start ScreenLock_Test_Promise_0100-------------------"); console.info("------------------start SUB_MISC_THEME_screenLock_API_Promise_001-------------------");
var isScreenLocked = true; let isScreenLocked = true;
try { try {
screenLock.isScreenLocked().then((data) => { screenLock.isScreenLocked().then((data) => {
console.info("ScreenLock_Test_Promise_0100 isScreenLocked result is " + data); console.info("SUB_MISC_THEME_screenLock_API_Promise_001 isScreenLocked result is " + data);
expect(data == true).assertTrue() expect(data == true).assertTrue()
}) })
} catch (error) { } catch (error) {
console.info("ScreenLock_Test_Promise_0100 test_setScreenLocked : error = " + error); console.info("SUB_MISC_THEME_screenLock_API_Promise_001 test_setScreenLocked : error = " + error);
expect(true).assertTrue(); expect(true).assertTrue();
} }
console.info("------------------end ScreenLock_Test_Promise_0100-------------------"); console.info("------------------end SUB_MISC_THEME_screenLock_API_Promise_001-------------------");
done(); done();
}); });
/* /*
* @tc.number ScreenLock_Test_Promise_0200 * @tc.number SUB_MISC_THEME_screenLock_API_Promise_002
* @tc.name Set to unlocked screen, query the lock screen state is unlocked state * @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Function test * @tc.desc Test ScreenLock API functionality.
* @tc.level 0 * @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/ */
it("ScreenLock_Test_Promise_0200", 0, async function (done) { it("SUB_MISC_THEME_screenLock_API_Promise_002", 0, async function (done) {
console.info("------------------start ScreenLock_Test_Promise_0200-------------------"); console.info("------------------start SUB_MISC_THEME_screenLock_API_Promise_002-------------------");
var isScreenLocked = false; let isScreenLocked = false;
try { try {
screenLock.isScreenLocked().then((data) => { screenLock.isScreenLocked().then((data) => {
console.info("ScreenLock_Test_Promise_0200 isScreenLocked result is " + data); console.info("SUB_MISC_THEME_screenLock_API_Promise_002 isScreenLocked result is " + data);
expect(data == false).assertTrue(); expect(data == false).assertTrue();
}); });
} catch (error) { } catch (error) {
console.info("ScreenLock_Test_Promise_0200 test_setScreenLocked : error = " + error); console.info("SUB_MISC_THEME_screenLock_API_Promise_002 test_setScreenLocked : error = " + error);
expect(true).assertTrue(); expect(true).assertTrue();
} }
console.info("------------------end ScreenLock_Test_Promise_0200-------------------"); console.info("------------------end SUB_MISC_THEME_screenLock_API_Promise_002-------------------");
done(); done();
}); });
/* /*
* @tc.number ScreenLock_Test_Promise_0300 * @tc.number SUB_MISC_THEME_screenLock_API_Promise_003
* @tc.name Query whether a password has been set, and return the password that has not been set * @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Function test * @tc.desc Test ScreenLock API functionality.
* @tc.level 0 * @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/ */
it("ScreenLock_Test_Promise_0300", 0, async function (done) { it("SUB_MISC_THEME_screenLock_API_Promise_003", 0, async function (done) {
console.info("------------------start ScreenLock_Test_Promise_0300-------------------"); console.info("------------------start SUB_MISC_THEME_screenLock_API_Promise_003-------------------");
try { try {
screenLock.isSecureMode().then((data) => { screenLock.isSecureMode().then((data) => {
console.info("ScreenLock_Test_Promise_0300 isScreenLocked result is " + data); console.info("SUB_MISC_THEME_screenLock_API_Promise_003 isScreenLocked result is " + data);
expect(data == false).assertTrue(); expect(data == false).assertTrue();
}); });
} catch (error) { } catch (error) {
console.info("ScreenLock_Test_Promise_0300 isScreenLocked TRUE: error = " + error); console.info("SUB_MISC_THEME_screenLock_API_Promise_003 isScreenLocked TRUE: error = " + error);
expect(true).assertTrue(); expect(true).assertTrue();
} }
console.info("------------------end ScreenLock_Test_Promise_0300-------------------"); console.info("------------------end SUB_MISC_THEME_screenLock_API_Promise_003-------------------");
done(); done();
}); });
/* /*
* @tc.number ScreenLock_Test_Promise_0400 * @tc.number SUB_MISC_THEME_screenLock_API_Promise_004
* @tc.name Request to unlock the device screen, unlock successfully * @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Function test * @tc.desc Test ScreenLock API functionality.
* @tc.level 0 * @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/ */
it("ScreenLock_Test_Promise_0400", 0, async function (done) { it("SUB_MISC_THEME_screenLock_API_Promise_004", 0, async function (done) {
console.info("------------------start ScreenLock_Test_Promise_0400-------------------"); console.info("------------------start SUB_MISC_THEME_screenLock_API_Promise_004-------------------");
try { try {
screenLock.unlockScreen().then(() => { screenLock.unlockScreen().then(() => {
console.info("ScreenLock_Test_Promise_0400: send unlockScreen issue success"); console.info("SUB_MISC_THEME_screenLock_API_Promise_004: send unlockScreen issue success");
}); });
sleep(SLEEP_TIME); sleep(SLEEP_TIME);
var unlockScreenResult = 0; let unlockScreenResult = 0;
var eventType = 'unlockScreenResult'; let eventType = 'unlockScreenResult';
screenLock.sendScreenLockEvent(eventType, unlockScreenResult).then((data) => { screenLock.sendScreenLockEvent(eventType, unlockScreenResult).then((data) => {
console.info("ScreenLock_Test_Promise_0400: sendScreenLockEvent result is " + data); console.info("SUB_MISC_THEME_screenLock_API_Promise_004: sendScreenLockEvent result is " + data);
expect(data == true).assertTrue(); expect(data == true).assertTrue();
}); });
sleep(SLEEP_TIME); sleep(SLEEP_TIME);
screenLock.isScreenLocked().then((data) => { screenLock.isScreenLocked().then((data) => {
console.info("ScreenLock_Test_Promise_0400: isScreenLocked result is " + data); console.info("SUB_MISC_THEME_screenLock_API_Promise_004: isScreenLocked result is " + data);
expect(data == false).assertTrue(); expect(data == false).assertTrue();
}); });
} catch (error) { } catch (error) {
console.info("Screenlock_Test_1400: error = " + error); console.info("Screenlock_Test_1400: error = " + error);
expect(true).assertTrue(); expect(true).assertTrue();
} }
console.info("------------------end ScreenLock_Test_Promise_0400-------------------"); console.info("------------------end SUB_MISC_THEME_screenLock_API_Promise_004-------------------");
done(); done();
}); });
/* /*
* @tc.number ScreenLock_Test_Promise_0500 * @tc.number SUB_MISC_THEME_screenLock_API_Promise_005
* @tc.name Request to unlock device screen, unlock failed * @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Function test * @tc.desc Test ScreenLock API functionality.
* @tc.level 0 * @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/ */
it("ScreenLock_Test_Promise_0500", 0, async function (done) { it("SUB_MISC_THEME_screenLock_API_Promise_005", 0, async function (done) {
console.info("------------------start ScreenLock_Test_Promise_0500-------------------"); console.info("------------------start SUB_MISC_THEME_screenLock_API_Promise_005-------------------");
try { try {
screenLock.unlockScreen().then(() => { screenLock.unlockScreen().then(() => {
console.info("ScreenLock_Test_Promise_0500: send unlockScreen issue success"); console.info("SUB_MISC_THEME_screenLock_API_Promise_005: send unlockScreen issue success");
}); });
sleep(SLEEP_TIME); sleep(SLEEP_TIME);
var unlockScreenResult = 1; let unlockScreenResult = 1;
var eventType = 'unlockScreenResult'; let eventType = 'unlockScreenResult';
screenLock.sendScreenLockEvent(eventType, unlockScreenResult).then((data) => { screenLock.sendScreenLockEvent(eventType, unlockScreenResult).then((data) => {
console.info("ScreenLock_Test_Promise_0500: sendScreenLockEvent result is " + data); console.info("SUB_MISC_THEME_screenLock_API_Promise_005: sendScreenLockEvent result is " + data);
expect(data == true).assertTrue(); expect(data == true).assertTrue();
}); });
sleep(SLEEP_TIME); sleep(SLEEP_TIME);
screenLock.isScreenLocked().then((data) => { screenLock.isScreenLocked().then((data) => {
console.info("ScreenLock_Test_Promise_0500: isScreenLocked result is " + data); console.info("SUB_MISC_THEME_screenLock_API_Promise_005: isScreenLocked result is " + data);
expect(data == true).assertTrue(); expect(data == true).assertTrue();
done(); done();
}); });
} catch (error) { } catch (error) {
console.info("logMessage ScreenLock_Test_Promise_0500: error = " + error); console.info("logMessage SUB_MISC_THEME_screenLock_API_Promise_005: error = " + error);
expect(true).assertTrue(); expect(true).assertTrue();
} }
console.info("------------------end ScreenLock_Test_Promise_0500-------------------"); console.info("------------------end SUB_MISC_THEME_screenLock_API_Promise_005-------------------");
done(); done();
}); });
......
...@@ -26,8 +26,8 @@ export default function screenLockJSUnit() { ...@@ -26,8 +26,8 @@ export default function screenLockJSUnit() {
console.info("-----------------------ScreenlockTest is starting-----------------------"); console.info("-----------------------ScreenlockTest is starting-----------------------");
function sleep(numberMillis) { function sleep(numberMillis) {
var now = new Date(); let now = new Date();
var exitTime = now.getTime() + numberMillis; let exitTime = now.getTime() + numberMillis;
while (true) { while (true) {
now = new Date(); now = new Date();
if (now.getTime() > exitTime) if (now.getTime() > exitTime)
...@@ -36,748 +36,806 @@ export default function screenLockJSUnit() { ...@@ -36,748 +36,806 @@ export default function screenLockJSUnit() {
} }
/* /*
* @tc.number ScreenLock_Test_0100 * @tc.number SUB_MISC_THEME_screenLock_API_0001
* @tc.name Set to locked screen, query the lock screen state is locked state * @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Function test * @tc.desc Test ScreenLock API functionality.
* @tc.level 0 * @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/ */
it("ScreenLock_Test_0100", 0, async function (done) { it("SUB_MISC_THEME_screenLock_API_0001", 0, async function (done) {
console.info("------------------start ScreenLock_Test_0100-------------------"); console.info("------------------start SUB_MISC_THEME_screenLock_API_0001-------------------");
try { try {
screenLock.isScreenLocked((err, data) => { screenLock.isScreenLocked((err, data) => {
console.info("ScreenLock_Test_0100 isScreenLocked's status is " + data); console.info("SUB_MISC_THEME_screenLock_API_0001 screen's status is " + data);
expect(data == true).assertTrue(); expect(data == true).assertTrue();
}); });
} catch (error) { } catch (error) {
console.info("logMessage ScreenLock_Test_0100: error = " + error); console.info("logMessage SUB_MISC_THEME_screenLock_API_0001: error = " + error);
expect(true).assertTrue(); expect(true).assertTrue();
} }
console.info("------------------end ScreenLock_Test_0100-------------------"); console.info("------------------end SUB_MISC_THEME_screenLock_API_0001-------------------");
done(); done();
}); });
/* /*
* @tc.number ScreenLock_Test_0200 * @tc.number SUB_MISC_THEME_screenLock_API_0002
* @tc.name Set to unlocked screen, query the lock screen state is unlocked state * @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Function test * @tc.desc Test ScreenLock API functionality.
* @tc.level 0 * @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/ */
it("ScreenLock_Test_0200", 0, async function (done) { it("SUB_MISC_THEME_screenLock_API_0002", 0, async function (done) {
console.info("------------------start ScreenLock_Test_0200-------------------"); console.info("------------------start SUB_MISC_THEME_screenLock_API_0002-------------------");
try { try {
screenLock.isScreenLocked((err, data) => { screenLock.isScreenLocked((err, data) => {
console.info("ScreenLock_Test_0200 isScreenLocked's status is " + data); console.info("SUB_MISC_THEME_screenLock_API_0002 screen's status is " + data);
expect(data == false).assertTrue(); expect(data == false).assertTrue();
}); });
} catch (error) { } catch (error) {
console.info("logMessage ScreenLock_Test_0200: error = " + error); console.info("logMessage SUB_MISC_THEME_screenLock_API_0002: error = " + error);
expect(true).assertTrue(); expect(true).assertTrue();
} }
console.info("------------------end ScreenLock_Test_0200-------------------"); console.info("------------------end SUB_MISC_THEME_screenLock_API_0002-------------------");
done(); done();
}); });
/* /*
* @tc.number ScreenLock_Test_0300 * @tc.number SUB_MISC_THEME_screenLock_API_0003
* @tc.name Query whether a password has been set, and return the password that has not been set * @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Function test * @tc.desc Test ScreenLock API functionality.
* @tc.level 0 * @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/ */
it("ScreenLock_Test_0300", 0, async function (done) { it("SUB_MISC_THEME_screenLock_API_0003", 0, async function (done) {
console.info("------------------start ScreenLock_Test_0300-------------------"); console.info("------------------start SUB_MISC_THEME_screenLock_API_0003-------------------");
try { try {
screenLock.isSecureMode((err, data) => { screenLock.isSecureMode((err, data) => {
console.info("ScreenLock_Test_0300 isSecureMode's result is " + data); console.info("SUB_MISC_THEME_screenLock_API_0003 secureMode's result is " + data);
expect(data == false).assertTrue(); expect(data == false).assertTrue();
}); });
} catch (error) { } catch (error) {
console.info("logMessage ScreenLock_Test_0300: error = " + error); console.info("logMessage SUB_MISC_THEME_screenLock_API_0003: error = " + error);
expect(true).assertTrue(); expect(true).assertTrue();
} }
console.info("------------------end ScreenLock_Test_0300-------------------"); console.info("------------------end SUB_MISC_THEME_screenLock_API_0003-------------------");
done(); done();
}); });
/* /*
* @tc.number Screenlock_Test_0400 * @tc.number SUB_MISC_THEME_screenLock_API_0004
* @tc.name Request to unlock the device screen, unlock successfully * @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Function test * @tc.desc Test ScreenLock API functionality.
* @tc.level 0 * @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/ */
it("Screenlock_Test_0400", 0, async function (done) { it("SUB_MISC_THEME_screenLock_API_0004", 0, async function (done) {
console.info("------------------start Screenlock_Test_0400-------------------"); console.info("------------------start SUB_MISC_THEME_screenLock_API_0004-------------------");
try { try {
screenLock.unlockScreen(() => { screenLock.unlockScreen(() => {
console.info("Screenlock_Test_0400: send unlockScreen issue success"); console.info("SUB_MISC_THEME_screenLock_API_0004: send unlockScreen issue success");
}); });
sleep(SLEEP_TIME); sleep(SLEEP_TIME);
var unlockScreenResult = 0; let unlockScreenResult = 0;
var eventType = 'unlockScreenResult'; let eventType = 'unlockScreenResult';
screenLock.sendScreenLockEvent(eventType, unlockScreenResult, (err, data) => { screenLock.sendScreenLockEvent(eventType, unlockScreenResult, (err, data) => {
console.info("Screenlock_Test_0400: sendScreenLockEvent result is " + data); console.info("SUB_MISC_THEME_screenLock_API_0004: sendScreenLockEvent result is " + data);
expect(data == true).assertTrue(); expect(data == true).assertTrue();
}); });
sleep(SLEEP_TIME); sleep(SLEEP_TIME);
screenLock.isScreenLocked((err, data) => { screenLock.isScreenLocked((err, data) => {
console.info("Screenlock_Test_0400: isScreenLocked result is " + data); console.info("SUB_MISC_THEME_screenLock_API_0004: isScreenLocked result is " + data);
expect(data == false).assertTrue(); expect(data == false).assertTrue();
}); });
} catch (error) { } catch (error) {
console.info("Screenlock_Test_1400: error = " + error); console.info("SUB_MISC_THEME_screenLock_API_0004: error = " + error);
expect(true).assertTrue(); expect(true).assertTrue();
} }
console.info("------------------end Screenlock_Test_0400-------------------"); console.info("------------------end SUB_MISC_THEME_screenLock_API_0004-------------------");
done(); done();
}); });
/* /*
* @tc.number Screenlock_Test_0500 * @tc.number SUB_MISC_THEME_screenLock_API_0005
* @tc.name Request to unlock device screen, unlock failed * @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Function test * @tc.desc Test ScreenLock API functionality.
* @tc.level 0 * @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/ */
it("Screenlock_Test_0500", 0, async function (done) { it("SUB_MISC_THEME_screenLock_API_0005", 0, async function (done) {
console.info("------------------start Screenlock_Test_0500-------------------"); console.info("------------------start SUB_MISC_THEME_screenLock_API_0005-------------------");
try { try {
screenLock.unlockScreen(() => { screenLock.unlockScreen(() => {
console.info("Screenlock_Test_0500: send unlockScreen issue success"); console.info("SUB_MISC_THEME_screenLock_API_0005: send unlockScreen issue success");
}); });
sleep(SLEEP_TIME); sleep(SLEEP_TIME);
var unlockScreenResult = 1; let unlockScreenResult = 1;
var eventType = 'unlockScreenResult'; let eventType = 'unlockScreenResult';
screenLock.sendScreenLockEvent(eventType, unlockScreenResult, (err, data) => { screenLock.sendScreenLockEvent(eventType, unlockScreenResult, (err, data) => {
console.info("Screenlock_Test_0500: sendScreenLockEvent result is " + data); console.info("SUB_MISC_THEME_screenLock_API_0005: sendScreenLockEvent result is " + data);
expect(data == true).assertTrue(); expect(data == true).assertTrue();
}); });
sleep(SLEEP_TIME); sleep(SLEEP_TIME);
screenLock.isScreenLocked((err, data) => { screenLock.isScreenLocked((err, data) => {
console.info("Screenlock_Test_0500: isScreenLocked result is " + data); console.info("SUB_MISC_THEME_screenLock_API_0005: isScreenLocked result is " + data);
expect(data == true).assertTrue(); expect(data == true).assertTrue();
}); });
} catch (error) { } catch (error) {
console.info("logMessage Screenlock_Test_0500: error = " + error); console.info("logMessage SUB_MISC_THEME_screenLock_API_0005: error = " + error);
expect(true).assertTrue(); expect(true).assertTrue();
} }
console.info("------------------end Screenlock_Test_0500-------------------"); console.info("------------------end SUB_MISC_THEME_screenLock_API_0005-------------------");
done(); done();
}); });
/* /*
* @tc.number Screenlock_Test_2100 * @tc.number SUB_MISC_THEME_screenLock_API_0006
* @tc.name After the systemUI is started, it is in the locked state, the lock management sends * @tc.name Set to locked screen, query the lock screen state is locked state
the unlock request successfully, and the lock screen application notifies the unlock * @tc.desc Test ScreenLock API functionality.
success message * @tc.size : MEDIUM
* @tc.desc Function test * @tc.type : Function
* @tc.level 0 * @tc.level : Level 0
*/ */
it("Screenlock_Test_2100", 0, async function (done) { it("SUB_MISC_THEME_screenLock_API_0006", 0, async function (done) {
console.info("------------------start Screenlock_Test_2100-------------------"); console.info("------------------start SUB_MISC_THEME_screenLock_API_0006-------------------");
try { try {
screenLock.isScreenLocked((err, data) => { screenLock.isScreenLocked((err, data) => {
console.info("Screenlock_Test_2100: isScreenLocked result is " + data); console.info("SUB_MISC_THEME_screenLock_API_0006: isScreenLocked result is " + data);
expect(data == true).assertTrue(); expect(data == true).assertTrue();
}); });
sleep(SLEEP_TIME); sleep(SLEEP_TIME);
screenLock.unlockScreen(() => { screenLock.unlockScreen(() => {
console.info("Screenlock_Test_2100: send unlockScreen issue success"); console.info("SUB_MISC_THEME_screenLock_API_0006: send unlockScreen issue success");
}); });
sleep(SLEEP_TIME); sleep(SLEEP_TIME);
var unlockScreenResult = 0; let unlockScreenResult = 0;
var eventType = 'unlockScreenResult'; let eventType = 'unlockScreenResult';
screenLock.sendScreenLockEvent(eventType, unlockScreenResult, (err, data) => { screenLock.sendScreenLockEvent(eventType, unlockScreenResult, (err, data) => {
console.info("Screenlock_Test_2100: sendScreenLockEvent result is " + data); console.info("SUB_MISC_THEME_screenLock_API_0006: sendScreenLockEvent result is " + data);
expect(data == true).assertTrue(); expect(data == true).assertTrue();
}); });
sleep(SLEEP_TIME); sleep(SLEEP_TIME);
screenLock.isScreenLocked((err, data) => { screenLock.isScreenLocked((err, data) => {
console.info("Screenlock_Test_2100: isScreenLocked result is " + data); console.info("SUB_MISC_THEME_screenLock_API_0006: isScreenLocked result is " + data);
expect(data == false).assertTrue(); expect(data == false).assertTrue();
}); });
} catch (error) { } catch (error) {
console.info("Screenlock_Test_2100: error = " + error); console.info("SUB_MISC_THEME_screenLock_API_0006: error = " + error);
expect(true).assertTrue(); expect(true).assertTrue();
} }
console.info("------------------end Screenlock_Test_2100-------------------"); console.info("------------------end SUB_MISC_THEME_screenLock_API_0006-------------------");
done(); done();
}); });
/* /*
* @tc.number Screenlock_Test_2200 * @tc.number SUB_MISC_THEME_screenLock_API_0007
* @tc.name After systemUI is started, it is currently unlocked * @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Function test * @tc.desc Test ScreenLock API functionality.
* @tc.level 0 * @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/ */
it("Screenlock_Test_2200", 0, async function (done) { it("SUB_MISC_THEME_screenLock_API_0007", 0, async function (done) {
console.info("------------------start Screenlock_Test_2200-------------------"); console.info("------------------start SUB_MISC_THEME_screenLock_API_0007-------------------");
try { try {
screenLock.isScreenLocked((err, data) => { screenLock.isScreenLocked((err, data) => {
console.info("Screenlock_Test_2200: isScreenLocked is successful, result is " + data); console.info("SUB_MISC_THEME_screenLock_API_0007: isScreenLocked is successful, result is " + data);
expect(data == false).assertTrue(); expect(data == false).assertTrue();
}); });
} catch (error) { } catch (error) {
console.info("logMessage Screenlock_Test_2200: error = " + error); console.info("logMessage SUB_MISC_THEME_screenLock_API_0007: error = " + error);
expect(true).assertTrue(); expect(true).assertTrue();
} }
console.info("------------------end ScreenLock_Test_2200-------------------"); console.info("------------------end SUB_MISC_THEME_screenLock_API_0007-------------------");
done(); done();
}); });
/* /*
* @tc.number Screenlock_Test_2300 * @tc.number SUB_MISC_THEME_screenLock_API_0008
* @tc.name After the systemUI is started, it is in the locked state, the lock management sends * @tc.name Set to locked screen, query the lock screen state is locked state
the unlock request successfully, and the lock screen application notifies the unlock * @tc.desc Test ScreenLock API functionality.
failed message * @tc.size : MEDIUM
* @tc.desc Function test * @tc.type : Function
* @tc.level 0 * @tc.level : Level 0
*/ */
it("Screenlock_Test_2300", 0, async function (done) { it("SUB_MISC_THEME_screenLock_API_0008", 0, async function (done) {
console.info("------------------start Screenlock_Test_2300-------------------"); console.info("------------------start SUB_MISC_THEME_screenLock_API_0008-------------------");
try { try {
screenLock.isScreenLocked((err, data) => { screenLock.isScreenLocked((err, data) => {
console.log("Screenlock_Test_2300: isScreenLocked result is " + data); console.log("SUB_MISC_THEME_screenLock_API_0008: isScreenLocked result is " + data);
expect(data == true).assertTrue(); expect(data == true).assertTrue();
}); });
sleep(SLEEP_TIME); sleep(SLEEP_TIME);
screenLock.unlockScreen(() => { screenLock.unlockScreen(() => {
console.log("Screenlock_Test_2300: send unlockScreen issue success"); console.log("SUB_MISC_THEME_screenLock_API_0008: send unlockScreen issue success");
}); });
sleep(SLEEP_TIME); sleep(SLEEP_TIME);
var unlockScreenResult = 1; let unlockScreenResult = 1;
var eventType = 'unlockScreenResult'; let eventType = 'unlockScreenResult';
screenLock.sendScreenLockEvent(eventType, unlockScreenResult, (err, data) => { screenLock.sendScreenLockEvent(eventType, unlockScreenResult, (err, data) => {
console.log("Screenlock_Test_2300: sendScreenLockEvent result is " + data); console.log("SUB_MISC_THEME_screenLock_API_0008: sendScreenLockEvent result is " + data);
expect(data == true).assertTrue(); expect(data == true).assertTrue();
}); });
sleep(SLEEP_TIME); sleep(SLEEP_TIME);
screenLock.isScreenLocked((err, data) => { screenLock.isScreenLocked((err, data) => {
console.log("Screenlock_Test_2300: isScreenLocked result is " + data); console.log("SUB_MISC_THEME_screenLock_API_0008: isScreenLocked result is " + data);
expect(data == true).assertTrue(); expect(data == true).assertTrue();
}); });
} catch (error) { } catch (error) {
console.info("Screenlock_Test_2300: error = " + error); console.info("SUB_MISC_THEME_screenLock_API_0008: error = " + error);
expect(true).assertTrue(); expect(true).assertTrue();
} }
console.info("------------------end Screenlock_Test_2300-------------------"); console.info("------------------end SUB_MISC_THEME_screenLock_API_0008-------------------");
done(); done();
}); });
/* /*
* @tc.number Screenlock_Test_2400 * @tc.number SUB_MISC_THEME_screenLock_API_0009
* @tc.name Device management causes the screen to go off, and run "beginWakeUp" operate * @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Function test * @tc.desc Test ScreenLock API functionality.
* @tc.level 0 * @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/ */
it("Screenlock_Test_2400", 0, async function (done) { it("SUB_MISC_THEME_screenLock_API_0009", 0, async function (done) {
console.log("------------------start Screenlock_Test_2400-------------------"); console.log("------------------start SUB_MISC_THEME_screenLock_API_0009-------------------");
try { try {
var eventType = 'beginWakeUp'; let eventType = 'beginWakeUp';
screenLock.off(eventType, () => { screenLock.off(eventType, () => {
console.log("Screenlock_Test_2400: test_getRuntimeState beginWakeUp is successful" ); console.log("SUB_MISC_THEME_screenLock_API_0009: test_getRuntimeState beginWakeUp is successful" );
}); });
} catch (error) { } catch (error) {
console.log("end Screenlock_Test_2400: error = " + error); console.log("end SUB_MISC_THEME_screenLock_API_0009: error = " + error);
expect(true).assertTrue(); expect(true).assertTrue();
} }
console.log("------------------end Screenlock_Test_2400-------------------"); console.log("------------------end SUB_MISC_THEME_screenLock_API_0009-------------------");
done(); done();
}); });
/* /*
* @tc.number Screenlock_Test_2500 * @tc.number SUB_MISC_THEME_screenLock_API_0010
* @tc.name Device management causes the screen to go off, and run "endWakeUp" operate * @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Function test * @tc.desc Test ScreenLock API functionality.
* @tc.level 0 * @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/ */
it("Screenlock_Test_2500", 0, async function (done) { it("SUB_MISC_THEME_screenLock_API_0010", 0, async function (done) {
console.log("------------------start Screenlock_Test_2500-------------------"); console.log("------------------start SUB_MISC_THEME_screenLock_API_0010-------------------");
try { try {
var eventType = 'endWakeUp'; let eventType = 'endWakeUp';
screenLock.off(eventType, () => { screenLock.off(eventType, () => {
console.log("Screenlock_Test_2500: test_getRuntimeState endWakeUp is successful" ); console.log("SUB_MISC_THEME_screenLock_API_0010: test_getRuntimeState endWakeUp is successful" );
}); });
} catch (error) { } catch (error) {
console.log("end Screenlock_Test_2500: error = " + error); console.log("end SUB_MISC_THEME_screenLock_API_0010: error = " + error);
expect(true).assertTrue(); expect(true).assertTrue();
} }
console.log("------------------end Screenlock_Test_2500-------------------"); console.log("------------------end SUB_MISC_THEME_screenLock_API_0010-------------------");
done(); done();
}); });
/* /*
* @tc.number Screenlock_Test_2600 * @tc.number SUB_MISC_THEME_screenLock_API_0011
* @tc.name Device management causes the screen to go off, and run "beginScreenOn" operate * @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Function test * @tc.desc Test ScreenLock API functionality.
* @tc.level 0 * @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/ */
it("Screenlock_Test_2600", 0, async function (done) { it("SUB_MISC_THEME_screenLock_API_0011", 0, async function (done) {
console.log("------------------start Screenlock_Test_2600-------------------"); console.log("------------------start SUB_MISC_THEME_screenLock_API_0011-------------------");
try { try {
var eventType = 'beginScreenOn'; let eventType = 'beginScreenOn';
screenLock.off(eventType, () => { screenLock.off(eventType, () => {
console.log("Screenlock_Test_2600: test_getRuntimeState beginScreenOn is successful" ); console.log("SUB_MISC_THEME_screenLock_API_0011: test_getRuntimeState beginScreenOn is successful" );
}); });
} catch (error) { } catch (error) {
console.log("end Screenlock_Test_2600: error = " + error); console.log("end SUB_MISC_THEME_screenLock_API_0011: error = " + error);
expect(true).assertTrue(); expect(true).assertTrue();
} }
console.log("------------------end Screenlock_Test_2600-------------------"); console.log("------------------end SUB_MISC_THEME_screenLock_API_0011-------------------");
done(); done();
}); });
/* /*
* @tc.number Screenlock_Test_2700 * @tc.number SUB_MISC_THEME_screenLock_API_0012
* @tc.name Device management causes the screen to go off, and run "endScreenOn" operate * @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Function test * @tc.desc Test ScreenLock API functionality.
* @tc.level 0 * @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/ */
it("Screenlock_Test_2700", 0, async function (done) { it("SUB_MISC_THEME_screenLock_API_0012", 0, async function (done) {
console.log("------------------start Screenlock_Test_2700-------------------"); console.log("------------------start SUB_MISC_THEME_screenLock_API_0012-------------------");
try { try {
var eventType = 'beginScreenOn'; let eventType = 'beginScreenOn';
screenLock.off(eventType, () => { screenLock.off(eventType, () => {
console.log("Screenlock_Test_2700: test_getRuntimeState endScreenOn is successful" ); console.log("SUB_MISC_THEME_screenLock_API_0012: test_getRuntimeState endScreenOn is successful" );
}); });
} catch (error) { } catch (error) {
console.log("end Screenlock_Test_2700: error = " + error); console.log("end SUB_MISC_THEME_screenLock_API_0012: error = " + error);
expect(true).assertTrue(); expect(true).assertTrue();
} }
console.log("------------------end Screenlock_Test_2700-------------------"); console.log("------------------end SUB_MISC_THEME_screenLock_API_0012-------------------");
done(); done();
}); });
/* /*
* @tc.number Screenlock_Test_2800 * @tc.number SUB_MISC_THEME_screenLock_API_0013
* @tc.name User causes the screen to go off, and run "beginScreenOff" operate * @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Function test * @tc.desc Test ScreenLock API functionality.
* @tc.level 0 * @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/ */
it("Screenlock_Test_2800", 0, async function (done) { it("SUB_MISC_THEME_screenLock_API_0013", 0, async function (done) {
console.log("------------------start Screenlock_Test_2800-------------------"); console.log("------------------start SUB_MISC_THEME_screenLock_API_0013-------------------");
try { try {
var eventType = 'beginScreenOff'; let eventType = 'beginScreenOff';
screenLock.off(eventType, () => { screenLock.off(eventType, () => {
console.log("Screenlock_Test_2800: test_getRuntimeState beginScreenOff is successful" ); console.log("SUB_MISC_THEME_screenLock_API_0013: test_getRuntimeState beginScreenOff is successful" );
}); });
} catch (error) { } catch (error) {
console.log("end Screenlock_Test_2800: error = " + error); console.log("end SUB_MISC_THEME_screenLock_API_0013: error = " + error);
expect(true).assertTrue(); expect(true).assertTrue();
} }
console.log("------------------end Screenlock_Test_2800-------------------"); console.log("------------------end SUB_MISC_THEME_screenLock_API_0013-------------------");
done(); done();
}); });
/* /*
* @tc.number Screenlock_Test_2900 * @tc.number SUB_MISC_THEME_screenLock_API_0014
* @tc.name User causes the screen to go off, and run "endScreenOff" operate * @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Function test * @tc.desc Test ScreenLock API functionality.
* @tc.level 0 * @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/ */
it("Screenlock_Test_2900", 0, async function (done) { it("SUB_MISC_THEME_screenLock_API_0014", 0, async function (done) {
console.log("------------------start Screenlock_Test_2900-------------------"); console.log("------------------start SUB_MISC_THEME_screenLock_API_0014-------------------");
try { try {
var eventType = 'endScreenOff'; let eventType = 'endScreenOff';
screenLock.off(eventType, () => { screenLock.off(eventType, () => {
console.log("Screenlock_Test_2900: test_getRuntimeState endScreenOff is successful" ); console.log("SUB_MISC_THEME_screenLock_API_0014: test_getRuntimeState endScreenOff is successful" );
}); });
} catch (error) { } catch (error) {
console.log("end Screenlock_Test_2900: error = " + error); console.log("end SUB_MISC_THEME_screenLock_API_0014: error = " + error);
expect(true).assertTrue(); expect(true).assertTrue();
} }
console.log("------------------end Screenlock_Test_2900-------------------"); console.log("------------------end SUB_MISC_THEME_screenLock_API_0014-------------------");
done(); done();
}); });
/* /*
* @tc.number Screenlock_Test_3000 * @tc.number SUB_MISC_THEME_screenLock_API_0015
* @tc.name User causes the screen to go off, and run "unlockScreen" operate * @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Function test * @tc.desc Test ScreenLock API functionality.
* @tc.level 0 * @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/ */
it("Screenlock_Test_3000", 0, async function (done) { it("SUB_MISC_THEME_screenLock_API_0015", 0, async function (done) {
console.log("------------------start Screenlock_Test_3000-------------------"); console.log("------------------start SUB_MISC_THEME_screenLock_API_0015-------------------");
try { try {
var eventType = 'unlockScreen'; let eventType = 'unlockScreen';
screenLock.off(eventType, () => { screenLock.off(eventType, () => {
console.log("Screenlock_Test_3000: test_getRuntimeState unlockScreen is successful" ); console.log("SUB_MISC_THEME_screenLock_API_0015: test_getRuntimeState unlockScreen is successful" );
}); });
} catch (error) { } catch (error) {
console.log("end Screenlock_Test_3000: error = " + error); console.log("end SUB_MISC_THEME_screenLock_API_0015: error = " + error);
expect(true).assertTrue(); expect(true).assertTrue();
} }
console.log("------------------end Screenlock_Test_3000-------------------"); console.log("------------------end SUB_MISC_THEME_screenLock_API_0015-------------------");
done(); done();
}); });
/* /*
* @tc.number Screenlock_Test_3100 * @tc.number SUB_MISC_THEME_screenLock_API_0016
* @tc.name User causes the screen to go off, and run "beginExitAnimation" operate * @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Function test * @tc.desc Test ScreenLock API functionality.
* @tc.level 0 * @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/ */
it("Screenlock_Test_3100", 0, async function (done) { it("SUB_MISC_THEME_screenLock_API_0016", 0, async function (done) {
console.log("------------------start Screenlock_Test_3100-------------------"); console.log("------------------start SUB_MISC_THEME_screenLock_API_0016-------------------");
try { try {
var eventType = 'beginExitAnimation'; let eventType = 'beginExitAnimation';
screenLock.off(eventType, () => { screenLock.off(eventType, () => {
console.log("Screenlock_Test_3100: test_getRuntimeState beginExitAnimation is successful" ); console.log("SUB_MISC_THEME_screenLock_API_0016: test_getRuntimeState beginExitAnimation is successful" );
}); });
} catch (error) { } catch (error) {
console.log("end Screenlock_Test_3100: error = " + error); console.log("end SUB_MISC_THEME_screenLock_API_0016: error = " + error);
expect(true).assertTrue(); expect(true).assertTrue();
} }
console.log("------------------end Screenlock_Test_3100-------------------"); console.log("------------------end SUB_MISC_THEME_screenLock_API_0016-------------------");
done(); done();
}); });
/* /*
* @tc.number Screenlock_Test_3200 * @tc.number SUB_MISC_THEME_screenLock_API_0017
* @tc.name No operation for a long time causes the screen to go off, and run "screenlockEnabled" operate * @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Function test * @tc.desc Test ScreenLock API functionality.
* @tc.level 0 * @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/ */
it("Screenlock_Test_3200", 0, async function (done) { it("SUB_MISC_THEME_screenLock_API_0017", 0, async function (done) {
console.log("------------------start Screenlock_Test_3200-------------------"); console.log("------------------start SUB_MISC_THEME_screenLock_API_0017-------------------");
try { try {
var eventType = 'screenlockEnabled'; let eventType = 'screenLockEnabled';
screenLock.off(eventType, () => { screenLock.off(eventType, () => {
console.log("Screenlock_Test_3200: test_getRuntimeState screenlockEnabled is successful" ); console.log("SUB_MISC_THEME_screenLock_API_0017: test_getRuntimeState screenLockEnabled is successful" );
}); });
} catch (error) { } catch (error) {
console.log("end Screenlock_Test_3200: error = " + error); console.log("end SUB_MISC_THEME_screenLock_API_0017: error = " + error);
expect(true).assertTrue(); expect(true).assertTrue();
} }
console.log("------------------end Screenlock_Test_3200-------------------"); console.log("------------------end SUB_MISC_THEME_screenLock_API_0017-------------------");
done(); done();
}); });
/* /*
* @tc.number Screenlock_Test_3300 * @tc.number SUB_MISC_THEME_screenLock_API_0018
* @tc.name No operation for a long time causes the screen to go off, and run "beginSleep" operate * @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Function test * @tc.desc Test ScreenLock API functionality.
* @tc.level 0 * @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/ */
it("Screenlock_Test_3300", 0, async function (done) { it("SUB_MISC_THEME_screenLock_API_0018", 0, async function (done) {
console.log("------------------start Screenlock_Test_3300-------------------"); console.log("------------------start SUB_MISC_THEME_screenLock_API_0018-------------------");
try { try {
var eventType = 'beginSleep'; let eventType = 'beginSleep';
screenLock.off(eventType, () => { screenLock.off(eventType, () => {
console.log("Screenlock_Test_3300: test_getRuntimeState beginSleep is successful" ); console.log("SUB_MISC_THEME_screenLock_API_0018: test_getRuntimeState beginSleep is successful" );
}); });
} catch (error) { } catch (error) {
console.log("end Screenlock_Test_3300: error = " + error); console.log("end SUB_MISC_THEME_screenLock_API_0018: error = " + error);
expect(true).assertTrue(); expect(true).assertTrue();
} }
console.log("------------------end Screenlock_Test_3300-------------------"); console.log("------------------end SUB_MISC_THEME_screenLock_API_0018-------------------");
done(); done();
}); });
/* /*
* @tc.number Screenlock_Test_3400 * @tc.number SUB_MISC_THEME_screenLock_API_0019
* @tc.name No operation for a long time causes the screen to go off, and run "endSleep" operate * @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Function test * @tc.desc Test ScreenLock API functionality.
* @tc.level 0 * @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/ */
it("Screenlock_Test_3400", 0, async function (done) { it("SUB_MISC_THEME_screenLock_API_0019", 0, async function (done) {
console.log("------------------start Screenlock_Test_3400-------------------"); console.log("------------------start SUB_MISC_THEME_screenLock_API_0019-------------------");
try { try {
var eventType = 'endSleep'; let eventType = 'endSleep';
screenLock.off(eventType, () => { screenLock.off(eventType, () => {
console.log("Screenlock_Test_3400: test_getRuntimeState endSleep is successful" ); console.log("SUB_MISC_THEME_screenLock_API_0019: test_getRuntimeState endSleep is successful" );
}); });
} catch (error) { } catch (error) {
console.log("end Screenlock_Test_3400: error = " + error); console.log("end SUB_MISC_THEME_screenLock_API_0019: error = " + error);
expect(true).assertTrue(); expect(true).assertTrue();
} }
console.log("------------------end Screenlock_Test_3400-------------------"); console.log("------------------end SUB_MISC_THEME_screenLock_API_0019-------------------");
done(); done();
}); });
/* /*
* @tc.number Screenlock_Test_3500 * @tc.number SUB_MISC_THEME_screenLock_API_0020
* @tc.name No operation for a long time causes the screen to go off, and run "changeUser" operate * @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Function test * @tc.desc Test ScreenLock API functionality.
* @tc.level 0 * @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/ */
it("Screenlock_Test_3500", 0, async function (done) { it("SUB_MISC_THEME_screenLock_API_0020", 0, async function (done) {
console.log("------------------start Screenlock_Test_3500-------------------"); console.log("------------------start SUB_MISC_THEME_screenLock_API_0020-------------------");
try { try {
var eventType = 'changeUser'; let eventType = 'changeUser';
screenLock.off(eventType, () => { screenLock.off(eventType, () => {
console.log("Screenlock_Test_3500: test_getRuntimeState changeUser is successful" ); console.log("SUB_MISC_THEME_screenLock_API_0020: test_getRuntimeState changeUser is successful" );
}); });
} catch (error) { } catch (error) {
console.log("end Screenlock_Test_3500: error = " + error); console.log("end SUB_MISC_THEME_screenLock_API_0020: error = " + error);
expect(true).assertTrue(); expect(true).assertTrue();
} }
console.log("------------------end Screenlock_Test_3500-------------------"); console.log("------------------end SUB_MISC_THEME_screenLock_API_0020-------------------");
done(); done();
}); });
/* /*
* @tc.number Screenlock_Test_3600 * @tc.number SUB_MISC_THEME_screenLock_API_0021
* @tc.name Responding to bright screen events, and run "beginWakeUp" operate * @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Function test * @tc.desc Test ScreenLock API functionality.
* @tc.level 0 * @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/ */
it("Screenlock_Test_3600", 0, async function (done) { it("SUB_MISC_THEME_screenLock_API_0021", 0, async function (done) {
console.log("------------------start Screenlock_Test_3600-------------------"); console.log("------------------start SUB_MISC_THEME_screenLock_API_0021-------------------");
try { try {
var eventType = 'beginWakeUp'; let eventType = 'beginWakeUp';
screenLock.on(eventType, () => { screenLock.on(eventType, () => {
console.log("Screenlock_Test_3600: test_getRuntimeState beginWakeUp is successful" ); console.log("SUB_MISC_THEME_screenLock_API_0021: test_getRuntimeState beginWakeUp is successful" );
}); });
} catch (error) { } catch (error) {
console.log("end Screenlock_Test_3600: error = " + error); console.log("end SUB_MISC_THEME_screenLock_API_0021: error = " + error);
expect(true).assertTrue(); expect(true).assertTrue();
} }
console.log("------------------end Screenlock_Test_3600-------------------"); console.log("------------------end SUB_MISC_THEME_screenLock_API_0021-------------------");
done(); done();
}); });
/* /*
* @tc.number Screenlock_Test_3700 * @tc.number SUB_MISC_THEME_screenLock_API_0022
* @tc.name Responding to bright screen events, and run "endWakeUp" operate * @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Function test * @tc.desc Test ScreenLock API functionality.
* @tc.level 0 * @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/ */
it("Screenlock_Test_3700", 0, async function (done) { it("SUB_MISC_THEME_screenLock_API_0022", 0, async function (done) {
console.log("------------------logMessage Screenlock_Test_3700-------------------"); console.log("------------------logMessage SUB_MISC_THEME_screenLock_API_0022-------------------");
try { try {
var eventType = 'endWakeUp'; let eventType = 'endWakeUp';
screenLock.on(eventType, () => { screenLock.on(eventType, () => {
console.log("Screenlock_Test_3700: test_getRuntimeState endWakeUp is successful" ); console.log("SUB_MISC_THEME_screenLock_API_0022: test_getRuntimeState endWakeUp is successful" );
}); });
} catch (error) { } catch (error) {
console.log("end Screenlock_Test_3700: error = " + error); console.log("end SUB_MISC_THEME_screenLock_API_0022: error = " + error);
expect(true).assertTrue(); expect(true).assertTrue();
} }
console.log("------------------end Screenlock_Test_3700-------------------"); console.log("------------------end SUB_MISC_THEME_screenLock_API_0022-------------------");
done(); done();
}); });
/* /*
* @tc.number Screenlock_Test_3800 * @tc.number SUB_MISC_THEME_screenLock_API_0023
* @tc.name Responding to bright screen events, and run "beginScreenOn" operate * @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Function test * @tc.desc Test ScreenLock API functionality.
* @tc.level 0 * @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/ */
it("Screenlock_Test_3800", 0, async function (done) { it("SUB_MISC_THEME_screenLock_API_0023", 0, async function (done) {
console.log("------------------start Screenlock_Test_3800-------------------"); console.log("------------------start SUB_MISC_THEME_screenLock_API_0023-------------------");
try { try {
var eventType = 'beginScreenOn'; let eventType = 'beginScreenOn';
screenLock.on(eventType, () => { screenLock.on(eventType, () => {
console.log("Screenlock_Test_3800: test_getRuntimeState beginScreenOn is successful" ); console.log("SUB_MISC_THEME_screenLock_API_0023: test_getRuntimeState beginScreenOn is successful" );
}); });
} catch (error) { } catch (error) {
console.log("end Screenlock_Test_3800: error = " + error); console.log("end SUB_MISC_THEME_screenLock_API_0023: error = " + error);
expect(true).assertTrue(); expect(true).assertTrue();
} }
console.log("------------------end Screenlock_Test_3800-------------------"); console.log("------------------end SUB_MISC_THEME_screenLock_API_0023-------------------");
done(); done();
}); });
/* /*
* @tc.number Screenlock_Test_3900 * @tc.number SUB_MISC_THEME_screenLock_API_0024
* @tc.name Responding to bright screen events, and run "endScreenOn" operate * @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Function test * @tc.desc Test ScreenLock API functionality.
* @tc.level 0 * @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/ */
it("Screenlock_Test_3900", 0, async function (done) { it("SUB_MISC_THEME_screenLock_API_0024", 0, async function (done) {
console.log("------------------start Screenlock_Test_3900-------------------"); console.log("------------------start SUB_MISC_THEME_screenLock_API_0024-------------------");
try { try {
var eventType = 'endScreenOn'; let eventType = 'endScreenOn';
screenLock.on(eventType, () => { screenLock.on(eventType, () => {
console.log("Screenlock_Test_3900: test_getRuntimeState endScreenOn is successful" ); console.log("SUB_MISC_THEME_screenLock_API_0024: test_getRuntimeState endScreenOn is successful" );
}); });
} catch (error) { } catch (error) {
console.log("end Screenlock_Test_3900: error = " + error); console.log("end SUB_MISC_THEME_screenLock_API_0024: error = " + error);
expect(true).assertTrue(); expect(true).assertTrue();
} }
console.log("------------------end Screenlock_Test_3900-------------------"); console.log("------------------end SUB_MISC_THEME_screenLock_API_0024-------------------");
done(); done();
}); });
/* /*
* @tc.number Screenlock_Test_4000 * @tc.number SUB_MISC_THEME_screenLock_API_0025
* @tc.name Responding to bright screen events, and run "beginScreenOff" operate * @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Function test * @tc.desc Test ScreenLock API functionality.
* @tc.level 0 * @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/ */
it("Screenlock_Test_4000", 0, async function (done) { it("SUB_MISC_THEME_screenLock_API_0025", 0, async function (done) {
console.log("------------------start Screenlock_Test_4000-------------------"); console.log("------------------start SUB_MISC_THEME_screenLock_API_0025-------------------");
try { try {
var eventType = 'beginScreenOff'; let eventType = 'beginScreenOff';
screenLock.on(eventType, () => { screenLock.on(eventType, () => {
console.log("Screenlock_Test_4000: test_getRuntimeState beginScreenOff is successful" ); console.log("SUB_MISC_THEME_screenLock_API_0025: test_getRuntimeState beginScreenOff is successful" );
}); });
} catch (error) { } catch (error) {
console.log("end Screenlock_Test_4000: error = " + error); console.log("end SUB_MISC_THEME_screenLock_API_0025: error = " + error);
expect(true).assertTrue(); expect(true).assertTrue();
} }
console.log("------------------end Screenlock_Test_4000-------------------"); console.log("------------------end SUB_MISC_THEME_screenLock_API_0025-------------------");
done(); done();
}); });
/* /*
* @tc.number Screenlock_Test_4100 * @tc.number SUB_MISC_THEME_screenLock_API_0026
* @tc.name Responding to bright screen events, and run "endScreenOff" operate * @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Function test * @tc.desc Test ScreenLock API functionality.
* @tc.level 0 * @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/ */
it("Screenlock_Test_4100", 0, async function (done) { it("SUB_MISC_THEME_screenLock_API_0026", 0, async function (done) {
console.log("------------------logMessage Screenlock_Test_4100-------------------"); console.log("------------------logMessage SUB_MISC_THEME_screenLock_API_0026-------------------");
try { try {
var eventType = 'endScreenOff'; let eventType = 'endScreenOff';
screenLock.on(eventType, () => { screenLock.on(eventType, () => {
console.log("Screenlock_Test_4100: test_getRuntimeState endScreenOff is successful" ); console.log("SUB_MISC_THEME_screenLock_API_0026: test_getRuntimeState endScreenOff is successful" );
}); });
} catch (error) { } catch (error) {
console.log("end Screenlock_Test_4100: error = " + error); console.log("end SUB_MISC_THEME_screenLock_API_0026: error = " + error);
expect(true).assertTrue(); expect(true).assertTrue();
} }
console.log("------------------end Screenlock_Test_4100-------------------"); console.log("------------------end SUB_MISC_THEME_screenLock_API_0026-------------------");
done(); done();
}); });
/* /*
* @tc.number Screenlock_Test_4200 * @tc.number SUB_MISC_THEME_screenLock_API_0027
* @tc.name Responding to bright screen events, and run "unlockScreen" operate * @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Function test * @tc.desc Test ScreenLock API functionality.
* @tc.level 0 * @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/ */
it("Screenlock_Test_4200", 0, async function (done) { it("SUB_MISC_THEME_screenLock_API_0027", 0, async function (done) {
console.log("------------------start Screenlock_Test_4200-------------------"); console.log("------------------start SUB_MISC_THEME_screenLock_API_0027-------------------");
try { try {
var eventType = 'unlockScreen'; let eventType = 'unlockScreen';
screenLock.on(eventType, () => { screenLock.on(eventType, () => {
console.log("Screenlock_Test_4200: test_getRuntimeState unlockScreen is successful" ); console.log("SUB_MISC_THEME_screenLock_API_0027: test_getRuntimeState unlockScreen is successful" );
}); });
} catch (error) { } catch (error) {
console.log("end Screenlock_Test_4200: error = " + error); console.log("end SUB_MISC_THEME_screenLock_API_0027: error = " + error);
expect(true).assertTrue(); expect(true).assertTrue();
} }
console.log("------------------end Screenlock_Test_4200-------------------"); console.log("------------------end SUB_MISC_THEME_screenLock_API_0027-------------------");
done(); done();
}); });
/* /*
* @tc.number Screenlock_Test_4300 * @tc.number SUB_MISC_THEME_screenLock_API_0028
* @tc.name Responding to bright screen events, and run "beginExitAnimation" operate * @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Function test * @tc.desc Test ScreenLock API functionality.
* @tc.level 0 * @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/ */
it("Screenlock_Test_4300", 0, async function (done) { it("SUB_MISC_THEME_screenLock_API_0028", 0, async function (done) {
console.log("------------------start Screenlock_Test_4300-------------------"); console.log("------------------start SUB_MISC_THEME_screenLock_API_0028-------------------");
try { try {
var eventType = 'beginExitAnimation'; let eventType = 'beginExitAnimation';
screenLock.on(eventType, () => { screenLock.on(eventType, () => {
console.log("Screenlock_Test_4300: test_getRuntimeState beginExitAnimation is successful" ); console.log("SUB_MISC_THEME_screenLock_API_0028: test_getRuntimeState beginExitAnimation is successful" );
}); });
} catch (error) { } catch (error) {
console.log("end Screenlock_Test_4300: error = " + error); console.log("end SUB_MISC_THEME_screenLock_API_0028: error = " + error);
expect(true).assertTrue(); expect(true).assertTrue();
} }
console.log("------------------end Screenlock_Test_4300-------------------"); console.log("------------------end SUB_MISC_THEME_screenLock_API_0028-------------------");
done(); done();
}); });
/* /*
* @tc.number Screenlock_Test_4400 * @tc.number SUB_MISC_THEME_screenLock_API_0029
* @tc.name Responding to bright screen events, and run "beginSleep" operate * @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Function test * @tc.desc Test ScreenLock API functionality.
* @tc.level 0 * @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/ */
it("Screenlock_Test_4400", 0, async function (done) { it("SUB_MISC_THEME_screenLock_API_0029", 0, async function (done) {
console.log("------------------start Screenlock_Test_4400-------------------"); console.log("------------------start SUB_MISC_THEME_screenLock_API_0029-------------------");
try { try {
var eventType = 'changeUser'; let eventType = 'changeUser';
screenLock.on(eventType, (err, data) => { screenLock.on(eventType, (err, data) => {
console.log("Screenlock_Test_4400: test_getRuntimeState beginSleep is successful"); console.log("SUB_MISC_THEME_screenLock_API_0029: test_getRuntimeState beginSleep is successful");
expect(data == INTERACTIVE_STATE_BEGIN_SLEEP).assertTrue(); expect(data == INTERACTIVE_STATE_BEGIN_SLEEP).assertTrue();
}); });
} catch (error) { } catch (error) {
console.log("logMessage Screenlock_Test_4400: error = " + error); console.log("logMessage SUB_MISC_THEME_screenLock_API_0029: error = " + error);
expect(true).assertTrue(); expect(true).assertTrue();
} }
console.log("------------------end Screenlock_Test_4400-------------------"); console.log("------------------end SUB_MISC_THEME_screenLock_API_0029-------------------");
done(); done();
}); });
/* /*
* @tc.number Screenlock_Test_4500 * @tc.number SUB_MISC_THEME_screenLock_API_0030
* @tc.name Responding to bright screen events, and run "endSleep" operate * @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Function test * @tc.desc Test ScreenLock API functionality.
* @tc.level 0 * @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/ */
it("Screenlock_Test_4500", 0, async function (done) { it("SUB_MISC_THEME_screenLock_API_0030", 0, async function (done) {
console.log("------------------start Screenlock_Test_4500-------------------"); console.log("------------------start SUB_MISC_THEME_screenLock_API_0030-------------------");
try { try {
var eventType = 'endSleep'; let eventType = 'endSleep';
screenLock.test_getRuntimeState(eventType, (err, data) => { screenLock.test_getRuntimeState(eventType, (err, data) => {
console.log("Screenlock_Test_4500: test_getRuntimeState endSleep is successful"); console.log("SUB_MISC_THEME_screenLock_API_0030: test_getRuntimeState endSleep is successful");
expect(data == INTERACTIVE_STATE_END_SLEEP).assertTrue(); expect(data == INTERACTIVE_STATE_END_SLEEP).assertTrue();
}); });
} catch (error) { } catch (error) {
console.log("logMessage Screenlock_Test_4500: error = " + error); console.log("logMessage SUB_MISC_THEME_screenLock_API_0030: error = " + error);
expect(true).assertTrue(); expect(true).assertTrue();
} }
console.log("------------------end Screenlock_Test_4500-------------------"); console.log("------------------end SUB_MISC_THEME_screenLock_API_0030-------------------");
done(); done();
}); });
/* /*
* @tc.number Screenlock_Test_4600 * @tc.number SUB_MISC_THEME_screenLock_API_0031
* @tc.name Responding to bright screen events, and run "changeUser" operate * @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Function test * @tc.desc Test ScreenLock API functionality.
* @tc.level 0 * @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/ */
it("Screenlock_Test_4600", 0, async function (done) { it("SUB_MISC_THEME_screenLock_API_0031", 0, async function (done) {
console.log("------------------start Screenlock_Test_4600-------------------"); console.log("------------------start SUB_MISC_THEME_screenLock_API_0031-------------------");
try { try {
var eventType = 'changeUser'; let eventType = 'changeUser';
screenLock.test_getRuntimeState(eventType, (err, data) => { screenLock.test_getRuntimeState(eventType, (err, data) => {
console.log("Screenlock_Test_4600: test_getRuntimeState changeUser is successfuls"); console.log("SUB_MISC_THEME_screenLock_API_0031: test_getRuntimeState changeUser is successful");
expect(data == INTERACTIVE_STATE_USERID).assertTrue(); expect(data == INTERACTIVE_STATE_USERID).assertTrue();
}); });
} catch (error) { } catch (error) {
console.log("logMessage Screenlock_Test_4600: error = " + error); console.log("logMessage SUB_MISC_THEME_screenLock_API_0031: error = " + error);
expect(true).assertTrue(); expect(true).assertTrue();
} }
console.log("------------------end Screenlock_Test_4600-------------------"); console.log("------------------end SUB_MISC_THEME_screenLock_API_0031-------------------");
done(); done();
}); });
/* /*
* @tc.number Screenlock_Test_4700 * @tc.number SUB_MISC_THEME_screenLock_API_0032
* @tc.name Responding to bright screen events, and run "screenlockEnabled" operate * @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Function test * @tc.desc Test ScreenLock API functionality.
* @tc.level 0 * @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/ */
it("Screenlock_Test_4700", 0, async function (done) { it("SUB_MISC_THEME_screenLock_API_0032", 0, async function (done) {
console.log("------------------start Screenlock_Test_4700-------------------"); console.log("------------------start SUB_MISC_THEME_screenLock_API_0032-------------------");
try { try {
var eventType = 'screenlockEnabled'; let eventType = 'screenLockEnabled';
screenLock.test_getRuntimeState(eventType, (err, data) => { screenLock.test_getRuntimeState(eventType, (err, data) => {
console.log("Screenlock_Test_4700: test_getRuntimeState screenlockEnabled is successfuls"); console.log("SUB_MISC_THEME_screenLock_API_0032: test_getRuntimeState screenLockEnabled is successfuls");
expect(data == true).assertTrue(); expect(data == true).assertTrue();
}); });
} catch (error) { } catch (error) {
console.log("logMessage Screenlock_Test_4700: error = " + error); console.log("logMessage SUB_MISC_THEME_screenLock_API_0032: error = " + error);
expect(true).assertTrue(); expect(true).assertTrue();
} }
console.log("------------------end Screenlock_Test_4700-------------------"); console.log("------------------end SUB_MISC_THEME_screenLock_API_0032-------------------");
done(); done();
}); });
}) })
......
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
...@@ -18,8 +18,8 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from ' ...@@ -18,8 +18,8 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
const WALLPAPER_SYSTEM = 0; const WALLPAPER_SYSTEM = 0;
const WALLPAPER_LOCKSCREEN = 1; const WALLPAPER_LOCKSCREEN = 1;
var imageSourceSystem = '/data/service/el1/public/wallpaper/0/system/wallpaper'; let imageSourceSystem = '/data/service/el1/public/wallpaper/0/system/wallpaper';
var imageSourceLockscreen = '/data/service/el1/public/wallpaper/0/lockscreen/wallpaper_lock'; let imageSourceLockscreen = '/data/service/el1/public/wallpaper/0/lockscreen/wallpaper_lock';
export default function wallpaperJSUnit() { export default function wallpaperJSUnit() {
describe('WallpaperJsunitTest', function () { describe('WallpaperJsunitTest', function () {
......
文件模式从 100644 更改为 100755
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册