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

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

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 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 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
5 // TODO(jakemac): swap this to @TestOn('pub-serve') once
6 // https://github.com/dart-lang/test/issues/388 is completed.
7 @TestOn('!js')
4 library initialize.initializer_custom_filter_test; 8 library initialize.initializer_custom_filter_test;
5 9
6 import 'dart:async'; 10 import 'dart:async';
7 import 'package:initialize/initialize.dart'; 11 import 'package:initialize/initialize.dart';
8 import 'package:unittest/unittest.dart'; 12 import 'package:test/test.dart';
9 import 'package:unittest/compact_vm_config.dart';
10 import 'package:initialize/src/initialize_tracker.dart'; 13 import 'package:initialize/src/initialize_tracker.dart';
11 14
12 main() { 15 main() {
13 useCompactVMConfiguration();
14
15 test('filter option limits which types of annotations will be ran', () { 16 test('filter option limits which types of annotations will be ran', () {
16 var originalSize; 17 var originalSize;
17 return runPhase(1).then((_) { 18 return runPhase(1).then((_) {
18 // Even though Baz extends Bar, only Baz should be run. 19 // Even though Baz extends Bar, only Baz should be run.
19 expect(InitializeTracker.seen, [Baz]); 20 expect(InitializeTracker.seen, [Baz]);
20 }).then((_) => runPhase(2)).then((_) { 21 }).then((_) => runPhase(2)).then((_) {
21 expect(InitializeTracker.seen, [Baz, foo]); 22 expect(InitializeTracker.seen, [Baz, foo]);
22 }).then((_) => runPhase(3)).then((_) { 23 }).then((_) => runPhase(3)).then((_) {
23 expect(InitializeTracker.seen, [Baz, foo, Foo]); 24 expect(InitializeTracker.seen, [Baz, foo, Foo]);
24 }).then((_) => runPhase(4)).then((_) { 25 }).then((_) => runPhase(4)).then((_) {
(...skipping 28 matching lines...) Expand all
53 @PhasedInitializer(1) 54 @PhasedInitializer(1)
54 class Baz extends Bar {} 55 class Baz extends Bar {}
55 56
56 // Initializer that has a phase associated with it, this can be used in 57 // Initializer that has a phase associated with it, this can be used in
57 // combination with a custom filter to run intialization in phases. 58 // combination with a custom filter to run intialization in phases.
58 class PhasedInitializer extends InitializeTracker { 59 class PhasedInitializer extends InitializeTracker {
59 final int phase; 60 final int phase;
60 61
61 const PhasedInitializer(this.phase); 62 const PhasedInitializer(this.phase);
62 } 63 }
OLDNEW
« no previous file with comments | « packages/initialize/test/init_method_test.html ('k') | packages/initialize/test/initializer_custom_filter_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698