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

Unified Diff: third_party/pkg/angular/test/_specs.dart

Issue 180843004: Revert revision 33053 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 10 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/test/_specs.dart
===================================================================
--- third_party/pkg/angular/test/_specs.dart (revision 33054)
+++ third_party/pkg/angular/test/_specs.dart (working copy)
@@ -1,10 +1,11 @@
library ng_specs;
+
import 'dart:html';
+import 'dart:mirrors' as mirror;
import 'package:unittest/unittest.dart' as unit;
import 'package:angular/angular.dart';
import 'package:angular/mock/module.dart';
-import 'package:collection/wrappers.dart' show DelegatingList;
import 'jasmine_syntax.dart';
@@ -83,7 +84,7 @@
toEqualSelect(options) {
var actualOptions = [];
- for (var option in actual.querySelectorAll('option')) {
+ for(var option in actual.querySelectorAll('option')) {
if (option.selected) {
actualOptions.add([option.value]);
} else {
@@ -117,11 +118,11 @@
toHaveClass(cls) => unit.expect(actual.classes.contains(cls), false, reason: ' Expected ${actual} to not have css class ${cls}');
toBe(expected) => unit.expect(actual,
- unit.predicate((actual) => !identical(expected, actual), 'not $expected'));
+ unit.predicate((actual) => !identical(expected, actual), '$expected'));
toEqual(expected) => unit.expect(actual,
- unit.predicate((actual) => expected != actual, 'not $expected'));
+ unit.predicate((actual) => expected != actual, '$expected'));
toContain(expected) => unit.expect(actual,
- unit.predicate((actual) => !actual.contains(expected), 'not $expected'));
+ unit.predicate((actual) => !actual.contains(expected), '$expected'));
}
class ExceptionContains extends unit.Matcher {
@@ -158,14 +159,16 @@
}
var getterSetter = new GetterSetter();
-class JQuery extends DelegatingList<Node> {
- JQuery([selector]) : super([]) {
+class JQuery implements List<Node> {
+ List<Node> _list = [];
+
+ JQuery([selector]) {
if (selector == null) {
// do nothing;
} else if (selector is String) {
- addAll(es(selector));
+ _list.addAll(es(selector));
} else if (selector is List) {
- addAll(selector);
+ _list.addAll(selector);
} else if (selector is Node) {
add(selector);
} else {
@@ -173,6 +176,8 @@
}
}
+ noSuchMethod(Invocation invocation) => mirror.reflect(_list).delegate(invocation);
+
_toHtml(node, [bool outer = false]) {
if (node is Comment) {
return '<!--${node.text}-->';
@@ -185,7 +190,7 @@
// TODO(dart): ?value does not work, since value was passed. :-(
var setterMode = value != null;
var result = setterMode ? this : '';
- forEach((node) {
+ _list.forEach((node) {
if (setterMode) {
setter(node, value);
} else {
@@ -220,9 +225,9 @@
(n is Element ? (n as Element).querySelectorAll(selector) : [])));
hasClass(String name) => fold(false, (hasClass, node) =>
hasClass || (node is Element && (node as Element).classes.contains(name)));
- addClass(String name) => forEach((node) =>
+ addClass(String name) => _list.forEach((node) =>
(node is Element) ? (node as Element).classes.add(name) : null);
- removeClass(String name) => forEach((node) =>
+ removeClass(String name) => _list.forEach((node) =>
(node is Element) ? (node as Element).classes.remove(name) : null);
css(String name, [String value]) => accessor(
(Element n) => n.style.getPropertyValue(name),

Powered by Google App Engine
This is Rietveld 408576698