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

Unified Diff: third_party/pkg/angular/perf/dom/compile_perf.dart

Issue 124053002: Adding Angular and dependent packages for testing (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 12 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 side-by-side diff with in-line comments
Download patch
Index: third_party/pkg/angular/perf/dom/compile_perf.dart
diff --git a/third_party/pkg/angular/perf/dom/compile_perf.dart b/third_party/pkg/angular/perf/dom/compile_perf.dart
new file mode 100644
index 0000000000000000000000000000000000000000..46b7c76aefc67f81fe9bdf233a27fea724aa9ec3
--- /dev/null
+++ b/third_party/pkg/angular/perf/dom/compile_perf.dart
@@ -0,0 +1,31 @@
+import '_perf.dart';
+
+main() => describe('compiler', () {
+ describe('block instantiation', () {
+ iit('time ', inject((TestBed tb) {
+ tb.compile(UL_REPEATER);
+ var items = [];
+ for(var i = 0; i < 100; i++) {
+ items.add({"text":'text_$i', "done": i & 1 == 1});
+ }
+ var empty = [];
+ tb.rootScope.classFor = (item) => 'ng-${item["done"]}';
+
+ time('create 100 blocks',
+ () => tb.rootScope.$apply(() => tb.rootScope.items = items),
+ cleanUp: () => tb.rootScope.$apply(() => tb.rootScope.items = empty),
+ verify: () => expect(tb.rootElement.queryAll('li').length).toEqual(100));
+ }));
+ });
+});
+
+var UL_REPEATER =
+"""
+<ul class="well unstyled">
+ <li ng-repeat="item in items" ng-class="classFor(item)">
+ <label class="checkbox">
+ <input type="checkbox" ng-model="item.done"> {{item.text}}
+ </label>
+ </li>
+</ul>
+""";

Powered by Google App Engine
This is Rietveld 408576698