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

Side by Side Diff: sky/tests/editing/delete_block_contents.sky

Issue 924203002: Morph the APIs for Node, ParentNode, and Element closer to the specs (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Less ref Created 5 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 unified diff | Download patch
OLDNEW
1 <sky> 1 <sky>
2 This test verifies that the height of an editable block remains the same after a dding block elements and removing them. 2 This test verifies that the height of an editable block remains the same after a dding block elements and removing them.
3 <div contenteditable="true" style="border: solid blue" id="test"></div> 3 <div contenteditable="true" style="border: solid blue" id="test"></div>
4 <script> 4 <script>
5 import "../resources/third_party/unittest/unittest.dart"; 5 import "../resources/third_party/unittest/unittest.dart";
6 import "../resources/unit.dart"; 6 import "../resources/unit.dart";
7 7
8 import "dart:async"; 8 import "dart:async";
9 import "dart:sky"; 9 import "dart:sky";
10 10
11 void main() { 11 void main() {
12 initUnit(); 12 initUnit();
13 13
14 test("remains the same after adding block elements and removing them", () { 14 test("remains the same after adding block elements and removing them", () {
15 var elem = document.getElementById("test"); 15 var elem = document.getElementById("test");
16 var originalHeight = elem.offsetHeight; 16 var originalHeight = elem.offsetHeight;
17 var d = elem.appendChild(document.createElement('div')); 17 var d = elem.appendChild(document.createElement('div'));
18 d.appendChild(new Text('aaa')); 18 d.appendChild(new Text('aaa'));
19 d = elem.appendChild(document.createElement('div')); 19 d = elem.appendChild(document.createElement('div'));
20 d.appendChild(new Text('bbb')); 20 d.appendChild(new Text('bbb'));
21 var newHeight = elem.offsetHeight; 21 var newHeight = elem.offsetHeight;
22 22
23 while (elem.firstChild != null) { 23 elem.removeChildren();
24 elem.removeChild(elem.firstChild);
25 }
26 24
27 new Timer(Duration.ZERO, expectAsync(() { 25 new Timer(Duration.ZERO, expectAsync(() {
28 expect(elem.offsetHeight, equals(originalHeight)); 26 expect(elem.offsetHeight, equals(originalHeight));
29 })); 27 }));
30 }); 28 });
31 } 29 }
32 </script> 30 </script>
33 </sky> 31 </sky>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698