| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 "include/dart_debugger_api.h" | 5 #include "include/dart_debugger_api.h" |
| 6 #include "platform/assert.h" | 6 #include "platform/assert.h" |
| 7 #include "vm/dart_api_impl.h" | 7 #include "vm/dart_api_impl.h" |
| 8 #include "vm/unit_test.h" | 8 #include "vm/unit_test.h" |
| 9 | 9 |
| 10 namespace dart { | 10 namespace dart { |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 " } \n" | 168 " } \n" |
| 169 " get_b() { return new B(); } \n" | 169 " get_b() { return new B(); } \n" |
| 170 " get_int() { return 666; } \n"; | 170 " get_int() { return 666; } \n"; |
| 171 | 171 |
| 172 // Number of instance fields in an object of class B. | 172 // Number of instance fields in an object of class B. |
| 173 const intptr_t kNumObjectFields = 3; | 173 const intptr_t kNumObjectFields = 3; |
| 174 | 174 |
| 175 Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL); | 175 Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL); |
| 176 EXPECT_NOT_ERROR(lib); | 176 EXPECT_NOT_ERROR(lib); |
| 177 | 177 |
| 178 Dart_Handle script_url = Dart_NewString(TestCase::url()); | |
| 179 Dart_Handle line_no = Dart_NewInteger(4); // In function 'foo'. | |
| 180 | |
| 181 Dart_Handle object_b = Invoke(lib, "get_b"); | 178 Dart_Handle object_b = Invoke(lib, "get_b"); |
| 182 | 179 |
| 183 EXPECT_NOT_ERROR(object_b); | 180 EXPECT_NOT_ERROR(object_b); |
| 184 | 181 |
| 185 Dart_Handle fields = Dart_GetInstanceFields(object_b); | 182 Dart_Handle fields = Dart_GetInstanceFields(object_b); |
| 186 EXPECT_NOT_ERROR(fields); | 183 EXPECT_NOT_ERROR(fields); |
| 187 EXPECT(Dart_IsList(fields)); | 184 EXPECT(Dart_IsList(fields)); |
| 188 intptr_t list_length = 0; | 185 intptr_t list_length = 0; |
| 189 Dart_Handle retval = Dart_ListLength(fields, &list_length); | 186 Dart_Handle retval = Dart_ListLength(fields, &list_length); |
| 190 EXPECT_NOT_ERROR(retval); | 187 EXPECT_NOT_ERROR(retval); |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 EXPECT(Dart_IsString(source)); | 337 EXPECT(Dart_IsString(source)); |
| 341 char const* source_chars; | 338 char const* source_chars; |
| 342 Dart_StringToCString(source, &source_chars); | 339 Dart_StringToCString(source, &source_chars); |
| 343 printf("\n=== source: ===\n%s", source_chars); | 340 printf("\n=== source: ===\n%s", source_chars); |
| 344 EXPECT_STREQ(kScriptChars, source_chars); | 341 EXPECT_STREQ(kScriptChars, source_chars); |
| 345 } | 342 } |
| 346 | 343 |
| 347 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). | 344 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). |
| 348 | 345 |
| 349 } // namespace dart | 346 } // namespace dart |
| OLD | NEW |