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

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

Issue 1220193009: Migrate most uses of Isolate::current_zone to Thread::zone. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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/debugger.cc ('k') | runtime/vm/deopt_instructions.cc » ('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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 #include "vm/dart_api_impl.h" 5 #include "vm/dart_api_impl.h"
6 #include "vm/debugger.h" 6 #include "vm/debugger.h"
7 #include "vm/unit_test.h" 7 #include "vm/unit_test.h"
8 8
9 namespace dart { 9 namespace dart {
10 10
11 // Search for the formatted string in buffer. 11 // Search for the formatted string in buffer.
12 // 12 //
13 // TODO(turnidge): This function obscures the line number of failing 13 // TODO(turnidge): This function obscures the line number of failing
14 // EXPECTs. Rework this. 14 // EXPECTs. Rework this.
15 static void ExpectSubstringF(const char* buff, const char* fmt, ...) { 15 static void ExpectSubstringF(const char* buff, const char* fmt, ...) {
16 Isolate* isolate = Isolate::Current();
17
18 va_list args; 16 va_list args;
19 va_start(args, fmt); 17 va_start(args, fmt);
20 intptr_t len = OS::VSNPrint(NULL, 0, fmt, args); 18 intptr_t len = OS::VSNPrint(NULL, 0, fmt, args);
21 va_end(args); 19 va_end(args);
22 20
23 char* buffer = isolate->current_zone()->Alloc<char>(len + 1); 21 char* buffer = Thread::Current()->zone()->Alloc<char>(len + 1);
24 va_list args2; 22 va_list args2;
25 va_start(args2, fmt); 23 va_start(args2, fmt);
26 OS::VSNPrint(buffer, (len + 1), fmt, args2); 24 OS::VSNPrint(buffer, (len + 1), fmt, args2);
27 va_end(args2); 25 va_end(args2);
28 26
29 EXPECT_SUBSTRING(buffer, buff); 27 EXPECT_SUBSTRING(buffer, buff);
30 } 28 }
31 29
32 30
33 TEST_CASE(Debugger_PrintBreakpointsToJSONArray) { 31 TEST_CASE(Debugger_PrintBreakpointsToJSONArray) {
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 debugger->SetBreakpointAtLine(url, 2); 129 debugger->SetBreakpointAtLine(url, 2);
132 Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL); 130 Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
133 EXPECT_VALID(result); 131 EXPECT_VALID(result);
134 EXPECT(Dart_IsString(result)); 132 EXPECT(Dart_IsString(result));
135 133
136 // We ran the code in InspectPausedEvent. 134 // We ran the code in InspectPausedEvent.
137 EXPECT(saw_paused_event); 135 EXPECT(saw_paused_event);
138 } 136 }
139 137
140 } // namespace dart 138 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/debugger.cc ('k') | runtime/vm/deopt_instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698