OLD | NEW |
(Empty) | |
| 1 dart_library.library('lib/html/transition_event_test', null, /* Imports */[ |
| 2 'dart_sdk', |
| 3 'unittest' |
| 4 ], function load__transition_event_test(exports, dart_sdk, unittest) { |
| 5 'use strict'; |
| 6 const core = dart_sdk.core; |
| 7 const html = dart_sdk.html; |
| 8 const async = dart_sdk.async; |
| 9 const dart = dart_sdk.dart; |
| 10 const dartx = dart_sdk.dartx; |
| 11 const html_individual_config = unittest.html_individual_config; |
| 12 const unittest$ = unittest.unittest; |
| 13 const src__matcher__expect = unittest.src__matcher__expect; |
| 14 const src__matcher__core_matchers = unittest.src__matcher__core_matchers; |
| 15 const transition_event_test = Object.create(null); |
| 16 let TransitionEventTodynamic = () => (TransitionEventTodynamic = dart.constFn(
dart.functionType(dart.dynamic, [html.TransitionEvent])))(); |
| 17 let VoidTovoid = () => (VoidTovoid = dart.constFn(dart.functionType(dart.void,
[])))(); |
| 18 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); |
| 19 let VoidTovoid$ = () => (VoidTovoid$ = dart.constFn(dart.definiteFunctionType(
dart.void, [])))(); |
| 20 let dynamicTodynamic = () => (dynamicTodynamic = dart.constFn(dart.definiteFun
ctionType(dart.dynamic, [dart.dynamic])))(); |
| 21 let const$; |
| 22 transition_event_test.main = function() { |
| 23 html_individual_config.useHtmlIndividualConfiguration(); |
| 24 unittest$.group('supported', dart.fn(() => { |
| 25 unittest$.test('supported', dart.fn(() => { |
| 26 src__matcher__expect.expect(html.CssStyleDeclaration[dartx.supportsTrans
itions], true); |
| 27 }, VoidTodynamic())); |
| 28 }, VoidTovoid$())); |
| 29 unittest$.group('functional', dart.fn(() => { |
| 30 unittest$.test('transitionEnd', dart.fn(() => { |
| 31 if (dart.test(html.CssStyleDeclaration[dartx.supportsTransitions])) { |
| 32 let element = html.DivElement.new(); |
| 33 html.document[dartx.body][dartx.append](element); |
| 34 element[dartx.style][dartx.opacity] = '0'; |
| 35 element[dartx.style][dartx.width] = '100px'; |
| 36 element[dartx.style][dartx.height] = '100px'; |
| 37 element[dartx.style][dartx.background] = 'red'; |
| 38 element[dartx.style][dartx.transition] = 'opacity .1s'; |
| 39 async.Timer.new(const$ || (const$ = dart.const(new core.Duration({mill
iseconds: 100}))), VoidTovoid()._check(unittest$.expectAsync(dart.fn(() => { |
| 40 element[dartx.onTransitionEnd].first.then(dart.dynamic)(TransitionEv
entTodynamic()._check(unittest$.expectAsync(dart.fn(e => { |
| 41 src__matcher__expect.expect(html.TransitionEvent.is(e), src__match
er__core_matchers.isTrue); |
| 42 src__matcher__expect.expect(dart.dload(e, 'propertyName'), 'opacit
y'); |
| 43 }, dynamicTodynamic())))); |
| 44 element[dartx.style][dartx.opacity] = '1'; |
| 45 }, VoidTodynamic())))); |
| 46 } |
| 47 }, VoidTodynamic())); |
| 48 }, VoidTovoid$())); |
| 49 }; |
| 50 dart.fn(transition_event_test.main, VoidTodynamic()); |
| 51 // Exports: |
| 52 exports.transition_event_test = transition_event_test; |
| 53 }); |
OLD | NEW |