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

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

Issue 10871005: Make ClassFinalizer indifferent on whether we are generating a snapshot or not. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | runtime/vm/dart_api_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "platform/assert.h" 5 #include "platform/assert.h"
6 #include "vm/class_finalizer.h" 6 #include "vm/class_finalizer.h"
7 #include "vm/symbols.h" 7 #include "vm/symbols.h"
8 #include "vm/unit_test.h" 8 #include "vm/unit_test.h"
9 9
10 namespace dart { 10 namespace dart {
(...skipping 30 matching lines...) Expand all
41 pending_classes.Add(*classes_2[1]); 41 pending_classes.Add(*classes_2[1]);
42 classes_2.Add(&Class::ZoneHandle(CreateTestClass("Alfa"))); 42 classes_2.Add(&Class::ZoneHandle(CreateTestClass("Alfa")));
43 pending_classes.Add(*classes_2[2]); 43 pending_classes.Add(*classes_2[2]);
44 EXPECT(ClassFinalizer::FinalizePendingClasses()); 44 EXPECT(ClassFinalizer::FinalizePendingClasses());
45 for (int i = 0; i < classes_1.length(); i++) { 45 for (int i = 0; i < classes_1.length(); i++) {
46 EXPECT(classes_1[i]->is_finalized()); 46 EXPECT(classes_1[i]->is_finalized());
47 } 47 }
48 for (int i = 0; i < classes_2.length(); i++) { 48 for (int i = 0; i < classes_2.length(); i++) {
49 EXPECT(classes_2[i]->is_finalized()); 49 EXPECT(classes_2[i]->is_finalized());
50 } 50 }
51 EXPECT(ClassFinalizer::AllClassesFinalized());
51 EXPECT(ClassFinalizer::FinalizePendingClasses()); 52 EXPECT(ClassFinalizer::FinalizePendingClasses());
52 } 53 }
53 54
54 55
55 TEST_CASE(ClassFinalize_Cycles) { 56 TEST_CASE(ClassFinalize_Cycles) {
56 Isolate* isolate = Isolate::Current(); 57 Isolate* isolate = Isolate::Current();
57 ObjectStore* object_store = isolate->object_store(); 58 ObjectStore* object_store = isolate->object_store();
58 const GrowableObjectArray& pending_classes = 59 const GrowableObjectArray& pending_classes =
59 GrowableObjectArray::Handle(isolate, object_store->pending_classes()); 60 GrowableObjectArray::Handle(isolate, object_store->pending_classes());
60 GrowableArray<const Class*> classes; 61 GrowableArray<const Class*> classes;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 Scanner::kDummyTokenIndex)); 97 Scanner::kDummyTokenIndex));
97 const TypeArguments& type_arguments = TypeArguments::Handle(); 98 const TypeArguments& type_arguments = TypeArguments::Handle();
98 rhb.set_super_type(Type::Handle( 99 rhb.set_super_type(Type::Handle(
99 Type::New(Object::Handle(unresolved.raw()), 100 Type::New(Object::Handle(unresolved.raw()),
100 type_arguments, 101 type_arguments,
101 Scanner::kDummyTokenIndex))); 102 Scanner::kDummyTokenIndex)));
102 EXPECT(ClassFinalizer::FinalizePendingClasses()); 103 EXPECT(ClassFinalizer::FinalizePendingClasses());
103 } 104 }
104 105
105 } // namespace dart 106 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | runtime/vm/dart_api_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698