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

Unified Diff: third_party/pkg/angular/test/core_dom/node_cursor_spec.dart

Issue 256553002: Revert "Update all Angular libs (run update_all.sh)." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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/core_dom/node_cursor_spec.dart
diff --git a/third_party/pkg/angular/test/core_dom/node_cursor_spec.dart b/third_party/pkg/angular/test/core_dom/node_cursor_spec.dart
index 731495e2b7a3931514bdecbff8d02d1adfc012f9..e150804293505b45f2c53d967e16a01ec60add4c 100644
--- a/third_party/pkg/angular/test/core_dom/node_cursor_spec.dart
+++ b/third_party/pkg/angular/test/core_dom/node_cursor_spec.dart
@@ -7,10 +7,10 @@ main() {
var a, b, c, d;
beforeEach(() {
- a = e('<a>A</a>');
- b = e('<b>B</b>');
- c = e('<i>C</i>');
- d = e('<span></span>');
+ a = $('<a>A</a>')[0];
+ b = $('<b>B</b>')[0];
+ c = $('<i>C</i>')[0];
+ d = $('<span></span>')[0];
d.append(a);
d.append(b);
});
@@ -19,10 +19,10 @@ main() {
it('should allow single level traversal', () {
var cursor = new NodeCursor([a, b]);
- expect(cursor.current, equals(a));
- expect(cursor.moveNext(), equals(true));
- expect(cursor.current, equals(b));
- expect(cursor.moveNext(), equals(false));
+ expect(cursor.nodeList(), equals([a]));
+ expect(cursor.microNext(), equals(true));
+ expect(cursor.nodeList(), equals([b]));
+ expect(cursor.microNext(), equals(false));
});
@@ -30,38 +30,38 @@ main() {
var cursor = new NodeCursor([d, c]);
expect(cursor.descend(), equals(true));
- expect(cursor.current, equals(a));
- expect(cursor.moveNext(), equals(true));
- expect(cursor.current, equals(b));
- expect(cursor.moveNext(), equals(false));
+ expect(cursor.nodeList(), equals([a]));
+ expect(cursor.microNext(), equals(true));
+ expect(cursor.nodeList(), equals([b]));
+ expect(cursor.microNext(), equals(false));
cursor.ascend();
- expect(cursor.moveNext(), equals(true));
- expect(cursor.current, equals(c));
- expect(cursor.moveNext(), equals(false));
+ expect(cursor.microNext(), equals(true));
+ expect(cursor.nodeList(), equals([c]));
+ expect(cursor.microNext(), equals(false));
});
it('should descend and ascend two levels', () {
- var l1 = e('<span></span>');
- var l2 = e('<span></span>');
- var g = e('<g>G</g>');
- var f = e('<f>F</f>');
+ var l1 = $('<span></span>')[0];
+ var l2 = $('<span></span>')[0];
+ var e = $('<e>E</e>')[0];
+ var f = $('<f>F</f>')[0];
l1.append(l2);
l1.append(f);
- l2.append(g);
+ l2.append(e);
var cursor = new NodeCursor([l1, c]);
expect(cursor.descend(), equals(true));
- expect(cursor.current, equals(l2));
+ expect(cursor.nodeList(), equals([l2]));
expect(cursor.descend(), equals(true));
- expect(cursor.current, equals(g));
+ expect(cursor.nodeList(), equals([e]));
cursor.ascend();
- expect(cursor.moveNext(), equals(true));
- expect(cursor.current, equals(f));
- expect(cursor.moveNext(), equals(false));
+ expect(cursor.microNext(), equals(true));
+ expect(cursor.nodeList(), equals([f]));
+ expect(cursor.microNext(), equals(false));
cursor.ascend();
- expect(cursor.moveNext(), equals(true));
- expect(cursor.current, equals(c));
- expect(cursor.moveNext(), equals(false));
+ expect(cursor.microNext(), equals(true));
+ expect(cursor.nodeList(), equals([c]));
+ expect(cursor.microNext(), equals(false));
});
@@ -82,27 +82,26 @@ main() {
it('should create child cursor upon replace of mid level', () {
- var dom = es('<div><span>text</span></div>');
+ var dom = $('<div><span>text</span></div>');
var parentCursor = new NodeCursor(dom);
parentCursor.descend(); // <span>
var childCursor = parentCursor.replaceWithAnchor('child');
expect(STRINGIFY(dom), equals('[<div><!--ANCHOR: child--></div>]'));
- expect(STRINGIFY(childCursor.elements.first), equals('<span>text</span>'));
+ expect(STRINGIFY(childCursor.elements[0]), equals('<span>text</span>'));
});
it('should preserve the top-level elements', () {
- var dom = es('<span>text</span>MoreText<div>other</div>');
+ var dom = $('<span>text</span>MoreText<div>other</div>');
var parentCursor = new NodeCursor(dom);
var childCursor = parentCursor.replaceWithAnchor('child');
expect(STRINGIFY(dom), equals('[<!--ANCHOR: child-->, MoreText, <div>other</div>]'));
- expect(STRINGIFY(childCursor.elements.first), equals('<span>text</span>'));
+ expect(STRINGIFY(childCursor.elements[0]), equals('<span>text</span>'));
});
});
}
-
« no previous file with comments | « third_party/pkg/angular/test/core_dom/ng_mustache_spec.dart ('k') | third_party/pkg/angular/test/core_dom/selector_spec.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698