| Index: test/cctest/test-debug.cc
|
| diff --git a/test/cctest/test-debug.cc b/test/cctest/test-debug.cc
|
| index 9d63e7b3a6d47eb7e59a9ff2a0f490a2f557e8a4..386e32c30c2a307599a13090616c0c769e70cbce 100644
|
| --- a/test/cctest/test-debug.cc
|
| +++ b/test/cctest/test-debug.cc
|
| @@ -319,6 +319,11 @@ static void ChangeBreakOnExceptionFromJS(v8::Isolate* isolate, bool caught,
|
| }
|
| }
|
|
|
| +// Change break on exception using the native API call.
|
| +static void ChangeBreakOnExceptionFromAPI(v8::Isolate* isolate,
|
| + v8::ExceptionBreakState state) {
|
| + v8::Debug::ChangeBreakOnException(isolate, state);
|
| +}
|
|
|
| // Prepare to step to next break location.
|
| static void PrepareStep(StepAction step_action) {
|
| @@ -3986,6 +3991,46 @@ TEST(BreakOnException) {
|
| edgeCaseFinally->Call(context, env->Global(), 0, NULL).ToLocalChecked();
|
| DebugEventCounterCheck(4, 3, 2);
|
|
|
| + // No break on exception using native API
|
| + DebugEventCounterClear();
|
| + MessageCallbackCountClear();
|
| + ChangeBreakOnExceptionFromAPI(env->GetIsolate(), v8::NoBreakOnException);
|
| + caught->Call(context, env->Global(), 0, NULL).ToLocalChecked();
|
| + DebugEventCounterCheck(0, 0, 0);
|
| + CHECK(notCaught->Call(context, env->Global(), 0, NULL).IsEmpty());
|
| + DebugEventCounterCheck(0, 0, 1);
|
| + CHECK(notCaughtFinally->Call(context, env->Global(), 0, NULL).IsEmpty());
|
| + DebugEventCounterCheck(0, 0, 2);
|
| + edgeCaseFinally->Call(context, env->Global(), 0, NULL).ToLocalChecked();
|
| + DebugEventCounterCheck(0, 0, 2);
|
| +
|
| + // // Break on uncaught exception using native API
|
| + DebugEventCounterClear();
|
| + MessageCallbackCountClear();
|
| + ChangeBreakOnExceptionFromAPI(env->GetIsolate(),
|
| + v8::BreakOnUncaughtException);
|
| + caught->Call(context, env->Global(), 0, NULL).ToLocalChecked();
|
| + DebugEventCounterCheck(0, 0, 0);
|
| + CHECK(notCaught->Call(context, env->Global(), 0, NULL).IsEmpty());
|
| + DebugEventCounterCheck(1, 1, 1);
|
| + CHECK(notCaughtFinally->Call(context, env->Global(), 0, NULL).IsEmpty());
|
| + DebugEventCounterCheck(2, 2, 2);
|
| + edgeCaseFinally->Call(context, env->Global(), 0, NULL).ToLocalChecked();
|
| + DebugEventCounterCheck(3, 3, 2);
|
| +
|
| + // // Break on exception and uncaught exception using native API
|
| + DebugEventCounterClear();
|
| + MessageCallbackCountClear();
|
| + ChangeBreakOnExceptionFromAPI(env->GetIsolate(), v8::BreakOnAnyException);
|
| + caught->Call(context, env->Global(), 0, NULL).ToLocalChecked();
|
| + DebugEventCounterCheck(1, 0, 0);
|
| + CHECK(notCaught->Call(context, env->Global(), 0, NULL).IsEmpty());
|
| + DebugEventCounterCheck(2, 1, 1);
|
| + CHECK(notCaughtFinally->Call(context, env->Global(), 0, NULL).IsEmpty());
|
| + DebugEventCounterCheck(3, 2, 2);
|
| + edgeCaseFinally->Call(context, env->Global(), 0, NULL).ToLocalChecked();
|
| + DebugEventCounterCheck(4, 3, 2);
|
| +
|
| v8::Debug::SetDebugEventListener(env->GetIsolate(), nullptr);
|
| CheckDebuggerUnloaded(env->GetIsolate());
|
| env->GetIsolate()->RemoveMessageListeners(MessageCallbackCount);
|
|
|