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

Side by Side Diff: sky/tests/dom/inherit-from-text.sky

Issue 936193005: Make it possible to inherit from any constructable host object (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Remove extra comment 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
(Empty)
1 <sky>
2 <script>
3 import "../resources/third_party/unittest/unittest.dart";
4 import "../resources/unit.dart";
5
6 import "dart:sky";
7
8 class CustomText extends Text {
9 CustomText() : super("awesome");
10
11 bool get isCustom => true;
12 }
13
14 void main() {
15 initUnit();
16
17 test("should be able to insert in DOM", () {
18 var child = new CustomText();
19 expect(child.isCustom, isTrue);
20 expect(child.parentNode, isNull);
21 expect(child.data, equals("awesome"));
22
23 var parent = document.createElement("div");
24 parent.appendChild(child);
25 expect(child.parentNode, equals(parent));
26 expect(parent.firstChild, equals(child));
27 expect(parent.firstChild.isCustom, isTrue);
28 });
29 }
30 </script>
31 </sky>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698