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

guofeng43@huawei.com

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