| 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 "platform/utils.h" | 7 #include "platform/utils.h" |
| 8 #include "vm/class_finalizer.h" | 8 #include "vm/class_finalizer.h" |
| 9 #include "vm/dart_api_impl.h" | 9 #include "vm/dart_api_impl.h" |
| 10 #include "vm/dart_api_state.h" | 10 #include "vm/dart_api_state.h" |
| (...skipping 2152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2163 "Fields test() {\n" | 2163 "Fields test() {\n" |
| 2164 " Fields.Init();\n" | 2164 " Fields.Init();\n" |
| 2165 " top_fld = 'top';\n" | 2165 " top_fld = 'top';\n" |
| 2166 " _top_fld = 'hidden top';\n" | 2166 " _top_fld = 'hidden top';\n" |
| 2167 " top_getset_fld = 'top getset';\n" | 2167 " top_getset_fld = 'top getset';\n" |
| 2168 " _top_getset_fld = 'hidden top getset';\n" | 2168 " _top_getset_fld = 'hidden top getset';\n" |
| 2169 " return new Fields();\n" | 2169 " return new Fields();\n" |
| 2170 "}\n"; | 2170 "}\n"; |
| 2171 | 2171 |
| 2172 // Shared setup. | 2172 // Shared setup. |
| 2173 Dart_Handle result; | |
| 2174 Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL); | 2173 Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL); |
| 2175 Dart_Handle cls = Dart_GetClass(lib, Dart_NewString("Fields")); | 2174 Dart_Handle cls = Dart_GetClass(lib, Dart_NewString("Fields")); |
| 2176 EXPECT_VALID(cls); | 2175 EXPECT_VALID(cls); |
| 2177 Dart_Handle instance = Dart_InvokeStatic(lib, | 2176 Dart_Handle instance = Dart_InvokeStatic(lib, |
| 2178 Dart_Null(), | 2177 Dart_Null(), |
| 2179 Dart_NewString("test"), | 2178 Dart_NewString("test"), |
| 2180 0, | 2179 0, |
| 2181 NULL); | 2180 NULL); |
| 2182 EXPECT_VALID(instance); | 2181 EXPECT_VALID(instance); |
| 2183 Dart_Handle name; | 2182 Dart_Handle name; |
| 2184 int64_t value = 0; | |
| 2185 | 2183 |
| 2186 // Instance field. | 2184 // Instance field. |
| 2187 name = Dart_NewString("instance_fld"); | 2185 name = Dart_NewString("instance_fld"); |
| 2188 TestFieldNotFound(lib, name); | 2186 TestFieldNotFound(lib, name); |
| 2189 TestFieldNotFound(cls, name); | 2187 TestFieldNotFound(cls, name); |
| 2190 TestFieldOk(instance, name, false, "instance"); | 2188 TestFieldOk(instance, name, false, "instance"); |
| 2191 | 2189 |
| 2192 // Hidden instance field. | 2190 // Hidden instance field. |
| 2193 name = Dart_NewString("_instance_fld"); | 2191 name = Dart_NewString("_instance_fld"); |
| 2194 TestFieldNotFound(lib, name); | 2192 TestFieldNotFound(lib, name); |
| (...skipping 2309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4504 // We should have received the expected number of interrupts. | 4502 // We should have received the expected number of interrupts. |
| 4505 EXPECT_EQ(kInterruptCount, interrupt_count); | 4503 EXPECT_EQ(kInterruptCount, interrupt_count); |
| 4506 | 4504 |
| 4507 // Give the spawned thread enough time to properly exit. | 4505 // Give the spawned thread enough time to properly exit. |
| 4508 Isolate::SetInterruptCallback(saved); | 4506 Isolate::SetInterruptCallback(saved); |
| 4509 } | 4507 } |
| 4510 | 4508 |
| 4511 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). | 4509 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). |
| 4512 | 4510 |
| 4513 } // namespace dart | 4511 } // namespace dart |
| OLD | NEW |