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

Side by Side Diff: tests/html/element_add_test.dart

Issue 512043002: Improve document.appendText test as follow up to "Fix Try Dart newline handling on IE11" change. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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 3 // BSD-style license that can be found in the LICENSE file
4 4
5 library ElementAddTest; 5 library ElementAddTest;
6 import 'package:unittest/unittest.dart'; 6 import 'package:unittest/unittest.dart';
7 import 'package:unittest/html_config.dart'; 7 import 'package:unittest/html_config.dart';
8 import 'util.dart'; 8 import 'util.dart';
9 import 'dart:html'; 9 import 'dart:html';
10 10
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 test('htmlelement', () { 77 test('htmlelement', () {
78 var el = new DivElement(); 78 var el = new DivElement();
79 var twoNewLines = "\n\n"; 79 var twoNewLines = "\n\n";
80 el.appendText(twoNewLines); 80 el.appendText(twoNewLines);
81 // No children were created. 81 // No children were created.
82 expect(el.children.length, equals(0)); 82 expect(el.children.length, equals(0));
83 // One text node was added. 83 // One text node was added.
84 expect(el.nodes.length, equals(1)); 84 expect(el.nodes.length, equals(1));
85 expect(el.nodes[0], isText); 85 expect(el.nodes[0], isText);
86 expect(el.nodes[0].text, equals(twoNewLines)); 86 expect(el.nodes[0].text, equals(twoNewLines));
87 expect(el.text, equals(twoNewLines));
87 }); 88 });
88 89
89 test('documentFragment', () { 90 test('documentFragment', () {
90 var fragment = new DocumentFragment(); 91 var fragment = new DocumentFragment();
91 fragment.appendText('foo'); 92 fragment.appendText('foo');
92 // No children were created. 93 // No children were created.
93 expect(fragment.children.length, equals(0)); 94 expect(fragment.children.length, equals(0));
94 // One text node was added. 95 // One text node was added.
95 expect(fragment.nodes.length, equals(1)); 96 expect(fragment.nodes.length, equals(1));
96 }); 97 });
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 var child = new DivElement(); 232 var child = new DivElement();
232 parent.children.add(child); 233 parent.children.add(child);
233 234
234 parent.insertAdjacentText('beforeend', 'test'); 235 parent.insertAdjacentText('beforeend', 'test');
235 236
236 expect(parent.nodes.length, 2); 237 expect(parent.nodes.length, 2);
237 expect(parent.nodes[1], isText); 238 expect(parent.nodes[1], isText);
238 }); 239 });
239 }); 240 });
240 } 241 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698