From 77584bfba17c112d7391d46918012479ea1b6ba0 Mon Sep 17 00:00:00 2001 From: fangting Date: Fri, 1 Nov 2024 16:13:34 +0800 Subject: [PATCH] testcase add Issue: #IB1GSV Signed-off-by: fangting --- tooling/test/debugger_impl_test.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tooling/test/debugger_impl_test.cpp b/tooling/test/debugger_impl_test.cpp index 0fbb8811..d318d8df 100644 --- a/tooling/test/debugger_impl_test.cpp +++ b/tooling/test/debugger_impl_test.cpp @@ -127,6 +127,28 @@ HWTEST_F_L0(DebuggerImplTest, NotifyScriptParsed__002) } } +HWTEST_F_L0(DebuggerImplTest, NotifyScriptParsed__003) +{ + std::string outStrForCallbackCheck = ""; + std::function callback = + [&outStrForCallbackCheck]([[maybe_unused]] const void *ptr, const std::string &inStrOfReply) { + outStrForCallbackCheck = inStrOfReply;}; + ProtocolChannel *protocolChannel = new ProtocolHandler(callback, ecmaVm); + auto runtimeImpl = std::make_unique(ecmaVm, protocolChannel); + auto debuggerImpl = std::make_unique(ecmaVm, protocolChannel, runtimeImpl.get()); + ecmaVm->GetJsDebuggerManager()->SetIsDebugApp(true); + ecmaVm->GetJsDebuggerManager()->SetDebugMode(false); + // DebuggerImpl::NotifyScriptParsed -- fileName.substr(0, DATA_APP_PATH.length()) != DATA_APP_PATH + std::string strFilename = ""; + EXPECT_FALSE(debuggerImpl->NotifyScriptParsed(strFilename, "")); + ecmaVm->GetJsDebuggerManager()->SetIsDebugApp(false); + ecmaVm->GetJsDebuggerManager()->SetDebugMode(false); + if (protocolChannel) { + delete protocolChannel; + protocolChannel = nullptr; + } +} + HWTEST_F_L0(DebuggerImplTest, GenerateCallFrames__001) { } -- Gitee