Index: tests/html/transition_event_test.dart |
diff --git a/tests/html/transition_event_test.dart b/tests/html/transition_event_test.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c96b46b4dd0b5458e87e67c0a0efad689df90b64 |
--- /dev/null |
+++ b/tests/html/transition_event_test.dart |
@@ -0,0 +1,42 @@ |
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
+// for details. All rights reserved. Use of this source code is governed by a |
+// BSD-style license that can be found in the LICENSE file |
+ |
+library transition_event_test; |
+import '../../pkg/unittest/lib/unittest.dart'; |
+import '../../pkg/unittest/lib/html_individual_config.dart'; |
+import 'dart:html'; |
+ |
+main() { |
+ useHtmlIndividualConfiguration(); |
+ |
+ group('supported', () { |
+ test('supported', () { |
+ expect(CssStyleDeclaration.supportsTransitions, true); |
+ }); |
+ }); |
+ |
+ group('functional', () { |
+ test('transitionEnd', () { |
+ if (CssStyleDeclaration.supportsTransitions) { |
+ var element = new DivElement(); |
+ document.body.append(element); |
+ |
+ element.style.opacity = '0'; |
+ element.style.width = '100px'; |
+ element.style.height = '100px'; |
+ element.style.background = 'red'; |
+ element.style.transition = 'opacity .1s'; |
+ |
+ window.setTimeout(expectAsync0(() { |
+ element.onTransitionEnd.first.then(expectAsync1((e) { |
+ expect(e is TransitionEvent, isTrue); |
+ expect(e.propertyName, 'opacity'); |
+ })); |
+ |
+ element.style.opacity = '1'; |
+ }), 100); |
+ } |
+ }); |
+ }); |
+} |