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

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

Issue 24210003: Never return a Dart_Handle on a dart::Class from the embedding API. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: . Created 7 years, 3 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 | Annotate | Revision Log
OLDNEW
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 "include/dart_mirrors_api.h" 6 #include "include/dart_mirrors_api.h"
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/dart_api_impl.h" 8 #include "vm/dart_api_impl.h"
9 #include "vm/thread.h" 9 #include "vm/thread.h"
10 #include "vm/unit_test.h" 10 #include "vm/unit_test.h"
(...skipping 945 matching lines...) Expand 10 before | Expand all | Expand 10 after
956 Dart_Handle value_handle = Dart_ListGetAt(fields, 1); 956 Dart_Handle value_handle = Dart_ListGetAt(fields, 1);
957 EXPECT_VALID(value_handle); 957 EXPECT_VALID(value_handle);
958 value_handle = Dart_ToString(value_handle); 958 value_handle = Dart_ToString(value_handle);
959 EXPECT_VALID(value_handle); 959 EXPECT_VALID(value_handle);
960 EXPECT(Dart_IsString(value_handle)); 960 EXPECT(Dart_IsString(value_handle));
961 char const* value; 961 char const* value;
962 Dart_StringToCString(value_handle, &value); 962 Dart_StringToCString(value_handle, &value);
963 EXPECT_STREQ("blah blah", value); 963 EXPECT_STREQ("blah blah", value);
964 964
965 // Check static field of B's superclass. 965 // Check static field of B's superclass.
966 Dart_Handle class_A = Dart_GetSuperclass(class_B); 966 Dart_Handle class_A = Dart_GetSupertype(class_B);
967 EXPECT_VALID(class_A); 967 EXPECT_VALID(class_A);
968 EXPECT(!Dart_IsNull(class_A)); 968 EXPECT(!Dart_IsNull(class_A));
969 fields = Dart_GetStaticFields(class_A); 969 fields = Dart_GetStaticFields(class_A);
970 EXPECT_VALID(fields); 970 EXPECT_VALID(fields);
971 EXPECT(Dart_IsList(fields)); 971 EXPECT(Dart_IsList(fields));
972 list_length = 0; 972 list_length = 0;
973 retval = Dart_ListLength(fields, &list_length); 973 retval = Dart_ListLength(fields, &list_length);
974 EXPECT_VALID(retval); 974 EXPECT_VALID(retval);
975 EXPECT_EQ(4, list_length); 975 EXPECT_EQ(4, list_length);
976 // Static field "bla" should have value "yada yada yada". 976 // Static field "bla" should have value "yada yada yada".
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after
1759 1759
1760 Dart_Handle list_type = Dart_InstanceGetType(list_access_test_obj); 1760 Dart_Handle list_type = Dart_InstanceGetType(list_access_test_obj);
1761 Dart_Handle super_type = Dart_GetSupertype(list_type); 1761 Dart_Handle super_type = Dart_GetSupertype(list_type);
1762 EXPECT(!Dart_IsError(super_type)); 1762 EXPECT(!Dart_IsError(super_type));
1763 super_type = Dart_GetSupertype(super_type); 1763 super_type = Dart_GetSupertype(super_type);
1764 EXPECT(!Dart_IsError(super_type)); 1764 EXPECT(!Dart_IsError(super_type));
1765 EXPECT(super_type == Dart_Null()); 1765 EXPECT(super_type == Dart_Null());
1766 } 1766 }
1767 1767
1768 } // namespace dart 1768 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698