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

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

Issue 1014843004: Make Element.animate work in dart2js Chrome (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix comment indentation Created 5 years, 9 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
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | tests/html/html.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2015, 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 element_animate_test;
6
7 import 'dart:async';
8 import 'dart:html';
9 import 'package:unittest/html_individual_config.dart';
10 import 'package:unittest/unittest.dart';
11
12 main() {
13 useHtmlIndividualConfiguration();
14
15 group('animate_supported', () {
16 test('supported', () {
17 expect(Notification.supported, true);
18 });
19
20 test('simple timing', () {
21 var body = document.body;
22 var opacity = num.parse(body.getComputedStyle().opacity);
23 body.animate([{"opacity": 100}, {"opacity": 0}], 100);
24 var newOpacity = num.parse(body.getComputedStyle().opacity);
25 expect(newOpacity < opacity, isTrue);
26 });
27
28 test('timing dict', () {
29 var body = document.body;
30 // Animate different characteristics so the tests can run concurrently.
31 var fontSize = body.getComputedStyle().fontSize;
32 var player = body.animate(
33 [{"font-size": "500px"}, {"font-size": fontSize}],
34 {"duration": 100});
35 var newFontSize = body.getComputedStyle().fontSize;
36 // Don't bother to parse to numbers, as long as it's changed that
37 // indicates something is happening.
38 expect(newFontSize == fontSize, isFalse);
39 player.on['finish'].listen(expectAsync((_) => 'done'));
40 });
41
42 test('omit timing', () {
43 var body = document.body;
44 var player = body.animate([
45 {"transform": "translate(100px, -100%)"},
46 {"transform": "translate(400px, 500px)"}
47 ]);
48 player.on['finish'].listen(expectAsync((_) => 'done'));
49 });
50 });
51 }
terry 2015/03/19 17:03:15 Should we have a test where the dictionary fails e
Alan Knight 2015/03/23 18:57:52 It would be nice if they did, but Chrome happily a
OLDNEW
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | tests/html/html.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698