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

Side by Side Diff: packages/initialize/test/initializer_test.dart

Issue 1400473008: Roll Observatory packages and add a roll script (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 years, 2 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
OLDNEW
(Empty)
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
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.
4 @initializeTracker
5 library initialize.initializer_test;
6
7 import 'foo/bar.dart';
8 import 'package:initialize/src/initialize_tracker.dart';
9 import 'package:initialize/initialize.dart';
10 import 'package:test_package/foo.dart';
11 import 'package:unittest/unittest.dart';
12 import 'package:unittest/compact_vm_config.dart';
13
14 main() {
15 useCompactVMConfiguration();
16
17 // Run all initializers.
18 run().then((_) {
19 test('annotations are seen in post-order with superclasses first', () {
20 var expectedNames = [
21 const LibraryIdentifier(#initialize.test.foo, null, 'foo.dart'),
22 fooBar,
23 foo,
24 Foo,
25 const LibraryIdentifier(#initialize.test.foo.bar, null, 'foo/bar.dart'),
26 bar,
27 Bar,
28 const LibraryIdentifier(#test_package.bar, 'test_package', 'bar.dart'),
29 const LibraryIdentifier(#test_package.foo, 'test_package', 'foo.dart'),
30 const LibraryIdentifier(
31 #initialize.initializer_test, null, 'initializer_test.dart'),
32 zap,
33 Zoop, // Zap extends Zoop, so Zoop comes first.
34 Zap,
35 ];
36 expect(InitializeTracker.seen, expectedNames);
37 });
38
39 test('annotations only run once', () {
40 // Run the initializers again, should be a no-op.
41 var originalSize = InitializeTracker.seen.length;
42 return run().then((_) {
43 expect(InitializeTracker.seen.length, originalSize);
44 });
45 });
46 });
47 }
48
49 @initializeTracker
50 class Zoop {}
51
52 @initializeTracker
53 class Zap extends Zoop {}
54
55 @initializeTracker
56 zap() {}
OLDNEW
« no previous file with comments | « packages/initialize/test/initializer_super_test.dart ('k') | packages/initialize/test/initializer_type_filter_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698