提交 75e88758 编写于 作者: U uoengopen

guofeng43@huawei.com

Signed-off-by: Nuoengopen <guofeng43@huawei.com>
上级 016d74df
......@@ -89,7 +89,8 @@ describe("FaultlogJsTest", function () {
const loopTimes = 10;
for (let i = 0; i < loopTimes; i++) {
console.info("--------FaultlogJsTest_002 3 + " + i + "----------");
faultlogger.addFaultLog(i, faultlogger.FaultType.CPP_CRASH, module, "faultloggertestsummary02 " + i);
faultlogger.addFaultLog(i + 100,
faultlogger.FaultType.CPP_CRASH, module, "faultloggertestsummary02 " + i);
await msleep(300);
}
await msleep(1000);
......@@ -135,27 +136,37 @@ describe("FaultlogJsTest", function () {
try {
let now = Date.now();
console.info("FaultlogJsTest_003 2 + " + now);
let module = "ohos.faultloggerjs.test";
const loopTimes = 10;
for (let i = 0; i < loopTimes; i++) {
const loopTimes = 2;
let i = 0;
let pro = new Promise(
(r, e) => {
setTimeout(function run() {
if (i < loopTimes) {
setTimeout(run, 1001);
} else {
r("done!")
return
}
console.info("--------FaultlogJsTest_003 3 + " + i + "----------");
faultlogger.addFaultLog(i, faultlogger.FaultType.JS_CRASH, module, "faultloggertestsummary03 " + i);
await msleep(300);
++i;
let dataStr = ["1", "2"]
console.info(dataStr[2].test);
}, 1001);
}
);
await pro;
await msleep(1000);
console.info("--------FaultlogJsTest_003 4" + "----------");
let ret = await faultlogger.querySelfFaultLog(faultlogger.FaultType.JS_CRASH);
console.info("FaultlogJsTest_003 ret == " + ret.length);
expect(ret.length).assertEqual(loopTimes);
for (let i = 0; i < loopTimes; i++) {
console.info("faultloggertestsummary03 " + i + " fullLog.length " + ret[i].fullLog.length);
if (ret[i].fullLog.indexOf("faultloggertestsummary03 " + (loopTimes - 1 - i)) != -1) {
console.info("FaultlogJsTest_003 " + ret[i].fullLog.length);
if (ret.length > 0) {
expect(true).assertTrue();
} else {
expect(false).assertTrue();
}
for (let i = 0; i < ret.length; i++) {
console.info("faultloggertestsummary03 " + i + " fullLog.length " + ret[i].fullLog.length);
}
done();
return;
......@@ -184,7 +195,8 @@ describe("FaultlogJsTest", function () {
const loopTimes = 10;
for (let i = 0; i < loopTimes; i++) {
console.info("--------FaultlogJsTest_004 3 + " + i + "----------");
faultlogger.addFaultLog(i, faultlogger.FaultType.APP_FREEZE, module, "faultloggertestsummary04 " + i);
faultlogger.addFaultLog(i + 300,
faultlogger.FaultType.APP_FREEZE, module, "faultloggertestsummary04 " + i);
await msleep(300);
}
await msleep(1000);
......@@ -229,7 +241,7 @@ describe("FaultlogJsTest", function () {
const loopTimes = 10;
for (let i = 0; i < loopTimes; i++) {
console.info("--------FaultlogJsTest_005 + " + i + "----------");
faultlogger.addFaultLog(i + 20,
faultlogger.addFaultLog(i + 400,
faultlogger.FaultType.CPP_CRASH, module, "faultloggertestsummary05 " + i);
await msleep(300);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册