| Index: tests/html/event_test.dart
|
| diff --git a/tests/html/event_test.dart b/tests/html/event_test.dart
|
| index 14c92f1db563f2e468a96d654cc75c497ff850aa..6243e645aebf1ec726c7ef4b73a6039d9ef31361 100644
|
| --- a/tests/html/event_test.dart
|
| +++ b/tests/html/event_test.dart
|
| @@ -3,6 +3,7 @@
|
| // BSD-style license that can be found in the LICENSE file.
|
|
|
| library EventTest;
|
| +
|
| import "package:expect/expect.dart";
|
| import 'package:unittest/unittest.dart';
|
| import 'package:unittest/html_config.dart';
|
| @@ -48,10 +49,13 @@ main() {
|
| // expect(ev.wasClean, isTrue);
|
| // });
|
|
|
| - eventTest('CompositionEvent',
|
| - () => new CompositionEvent('compositionstart', view: window, data: 'data'),
|
| - (ev) { expect(ev.data, 'data'); },
|
| - 'compositionstart');
|
| + eventTest(
|
| + 'CompositionEvent',
|
| + () =>
|
| + new CompositionEvent('compositionstart', view: window, data: 'data'),
|
| + (ev) {
|
| + expect(ev.data, 'data');
|
| + }, 'compositionstart');
|
|
|
| // initCustomEvent is not yet implemented
|
| // eventTest('CustomEvent',
|
| @@ -82,36 +86,46 @@ main() {
|
| // expect(ev.lineno, 10);
|
| // });
|
|
|
| - eventTest('Event',
|
| - () => new Event('foo', canBubble: false, cancelable: false),
|
| + eventTest(
|
| + 'Event', () => new Event('foo', canBubble: false, cancelable: false),
|
| (ev) {
|
| expect(ev.type, equals('foo'));
|
| expect(ev.bubbles, isFalse);
|
| expect(ev.cancelable, isFalse);
|
| });
|
|
|
| - eventTest('HashChangeEvent',
|
| - () => new HashChangeEvent('foo', oldUrl: 'http://old.url',
|
| - newUrl: 'http://new.url'), (ev) {
|
| + eventTest(
|
| + 'HashChangeEvent',
|
| + () => new HashChangeEvent('foo',
|
| + oldUrl: 'http://old.url', newUrl: 'http://new.url'), (ev) {
|
| expect(ev.oldUrl, equals('http://old.url'));
|
| expect(ev.newUrl, equals('http://new.url'));
|
| });
|
|
|
| // KeyboardEvent has its own test file, and has cross-browser issues.
|
|
|
| - eventTest('MouseEvent',
|
| - () => new MouseEvent('foo', view: window, detail: 1, screenX: 2,
|
| - screenY: 3, clientX: 4, clientY: 5, button: 6,
|
| - ctrlKey: true, altKey: true, shiftKey: true,
|
| - metaKey: true, relatedTarget: document.body),
|
| - (ev) {
|
| + eventTest(
|
| + 'MouseEvent',
|
| + () => new MouseEvent('foo',
|
| + view: window,
|
| + detail: 1,
|
| + screenX: 2,
|
| + screenY: 3,
|
| + clientX: 4,
|
| + clientY: 5,
|
| + button: 6,
|
| + ctrlKey: true,
|
| + altKey: true,
|
| + shiftKey: true,
|
| + metaKey: true,
|
| + relatedTarget: document.body), (ev) {
|
| expect(ev.detail, 1);
|
| expect(ev.screen.x, 2);
|
| expect(ev.screen.y, 3);
|
| expect(ev.client.x, 4);
|
| expect(ev.client.y, 5);
|
| - expect(ev.offset.x, 4); // Same as clientX.
|
| - expect(ev.offset.y, 5); // Same as clientY.
|
| + expect(ev.offset.x, 4); // Same as clientX.
|
| + expect(ev.offset.y, 5); // Same as clientY.
|
| expect(ev.button, 6);
|
| expect(ev.ctrlKey, isTrue);
|
| expect(ev.altKey, isTrue);
|
| @@ -152,11 +166,16 @@ main() {
|
| // expect(ev.total, 10);
|
| // });
|
|
|
| - eventTest('StorageEvent',
|
| - () => new StorageEvent('foo', key: 'key', url: 'http://example.url',
|
| - storageArea: window.localStorage, canBubble: true, cancelable: true,
|
| - oldValue: 'old', newValue: 'new'),
|
| - (ev) {
|
| + eventTest(
|
| + 'StorageEvent',
|
| + () => new StorageEvent('foo',
|
| + key: 'key',
|
| + url: 'http://example.url',
|
| + storageArea: window.localStorage,
|
| + canBubble: true,
|
| + cancelable: true,
|
| + oldValue: 'old',
|
| + newValue: 'new'), (ev) {
|
| expect(ev.key, 'key');
|
| expect(ev.url, 'http://example.url');
|
| // Equality isn't preserved for storageArea
|
| @@ -178,13 +197,22 @@ main() {
|
| expect(12, ev.detail);
|
| });
|
|
|
| - eventTest('WheelEvent',
|
| + eventTest(
|
| + 'WheelEvent',
|
| // TODO(alanknight): Can't pass window on Dartium. Add view: window
|
| // once going through JS.
|
| - () => new WheelEvent("mousewheel", deltaX: 1, deltaY: 0,
|
| - detail: 4, screenX: 3, screenY: 4, clientX: 5, clientY: 6,
|
| - ctrlKey: true, altKey: true, shiftKey: true, metaKey: true),
|
| - (ev) {
|
| + () => new WheelEvent("mousewheel",
|
| + deltaX: 1,
|
| + deltaY: 0,
|
| + detail: 4,
|
| + screenX: 3,
|
| + screenY: 4,
|
| + clientX: 5,
|
| + clientY: 6,
|
| + ctrlKey: true,
|
| + altKey: true,
|
| + shiftKey: true,
|
| + metaKey: true), (ev) {
|
| expect(ev.deltaX, 1);
|
| expect(ev.deltaY, 0);
|
| expect(ev.screen.x, 3);
|
|
|