Chromium Code Reviews| Index: runtime/vm/debugger_api_impl_test.cc |
| diff --git a/runtime/vm/debugger_api_impl_test.cc b/runtime/vm/debugger_api_impl_test.cc |
| index 04ad02945703de8daae73dc1cf113885cbc6dad2..be1ca507e2b0906aadd643e15bc825926997703a 100644 |
| --- a/runtime/vm/debugger_api_impl_test.cc |
| +++ b/runtime/vm/debugger_api_impl_test.cc |
| @@ -1990,6 +1990,43 @@ TEST_CASE(Debug_EvaluateExpr) { |
| } |
| +static void EvaluateInActivationOfEvaluateHandler(Dart_IsolateId isolate_id, |
| + Dart_Handle exception_object, |
| + Dart_StackTrace trace) { |
| + breakpoint_hit_counter++; |
| + Dart_ActivationFrame top_frame = 0; |
| + Dart_Handle result = Dart_GetActivationFrame(trace, 0, &top_frame); |
| + EXPECT_VALID(result); |
| + |
| + result = Dart_ActivationFrameEvaluate(top_frame, NewString("p.r")); |
| + EXPECT_VALID(result); |
| + EXPECT_EQ(5.0, ToDouble(result)); |
| +} |
| + |
| + |
| +TEST_CASE(Debug_EvaluateInActivationOfEvaluate) { |
| + // This library deliberately declares no top-level variables or methods. |
|
hausner
2014/07/10 22:57:26
Maybe add a sentence why that is significant?
rmacnak
2014/07/10 23:17:37
Added.
|
| + const char* kScriptChars = |
| + "import 'dart:math'; \n" |
| + "class Point { \n" |
| + " var x, y; \n" |
| + " Point(this.x, this.y); \n" |
| + " get r => sqrt(x*x + y*y); \n" |
| + "} \n"; |
|
hausner
2014/07/10 22:57:26
Nit: alignment.
|
| + LoadScript(kScriptChars); |
| + Dart_FinalizeLoading(); |
|
hausner
2014/07/10 22:57:26
Why not moving the FinalizeLoading call into the h
rmacnak
2014/07/10 23:17:37
Some tests fail, mostly related to snapshots.
|
| + |
| + Dart_SetExceptionThrownHandler(&EvaluateInActivationOfEvaluateHandler); |
| + Dart_SetExceptionPauseInfo(kPauseOnAllExceptions); |
| + breakpoint_hit_counter = 0; |
| + |
| + Dart_Handle result = Dart_EvaluateExpr(script_lib, NewString( |
| + "() { var p = new Point(3, 4); throw p; } ())")); |
| + EXPECT(Dart_IsError(result)); |
| + EXPECT_EQ(1, breakpoint_hit_counter); |
| +} |
| + |
| + |
| TEST_CASE(Debug_GetClosureInfo) { |
| const char* kScriptChars = |
| "void foo() { return 43; } \n" |