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

Unified Diff: tests/html/events_test.dart

Issue 14387011: fix a bug in the Event constructor (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | tools/dom/templates/html/impl/impl_Event.darttemplate » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/html/events_test.dart
diff --git a/tests/html/events_test.dart b/tests/html/events_test.dart
index a88d63196f48700ac9c601f1cd0026a40063da5e..4e22018b58a6e68e40f27bc245738fd1bbd1a7d4 100644
--- a/tests/html/events_test.dart
+++ b/tests/html/events_test.dart
@@ -5,12 +5,25 @@ import 'dart:html';
main() {
useHtmlConfiguration();
+
test('TimeStamp', () {
Event event = new Event('test');
int timeStamp = event.timeStamp;
expect(timeStamp, greaterThan(0));
});
+
+ test('Event canBubble and cancelable', () {
+ // Try every combination of canBubble and cancelable
+ for (var i = 0; i < 4; i++) {
+ var bubble = (i & 1) != 0;
+ var cancel = (i & 2) != 0;
+ var e = new Event('input', canBubble: bubble, cancelable: cancel);
+ expect(e.bubbles, bubble, reason: 'canBubble was set to $bubble');
+ expect(e.cancelable, cancel, reason: 'cancelable was set to $cancel');
+ }
+ });
+
// The next test is not asynchronous because [on['test'].dispatch(event)] fires the event
// and event listener synchronously.
test('EventTarget', () {
@@ -54,6 +67,7 @@ main() {
element.dispatchEvent(event);
expect(invocationCounter, 1);
});
+
test('InitMouseEvent', () {
DivElement div = new Element.tag('div');
MouseEvent event = new MouseEvent('zebra', relatedTarget: div);
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | tools/dom/templates/html/impl/impl_Event.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698