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

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

Issue 287873005: 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 1ee4810237715aae7e7126135e5cd29c3c66c521..0bad720426dd7711fdc318cb46c3aef85aa362e5 100644
--- a/test/cctest/test-debug.cc
+++ b/test/cctest/test-debug.cc
@@ -99,10 +99,11 @@ 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.
- debug->Load();
- debug->debug_context()->set_security_token(
+ CHECK(isolate->debug()->Load());
+ Handle<v8::internal::Context> debug_context =
+ isolate->debug()->debug_context();
+ debug_context->set_security_token(
v8::Utils::OpenHandle(*context_)->security_token());
Handle<JSGlobalProxy> global(Handle<JSGlobalProxy>::cast(
@@ -110,7 +111,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->debug_context()->global_proxy(), isolate),
+ Handle<Object>(debug_context->global_proxy(), isolate),
DONT_ENUM,
::v8::internal::SLOPPY).Check();
}
@@ -422,12 +423,6 @@ void CheckDebuggerUnloaded(bool check_functions) {
}
-void ForceUnloadDebugger() {
- CcTest::i_isolate()->debugger()->never_unload_debugger_ = false;
- CcTest::i_isolate()->debugger()->UnloadDebugger();
-}
-
-
} } // namespace v8::internal
@@ -5501,13 +5496,12 @@ static void CheckDataParameter(
v8::String::NewFromUtf8(args.GetIsolate(), "Test");
CHECK(v8::Debug::Call(debugger_call_with_data, data)->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());
+ 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());
+ }
}
@@ -6873,9 +6867,11 @@ 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