Reviewers: Mads Ager, Søren Gjesse,

Description:
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

Please review this at http://codereview.chromium.org/384120

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
   M     test/cctest/test-debug.cc


Index: test/cctest/test-debug.cc
===================================================================
--- test/cctest/test-debug.cc   (revision 3300)
+++ test/cctest/test-debug.cc   (working copy)
@@ -2728,6 +2728,36 @@
  }


+// 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
  // of debug event exception callbacks and message callbacks are collected.  
The
  // number of debug event exception callbacks are used to check that the



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

Reply via email to