提交 39876073 编写于 作者: Z zengxingdong

modify some case names;

Signed-off-by: Nzengxingdong <zengxingdong@huawei.com>
上级 4f7b6898
......@@ -12,16 +12,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import inputmethohJsunit from './InputmethohJsunit.test.ets';
import inputmethodEngineJsunit from './InputmethodEngineJsunit.test.ets';
import inputRequestJsunit from './InputRequestJsunit.test.ets';
import requestJsunit from './RequestJsunit.test.ets';
import requestDownloadJsunit from './RequestDownloadTaskJsunit.test.ets';
import inputMethodJSUnit from './inputMethodJSUnit.ets';
import inputMethodEngineJSUnit from './inputMethodEngineJSUnit.ets';
import inputRequestJSUnit from './inputRequestJSUnit.ets';
import requestJSUnit from './requestJSUnit.ets';
import requestDownloadJSUnit from './requestDownloadJSUnit.ets';
export default function testsuite() {
inputmethohJsunit();
inputmethodEngineJsunit();
inputRequestJsunit();
requestDownloadJsunit();
requestJsunit();
inputMethodJSUnit();
inputMethodEngineJSUnit();
inputRequestJSUnit();
requestDownloadJSUnit();
requestJSUnit();
}
\ No newline at end of file
......@@ -57,10 +57,10 @@ export default class Utils {
}
static async drags(downX, downY, upX, upY, steps, drag) {
var xStep;
var yStep;
var swipeSteps;
var ret;
let xStep;
let yStep;
let swipeSteps;
let ret;
xStep = 0;
yStep = 0;
ret = false;
......@@ -71,7 +71,7 @@ export default class Utils {
xStep = (upX - downX) / swipeSteps;
yStep = (upY - downY) / swipeSteps;
console.info('move step is: ' + 'xStep: ' + xStep + ' yStep: ' + yStep)
var downPonit: TouchObject = {
let downPonit: TouchObject = {
id: 1,
x: downX,
y: downY,
......@@ -83,8 +83,8 @@ export default class Utils {
if (drag) {
await this.sleep(500)
}
for (var i = 1;i <= swipeSteps; i++) {
var movePoint: TouchObject = {
for (let i = 1;i <= swipeSteps; i++) {
let movePoint: TouchObject = {
id: 1,
x: downX + (xStep * i),
y: downY + (yStep * i),
......@@ -101,7 +101,7 @@ export default class Utils {
if (drag) {
await this.sleep(100)
}
var upPoint: TouchObject = {
let upPoint: TouchObject = {
id: 1,
x: upX,
y: upY,
......
......@@ -19,12 +19,12 @@ import Utils from './Utils';
import router from '@system.router';
import events_emitter from '@ohos.events.emitter';
export default function inputMethodEngineJsunit() {
export default function inputMethodEngineJSUnit() {
describe('appInfoTest_input_1', function () {
var mKeyboardDelegate = null;
var inputMethodEngineObject = inputMethodEngine.getInputMethodEngine();
var textInputClient = null;
var kbController = null;
let mKeyboardDelegate = null;
let inputMethodEngineObject = inputMethodEngine.getInputMethodEngine();
let textInputClient = null;
let kbController = null;
console.info("************* inputMethodEngine Test start*************");
beforeEach(async function (done) {
......
......@@ -16,7 +16,7 @@
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'hypium/index';
import inputMethod from '@ohos.inputmethod';
export default function settingUiJsunit() {
export default function inputMethodJSUnit() {
describe('appInfoTest_input_2', function () {
console.info("************* settings Test start*************");
it('inputmethoh_test_001', 0, async function (done) {
......
......@@ -16,7 +16,7 @@
import {describe, it, expect} from 'hypium/index';
import request from '@ohos.request';
export default function inputRequestJsunit() {
export default function inputRequestJSUnit() {
describe('inputRequestTest', function () {
console.log("************* request Test start*************");
......
......@@ -16,7 +16,7 @@
import {describe, it, expect} from "deccjsunit/index.ets";
import request from '@ohos.request';
export default function requestDownloadJsunit() {
export default function requestDownloadJSUnit() {
describe('requestDownloadTest', function () {
let downloadConfig = {
url: "www.baidu.com"
......@@ -32,10 +32,10 @@ export default function requestDownloadJsunit() {
header: 'HTTP',
method: 'post',
files: file,
data: 'jason/xml'
data: 'json/xml'
};
var receivedSize;
var totalSize;
let receivedSize;
let totalSize;
console.log("************* settings Test start*************");
/**
......
......@@ -16,7 +16,7 @@
import {describe, it, expect} from "deccjsunit/index.ets";
import request from '@ohos.request';
export default function requestJsunit() {
export default function requestJSUnit() {
describe('requestTest', function () {
/**
......
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
......@@ -13,8 +13,8 @@
* limitations under the License.
*/
import uploadRequestJsunitTest from './uploadCallbackXTSJsunitTest';
import uploadRequestJSUnitTest from './uploadCallbackXTSJSUnitTest';
export default function testsuite() {
uploadRequestJsunitTest()
uploadRequestJSUnitTest()
}
\ No newline at end of file
......@@ -27,7 +27,7 @@ function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
function getUploadConfig(fileurl){
function getUploadConfig(fileURL){
let File = {
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.
......@@ -52,74 +52,74 @@ function getUploadConfig(fileurl){
}
//upload公共方法
function publicupload(UploadConfig){
console.info(`Testupdate UploadConfig ${JSON.stringify(UploadConfig)}`)
function publicUpload(UploadConfig){
console.info(`TestUpdate UploadConfig ${JSON.stringify(UploadConfig)}`)
return new Promise(function(resolve, reject) {
request.upload(UploadConfig, (err, data) => {
console.info("Testupdate publiconprogress Updatetask =" + JSON.stringify(data));
console.info("TestUpdate publicOnProgress UpdateTask =" + JSON.stringify(data));
resolve(data);
})
})
}
//onprogress公共方法
function publiconprogress(Updatetask, Type){
//OnProgress公共方法
function publicOnProgress(UpdateTask, Type){
return new Promise(function(resolve, reject) {
Updatetask.on(Type, function(data1 ,data2){
UpdateTask.on(Type, function(data1 ,data2){
let progress = {
uploadedSize : data1,
totalSize : data2
}
console.info("Testupdate publiconprogress uploadedSize =" + data1);
console.info("Testupdate publiconprogress totalSize =" + data2);
console.info("TestUpdate publicOnProgress uploadedSize =" + data1);
console.info("TestUpdate publicOnProgress totalSize =" + data2);
resolve(progress);
})
})
}
//offprogress公共方法
function publicoffprogress(Updatetask, Type){
//OffProgress公共方法
function publicOffProgress(UpdateTask, Type){
return new Promise(function(resolve, reject) {
Updatetask.off(Type, function(data1 ,data2){
UpdateTask.off(Type, function(data1 ,data2){
let progress = {
uploadedSize : data1,
totalSize : data2
}
console.info("Testupdate publicoffprogress uploadedSize =" + data1);
console.info("Testupdate publicoffprogress totalSize =" + data2);
console.info("TestUpdate publicOffProgress uploadedSize =" + data1);
console.info("TestUpdate publicOffProgress totalSize =" + data2);
resolve(progress);
})
})
}
//其他on公共方法
function publicon(Updatetask, Type){
function publicOn(UpdateTask, Type){
return new Promise(function(resolve, reject) {
Updatetask.on(Type, function(data){
console.info("Testupdate publicon =" + data);
UpdateTask.on(Type, function(data){
console.info("TestUpdate publicOn =" + data);
resolve(data);
})
})
}
//其他off公共方法
function publicoff(Updatetask, Type){
function publicOff(UpdateTask, Type){
return new Promise(function(resolve, reject) {
Updatetask.off(Type, function(data){
console.info("Testupdate publicoff =" + data);
UpdateTask.off(Type, function(data){
console.info("TestUpdate publicOff =" + data);
resolve(data);
})
})
}
//remove公共方法
function publicremove(Updatetask){
function publicRemove(UpdateTask){
return new Promise(function(resolve, reject) {
Updatetask.remove((err,data) => {
console.info("Testupdate publicremove =" + data);
UpdateTask.remove((err,data) => {
console.info("TestUpdate publicRemove =" + data);
resolve(data);
})
})
}
export{publicupload,publicon,publicoff,publicremove,publiconprogress,publicoffprogress,getUploadConfig,sleep}
\ No newline at end of file
export{publicUpload,publicOn,publicOff,publicRemove,publicOnProgress,publicOffProgress,getUploadConfig,sleep}
\ No newline at end of file
......@@ -15,7 +15,7 @@
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
import request from '@ohos.request';
import * as pubfun from './Publicfunction.ets'
import * as pubFun from './publicFunction.ets'
var typeProgress = 'progress';
var typeHeaderReceive = 'headerReceive';
......@@ -23,7 +23,7 @@ var typeFail = 'fail';
let uploadTask;
let file7url = 'internal://cache/test.txt';
export default function uploadRequestJsunitTest() {
export default function uploadRequestJSUnitTest() {
describe('UploadTest', function () {
beforeAll(function () {
console.info('beforeAll: Prerequisites at the test suite level, ' +
......@@ -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.desc : Mixed strings value can be obtained correctly
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level 1
*/
it('InitUploadtaskCallback001', 0, async function (done) {
it('SUB_MISC_REQUEST_API_UploadTask_0001', 0, async function (done) {
try {
console.info("Testupdate before getuploadconfig");
let UploadConfig = pubfun.getUploadConfig(file7url)
console.info("Testupdate before upload UploadConfig = " + JSON.stringify(UploadConfig));
console.info("Testupdate before upload");
await pubfun.publicupload(UploadConfig).then((data) => {
console.info("Testupdate going upload uploadTask = " + data);
console.info("TestUpdate before getUploadConfig");
let UploadConfig = pubFun.getUploadConfig(file7url)
console.info("TestUpdate before upload UploadConfig = " + JSON.stringify(UploadConfig));
console.info("TestUpdate before upload");
await pubFun.publicUpload(UploadConfig).then((data) => {
console.info("TestUpdate going upload uploadTask = " + data);
uploadTask = data;
expect(true).assertEqual((data != undefined) || (data != "") || (data != {}));
done();
}).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();
done();
})
} 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();
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.desc : Mixed strings value can be obtained correctly
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level 1
*/
it('SwitchOnProgressCallback001', 0, async function (done) {
it('SUB_MISC_REQUEST_API_OnProgress_0001', 0, async function (done) {
try {
pubfun.publiconprogress(uploadTask, typeProgress);
pubFun.publicOnProgress(uploadTask, typeProgress);
expect(true).assertEqual(0 == 0);
done();
} 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();
done();
}
});
/*
* @tc.number : SwitchOffProgressCallback001
* @tc.number : SUB_MISC_REQUEST__OffProgress_0001
* @tc.name : Use getEntries get the value by mixing the string key
* @tc.desc : Mixed strings value can be obtained correctly
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level 1
*/
it('SwitchOffProgressCallback001', 0, async function (done) {
it('SUB_MISC_REQUEST_OffProgress_0001', 0, async function (done) {
try {
pubfun.publiconprogress(uploadTask, typeProgress);
pubFun.publicOnProgress(uploadTask, typeProgress);
expect(true).assertEqual(0 == 0);
await pubfun.publicoffprogress(uploadTask, typeProgress).then((data) => {
console.info("SwitchOffProgressCallback001 data" + JSON.stringify(data));
await pubFun.publicOffProgress(uploadTask, typeProgress).then((data) => {
console.info("SUB_MISC_REQUEST_OffProgress_0001 data" + JSON.stringify(data));
expect(7).assertEqual(data["totalSize"]);
done();
}).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();
done();
})
} 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();
done();
}
})
/*
* @tc.number : SwitchOnFailCallback001
* @tc.number : SUB_MISC_REQUEST_OnFail_0001
* @tc.name : Use getEntries get the value by mixing the string key
* @tc.desc : Mixed strings value can be obtained correctly
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level 1
*/
it('SwitchOnFailCallback001', 0, async function (done) {
it('SUB_MISC_REQUEST_OnFail_0001', 0, async function (done) {
try {
await pubfun.publicon(uploadTask, typeFail).then((data) => {
console.info("SwitchOnFailCallback001 data " + data);
await pubFun.publicOn(uploadTask, typeFail).then((data) => {
console.info("SUB_MISC_REQUEST_OnFail_0001 data " + data);
expect(5).assertEqual(data);
done();
}).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();
done();
})
} 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();
done();
}
})
/*
* @tc.number : SwitchOffFailCallback001
* @tc.number : SUB_MISC_REQUEST_OffFail_0001
* @tc.name : Use getEntries get the value by mixing the string key
* @tc.desc : Mixed strings value can be obtained correctly
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level 1
*/
it('SwitchOffFailCallback001', 0, async function (done) {
it('SUB_MISC_REQUEST_OffFail_0001', 0, async function (done) {
try {
await pubfun.publicon(uploadTask, typeFail)
await pubfun.publicoff(uploadTask, typeFail).then((data) => {
console.info("SwitchOffFailCallback001 data " + data);
await pubFun.publicOn(uploadTask, typeFail)
await pubFun.publicOff(uploadTask, typeFail).then((data) => {
console.info("SUB_MISC_REQUEST_OffFail_0001 data " + data);
expect(5).assertEqual(data);
done();
}).catch((err) => {
console.info("SwitchOffFailCallback001 fail 2" + JSON.stringify(err));
console.info("SUB_MISC_REQUEST_OffFail_0001 fail 2" + JSON.stringify(err));
done();
expect(err).assertFail();
})
} 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();
done();
}
})
/*
* @tc.number : RemoveCallback001
* @tc.number : SUB_MISC_REQUEST_RmvCB_0001
* @tc.name : Use getEntries get the value by mixing the string key
* @tc.desc : Mixed strings value can be obtained correctly
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level 1
*/
it('RemoveCallback001', 0, async function (done) {
it('SUB_MISC_REQUEST_RmvCB_0001', 0, async function (done) {
try {
await pubfun.publicremove(uploadTask).then((data) => {
console.info("RemoveCallback001 data " + data);
await pubFun.publicRemove(uploadTask).then((data) => {
console.info("SUB_MISC_REQUEST_RmvCB_0001 data " + data);
expect(true).assertEqual(data);
done();
}).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();
done();
})
} 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();
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(){
console.info("-----------------------ScreenlockPromiseTest is starting-----------------------");
function sleep(numberMillis) {
var now = new Date();
var exitTime = now.getTime() + numberMillis;
let now = new Date();
let exitTime = now.getTime() + numberMillis;
while (true) {
now = new Date();
if (now.getTime() > exitTime)
......@@ -33,134 +33,144 @@ export default function ScreenLockPromiseTest(){
}
/*
* @tc.number ScreenLock_Test_Promise_0100
* @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Function test
* @tc.level 0
* @tc.number SUB_MISC_THEME_screenLock_API_Promise_001
* @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("ScreenLock_Test_Promise_0100", 0, async function (done) {
console.info("------------------start ScreenLock_Test_Promise_0100-------------------");
var isScreenLocked = true;
it("SUB_MISC_THEME_screenLock_API_Promise_001", 0, async function (done) {
console.info("------------------start SUB_MISC_THEME_screenLock_API_Promise_001-------------------");
let isScreenLocked = true;
try {
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()
})
} 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();
}
console.info("------------------end ScreenLock_Test_Promise_0100-------------------");
console.info("------------------end SUB_MISC_THEME_screenLock_API_Promise_001-------------------");
done();
});
/*
* @tc.number ScreenLock_Test_Promise_0200
* @tc.name Set to unlocked screen, query the lock screen state is unlocked state
* @tc.desc Function test
* @tc.level 0
* @tc.number SUB_MISC_THEME_screenLock_API_Promise_002
* @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("ScreenLock_Test_Promise_0200", 0, async function (done) {
console.info("------------------start ScreenLock_Test_Promise_0200-------------------");
var isScreenLocked = false;
it("SUB_MISC_THEME_screenLock_API_Promise_002", 0, async function (done) {
console.info("------------------start SUB_MISC_THEME_screenLock_API_Promise_002-------------------");
let isScreenLocked = false;
try {
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();
});
} 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();
}
console.info("------------------end ScreenLock_Test_Promise_0200-------------------");
console.info("------------------end SUB_MISC_THEME_screenLock_API_Promise_002-------------------");
done();
});
/*
* @tc.number ScreenLock_Test_Promise_0300
* @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_Promise_003
* @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("ScreenLock_Test_Promise_0300", 0, async function (done) {
console.info("------------------start ScreenLock_Test_Promise_0300-------------------");
it("SUB_MISC_THEME_screenLock_API_Promise_003", 0, async function (done) {
console.info("------------------start SUB_MISC_THEME_screenLock_API_Promise_003-------------------");
try {
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();
});
} 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();
}
console.info("------------------end ScreenLock_Test_Promise_0300-------------------");
console.info("------------------end SUB_MISC_THEME_screenLock_API_Promise_003-------------------");
done();
});
/*
* @tc.number ScreenLock_Test_Promise_0400
* @tc.name Request to unlock the device screen, unlock successfully
* @tc.desc Function test
* @tc.level 0
* @tc.number SUB_MISC_THEME_screenLock_API_Promise_004
* @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("ScreenLock_Test_Promise_0400", 0, async function (done) {
console.info("------------------start ScreenLock_Test_Promise_0400-------------------");
it("SUB_MISC_THEME_screenLock_API_Promise_004", 0, async function (done) {
console.info("------------------start SUB_MISC_THEME_screenLock_API_Promise_004-------------------");
try {
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);
var unlockScreenResult = 0;
var eventType = 'unlockScreenResult';
let unlockScreenResult = 0;
let eventType = 'unlockScreenResult';
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();
});
sleep(SLEEP_TIME);
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();
});
} catch (error) {
console.info("Screenlock_Test_1400: error = " + error);
expect(true).assertTrue();
}
console.info("------------------end ScreenLock_Test_Promise_0400-------------------");
console.info("------------------end SUB_MISC_THEME_screenLock_API_Promise_004-------------------");
done();
});
/*
* @tc.number ScreenLock_Test_Promise_0500
* @tc.name Request to unlock device screen, unlock failed
* @tc.desc Function test
* @tc.level 0
* @tc.number SUB_MISC_THEME_screenLock_API_Promise_005
* @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("ScreenLock_Test_Promise_0500", 0, async function (done) {
console.info("------------------start ScreenLock_Test_Promise_0500-------------------");
it("SUB_MISC_THEME_screenLock_API_Promise_005", 0, async function (done) {
console.info("------------------start SUB_MISC_THEME_screenLock_API_Promise_005-------------------");
try {
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);
var unlockScreenResult = 1;
var eventType = 'unlockScreenResult';
let unlockScreenResult = 1;
let eventType = 'unlockScreenResult';
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();
});
sleep(SLEEP_TIME);
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();
done();
});
} 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();
}
console.info("------------------end ScreenLock_Test_Promise_0500-------------------");
console.info("------------------end SUB_MISC_THEME_screenLock_API_Promise_005-------------------");
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 '
const WALLPAPER_SYSTEM = 0;
const WALLPAPER_LOCKSCREEN = 1;
var imageSourceSystem = '/data/service/el1/public/wallpaper/0/system/wallpaper';
var imageSourceLockscreen = '/data/service/el1/public/wallpaper/0/lockscreen/wallpaper_lock';
let imageSourceSystem = '/data/service/el1/public/wallpaper/0/system/wallpaper';
let imageSourceLockscreen = '/data/service/el1/public/wallpaper/0/lockscreen/wallpaper_lock';
export default function wallpaperJSUnit() {
describe('WallpaperJsunitTest', function () {
......
文件模式从 100644 更改为 100755
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册