| Index: tests/lib_strong/html/event_test.dart
|
| diff --git a/tests/lib_strong/html/event_test.dart b/tests/lib_strong/html/event_test.dart
|
| index 82dc1045eae82b1ac1b52936de7972d159337efc..873513739ef55dbc3309bf5bce6e09e407e06b6e 100644
|
| --- a/tests/lib_strong/html/event_test.dart
|
| +++ b/tests/lib_strong/html/event_test.dart
|
| @@ -42,10 +42,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',
|
| @@ -76,36 +79,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);
|
| @@ -146,11 +159,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
|
| @@ -172,13 +190,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);
|
|
|