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

Side by Side Diff: tests/html/element_webkit_test.dart

Issue 11615038: Updating status of tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 library ElementWebKitTest;
6 import '../../pkg/unittest/lib/unittest.dart';
7 import '../../pkg/unittest/lib/html_config.dart';
8 import 'dart:html';
9
10
11 // NOTE:
12 // These should ALL be webkit-specific items
13 // Ideally all of these should be functional on all browsers and moved into
14 // element_test.dart.
15
16 void testEventHelper(EventListenerList listenerList, type,
17 [Function registerOnEventListener = null]) {
18 bool firedWhenAddedToListenerList = false;
19 bool firedOnEvent = false;
20 listenerList.add((e) {
21 firedWhenAddedToListenerList = true;
22 });
23 if (registerOnEventListener != null) {
24 registerOnEventListener((e) {
25 firedOnEvent = true;
26 });
27 }
28
29 final event = new Event(type);
30 listenerList.dispatch(event);
31
32 expect(firedWhenAddedToListenerList, isTrue);
33 if (registerOnEventListener != null) {
34 expect(firedOnEvent, isTrue);
35 }
36 }
37
38 main() {
39 useHtmlConfiguration();
40
41
42 group('events', () {
43 final element = new Element.tag('div');
44 final on = element.on;
45 testEventHelper(on.transitionEnd, 'webkitTransitionEnd');
46 testEventHelper(on.fullscreenChange, 'webkitfullscreenchange',
47 (listener) => Testing.addEventListener(element,
48 'webkitfullscreenchange', listener, true));
49 });
50 }
51
52
53
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698