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

Unified Diff: sky/tests/editing/delete_block_contents.sky

Issue 921123002: Port all of Sky's editing tests to Dart (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: sky/tests/editing/delete_block_contents.sky
diff --git a/sky/tests/editing/delete_block_contents.sky b/sky/tests/editing/delete_block_contents.sky
index f1ab1f4e36c60216383120fc346e8f60832bbc4f..8552e9d1e68806e8602104d903d7bccbd58f1c56 100644
--- a/sky/tests/editing/delete_block_contents.sky
+++ b/sky/tests/editing/delete_block_contents.sky
@@ -1,11 +1,17 @@
<sky>
-<import src="../resources/chai.sky" />
-<import src="../resources/mocha.sky" />
This test verifies that the height of an editable block remains the same after adding block elements and removing them.
<div contenteditable="true" style="border: solid blue" id="test"></div>
<script>
-describe("height of an editable block", function() {
- it("remains the same after adding block elements and removing them", function(done) {
+import "../resources/third_party/unittest/unittest.dart";
+import "../resources/unit.dart";
+
+import "dart:async";
+import "dart:sky";
+
+void main() {
+ initUnit();
+
+ test("remains the same after adding block elements and removing them", () {
var elem = document.getElementById("test");
var originalHeight = elem.offsetHeight;
var d = elem.appendChild(document.createElement('div'));
@@ -14,15 +20,14 @@ describe("height of an editable block", function() {
d.appendChild(new Text('bbb'));
var newHeight = elem.offsetHeight;
- while (elem.firstChild) {
+ while (elem.firstChild != null) {
elem.removeChild(elem.firstChild);
}
- setTimeout(function() {
- assert.equal(elem.offsetHeight, originalHeight);
- done();
- });
+ new Timer(Duration.ZERO, expectAsync(() {
+ expect(elem.offsetHeight, equals(originalHeight));
+ }));
});
-})
+}
</script>
</sky>

Powered by Google App Engine
This is Rietveld 408576698