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

Side by Side Diff: sky/tests/events/custom-event.sky

Issue 988573002: Fix test_sky after 14270f1151aacfa650985c4333572c356d15c024 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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
« 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 <script> 1 <script>
2 import "../resources/third_party/unittest/unittest.dart"; 2 import "../resources/third_party/unittest/unittest.dart";
3 import "../resources/unit.dart"; 3 import "../resources/unit.dart";
4 4
5 import "dart:sky"; 5 import "dart:sky";
6 6
7 class MyEvent extends Event { 7 class MyEvent extends Event {
8 MyEvent() : super("awesome", bubbles: true); 8 MyEvent() : super(type: "awesome", bubbles: true);
9 9
10 bool get isCustom => true; 10 bool get isCustom => true;
11 } 11 }
12 12
13 void main() { 13 void main() {
14 initUnit(); 14 initUnit();
15 15
16 test("should be able to dispatch", () { 16 test("should be able to dispatch", () {
17 var event = new MyEvent(); 17 var event = new MyEvent();
18 expect(event.isCustom, isTrue); 18 expect(event.isCustom, isTrue);
19 expect(event.type, equals("awesome")); 19 expect(event.type, equals("awesome"));
20 expect(event.bubbles, isTrue); 20 expect(event.bubbles, isTrue);
21 expect(event.cancelable, isFalse); 21 expect(event.cancelable, isFalse);
22 expect(event.isCustom, isTrue); 22 expect(event.isCustom, isTrue);
23 23
24 bool gotEvent = false; 24 bool gotEvent = false;
25 var element = document.createElement("div"); 25 var element = document.createElement("div");
26 element.addEventListener("awesome", (e) { 26 element.addEventListener("awesome", (e) {
27 expect(e, equals(event)); 27 expect(e, equals(event));
28 expect(event.isCustom, isTrue); 28 expect(event.isCustom, isTrue);
29 gotEvent = true; 29 gotEvent = true;
30 }); 30 });
31 element.dispatchEvent(event); 31 element.dispatchEvent(event);
32 expect(gotEvent, isTrue); 32 expect(gotEvent, isTrue);
33 }); 33 });
34 } 34 }
35 </script> 35 </script>
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