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

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

Issue 1324153005: Version 4.6.85.14 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@4.6
Patch Set: Created 5 years, 3 months 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
« no previous file with comments | « src/debug/debug.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7606 matching lines...) Expand 10 before | Expand all | Expand 10 after
7617 "let y = 2; \n" 7617 "let y = 2; \n"
7618 "debugger; \n" 7618 "debugger; \n"
7619 "x * y", 7619 "x * y",
7620 30); 7620 30);
7621 ExpectInt32( 7621 ExpectInt32(
7622 "x = 1; y = 2; \n" 7622 "x = 1; y = 2; \n"
7623 "debugger;" 7623 "debugger;"
7624 "x * y", 7624 "x * y",
7625 30); 7625 30);
7626 } 7626 }
7627
7628 static int after_compile_handler_depth = 0;
7629 static void HandleInterrupt(v8::Isolate* isolate, void* data) {
7630 CHECK_EQ(0, after_compile_handler_depth);
7631 }
7632
7633 static void NoInterruptsOnDebugEvent(
7634 const v8::Debug::EventDetails& event_details) {
7635 if (event_details.GetEvent() != v8::AfterCompile) return;
7636 ++after_compile_handler_depth;
7637 // Do not allow nested AfterCompile events.
7638 CHECK(after_compile_handler_depth <= 1);
7639 v8::Isolate* isolate = event_details.GetEventContext()->GetIsolate();
7640 isolate->RequestInterrupt(&HandleInterrupt, nullptr);
7641 CompileRun("function foo() {}; foo();");
7642 --after_compile_handler_depth;
7643 }
7644
7645
7646 TEST(NoInterruptsInDebugListener) {
7647 DebugLocalContext env;
7648 v8::Debug::SetDebugEventListener(NoInterruptsOnDebugEvent);
7649 CompileRun("void(0);");
7650 }
OLDNEW
« no previous file with comments | « src/debug/debug.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698