未验证 提交 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();
}); });
......
...@@ -17,768 +17,826 @@ import screenLock from '@ohos.screenLock'; ...@@ -17,768 +17,826 @@ import screenLock from '@ohos.screenLock';
import {describe, expect, it} from "hypium/index"; import {describe, expect, it} from "hypium/index";
export default function screenLockJSUnit() { export default function screenLockJSUnit() {
const INTERACTIVE_STATE_END_SLEEP = 0; const INTERACTIVE_STATE_END_SLEEP = 0;
const INTERACTIVE_STATE_USERID = 2; const INTERACTIVE_STATE_USERID = 2;
const INTERACTIVE_STATE_BEGIN_SLEEP = 3; const INTERACTIVE_STATE_BEGIN_SLEEP = 3;
const SLEEP_TIME = 1000; const SLEEP_TIME = 1000;
describe('ScreenLockServiceTest', function () { describe('ScreenLockServiceTest', function () {
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)
return; return;
} }
} }
/* /*
* @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
it("ScreenLock_Test_0100", 0, async function (done) { * @tc.level : Level 0
console.info("------------------start ScreenLock_Test_0100-------------------"); */
try { it("SUB_MISC_THEME_screenLock_API_0001", 0, async function (done) {
screenLock.isScreenLocked((err, data) => { console.info("------------------start SUB_MISC_THEME_screenLock_API_0001-------------------");
console.info("ScreenLock_Test_0100 isScreenLocked's status is " + data); try {
expect(data == true).assertTrue(); screenLock.isScreenLocked((err, data) => {
}); console.info("SUB_MISC_THEME_screenLock_API_0001 screen's status is " + data);
} catch (error) { expect(data == true).assertTrue();
console.info("logMessage ScreenLock_Test_0100: error = " + error); });
expect(true).assertTrue(); } catch (error) {
} console.info("logMessage SUB_MISC_THEME_screenLock_API_0001: error = " + error);
console.info("------------------end ScreenLock_Test_0100-------------------"); expect(true).assertTrue();
done(); }
}); console.info("------------------end SUB_MISC_THEME_screenLock_API_0001-------------------");
done();
/* });
* @tc.number ScreenLock_Test_0200
* @tc.name Set to unlocked screen, query the lock screen state is unlocked state /*
* @tc.desc Function test * @tc.number SUB_MISC_THEME_screenLock_API_0002
* @tc.level 0 * @tc.name Set to locked screen, query the lock screen state is locked state
*/ * @tc.desc Test ScreenLock API functionality.
it("ScreenLock_Test_0200", 0, async function (done) { * @tc.size : MEDIUM
console.info("------------------start ScreenLock_Test_0200-------------------"); * @tc.type : Function
try { * @tc.level : Level 0
screenLock.isScreenLocked((err, data) => { */
console.info("ScreenLock_Test_0200 isScreenLocked's status is " + data); it("SUB_MISC_THEME_screenLock_API_0002", 0, async function (done) {
expect(data == false).assertTrue(); console.info("------------------start SUB_MISC_THEME_screenLock_API_0002-------------------");
}); try {
} catch (error) { screenLock.isScreenLocked((err, data) => {
console.info("logMessage ScreenLock_Test_0200: error = " + error); console.info("SUB_MISC_THEME_screenLock_API_0002 screen's status is " + data);
expect(true).assertTrue(); expect(data == false).assertTrue();
} });
console.info("------------------end ScreenLock_Test_0200-------------------"); } catch (error) {
done(); console.info("logMessage SUB_MISC_THEME_screenLock_API_0002: error = " + error);
}); expect(true).assertTrue();
}
/* console.info("------------------end SUB_MISC_THEME_screenLock_API_0002-------------------");
* @tc.number ScreenLock_Test_0300 done();
* @tc.name Query whether a password has been set, and return the password that has not been set });
* @tc.desc Function test
* @tc.level 0 /*
*/ * @tc.number SUB_MISC_THEME_screenLock_API_0003
it("ScreenLock_Test_0300", 0, async function (done) { * @tc.name Set to locked screen, query the lock screen state is locked state
console.info("------------------start ScreenLock_Test_0300-------------------"); * @tc.desc Test ScreenLock API functionality.
try { * @tc.size : MEDIUM
screenLock.isSecureMode((err, data) => { * @tc.type : Function
console.info("ScreenLock_Test_0300 isSecureMode's result is " + data); * @tc.level : Level 0
expect(data == false).assertTrue(); */
}); it("SUB_MISC_THEME_screenLock_API_0003", 0, async function (done) {
} catch (error) { console.info("------------------start SUB_MISC_THEME_screenLock_API_0003-------------------");
console.info("logMessage ScreenLock_Test_0300: error = " + error); try {
expect(true).assertTrue(); screenLock.isSecureMode((err, data) => {
} console.info("SUB_MISC_THEME_screenLock_API_0003 secureMode's result is " + data);
console.info("------------------end ScreenLock_Test_0300-------------------"); expect(data == false).assertTrue();
done(); });
}); } catch (error) {
console.info("logMessage SUB_MISC_THEME_screenLock_API_0003: error = " + error);
/* expect(true).assertTrue();
* @tc.number Screenlock_Test_0400 }
* @tc.name Request to unlock the device screen, unlock successfully console.info("------------------end SUB_MISC_THEME_screenLock_API_0003-------------------");
* @tc.desc Function test done();
* @tc.level 0 });
*/
it("Screenlock_Test_0400", 0, async function (done) { /*
console.info("------------------start Screenlock_Test_0400-------------------"); * @tc.number SUB_MISC_THEME_screenLock_API_0004
try { * @tc.name Set to locked screen, query the lock screen state is locked state
screenLock.unlockScreen(() => { * @tc.desc Test ScreenLock API functionality.
console.info("Screenlock_Test_0400: send unlockScreen issue success"); * @tc.size : MEDIUM
}); * @tc.type : Function
* @tc.level : Level 0
sleep(SLEEP_TIME); */
var unlockScreenResult = 0; it("SUB_MISC_THEME_screenLock_API_0004", 0, async function (done) {
var eventType = 'unlockScreenResult'; console.info("------------------start SUB_MISC_THEME_screenLock_API_0004-------------------");
screenLock.sendScreenLockEvent(eventType, unlockScreenResult, (err, data) => { try {
console.info("Screenlock_Test_0400: sendScreenLockEvent result is " + data); screenLock.unlockScreen(() => {
expect(data == true).assertTrue(); console.info("SUB_MISC_THEME_screenLock_API_0004: send unlockScreen issue success");
}); });
sleep(SLEEP_TIME); sleep(SLEEP_TIME);
screenLock.isScreenLocked((err, data) => { let unlockScreenResult = 0;
console.info("Screenlock_Test_0400: isScreenLocked result is " + data); let eventType = 'unlockScreenResult';
expect(data == false).assertTrue(); screenLock.sendScreenLockEvent(eventType, unlockScreenResult, (err, data) => {
}); console.info("SUB_MISC_THEME_screenLock_API_0004: sendScreenLockEvent result is " + data);
} catch (error) { expect(data == true).assertTrue();
console.info("Screenlock_Test_1400: error = " + error); });
expect(true).assertTrue();
} sleep(SLEEP_TIME);
console.info("------------------end Screenlock_Test_0400-------------------"); screenLock.isScreenLocked((err, data) => {
done(); console.info("SUB_MISC_THEME_screenLock_API_0004: isScreenLocked result is " + data);
}); expect(data == false).assertTrue();
});
/* } catch (error) {
* @tc.number Screenlock_Test_0500 console.info("SUB_MISC_THEME_screenLock_API_0004: error = " + error);
* @tc.name Request to unlock device screen, unlock failed expect(true).assertTrue();
* @tc.desc Function test }
* @tc.level 0 console.info("------------------end SUB_MISC_THEME_screenLock_API_0004-------------------");
*/ done();
it("Screenlock_Test_0500", 0, async function (done) { });
console.info("------------------start Screenlock_Test_0500-------------------");
try { /*
screenLock.unlockScreen(() => { * @tc.number SUB_MISC_THEME_screenLock_API_0005
console.info("Screenlock_Test_0500: send unlockScreen issue success"); * @tc.name Set to locked screen, query the lock screen state is locked state
}); * @tc.desc Test ScreenLock API functionality.
* @tc.size : MEDIUM
sleep(SLEEP_TIME); * @tc.type : Function
var unlockScreenResult = 1; * @tc.level : Level 0
var eventType = 'unlockScreenResult'; */
screenLock.sendScreenLockEvent(eventType, unlockScreenResult, (err, data) => { it("SUB_MISC_THEME_screenLock_API_0005", 0, async function (done) {
console.info("Screenlock_Test_0500: sendScreenLockEvent result is " + data); console.info("------------------start SUB_MISC_THEME_screenLock_API_0005-------------------");
expect(data == true).assertTrue(); try {
}); screenLock.unlockScreen(() => {
console.info("SUB_MISC_THEME_screenLock_API_0005: send unlockScreen issue success");
sleep(SLEEP_TIME); });
screenLock.isScreenLocked((err, data) => {
console.info("Screenlock_Test_0500: isScreenLocked result is " + data); sleep(SLEEP_TIME);
expect(data == true).assertTrue(); let unlockScreenResult = 1;
}); let eventType = 'unlockScreenResult';
} catch (error) { screenLock.sendScreenLockEvent(eventType, unlockScreenResult, (err, data) => {
console.info("logMessage Screenlock_Test_0500: error = " + error); console.info("SUB_MISC_THEME_screenLock_API_0005: sendScreenLockEvent result is " + data);
expect(true).assertTrue(); expect(data == true).assertTrue();
} });
console.info("------------------end Screenlock_Test_0500-------------------");
done(); sleep(SLEEP_TIME);
}); screenLock.isScreenLocked((err, data) => {
console.info("SUB_MISC_THEME_screenLock_API_0005: isScreenLocked result is " + data);
/* expect(data == true).assertTrue();
* @tc.number Screenlock_Test_2100 });
* @tc.name After the systemUI is started, it is in the locked state, the lock management sends } catch (error) {
the unlock request successfully, and the lock screen application notifies the unlock console.info("logMessage SUB_MISC_THEME_screenLock_API_0005: error = " + error);
success message expect(true).assertTrue();
* @tc.desc Function test }
* @tc.level 0 console.info("------------------end SUB_MISC_THEME_screenLock_API_0005-------------------");
*/ done();
it("Screenlock_Test_2100", 0, async function (done) { });
console.info("------------------start Screenlock_Test_2100-------------------");
try { /*
screenLock.isScreenLocked((err, data) => { * @tc.number SUB_MISC_THEME_screenLock_API_0006
console.info("Screenlock_Test_2100: isScreenLocked result is " + data); * @tc.name Set to locked screen, query the lock screen state is locked state
expect(data == true).assertTrue(); * @tc.desc Test ScreenLock API functionality.
}); * @tc.size : MEDIUM
* @tc.type : Function
sleep(SLEEP_TIME); * @tc.level : Level 0
screenLock.unlockScreen(() => { */
console.info("Screenlock_Test_2100: send unlockScreen issue success"); it("SUB_MISC_THEME_screenLock_API_0006", 0, async function (done) {
}); console.info("------------------start SUB_MISC_THEME_screenLock_API_0006-------------------");
try {
sleep(SLEEP_TIME); screenLock.isScreenLocked((err, data) => {
var unlockScreenResult = 0; console.info("SUB_MISC_THEME_screenLock_API_0006: isScreenLocked result is " + data);
var eventType = 'unlockScreenResult'; expect(data == true).assertTrue();
screenLock.sendScreenLockEvent(eventType, unlockScreenResult, (err, data) => { });
console.info("Screenlock_Test_2100: sendScreenLockEvent result is " + data);
expect(data == true).assertTrue(); sleep(SLEEP_TIME);
}); screenLock.unlockScreen(() => {
console.info("SUB_MISC_THEME_screenLock_API_0006: send unlockScreen issue success");
sleep(SLEEP_TIME); });
screenLock.isScreenLocked((err, data) => {
console.info("Screenlock_Test_2100: isScreenLocked result is " + data); sleep(SLEEP_TIME);
expect(data == false).assertTrue(); let unlockScreenResult = 0;
}); let eventType = 'unlockScreenResult';
} catch (error) { screenLock.sendScreenLockEvent(eventType, unlockScreenResult, (err, data) => {
console.info("Screenlock_Test_2100: error = " + error); console.info("SUB_MISC_THEME_screenLock_API_0006: sendScreenLockEvent result is " + data);
expect(true).assertTrue(); expect(data == true).assertTrue();
} });
console.info("------------------end Screenlock_Test_2100-------------------");
done(); sleep(SLEEP_TIME);
}); screenLock.isScreenLocked((err, data) => {
console.info("SUB_MISC_THEME_screenLock_API_0006: isScreenLocked result is " + data);
/* expect(data == false).assertTrue();
* @tc.number Screenlock_Test_2200 });
* @tc.name After systemUI is started, it is currently unlocked } catch (error) {
* @tc.desc Function test console.info("SUB_MISC_THEME_screenLock_API_0006: error = " + error);
* @tc.level 0 expect(true).assertTrue();
*/ }
it("Screenlock_Test_2200", 0, async function (done) { console.info("------------------end SUB_MISC_THEME_screenLock_API_0006-------------------");
console.info("------------------start Screenlock_Test_2200-------------------"); done();
try { });
screenLock.isScreenLocked((err, data) => {
console.info("Screenlock_Test_2200: isScreenLocked is successful, result is " + data); /*
expect(data == false).assertTrue(); * @tc.number SUB_MISC_THEME_screenLock_API_0007
}); * @tc.name Set to locked screen, query the lock screen state is locked state
} catch (error) { * @tc.desc Test ScreenLock API functionality.
console.info("logMessage Screenlock_Test_2200: error = " + error); * @tc.size : MEDIUM
expect(true).assertTrue(); * @tc.type : Function
} * @tc.level : Level 0
console.info("------------------end ScreenLock_Test_2200-------------------"); */
done(); it("SUB_MISC_THEME_screenLock_API_0007", 0, async function (done) {
}); console.info("------------------start SUB_MISC_THEME_screenLock_API_0007-------------------");
try {
screenLock.isScreenLocked((err, data) => {
/* console.info("SUB_MISC_THEME_screenLock_API_0007: isScreenLocked is successful, result is " + data);
* @tc.number Screenlock_Test_2300 expect(data == false).assertTrue();
* @tc.name After the systemUI is started, it is in the locked state, the lock management sends });
the unlock request successfully, and the lock screen application notifies the unlock } catch (error) {
failed message console.info("logMessage SUB_MISC_THEME_screenLock_API_0007: error = " + error);
* @tc.desc Function test expect(true).assertTrue();
* @tc.level 0 }
*/ console.info("------------------end SUB_MISC_THEME_screenLock_API_0007-------------------");
it("Screenlock_Test_2300", 0, async function (done) { done();
console.info("------------------start Screenlock_Test_2300-------------------"); });
try {
screenLock.isScreenLocked((err, data) => { /*
console.log("Screenlock_Test_2300: isScreenLocked result is " + data); * @tc.number SUB_MISC_THEME_screenLock_API_0008
expect(data == true).assertTrue(); * @tc.name Set to locked screen, query the lock screen state is locked state
}); * @tc.desc Test ScreenLock API functionality.
* @tc.size : MEDIUM
sleep(SLEEP_TIME); * @tc.type : Function
screenLock.unlockScreen(() => { * @tc.level : Level 0
console.log("Screenlock_Test_2300: send unlockScreen issue success"); */
}); it("SUB_MISC_THEME_screenLock_API_0008", 0, async function (done) {
console.info("------------------start SUB_MISC_THEME_screenLock_API_0008-------------------");
sleep(SLEEP_TIME); try {
var unlockScreenResult = 1; screenLock.isScreenLocked((err, data) => {
var eventType = 'unlockScreenResult'; console.log("SUB_MISC_THEME_screenLock_API_0008: isScreenLocked result is " + data);
screenLock.sendScreenLockEvent(eventType, unlockScreenResult, (err, data) => { expect(data == true).assertTrue();
console.log("Screenlock_Test_2300: sendScreenLockEvent result is " + data); });
expect(data == true).assertTrue();
}); sleep(SLEEP_TIME);
screenLock.unlockScreen(() => {
sleep(SLEEP_TIME); console.log("SUB_MISC_THEME_screenLock_API_0008: send unlockScreen issue success");
screenLock.isScreenLocked((err, data) => { });
console.log("Screenlock_Test_2300: isScreenLocked result is " + data);
expect(data == true).assertTrue(); sleep(SLEEP_TIME);
}); let unlockScreenResult = 1;
} catch (error) { let eventType = 'unlockScreenResult';
console.info("Screenlock_Test_2300: error = " + error); screenLock.sendScreenLockEvent(eventType, unlockScreenResult, (err, data) => {
expect(true).assertTrue(); console.log("SUB_MISC_THEME_screenLock_API_0008: sendScreenLockEvent result is " + data);
} expect(data == true).assertTrue();
console.info("------------------end Screenlock_Test_2300-------------------"); });
done();
}); sleep(SLEEP_TIME);
screenLock.isScreenLocked((err, data) => {
console.log("SUB_MISC_THEME_screenLock_API_0008: isScreenLocked result is " + data);
/* expect(data == true).assertTrue();
* @tc.number Screenlock_Test_2400 });
* @tc.name Device management causes the screen to go off, and run "beginWakeUp" operate } catch (error) {
* @tc.desc Function test console.info("SUB_MISC_THEME_screenLock_API_0008: error = " + error);
* @tc.level 0 expect(true).assertTrue();
*/ }
it("Screenlock_Test_2400", 0, async function (done) { console.info("------------------end SUB_MISC_THEME_screenLock_API_0008-------------------");
console.log("------------------start Screenlock_Test_2400-------------------"); done();
try { });
var eventType = 'beginWakeUp';
screenLock.off(eventType, () => { /*
console.log("Screenlock_Test_2400: test_getRuntimeState beginWakeUp is successful" ); * @tc.number SUB_MISC_THEME_screenLock_API_0009
}); * @tc.name Set to locked screen, query the lock screen state is locked state
} catch (error) { * @tc.desc Test ScreenLock API functionality.
console.log("end Screenlock_Test_2400: error = " + error); * @tc.size : MEDIUM
expect(true).assertTrue(); * @tc.type : Function
} * @tc.level : Level 0
console.log("------------------end Screenlock_Test_2400-------------------"); */
done(); it("SUB_MISC_THEME_screenLock_API_0009", 0, async function (done) {
}); console.log("------------------start SUB_MISC_THEME_screenLock_API_0009-------------------");
try {
/* let eventType = 'beginWakeUp';
* @tc.number Screenlock_Test_2500 screenLock.off(eventType, () => {
* @tc.name Device management causes the screen to go off, and run "endWakeUp" operate console.log("SUB_MISC_THEME_screenLock_API_0009: test_getRuntimeState beginWakeUp is successful" );
* @tc.desc Function test });
* @tc.level 0 } catch (error) {
*/ console.log("end SUB_MISC_THEME_screenLock_API_0009: error = " + error);
it("Screenlock_Test_2500", 0, async function (done) { expect(true).assertTrue();
console.log("------------------start Screenlock_Test_2500-------------------"); }
try { console.log("------------------end SUB_MISC_THEME_screenLock_API_0009-------------------");
var eventType = 'endWakeUp'; done();
screenLock.off(eventType, () => { });
console.log("Screenlock_Test_2500: test_getRuntimeState endWakeUp is successful" );
}); /*
} catch (error) { * @tc.number SUB_MISC_THEME_screenLock_API_0010
console.log("end Screenlock_Test_2500: error = " + error); * @tc.name Set to locked screen, query the lock screen state is locked state
expect(true).assertTrue(); * @tc.desc Test ScreenLock API functionality.
} * @tc.size : MEDIUM
console.log("------------------end Screenlock_Test_2500-------------------"); * @tc.type : Function
done(); * @tc.level : Level 0
}); */
it("SUB_MISC_THEME_screenLock_API_0010", 0, async function (done) {
/* console.log("------------------start SUB_MISC_THEME_screenLock_API_0010-------------------");
* @tc.number Screenlock_Test_2600 try {
* @tc.name Device management causes the screen to go off, and run "beginScreenOn" operate let eventType = 'endWakeUp';
* @tc.desc Function test screenLock.off(eventType, () => {
* @tc.level 0 console.log("SUB_MISC_THEME_screenLock_API_0010: test_getRuntimeState endWakeUp is successful" );
*/ });
it("Screenlock_Test_2600", 0, async function (done) { } catch (error) {
console.log("------------------start Screenlock_Test_2600-------------------"); console.log("end SUB_MISC_THEME_screenLock_API_0010: error = " + error);
try { expect(true).assertTrue();
var eventType = 'beginScreenOn'; }
screenLock.off(eventType, () => { console.log("------------------end SUB_MISC_THEME_screenLock_API_0010-------------------");
console.log("Screenlock_Test_2600: test_getRuntimeState beginScreenOn is successful" ); done();
}); });
} catch (error) {
console.log("end Screenlock_Test_2600: error = " + error); /*
expect(true).assertTrue(); * @tc.number SUB_MISC_THEME_screenLock_API_0011
} * @tc.name Set to locked screen, query the lock screen state is locked state
console.log("------------------end Screenlock_Test_2600-------------------"); * @tc.desc Test ScreenLock API functionality.
done(); * @tc.size : MEDIUM
}); * @tc.type : Function
* @tc.level : Level 0
/* */
* @tc.number Screenlock_Test_2700 it("SUB_MISC_THEME_screenLock_API_0011", 0, async function (done) {
* @tc.name Device management causes the screen to go off, and run "endScreenOn" operate console.log("------------------start SUB_MISC_THEME_screenLock_API_0011-------------------");
* @tc.desc Function test try {
* @tc.level 0 let eventType = 'beginScreenOn';
*/ screenLock.off(eventType, () => {
it("Screenlock_Test_2700", 0, async function (done) { console.log("SUB_MISC_THEME_screenLock_API_0011: test_getRuntimeState beginScreenOn is successful" );
console.log("------------------start Screenlock_Test_2700-------------------"); });
try { } catch (error) {
var eventType = 'beginScreenOn'; console.log("end SUB_MISC_THEME_screenLock_API_0011: error = " + error);
screenLock.off(eventType, () => { expect(true).assertTrue();
console.log("Screenlock_Test_2700: test_getRuntimeState endScreenOn is successful" ); }
}); console.log("------------------end SUB_MISC_THEME_screenLock_API_0011-------------------");
} catch (error) { done();
console.log("end Screenlock_Test_2700: error = " + error); });
expect(true).assertTrue();
} /*
console.log("------------------end Screenlock_Test_2700-------------------"); * @tc.number SUB_MISC_THEME_screenLock_API_0012
done(); * @tc.name Set to locked screen, query the lock screen state is locked state
}); * @tc.desc Test ScreenLock API functionality.
* @tc.size : MEDIUM
/* * @tc.type : Function
* @tc.number Screenlock_Test_2800 * @tc.level : Level 0
* @tc.name User causes the screen to go off, and run "beginScreenOff" operate */
* @tc.desc Function test it("SUB_MISC_THEME_screenLock_API_0012", 0, async function (done) {
* @tc.level 0 console.log("------------------start SUB_MISC_THEME_screenLock_API_0012-------------------");
*/ try {
it("Screenlock_Test_2800", 0, async function (done) { let eventType = 'beginScreenOn';
console.log("------------------start Screenlock_Test_2800-------------------"); screenLock.off(eventType, () => {
try { console.log("SUB_MISC_THEME_screenLock_API_0012: test_getRuntimeState endScreenOn is successful" );
var eventType = 'beginScreenOff'; });
screenLock.off(eventType, () => { } catch (error) {
console.log("Screenlock_Test_2800: test_getRuntimeState beginScreenOff is successful" ); console.log("end SUB_MISC_THEME_screenLock_API_0012: error = " + error);
}); expect(true).assertTrue();
} catch (error) { }
console.log("end Screenlock_Test_2800: error = " + error); console.log("------------------end SUB_MISC_THEME_screenLock_API_0012-------------------");
expect(true).assertTrue(); done();
} });
console.log("------------------end Screenlock_Test_2800-------------------");
done(); /*
}); * @tc.number SUB_MISC_THEME_screenLock_API_0013
* @tc.name Set to locked screen, query the lock screen state is locked state
/* * @tc.desc Test ScreenLock API functionality.
* @tc.number Screenlock_Test_2900 * @tc.size : MEDIUM
* @tc.name User causes the screen to go off, and run "endScreenOff" operate * @tc.type : Function
* @tc.desc Function test * @tc.level : Level 0
* @tc.level 0 */
*/ it("SUB_MISC_THEME_screenLock_API_0013", 0, async function (done) {
it("Screenlock_Test_2900", 0, async function (done) { console.log("------------------start SUB_MISC_THEME_screenLock_API_0013-------------------");
console.log("------------------start Screenlock_Test_2900-------------------"); try {
try { let eventType = 'beginScreenOff';
var eventType = 'endScreenOff'; screenLock.off(eventType, () => {
screenLock.off(eventType, () => { console.log("SUB_MISC_THEME_screenLock_API_0013: test_getRuntimeState beginScreenOff is successful" );
console.log("Screenlock_Test_2900: test_getRuntimeState endScreenOff is successful" ); });
}); } catch (error) {
} catch (error) { console.log("end SUB_MISC_THEME_screenLock_API_0013: error = " + error);
console.log("end Screenlock_Test_2900: error = " + error); expect(true).assertTrue();
expect(true).assertTrue(); }
} console.log("------------------end SUB_MISC_THEME_screenLock_API_0013-------------------");
console.log("------------------end Screenlock_Test_2900-------------------"); done();
done(); });
});
/*
/* * @tc.number SUB_MISC_THEME_screenLock_API_0014
* @tc.number Screenlock_Test_3000 * @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.name User causes the screen to go off, and run "unlockScreen" operate * @tc.desc Test ScreenLock API functionality.
* @tc.desc Function test * @tc.size : MEDIUM
* @tc.level 0 * @tc.type : Function
*/ * @tc.level : Level 0
it("Screenlock_Test_3000", 0, async function (done) { */
console.log("------------------start Screenlock_Test_3000-------------------"); it("SUB_MISC_THEME_screenLock_API_0014", 0, async function (done) {
try { console.log("------------------start SUB_MISC_THEME_screenLock_API_0014-------------------");
var eventType = 'unlockScreen'; try {
screenLock.off(eventType, () => { let eventType = 'endScreenOff';
console.log("Screenlock_Test_3000: test_getRuntimeState unlockScreen is successful" ); screenLock.off(eventType, () => {
}); console.log("SUB_MISC_THEME_screenLock_API_0014: test_getRuntimeState endScreenOff is successful" );
} catch (error) { });
console.log("end Screenlock_Test_3000: error = " + error); } catch (error) {
expect(true).assertTrue(); console.log("end SUB_MISC_THEME_screenLock_API_0014: error = " + error);
} expect(true).assertTrue();
console.log("------------------end Screenlock_Test_3000-------------------"); }
done(); console.log("------------------end SUB_MISC_THEME_screenLock_API_0014-------------------");
}); done();
});
/*
* @tc.number Screenlock_Test_3100 /*
* @tc.name User causes the screen to go off, and run "beginExitAnimation" operate * @tc.number SUB_MISC_THEME_screenLock_API_0015
* @tc.desc Function test * @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.level 0 * @tc.desc Test ScreenLock API functionality.
*/ * @tc.size : MEDIUM
it("Screenlock_Test_3100", 0, async function (done) { * @tc.type : Function
console.log("------------------start Screenlock_Test_3100-------------------"); * @tc.level : Level 0
try { */
var eventType = 'beginExitAnimation'; it("SUB_MISC_THEME_screenLock_API_0015", 0, async function (done) {
screenLock.off(eventType, () => { console.log("------------------start SUB_MISC_THEME_screenLock_API_0015-------------------");
console.log("Screenlock_Test_3100: test_getRuntimeState beginExitAnimation is successful" ); try {
}); let eventType = 'unlockScreen';
} catch (error) { screenLock.off(eventType, () => {
console.log("end Screenlock_Test_3100: error = " + error); console.log("SUB_MISC_THEME_screenLock_API_0015: test_getRuntimeState unlockScreen is successful" );
expect(true).assertTrue(); });
} } catch (error) {
console.log("------------------end Screenlock_Test_3100-------------------"); console.log("end SUB_MISC_THEME_screenLock_API_0015: error = " + error);
done(); expect(true).assertTrue();
}); }
console.log("------------------end SUB_MISC_THEME_screenLock_API_0015-------------------");
/* done();
* @tc.number Screenlock_Test_3200 });
* @tc.name No operation for a long time causes the screen to go off, and run "screenlockEnabled" operate
* @tc.desc Function test /*
* @tc.level 0 * @tc.number SUB_MISC_THEME_screenLock_API_0016
*/ * @tc.name Set to locked screen, query the lock screen state is locked state
it("Screenlock_Test_3200", 0, async function (done) { * @tc.desc Test ScreenLock API functionality.
console.log("------------------start Screenlock_Test_3200-------------------"); * @tc.size : MEDIUM
try { * @tc.type : Function
var eventType = 'screenlockEnabled'; * @tc.level : Level 0
screenLock.off(eventType, () => { */
console.log("Screenlock_Test_3200: test_getRuntimeState screenlockEnabled is successful" ); it("SUB_MISC_THEME_screenLock_API_0016", 0, async function (done) {
}); console.log("------------------start SUB_MISC_THEME_screenLock_API_0016-------------------");
} catch (error) { try {
console.log("end Screenlock_Test_3200: error = " + error); let eventType = 'beginExitAnimation';
expect(true).assertTrue(); screenLock.off(eventType, () => {
} console.log("SUB_MISC_THEME_screenLock_API_0016: test_getRuntimeState beginExitAnimation is successful" );
console.log("------------------end Screenlock_Test_3200-------------------"); });
done(); } catch (error) {
}); console.log("end SUB_MISC_THEME_screenLock_API_0016: error = " + error);
expect(true).assertTrue();
/* }
* @tc.number Screenlock_Test_3300 console.log("------------------end SUB_MISC_THEME_screenLock_API_0016-------------------");
* @tc.name No operation for a long time causes the screen to go off, and run "beginSleep" operate done();
* @tc.desc Function test });
* @tc.level 0
*/ /*
it("Screenlock_Test_3300", 0, async function (done) { * @tc.number SUB_MISC_THEME_screenLock_API_0017
console.log("------------------start Screenlock_Test_3300-------------------"); * @tc.name Set to locked screen, query the lock screen state is locked state
try { * @tc.desc Test ScreenLock API functionality.
var eventType = 'beginSleep'; * @tc.size : MEDIUM
screenLock.off(eventType, () => { * @tc.type : Function
console.log("Screenlock_Test_3300: test_getRuntimeState beginSleep is successful" ); * @tc.level : Level 0
}); */
} catch (error) { it("SUB_MISC_THEME_screenLock_API_0017", 0, async function (done) {
console.log("end Screenlock_Test_3300: error = " + error); console.log("------------------start SUB_MISC_THEME_screenLock_API_0017-------------------");
expect(true).assertTrue(); try {
} let eventType = 'screenLockEnabled';
console.log("------------------end Screenlock_Test_3300-------------------"); screenLock.off(eventType, () => {
done(); console.log("SUB_MISC_THEME_screenLock_API_0017: test_getRuntimeState screenLockEnabled is successful" );
}); });
} catch (error) {
/* console.log("end SUB_MISC_THEME_screenLock_API_0017: error = " + error);
* @tc.number Screenlock_Test_3400 expect(true).assertTrue();
* @tc.name No operation for a long time causes the screen to go off, and run "endSleep" operate }
* @tc.desc Function test console.log("------------------end SUB_MISC_THEME_screenLock_API_0017-------------------");
* @tc.level 0 done();
*/ });
it("Screenlock_Test_3400", 0, async function (done) {
console.log("------------------start Screenlock_Test_3400-------------------"); /*
try { * @tc.number SUB_MISC_THEME_screenLock_API_0018
var eventType = 'endSleep'; * @tc.name Set to locked screen, query the lock screen state is locked state
screenLock.off(eventType, () => { * @tc.desc Test ScreenLock API functionality.
console.log("Screenlock_Test_3400: test_getRuntimeState endSleep is successful" ); * @tc.size : MEDIUM
}); * @tc.type : Function
} catch (error) { * @tc.level : Level 0
console.log("end Screenlock_Test_3400: error = " + error); */
expect(true).assertTrue(); it("SUB_MISC_THEME_screenLock_API_0018", 0, async function (done) {
} console.log("------------------start SUB_MISC_THEME_screenLock_API_0018-------------------");
console.log("------------------end Screenlock_Test_3400-------------------"); try {
done(); let eventType = 'beginSleep';
}); screenLock.off(eventType, () => {
console.log("SUB_MISC_THEME_screenLock_API_0018: test_getRuntimeState beginSleep is successful" );
/* });
* @tc.number Screenlock_Test_3500 } catch (error) {
* @tc.name No operation for a long time causes the screen to go off, and run "changeUser" operate console.log("end SUB_MISC_THEME_screenLock_API_0018: error = " + error);
* @tc.desc Function test expect(true).assertTrue();
* @tc.level 0 }
*/ console.log("------------------end SUB_MISC_THEME_screenLock_API_0018-------------------");
it("Screenlock_Test_3500", 0, async function (done) { done();
console.log("------------------start Screenlock_Test_3500-------------------"); });
try {
var eventType = 'changeUser'; /*
screenLock.off(eventType, () => { * @tc.number SUB_MISC_THEME_screenLock_API_0019
console.log("Screenlock_Test_3500: test_getRuntimeState changeUser is successful" ); * @tc.name Set to locked screen, query the lock screen state is locked state
}); * @tc.desc Test ScreenLock API functionality.
} catch (error) { * @tc.size : MEDIUM
console.log("end Screenlock_Test_3500: error = " + error); * @tc.type : Function
expect(true).assertTrue(); * @tc.level : Level 0
} */
console.log("------------------end Screenlock_Test_3500-------------------"); it("SUB_MISC_THEME_screenLock_API_0019", 0, async function (done) {
done(); console.log("------------------start SUB_MISC_THEME_screenLock_API_0019-------------------");
}); try {
let eventType = 'endSleep';
/* screenLock.off(eventType, () => {
* @tc.number Screenlock_Test_3600 console.log("SUB_MISC_THEME_screenLock_API_0019: test_getRuntimeState endSleep is successful" );
* @tc.name Responding to bright screen events, and run "beginWakeUp" operate });
* @tc.desc Function test } catch (error) {
* @tc.level 0 console.log("end SUB_MISC_THEME_screenLock_API_0019: error = " + error);
*/ expect(true).assertTrue();
it("Screenlock_Test_3600", 0, async function (done) { }
console.log("------------------start Screenlock_Test_3600-------------------"); console.log("------------------end SUB_MISC_THEME_screenLock_API_0019-------------------");
try { done();
var eventType = 'beginWakeUp'; });
screenLock.on(eventType, () => {
console.log("Screenlock_Test_3600: test_getRuntimeState beginWakeUp is successful" ); /*
}); * @tc.number SUB_MISC_THEME_screenLock_API_0020
} catch (error) { * @tc.name Set to locked screen, query the lock screen state is locked state
console.log("end Screenlock_Test_3600: error = " + error); * @tc.desc Test ScreenLock API functionality.
expect(true).assertTrue(); * @tc.size : MEDIUM
} * @tc.type : Function
console.log("------------------end Screenlock_Test_3600-------------------"); * @tc.level : Level 0
done(); */
}); it("SUB_MISC_THEME_screenLock_API_0020", 0, async function (done) {
console.log("------------------start SUB_MISC_THEME_screenLock_API_0020-------------------");
/* try {
* @tc.number Screenlock_Test_3700 let eventType = 'changeUser';
* @tc.name Responding to bright screen events, and run "endWakeUp" operate screenLock.off(eventType, () => {
* @tc.desc Function test console.log("SUB_MISC_THEME_screenLock_API_0020: test_getRuntimeState changeUser is successful" );
* @tc.level 0 });
*/ } catch (error) {
it("Screenlock_Test_3700", 0, async function (done) { console.log("end SUB_MISC_THEME_screenLock_API_0020: error = " + error);
console.log("------------------logMessage Screenlock_Test_3700-------------------"); expect(true).assertTrue();
try { }
var eventType = 'endWakeUp'; console.log("------------------end SUB_MISC_THEME_screenLock_API_0020-------------------");
screenLock.on(eventType, () => { done();
console.log("Screenlock_Test_3700: test_getRuntimeState endWakeUp is successful" ); });
});
} catch (error) { /*
console.log("end Screenlock_Test_3700: error = " + error); * @tc.number SUB_MISC_THEME_screenLock_API_0021
expect(true).assertTrue(); * @tc.name Set to locked screen, query the lock screen state is locked state
} * @tc.desc Test ScreenLock API functionality.
console.log("------------------end Screenlock_Test_3700-------------------"); * @tc.size : MEDIUM
done(); * @tc.type : Function
}); * @tc.level : Level 0
*/
/* it("SUB_MISC_THEME_screenLock_API_0021", 0, async function (done) {
* @tc.number Screenlock_Test_3800 console.log("------------------start SUB_MISC_THEME_screenLock_API_0021-------------------");
* @tc.name Responding to bright screen events, and run "beginScreenOn" operate try {
* @tc.desc Function test let eventType = 'beginWakeUp';
* @tc.level 0 screenLock.on(eventType, () => {
*/ console.log("SUB_MISC_THEME_screenLock_API_0021: test_getRuntimeState beginWakeUp is successful" );
it("Screenlock_Test_3800", 0, async function (done) { });
console.log("------------------start Screenlock_Test_3800-------------------"); } catch (error) {
try { console.log("end SUB_MISC_THEME_screenLock_API_0021: error = " + error);
var eventType = 'beginScreenOn'; expect(true).assertTrue();
screenLock.on(eventType, () => { }
console.log("Screenlock_Test_3800: test_getRuntimeState beginScreenOn is successful" ); console.log("------------------end SUB_MISC_THEME_screenLock_API_0021-------------------");
}); done();
} catch (error) { });
console.log("end Screenlock_Test_3800: error = " + error);
expect(true).assertTrue(); /*
} * @tc.number SUB_MISC_THEME_screenLock_API_0022
console.log("------------------end Screenlock_Test_3800-------------------"); * @tc.name Set to locked screen, query the lock screen state is locked state
done(); * @tc.desc Test ScreenLock API functionality.
}); * @tc.size : MEDIUM
* @tc.type : Function
/* * @tc.level : Level 0
* @tc.number Screenlock_Test_3900 */
* @tc.name Responding to bright screen events, and run "endScreenOn" operate it("SUB_MISC_THEME_screenLock_API_0022", 0, async function (done) {
* @tc.desc Function test console.log("------------------logMessage SUB_MISC_THEME_screenLock_API_0022-------------------");
* @tc.level 0 try {
*/ let eventType = 'endWakeUp';
it("Screenlock_Test_3900", 0, async function (done) { screenLock.on(eventType, () => {
console.log("------------------start Screenlock_Test_3900-------------------"); console.log("SUB_MISC_THEME_screenLock_API_0022: test_getRuntimeState endWakeUp is successful" );
try { });
var eventType = 'endScreenOn'; } catch (error) {
screenLock.on(eventType, () => { console.log("end SUB_MISC_THEME_screenLock_API_0022: error = " + error);
console.log("Screenlock_Test_3900: test_getRuntimeState endScreenOn is successful" ); expect(true).assertTrue();
}); }
} catch (error) { console.log("------------------end SUB_MISC_THEME_screenLock_API_0022-------------------");
console.log("end Screenlock_Test_3900: error = " + error); done();
expect(true).assertTrue(); });
}
console.log("------------------end Screenlock_Test_3900-------------------"); /*
done(); * @tc.number SUB_MISC_THEME_screenLock_API_0023
}); * @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Test ScreenLock API functionality.
/* * @tc.size : MEDIUM
* @tc.number Screenlock_Test_4000 * @tc.type : Function
* @tc.name Responding to bright screen events, and run "beginScreenOff" operate * @tc.level : Level 0
* @tc.desc Function test */
* @tc.level 0 it("SUB_MISC_THEME_screenLock_API_0023", 0, async function (done) {
*/ console.log("------------------start SUB_MISC_THEME_screenLock_API_0023-------------------");
it("Screenlock_Test_4000", 0, async function (done) { try {
console.log("------------------start Screenlock_Test_4000-------------------"); let eventType = 'beginScreenOn';
try { screenLock.on(eventType, () => {
var eventType = 'beginScreenOff'; console.log("SUB_MISC_THEME_screenLock_API_0023: test_getRuntimeState beginScreenOn is successful" );
screenLock.on(eventType, () => { });
console.log("Screenlock_Test_4000: test_getRuntimeState beginScreenOff is successful" ); } catch (error) {
}); console.log("end SUB_MISC_THEME_screenLock_API_0023: error = " + error);
} catch (error) { expect(true).assertTrue();
console.log("end Screenlock_Test_4000: error = " + error); }
expect(true).assertTrue(); console.log("------------------end SUB_MISC_THEME_screenLock_API_0023-------------------");
} done();
console.log("------------------end Screenlock_Test_4000-------------------"); });
done();
}); /*
* @tc.number SUB_MISC_THEME_screenLock_API_0024
/* * @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.number Screenlock_Test_4100 * @tc.desc Test ScreenLock API functionality.
* @tc.name Responding to bright screen events, and run "endScreenOff" operate * @tc.size : MEDIUM
* @tc.desc Function test * @tc.type : Function
* @tc.level 0 * @tc.level : Level 0
*/ */
it("Screenlock_Test_4100", 0, async function (done) { it("SUB_MISC_THEME_screenLock_API_0024", 0, async function (done) {
console.log("------------------logMessage Screenlock_Test_4100-------------------"); console.log("------------------start SUB_MISC_THEME_screenLock_API_0024-------------------");
try { try {
var eventType = 'endScreenOff'; let eventType = 'endScreenOn';
screenLock.on(eventType, () => { screenLock.on(eventType, () => {
console.log("Screenlock_Test_4100: test_getRuntimeState endScreenOff is successful" ); console.log("SUB_MISC_THEME_screenLock_API_0024: test_getRuntimeState endScreenOn is successful" );
}); });
} catch (error) { } catch (error) {
console.log("end Screenlock_Test_4100: error = " + error); console.log("end SUB_MISC_THEME_screenLock_API_0024: error = " + error);
expect(true).assertTrue(); expect(true).assertTrue();
} }
console.log("------------------end Screenlock_Test_4100-------------------"); console.log("------------------end SUB_MISC_THEME_screenLock_API_0024-------------------");
done(); done();
}); });
/* /*
* @tc.number Screenlock_Test_4200 * @tc.number SUB_MISC_THEME_screenLock_API_0025
* @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
it("Screenlock_Test_4200", 0, async function (done) { * @tc.level : Level 0
console.log("------------------start Screenlock_Test_4200-------------------"); */
try { it("SUB_MISC_THEME_screenLock_API_0025", 0, async function (done) {
var eventType = 'unlockScreen'; console.log("------------------start SUB_MISC_THEME_screenLock_API_0025-------------------");
screenLock.on(eventType, () => { try {
console.log("Screenlock_Test_4200: test_getRuntimeState unlockScreen is successful" ); let eventType = 'beginScreenOff';
}); screenLock.on(eventType, () => {
} catch (error) { console.log("SUB_MISC_THEME_screenLock_API_0025: test_getRuntimeState beginScreenOff is successful" );
console.log("end Screenlock_Test_4200: error = " + error); });
expect(true).assertTrue(); } catch (error) {
} console.log("end SUB_MISC_THEME_screenLock_API_0025: error = " + error);
console.log("------------------end Screenlock_Test_4200-------------------"); expect(true).assertTrue();
done(); }
}); console.log("------------------end SUB_MISC_THEME_screenLock_API_0025-------------------");
done();
/* });
* @tc.number Screenlock_Test_4300
* @tc.name Responding to bright screen events, and run "beginExitAnimation" operate /*
* @tc.desc Function test * @tc.number SUB_MISC_THEME_screenLock_API_0026
* @tc.level 0 * @tc.name Set to locked screen, query the lock screen state is locked state
*/ * @tc.desc Test ScreenLock API functionality.
it("Screenlock_Test_4300", 0, async function (done) { * @tc.size : MEDIUM
console.log("------------------start Screenlock_Test_4300-------------------"); * @tc.type : Function
try { * @tc.level : Level 0
var eventType = 'beginExitAnimation'; */
screenLock.on(eventType, () => { it("SUB_MISC_THEME_screenLock_API_0026", 0, async function (done) {
console.log("Screenlock_Test_4300: test_getRuntimeState beginExitAnimation is successful" ); console.log("------------------logMessage SUB_MISC_THEME_screenLock_API_0026-------------------");
}); try {
} catch (error) { let eventType = 'endScreenOff';
console.log("end Screenlock_Test_4300: error = " + error); screenLock.on(eventType, () => {
expect(true).assertTrue(); console.log("SUB_MISC_THEME_screenLock_API_0026: test_getRuntimeState endScreenOff is successful" );
} });
console.log("------------------end Screenlock_Test_4300-------------------"); } catch (error) {
done(); console.log("end SUB_MISC_THEME_screenLock_API_0026: error = " + error);
}); expect(true).assertTrue();
}
/* console.log("------------------end SUB_MISC_THEME_screenLock_API_0026-------------------");
* @tc.number Screenlock_Test_4400 done();
* @tc.name Responding to bright screen events, and run "beginSleep" operate });
* @tc.desc Function test
* @tc.level 0 /*
*/ * @tc.number SUB_MISC_THEME_screenLock_API_0027
it("Screenlock_Test_4400", 0, async function (done) { * @tc.name Set to locked screen, query the lock screen state is locked state
console.log("------------------start Screenlock_Test_4400-------------------"); * @tc.desc Test ScreenLock API functionality.
try { * @tc.size : MEDIUM
var eventType = 'changeUser'; * @tc.type : Function
screenLock.on(eventType, (err, data) => { * @tc.level : Level 0
console.log("Screenlock_Test_4400: test_getRuntimeState beginSleep is successful"); */
expect(data == INTERACTIVE_STATE_BEGIN_SLEEP).assertTrue(); it("SUB_MISC_THEME_screenLock_API_0027", 0, async function (done) {
}); console.log("------------------start SUB_MISC_THEME_screenLock_API_0027-------------------");
} catch (error) { try {
console.log("logMessage Screenlock_Test_4400: error = " + error); let eventType = 'unlockScreen';
expect(true).assertTrue(); screenLock.on(eventType, () => {
} console.log("SUB_MISC_THEME_screenLock_API_0027: test_getRuntimeState unlockScreen is successful" );
console.log("------------------end Screenlock_Test_4400-------------------"); });
done(); } catch (error) {
}); console.log("end SUB_MISC_THEME_screenLock_API_0027: error = " + error);
expect(true).assertTrue();
/* }
* @tc.number Screenlock_Test_4500 console.log("------------------end SUB_MISC_THEME_screenLock_API_0027-------------------");
* @tc.name Responding to bright screen events, and run "endSleep" operate done();
* @tc.desc Function test });
* @tc.level 0
*/ /*
it("Screenlock_Test_4500", 0, async function (done) { * @tc.number SUB_MISC_THEME_screenLock_API_0028
console.log("------------------start Screenlock_Test_4500-------------------"); * @tc.name Set to locked screen, query the lock screen state is locked state
try { * @tc.desc Test ScreenLock API functionality.
var eventType = 'endSleep'; * @tc.size : MEDIUM
screenLock.test_getRuntimeState(eventType, (err, data) => { * @tc.type : Function
console.log("Screenlock_Test_4500: test_getRuntimeState endSleep is successful"); * @tc.level : Level 0
expect(data == INTERACTIVE_STATE_END_SLEEP).assertTrue(); */
}); it("SUB_MISC_THEME_screenLock_API_0028", 0, async function (done) {
} catch (error) { console.log("------------------start SUB_MISC_THEME_screenLock_API_0028-------------------");
console.log("logMessage Screenlock_Test_4500: error = " + error); try {
expect(true).assertTrue(); let eventType = 'beginExitAnimation';
} screenLock.on(eventType, () => {
console.log("------------------end Screenlock_Test_4500-------------------"); console.log("SUB_MISC_THEME_screenLock_API_0028: test_getRuntimeState beginExitAnimation is successful" );
done(); });
}); } catch (error) {
console.log("end SUB_MISC_THEME_screenLock_API_0028: error = " + error);
/* expect(true).assertTrue();
* @tc.number Screenlock_Test_4600 }
* @tc.name Responding to bright screen events, and run "changeUser" operate console.log("------------------end SUB_MISC_THEME_screenLock_API_0028-------------------");
* @tc.desc Function test done();
* @tc.level 0 });
*/
it("Screenlock_Test_4600", 0, async function (done) { /*
console.log("------------------start Screenlock_Test_4600-------------------"); * @tc.number SUB_MISC_THEME_screenLock_API_0029
try { * @tc.name Set to locked screen, query the lock screen state is locked state
var eventType = 'changeUser'; * @tc.desc Test ScreenLock API functionality.
screenLock.test_getRuntimeState(eventType, (err, data) => { * @tc.size : MEDIUM
console.log("Screenlock_Test_4600: test_getRuntimeState changeUser is successfuls"); * @tc.type : Function
expect(data == INTERACTIVE_STATE_USERID).assertTrue(); * @tc.level : Level 0
}); */
} catch (error) { it("SUB_MISC_THEME_screenLock_API_0029", 0, async function (done) {
console.log("logMessage Screenlock_Test_4600: error = " + error); console.log("------------------start SUB_MISC_THEME_screenLock_API_0029-------------------");
expect(true).assertTrue(); try {
} let eventType = 'changeUser';
console.log("------------------end Screenlock_Test_4600-------------------"); screenLock.on(eventType, (err, data) => {
done(); console.log("SUB_MISC_THEME_screenLock_API_0029: test_getRuntimeState beginSleep is successful");
}); expect(data == INTERACTIVE_STATE_BEGIN_SLEEP).assertTrue();
});
/* } catch (error) {
* @tc.number Screenlock_Test_4700 console.log("logMessage SUB_MISC_THEME_screenLock_API_0029: error = " + error);
* @tc.name Responding to bright screen events, and run "screenlockEnabled" operate expect(true).assertTrue();
* @tc.desc Function test }
* @tc.level 0 console.log("------------------end SUB_MISC_THEME_screenLock_API_0029-------------------");
*/ done();
it("Screenlock_Test_4700", 0, async function (done) { });
console.log("------------------start Screenlock_Test_4700-------------------");
try { /*
var eventType = 'screenlockEnabled'; * @tc.number SUB_MISC_THEME_screenLock_API_0030
screenLock.test_getRuntimeState(eventType, (err, data) => { * @tc.name Set to locked screen, query the lock screen state is locked state
console.log("Screenlock_Test_4700: test_getRuntimeState screenlockEnabled is successfuls"); * @tc.desc Test ScreenLock API functionality.
expect(data == true).assertTrue(); * @tc.size : MEDIUM
}); * @tc.type : Function
} catch (error) { * @tc.level : Level 0
console.log("logMessage Screenlock_Test_4700: error = " + error); */
expect(true).assertTrue(); it("SUB_MISC_THEME_screenLock_API_0030", 0, async function (done) {
} console.log("------------------start SUB_MISC_THEME_screenLock_API_0030-------------------");
console.log("------------------end Screenlock_Test_4700-------------------"); try {
done(); let eventType = 'endSleep';
}); screenLock.test_getRuntimeState(eventType, (err, data) => {
console.log("SUB_MISC_THEME_screenLock_API_0030: test_getRuntimeState endSleep is successful");
expect(data == INTERACTIVE_STATE_END_SLEEP).assertTrue();
});
} catch (error) {
console.log("logMessage SUB_MISC_THEME_screenLock_API_0030: error = " + error);
expect(true).assertTrue();
}
console.log("------------------end SUB_MISC_THEME_screenLock_API_0030-------------------");
done();
});
/*
* @tc.number SUB_MISC_THEME_screenLock_API_0031
* @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Test ScreenLock API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it("SUB_MISC_THEME_screenLock_API_0031", 0, async function (done) {
console.log("------------------start SUB_MISC_THEME_screenLock_API_0031-------------------");
try {
let eventType = 'changeUser';
screenLock.test_getRuntimeState(eventType, (err, data) => {
console.log("SUB_MISC_THEME_screenLock_API_0031: test_getRuntimeState changeUser is successful");
expect(data == INTERACTIVE_STATE_USERID).assertTrue();
});
} catch (error) {
console.log("logMessage SUB_MISC_THEME_screenLock_API_0031: error = " + error);
expect(true).assertTrue();
}
console.log("------------------end SUB_MISC_THEME_screenLock_API_0031-------------------");
done();
});
/*
* @tc.number SUB_MISC_THEME_screenLock_API_0032
* @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Test ScreenLock API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it("SUB_MISC_THEME_screenLock_API_0032", 0, async function (done) {
console.log("------------------start SUB_MISC_THEME_screenLock_API_0032-------------------");
try {
let eventType = 'screenLockEnabled';
screenLock.test_getRuntimeState(eventType, (err, data) => {
console.log("SUB_MISC_THEME_screenLock_API_0032: test_getRuntimeState screenLockEnabled is successfuls");
expect(data == true).assertTrue();
});
} catch (error) {
console.log("logMessage SUB_MISC_THEME_screenLock_API_0032: error = " + error);
expect(true).assertTrue();
}
console.log("------------------end SUB_MISC_THEME_screenLock_API_0032-------------------");
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.
先完成此消息的编辑!
想要评论请 注册