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

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

Issue 754463003: Fix race condition in test (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
« 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 <sky> 1 <sky>
2 <import src="../resources/chai.sky" /> 2 <import src="../resources/chai.sky" />
3 <import src="../resources/mocha.sky" /> 3 <import src="../resources/mocha.sky" />
4 This test verifies that the height of an editable block remains the same after a dding block elements and removing them. 4 This test verifies that the height of an editable block remains the same after a dding block elements and removing them.
5 <div contenteditable="true" style="border: solid blue" id="test"></div> 5 <div contenteditable="true" style="border: solid blue" id="test"></div>
6 <script> 6 <script>
7 describe("height of an editable block", function(done) { 7 describe("height of an editable block", function() {
8 it("remains the same after adding block elements and removing them", function( ) { 8 it("remains the same after adding block elements and removing them", function( done) {
9 var elem = document.getElementById("test"); 9 var elem = document.getElementById("test");
10 var originalHeight = elem.offsetHeight; 10 var originalHeight = elem.offsetHeight;
11 var d = elem.appendChild(document.createElement('div')); 11 var d = elem.appendChild(document.createElement('div'));
12 d.appendChild(document.createTextNode('aaa')); 12 d.appendChild(document.createTextNode('aaa'));
13 d = elem.appendChild(document.createElement('div')); 13 d = elem.appendChild(document.createElement('div'));
14 d.appendChild(document.createTextNode('bbb')); 14 d.appendChild(document.createTextNode('bbb'));
15 var newHeight = elem.offsetHeight; 15 var newHeight = elem.offsetHeight;
16 16
17 while (elem.firstChild) { 17 while (elem.firstChild) {
18 elem.removeChild(elem.firstChild); 18 elem.removeChild(elem.firstChild);
19 } 19 }
20 20
21 setTimeout(function() { 21 setTimeout(function() {
22 assert.equal(elem.offsetHeight, originalHeight); 22 assert.equal(elem.offsetHeight, originalHeight);
23 done(); 23 done();
24 }); 24 });
25 }); 25 });
26 }) 26 })
27 </script> 27 </script>
28 </sky> 28 </sky>
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