Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Side by Side Diff: test/cctest/test-debug.cc

Issue 2549133002: [debug] Remove DebugInterface class (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 } 305 }
306 if (uncaught) { 306 if (uncaught) {
307 CompileRunChecked(isolate, "debug.Debug.setBreakOnUncaughtException()"); 307 CompileRunChecked(isolate, "debug.Debug.setBreakOnUncaughtException()");
308 } else { 308 } else {
309 CompileRunChecked(isolate, "debug.Debug.clearBreakOnUncaughtException()"); 309 CompileRunChecked(isolate, "debug.Debug.clearBreakOnUncaughtException()");
310 } 310 }
311 } 311 }
312 312
313 // Change break on exception using the native API call. 313 // Change break on exception using the native API call.
314 static void ChangeBreakOnExceptionFromAPI( 314 static void ChangeBreakOnExceptionFromAPI(
315 v8::Isolate* isolate, v8::DebugInterface::ExceptionBreakState state) { 315 v8::Isolate* isolate, v8::debug::ExceptionBreakState state) {
316 v8::DebugInterface::ChangeBreakOnException(isolate, state); 316 v8::debug::DebugInterface::ChangeBreakOnException(isolate, state);
317 } 317 }
318 318
319 // Prepare to step to next break location. 319 // Prepare to step to next break location.
320 static void PrepareStep(StepAction step_action) { 320 static void PrepareStep(StepAction step_action) {
321 v8::internal::Debug* debug = CcTest::i_isolate()->debug(); 321 v8::internal::Debug* debug = CcTest::i_isolate()->debug();
322 debug->PrepareStep(step_action); 322 debug->PrepareStep(step_action);
323 } 323 }
324 324
325 325
326 static void ClearStepping() { CcTest::i_isolate()->debug()->ClearStepping(); } 326 static void ClearStepping() { CcTest::i_isolate()->debug()->ClearStepping(); }
(...skipping 3484 matching lines...) Expand 10 before | Expand all | Expand 10 after
3811 DebugEventCounterCheck(2, 1, 1); 3811 DebugEventCounterCheck(2, 1, 1);
3812 CHECK(notCaughtFinally->Call(context, env->Global(), 0, NULL).IsEmpty()); 3812 CHECK(notCaughtFinally->Call(context, env->Global(), 0, NULL).IsEmpty());
3813 DebugEventCounterCheck(3, 2, 2); 3813 DebugEventCounterCheck(3, 2, 2);
3814 edgeCaseFinally->Call(context, env->Global(), 0, NULL).ToLocalChecked(); 3814 edgeCaseFinally->Call(context, env->Global(), 0, NULL).ToLocalChecked();
3815 DebugEventCounterCheck(4, 3, 2); 3815 DebugEventCounterCheck(4, 3, 2);
3816 3816
3817 // No break on exception using native API 3817 // No break on exception using native API
3818 DebugEventCounterClear(); 3818 DebugEventCounterClear();
3819 MessageCallbackCountClear(); 3819 MessageCallbackCountClear();
3820 ChangeBreakOnExceptionFromAPI(env->GetIsolate(), 3820 ChangeBreakOnExceptionFromAPI(env->GetIsolate(),
3821 v8::DebugInterface::NoBreakOnException); 3821 v8::debug::NoBreakOnException);
3822 caught->Call(context, env->Global(), 0, NULL).ToLocalChecked(); 3822 caught->Call(context, env->Global(), 0, NULL).ToLocalChecked();
3823 DebugEventCounterCheck(0, 0, 0); 3823 DebugEventCounterCheck(0, 0, 0);
3824 CHECK(notCaught->Call(context, env->Global(), 0, NULL).IsEmpty()); 3824 CHECK(notCaught->Call(context, env->Global(), 0, NULL).IsEmpty());
3825 DebugEventCounterCheck(0, 0, 1); 3825 DebugEventCounterCheck(0, 0, 1);
3826 CHECK(notCaughtFinally->Call(context, env->Global(), 0, NULL).IsEmpty()); 3826 CHECK(notCaughtFinally->Call(context, env->Global(), 0, NULL).IsEmpty());
3827 DebugEventCounterCheck(0, 0, 2); 3827 DebugEventCounterCheck(0, 0, 2);
3828 edgeCaseFinally->Call(context, env->Global(), 0, NULL).ToLocalChecked(); 3828 edgeCaseFinally->Call(context, env->Global(), 0, NULL).ToLocalChecked();
3829 DebugEventCounterCheck(0, 0, 2); 3829 DebugEventCounterCheck(0, 0, 2);
3830 3830
3831 // // Break on uncaught exception using native API 3831 // // Break on uncaught exception using native API
3832 DebugEventCounterClear(); 3832 DebugEventCounterClear();
3833 MessageCallbackCountClear(); 3833 MessageCallbackCountClear();
3834 ChangeBreakOnExceptionFromAPI(env->GetIsolate(), 3834 ChangeBreakOnExceptionFromAPI(env->GetIsolate(),
3835 v8::DebugInterface::BreakOnUncaughtException); 3835 v8::debug::BreakOnUncaughtException);
3836 caught->Call(context, env->Global(), 0, NULL).ToLocalChecked(); 3836 caught->Call(context, env->Global(), 0, NULL).ToLocalChecked();
3837 DebugEventCounterCheck(0, 0, 0); 3837 DebugEventCounterCheck(0, 0, 0);
3838 CHECK(notCaught->Call(context, env->Global(), 0, NULL).IsEmpty()); 3838 CHECK(notCaught->Call(context, env->Global(), 0, NULL).IsEmpty());
3839 DebugEventCounterCheck(1, 1, 1); 3839 DebugEventCounterCheck(1, 1, 1);
3840 CHECK(notCaughtFinally->Call(context, env->Global(), 0, NULL).IsEmpty()); 3840 CHECK(notCaughtFinally->Call(context, env->Global(), 0, NULL).IsEmpty());
3841 DebugEventCounterCheck(2, 2, 2); 3841 DebugEventCounterCheck(2, 2, 2);
3842 edgeCaseFinally->Call(context, env->Global(), 0, NULL).ToLocalChecked(); 3842 edgeCaseFinally->Call(context, env->Global(), 0, NULL).ToLocalChecked();
3843 DebugEventCounterCheck(3, 3, 2); 3843 DebugEventCounterCheck(3, 3, 2);
3844 3844
3845 // // Break on exception and uncaught exception using native API 3845 // // Break on exception and uncaught exception using native API
3846 DebugEventCounterClear(); 3846 DebugEventCounterClear();
3847 MessageCallbackCountClear(); 3847 MessageCallbackCountClear();
3848 ChangeBreakOnExceptionFromAPI(env->GetIsolate(), 3848 ChangeBreakOnExceptionFromAPI(env->GetIsolate(),
3849 v8::DebugInterface::BreakOnAnyException); 3849 v8::debug::BreakOnAnyException);
3850 caught->Call(context, env->Global(), 0, NULL).ToLocalChecked(); 3850 caught->Call(context, env->Global(), 0, NULL).ToLocalChecked();
3851 DebugEventCounterCheck(1, 0, 0); 3851 DebugEventCounterCheck(1, 0, 0);
3852 CHECK(notCaught->Call(context, env->Global(), 0, NULL).IsEmpty()); 3852 CHECK(notCaught->Call(context, env->Global(), 0, NULL).IsEmpty());
3853 DebugEventCounterCheck(2, 1, 1); 3853 DebugEventCounterCheck(2, 1, 1);
3854 CHECK(notCaughtFinally->Call(context, env->Global(), 0, NULL).IsEmpty()); 3854 CHECK(notCaughtFinally->Call(context, env->Global(), 0, NULL).IsEmpty());
3855 DebugEventCounterCheck(3, 2, 2); 3855 DebugEventCounterCheck(3, 2, 2);
3856 edgeCaseFinally->Call(context, env->Global(), 0, NULL).ToLocalChecked(); 3856 edgeCaseFinally->Call(context, env->Global(), 0, NULL).ToLocalChecked();
3857 DebugEventCounterCheck(4, 3, 2); 3857 DebugEventCounterCheck(4, 3, 2);
3858 3858
3859 v8::Debug::SetDebugEventListener(env->GetIsolate(), nullptr); 3859 v8::Debug::SetDebugEventListener(env->GetIsolate(), nullptr);
(...skipping 2934 matching lines...) Expand 10 before | Expand all | Expand 10 after
6794 "function foo() {\n" 6794 "function foo() {\n"
6795 " try { throw new Error(); } catch (e) {}\n" 6795 " try { throw new Error(); } catch (e) {}\n"
6796 "}\n" 6796 "}\n"
6797 "debugger;\n" 6797 "debugger;\n"
6798 "foo();\n" 6798 "foo();\n"
6799 "foo();\n"); 6799 "foo();\n");
6800 6800
6801 v8::Debug::SetDebugEventListener(env->GetIsolate(), nullptr); 6801 v8::Debug::SetDebugEventListener(env->GetIsolate(), nullptr);
6802 CHECK_EQ(break_point_hit_count, 4); 6802 CHECK_EQ(break_point_hit_count, 4);
6803 } 6803 }
OLDNEW
« src/debug/debug-interface.h ('K') | « src/inspector/wasm-translation.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698