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

Unified Diff: tests/standalone/debugger/debug_lib.dart

Issue 933253003: VM: Fix issue with local variable values reported by the debugger. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: addressed comments Created 5 years, 10 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 | « runtime/vm/parser_test.cc ('k') | tests/standalone/debugger/local_variables_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/debugger/debug_lib.dart
===================================================================
--- tests/standalone/debugger/debug_lib.dart (revision 43843)
+++ tests/standalone/debugger/debug_lib.dart (working copy)
@@ -338,6 +338,43 @@
}
+// Used to check if local variables are visible.
+class AssertLocalsNotVisibleMatcher extends Command {
+ List<String> locals;
+ int frame_index;
+
+ AssertLocalsNotVisibleMatcher(this.locals, this.frame_index) {
+ template = {"id": 0, "command": "getStackTrace", "params": {"isolateId": 0}};
+ }
+
+ void matchResponse(Debugger debugger) {
+ super.matchResponse(debugger);
+
+ List frames = getJsonValue(debugger.currentMessage, "result:callFrames");
+ assert(frames != null);
+
+ String functionName = frames[frame_index]['functionName'];
+ List localsList = frames[frame_index]['locals'];
+ Map reportedLocals = {};
+ localsList.forEach((local) => reportedLocals[local['name']] = local['value']);
+ for (String key in locals) {
+ if (reportedLocals[key] != null) {
+ debugger.error("Error in $functionName(): local variable $key not "
+ "expected in scope (reported value "
+ "${reportedLocals[key]['text']})");
+ return;
+ }
+ }
+ print("Matched locals $locals");
+ }
+}
+
+
+AssertLocalsNotVisible(List<String> locals, [int frame_index = 0]) {
+ return new AssertLocalsNotVisibleMatcher(locals, frame_index);
+}
+
+
class EventMatcher {
String eventName;
Map params;
« no previous file with comments | « runtime/vm/parser_test.cc ('k') | tests/standalone/debugger/local_variables_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698