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

Side by Side Diff: runtime/vm/parser_test.cc

Issue 1978603002: Remove DebuggerEvent. Refactor remaining code. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: before landing Created 4 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/object_test.cc ('k') | runtime/vm/service.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 5
6 #include "vm/ast_printer.h" 6 #include "vm/ast_printer.h"
7 #include "vm/class_finalizer.h" 7 #include "vm/class_finalizer.h"
8 #include "vm/debugger.h" 8 #include "vm/debugger.h"
9 #include "vm/longjump.h" 9 #include "vm/longjump.h"
10 #include "vm/object.h" 10 #include "vm/object.h"
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 241
242 242
243 // Uses the debugger to pause the program and capture the variable 243 // Uses the debugger to pause the program and capture the variable
244 // descriptors for all frames on the stack. 244 // descriptors for all frames on the stack.
245 static const char* CaptureVarsAtLine(Dart_Handle lib, 245 static const char* CaptureVarsAtLine(Dart_Handle lib,
246 const char* entry, 246 const char* entry,
247 int line) { 247 int line) {
248 EXPECT(ClassFinalizer::ProcessPendingClasses()); 248 EXPECT(ClassFinalizer::ProcessPendingClasses());
249 bool saved_flag = FLAG_show_invisible_frames; 249 bool saved_flag = FLAG_show_invisible_frames;
250 FLAG_show_invisible_frames = true; 250 FLAG_show_invisible_frames = true;
251 Isolate* isolate = Isolate::Current();
252 Debugger* debugger = isolate->debugger();
253 const String& url = String::Handle(String::New(TestCase::url()));
254 Dart_SetPausedEventHandler(SaveVars); 251 Dart_SetPausedEventHandler(SaveVars);
255 debugger->SetBreakpointAtLine(url, line); 252 EXPECT_VALID(Dart_SetBreakpoint(NewString(TestCase::url()), line));
256 saved_vars = NULL; 253 saved_vars = NULL;
257 EXPECT_VALID(Dart_Invoke(lib, NewString(entry), 0, NULL)); 254 EXPECT_VALID(Dart_Invoke(lib, NewString(entry), 0, NULL));
258 const char* tmp = saved_vars; 255 const char* tmp = saved_vars;
259 saved_vars = NULL; 256 saved_vars = NULL;
260 FLAG_show_invisible_frames = saved_flag; 257 FLAG_show_invisible_frames = saved_flag;
261 return tmp; 258 return tmp;
262 } 259 }
263 260
264 261
265 TEST_CASE(Parser_AllocateVariables_CapturedVar) { 262 TEST_CASE(Parser_AllocateVariables_CapturedVar) {
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 " name=:current_context_var\n" 570 " name=:current_context_var\n"
574 " 1 ContextLevel level=1 scope=2 begin=3 end=79\n" 571 " 1 ContextLevel level=1 scope=2 begin=3 end=79\n"
575 " 2 ContextVar level=1 begin=9 end=79 name=x\n" 572 " 2 ContextVar level=1 begin=9 end=79 name=x\n"
576 " 3 StackVar scope=2 begin=11 end=79 name=b\n", 573 " 3 StackVar scope=2 begin=11 end=79 name=b\n",
577 CaptureVarsAtLine(lib, "a", 10)); 574 CaptureVarsAtLine(lib, "a", 10));
578 } 575 }
579 576
580 #endif // !PRODUCT 577 #endif // !PRODUCT
581 578
582 } // namespace dart 579 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object_test.cc ('k') | runtime/vm/service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698