diff --git a/arkui/ace_napi_test/entry/src/main/cpp/napi/napi_test.cpp b/arkui/ace_napi_test/entry/src/main/cpp/napi/napi_test.cpp index e23b298e2fa39d23cb1f723883294664eb93523f..20740aaf96a0b8e1ca95ba1e8e1c9ea39d8b63fe 100644 --- a/arkui/ace_napi_test/entry/src/main/cpp/napi/napi_test.cpp +++ b/arkui/ace_napi_test/entry/src/main/cpp/napi/napi_test.cpp @@ -1862,9 +1862,6 @@ static void AddPromiseCompleteCB(napi_env env, napi_status status, void *data) { } else { NAPI_CALL_RETURN_VOID(env, napi_reject_deferred(env, addonData->deferred, result)); } - if (addonData->callback != nullptr) { - NAPI_CALL_RETURN_VOID(env, napi_delete_reference(env, addonData->callback)); - } NAPI_CALL_RETURN_VOID(env, napi_delete_async_work(env, addonData->asyncWork)); free(addonData); diff --git a/arkui/ace_napi_test/entry/src/main/ets/test/NativeApiStringTest.ets b/arkui/ace_napi_test/entry/src/main/ets/test/NativeApiStringTest.ets index 6656f1636d51a7e7d9fddbf6dc810900e560a8b5..6e462b33a8bc80e9c57327b2bbea97413aef3e45 100644 --- a/arkui/ace_napi_test/entry/src/main/ets/test/NativeApiStringTest.ets +++ b/arkui/ace_napi_test/entry/src/main/ets/test/NativeApiStringTest.ets @@ -1115,17 +1115,26 @@ export default function nativeApiStringJsunit() { console.info('aceNapiTest079 START'); value = napitest.testPromise(1).then( (result)=>{ - console.info('aceNapiTest079 testString result is: ' + result + "--" + JSON.stringify(result)); - expect(result > 0).assertTrue(); + console.info('aceNapiTest079 testString resolve1 result is: ' + result + "--" + JSON.stringify(result)); + expect(result > 0).assertTrue(); + done(); + }, (result) =>{ + console.info('aceNapiTest079 testString reject1 result is: ' + result + "--" + JSON.stringify(result)); + expect(result < 0).assertTrue(); + done(); } ); value = napitest.testPromise(-1).then( - (result)=>{ - console.info('aceNapiTest079 testString result is: ' + result + "--" + JSON.stringify(result)); - expect(result > 0).assertTrue(); - } + (result)=>{ + console.info('aceNapiTest079 testString resolve2 result is: ' + result + "--" + JSON.stringify(result)); + expect(result > 0).assertTrue(); + done(); + }, (result) =>{ + console.info('aceNapiTest079 testString reject2 result is: ' + result + "--" + JSON.stringify(result)); + expect(result < 0).assertTrue(); + done(); + } ); - done(); }); /**