| 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_api.h" | 5 #include "include/dart_api.h" |
| 6 #include "platform/assert.h" | 6 #include "platform/assert.h" |
| 7 #include "vm/class_finalizer.h" | 7 #include "vm/class_finalizer.h" |
| 8 #include "vm/compiler.h" | 8 #include "vm/compiler.h" |
| 9 #include "vm/dart_api_impl.h" | 9 #include "vm/dart_api_impl.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 "class StackFrameTest {" | 233 "class StackFrameTest {" |
| 234 " static testMain() {" | 234 " static testMain() {" |
| 235 " Second obj = new Second();" | 235 " Second obj = new Second();" |
| 236 " obj.method1(1);" | 236 " obj.method1(1);" |
| 237 " obj.method1(2);" | 237 " obj.method1(2);" |
| 238 " }" | 238 " }" |
| 239 "}"; | 239 "}"; |
| 240 Dart_Handle lib = TestCase::LoadTestScript( | 240 Dart_Handle lib = TestCase::LoadTestScript( |
| 241 kScriptChars, | 241 kScriptChars, |
| 242 reinterpret_cast<Dart_NativeEntryResolver>(native_lookup)); | 242 reinterpret_cast<Dart_NativeEntryResolver>(native_lookup)); |
| 243 Dart_Handle cls = Dart_GetClass(lib, Dart_NewString("StackFrameTest")); | 243 Dart_Handle cls = Dart_GetClass(lib, NewString("StackFrameTest")); |
| 244 EXPECT_VALID(Dart_Invoke(cls, Dart_NewString("testMain"), 0, NULL)); | 244 EXPECT_VALID(Dart_Invoke(cls, NewString("testMain"), 0, NULL)); |
| 245 } | 245 } |
| 246 | 246 |
| 247 | 247 |
| 248 // Unit test case to verify stack frame iteration. | 248 // Unit test case to verify stack frame iteration. |
| 249 TEST_CASE(ValidateNoSuchMethodStackFrameIteration) { | 249 TEST_CASE(ValidateNoSuchMethodStackFrameIteration) { |
| 250 const char* kScriptChars = | 250 const char* kScriptChars = |
| 251 "class StackFrame {" | 251 "class StackFrame {" |
| 252 " static equals(var obj1, var obj2) native \"StackFrame_equals\";" | 252 " static equals(var obj1, var obj2) native \"StackFrame_equals\";" |
| 253 " static int frameCount() native \"StackFrame_frameCount\";" | 253 " static int frameCount() native \"StackFrame_frameCount\";" |
| 254 " static int dartFrameCount() native \"StackFrame_dartFrameCount\";" | 254 " static int dartFrameCount() native \"StackFrame_dartFrameCount\";" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 276 " return 5;" | 276 " return 5;" |
| 277 " }" | 277 " }" |
| 278 " static testMain() {" | 278 " static testMain() {" |
| 279 " var obj = new StackFrame2Test();" | 279 " var obj = new StackFrame2Test();" |
| 280 " StackFrame.equals(5, obj.foo(101, 202));" | 280 " StackFrame.equals(5, obj.foo(101, 202));" |
| 281 " }" | 281 " }" |
| 282 "}"; | 282 "}"; |
| 283 Dart_Handle lib = TestCase::LoadTestScript( | 283 Dart_Handle lib = TestCase::LoadTestScript( |
| 284 kScriptChars, | 284 kScriptChars, |
| 285 reinterpret_cast<Dart_NativeEntryResolver>(native_lookup)); | 285 reinterpret_cast<Dart_NativeEntryResolver>(native_lookup)); |
| 286 Dart_Handle cls = Dart_GetClass(lib, Dart_NewString("StackFrame2Test")); | 286 Dart_Handle cls = Dart_GetClass(lib, NewString("StackFrame2Test")); |
| 287 EXPECT_VALID(Dart_Invoke(cls, Dart_NewString("testMain"), 0, NULL)); | 287 EXPECT_VALID(Dart_Invoke(cls, NewString("testMain"), 0, NULL)); |
| 288 } | 288 } |
| 289 #endif // TARGET_ARCH_IA32 || TARGET_ARCH_X64. | 289 #endif // TARGET_ARCH_IA32 || TARGET_ARCH_X64. |
| 290 | 290 |
| 291 } // namespace dart | 291 } // namespace dart |
| OLD | NEW |