Revision: 3305
Author: [email protected]
Date: Fri Nov 13 06:04:08 2009
Log: Test that pause can be set in script and won't lead to crash when  
execution is resumed.

The test currently fails on v8 trunk if the new compiler is used. The issue  
seems to be fixed on bleeding_edge so there is no changes to src, just test.

Cromium bug: http://crbug.com/26686
Review URL: http://codereview.chromium.org/384120
http://code.google.com/p/v8/source/detail?r=3305

Modified:
  /branches/bleeding_edge/test/cctest/test-debug.cc

=======================================
--- /branches/bleeding_edge/test/cctest/test-debug.cc   Wed Nov 11 01:50:06  
2009
+++ /branches/bleeding_edge/test/cctest/test-debug.cc   Fri Nov 13 06:04:08  
2009
@@ -2726,6 +2726,37 @@
    v8::Debug::SetDebugEventListener(NULL);
    CheckDebuggerUnloaded();
  }
+
+
+// Tests that breakpoint will be hit if it's set in script.
+TEST(PauseInScript) {
+  v8::HandleScope scope;
+  DebugLocalContext env;
+  env.ExposeDebug();
+
+  // Register a debug event listener which counts.
+  v8::Debug::SetDebugEventListener(DebugEventCounter);
+
+  // Create a script that returns a function.
+  const char* src = "(function (evt) {})";
+  const char* script_name = "StepInHandlerTest";
+
+  // Set breakpoint in the script.
+  SetScriptBreakPointByNameFromJS(script_name, 0, -1);
+  break_point_hit_count = 0;
+
+  v8::ScriptOrigin origin(v8::String::New(script_name),  
v8::Integer::New(0));
+  v8::Handle<v8::Script> script = v8::Script::Compile(v8::String::New(src),
+                                                      &origin);
+  v8::Local<v8::Value> r = script->Run();
+
+  CHECK(r->IsFunction());
+  CHECK_EQ(1, break_point_hit_count );
+
+  // Get rid of the debug event listener.
+  v8::Debug::SetDebugEventListener(NULL);
+  CheckDebuggerUnloaded();
+}


  // Test break on exceptions. For each exception break combination the  
number

--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to