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

Side by Side Diff: packages/initialize/test/init_method_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 library initialize.init_method_test;
5
6 import 'package:initialize/initialize.dart';
7 import 'package:unittest/unittest.dart';
8 import 'package:unittest/compact_vm_config.dart';
9
10 int calledFoo = 0;
11 int calledBar = 0;
12
13 main() {
14 useCompactVMConfiguration();
15
16 // Run all initializers.
17 run().then((_) {
18 test('initMethod annotation invokes functions once', () {
19 expect(calledFoo, 1);
20 expect(calledBar, 1);
21 // Re-run all initializers, should be a no-op.
22 return run().then((_) {
23 expect(calledFoo, 1);
24 expect(calledBar, 1);
25 });
26 });
27 });
28 }
29
30 @initMethod
31 foo() => calledFoo++;
32
33 @initMethod
34 bar() => calledBar++;
OLDNEW
« no previous file with comments | « packages/initialize/test/foo/bar.dart ('k') | packages/initialize/test/initializer_custom_filter_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698