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

Side by Side Diff: third_party/pkg/di/benchmark/injector_benchmark_common.dart

Issue 107003007: Adding Angular's DI package & Dart unittests which test it. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years 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
(Empty)
1 library di.injector_benchmark_common;
2
3 import 'package:benchmark_harness/benchmark_harness.dart';
4 import 'package:di/di.dart';
5
6 class InjectorBenchmark extends BenchmarkBase {
7 var injectorFactory;
8 var module;
9
10 InjectorBenchmark(name, this.injectorFactory) : super(name);
11
12 void run() {
13 Injector injector = injectorFactory([module]);
14 injector.get(A);
15 injector.get(B);
16
17 var childInjector = injector.createChild([module]);
18 childInjector.get(A);
19 childInjector.get(B);
20 }
21
22 setup() {
23 module = new Module()
24 ..type(A)
25 ..type(B)
26 ..type(C)
27 ..type(D)
28 ..type(E);
29 }
30 }
31
32 class A {
33 A(B b, C c);
34 }
35
36 class B {
37 B(D b, E c);
38 }
39
40 class C {
41 }
42
43 class D {
44 }
45
46 class E {
47 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698