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 "bin/builtin.h" | 5 #include "bin/builtin.h" |
6 #include "include/dart_api.h" | 6 #include "include/dart_api.h" |
7 #include "include/dart_mirrors_api.h" | 7 #include "include/dart_mirrors_api.h" |
8 #include "include/dart_native_api.h" | 8 #include "include/dart_native_api.h" |
9 #include "include/dart_tools_api.h" | 9 #include "include/dart_tools_api.h" |
10 #include "platform/assert.h" | 10 #include "platform/assert.h" |
(...skipping 2801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2812 | 2812 |
2813 UNIT_TEST_CASE(WeakPersistentHandlesCallbackShutdown) { | 2813 UNIT_TEST_CASE(WeakPersistentHandlesCallbackShutdown) { |
2814 TestCase::CreateTestIsolate(); | 2814 TestCase::CreateTestIsolate(); |
2815 Dart_EnterScope(); | 2815 Dart_EnterScope(); |
2816 Dart_Handle ref = Dart_True(); | 2816 Dart_Handle ref = Dart_True(); |
2817 int peer = 1234; | 2817 int peer = 1234; |
2818 Dart_NewWeakPersistentHandle(ref, | 2818 Dart_NewWeakPersistentHandle(ref, |
2819 &peer, | 2819 &peer, |
2820 0, | 2820 0, |
2821 WeakPersistentHandlePeerFinalizer); | 2821 WeakPersistentHandlePeerFinalizer); |
| 2822 Dart_ExitScope(); |
2822 Dart_ShutdownIsolate(); | 2823 Dart_ShutdownIsolate(); |
2823 EXPECT(peer == 42); | 2824 EXPECT(peer == 42); |
2824 } | 2825 } |
2825 | 2826 |
2826 | 2827 |
2827 TEST_CASE(WeakPersistentHandleExternalAllocationSize) { | 2828 TEST_CASE(WeakPersistentHandleExternalAllocationSize) { |
2828 Heap* heap = Isolate::Current()->heap(); | 2829 Heap* heap = Isolate::Current()->heap(); |
2829 EXPECT(heap->ExternalInWords(Heap::kNew) == 0); | 2830 EXPECT(heap->ExternalInWords(Heap::kNew) == 0); |
2830 EXPECT(heap->ExternalInWords(Heap::kOld) == 0); | 2831 EXPECT(heap->ExternalInWords(Heap::kOld) == 0); |
2831 Dart_WeakPersistentHandle weak1 = NULL; | 2832 Dart_WeakPersistentHandle weak1 = NULL; |
(...skipping 6930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9762 EXPECT_SUBSTRING("\"function\":\"::_main\"", buffer); | 9763 EXPECT_SUBSTRING("\"function\":\"::_main\"", buffer); |
9763 | 9764 |
9764 // Heartbeat test for new events. | 9765 // Heartbeat test for new events. |
9765 EXPECT_SUBSTRING("\"name\":\"TestVMDuration2\"", buffer); | 9766 EXPECT_SUBSTRING("\"name\":\"TestVMDuration2\"", buffer); |
9766 EXPECT_SUBSTRING("\"function\":\"::_bar\"", buffer); | 9767 EXPECT_SUBSTRING("\"function\":\"::_bar\"", buffer); |
9767 } | 9768 } |
9768 | 9769 |
9769 #endif // !PRODUCT | 9770 #endif // !PRODUCT |
9770 | 9771 |
9771 } // namespace dart | 9772 } // namespace dart |
OLD | NEW |