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

Unified Diff: test/cctest/test-debug.cc

Issue 292713002: Revert "Simplify debugger state." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime.cc ('k') | test/cctest/test-heap-profiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-debug.cc
diff --git a/test/cctest/test-debug.cc b/test/cctest/test-debug.cc
index 91b610247f5a54756cb9b67d7560cdc5e50a69d7..2a2ca3e7cfd46b151742d307ea646432598b718e 100644
--- a/test/cctest/test-debug.cc
+++ b/test/cctest/test-debug.cc
@@ -98,11 +98,10 @@ class DebugLocalContext {
v8::internal::Isolate* isolate =
reinterpret_cast<v8::internal::Isolate*>(context_->GetIsolate());
v8::internal::Factory* factory = isolate->factory();
+ v8::internal::Debug* debug = isolate->debug();
// Expose the debug context global object in the global object for testing.
- CHECK(isolate->debug()->Load());
- Handle<v8::internal::Context> debug_context =
- isolate->debug()->debug_context();
- debug_context->set_security_token(
+ debug->Load();
+ debug->debug_context()->set_security_token(
v8::Utils::OpenHandle(*context_)->security_token());
Handle<JSGlobalProxy> global(Handle<JSGlobalProxy>::cast(
@@ -110,7 +109,7 @@ class DebugLocalContext {
Handle<v8::internal::String> debug_string =
factory->InternalizeOneByteString(STATIC_ASCII_VECTOR("debug"));
v8::internal::Runtime::SetObjectProperty(isolate, global, debug_string,
- Handle<Object>(debug_context->global_proxy(), isolate),
+ Handle<Object>(debug->debug_context()->global_proxy(), isolate),
DONT_ENUM,
::v8::internal::SLOPPY).Check();
}
@@ -422,6 +421,12 @@ void CheckDebuggerUnloaded(bool check_functions) {
}
+void ForceUnloadDebugger() {
+ CcTest::i_isolate()->debugger()->never_unload_debugger_ = false;
+ CcTest::i_isolate()->debugger()->UnloadDebugger();
+}
+
+
} } // namespace v8::internal
@@ -5495,12 +5500,13 @@ static void CheckDataParameter(
v8::String::NewFromUtf8(args.GetIsolate(), "Test");
CHECK(v8::Debug::Call(debugger_call_with_data, data)->IsString());
- for (int i = 0; i < 3; i++) {
- v8::TryCatch catcher;
- CHECK(v8::Debug::Call(debugger_call_with_data).IsEmpty());
- CHECK(catcher.HasCaught());
- CHECK(catcher.Exception()->IsString());
- }
+ CHECK(v8::Debug::Call(debugger_call_with_data).IsEmpty());
+ CHECK(v8::Debug::Call(debugger_call_with_data).IsEmpty());
+
+ v8::TryCatch catcher;
+ v8::Debug::Call(debugger_call_with_data);
+ CHECK(catcher.HasCaught());
+ CHECK(catcher.Exception()->IsString());
}
@@ -6866,11 +6872,9 @@ TEST(CallingContextIsNotDebugContext) {
TEST(DebugContextIsPreservedBetweenAccesses) {
v8::HandleScope scope(CcTest::isolate());
- v8::Debug::SetDebugEventListener(DebugEventBreakPointHitCount);
v8::Local<v8::Context> context1 = v8::Debug::GetDebugContext();
v8::Local<v8::Context> context2 = v8::Debug::GetDebugContext();
CHECK_EQ(*context1, *context2);
- v8::Debug::SetDebugEventListener(NULL);
}
« no previous file with comments | « src/runtime.cc ('k') | test/cctest/test-heap-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698