diff options
Diffstat (limited to 'contexts/data/lib/closure-library/closure/goog/fx/css3')
11 files changed, 83 insertions, 635 deletions
diff --git a/contexts/data/lib/closure-library/closure/goog/fx/css3/.svn/all-wcprops b/contexts/data/lib/closure-library/closure/goog/fx/css3/.svn/all-wcprops deleted file mode 100644 index 2eef29a..0000000 --- a/contexts/data/lib/closure-library/closure/goog/fx/css3/.svn/all-wcprops +++ /dev/null @@ -1,23 +0,0 @@ -K 25 -svn:wc:ra_dav:version-url -V 45 -/svn/!svn/ver/1331/trunk/closure/goog/fx/css3 -END -transition.js -K 25 -svn:wc:ra_dav:version-url -V 59 -/svn/!svn/ver/1331/trunk/closure/goog/fx/css3/transition.js -END -fx.js -K 25 -svn:wc:ra_dav:version-url -V 51 -/svn/!svn/ver/1103/trunk/closure/goog/fx/css3/fx.js -END -transition_test.html -K 25 -svn:wc:ra_dav:version-url -V 66 -/svn/!svn/ver/1331/trunk/closure/goog/fx/css3/transition_test.html -END diff --git a/contexts/data/lib/closure-library/closure/goog/fx/css3/.svn/entries b/contexts/data/lib/closure-library/closure/goog/fx/css3/.svn/entries deleted file mode 100644 index ae887c8..0000000 --- a/contexts/data/lib/closure-library/closure/goog/fx/css3/.svn/entries +++ /dev/null @@ -1,130 +0,0 @@ -10 - -dir -1494 -http://closure-library.googlecode.com/svn/trunk/closure/goog/fx/css3 -http://closure-library.googlecode.com/svn - - - -2011-10-11T10:31:58.000000Z -1331 -steineldar@google.com - - - - - - - - - - - - - - -0b95b8e8-c90f-11de-9d4f-f947ee5921c8 - -transition.js -file - - - - -2011-12-23T22:42:27.639320Z -7a005d46bf9ddfe449eb8f0cd2cd8f61 -2011-10-11T10:31:58.000000Z -1331 -steineldar@google.com -has-props - - - - - - - - - - - - - - - - - - - - -5402 - -fx.js -file - - - - -2011-12-23T22:42:27.640320Z -4172ad822ced4254fc274210740970b1 -2011-07-06T22:48:20.000000Z -1103 -chrishenry@google.com -has-props - - - - - - - - - - - - - - - - - - - - -2141 - -transition_test.html -file - - - - -2011-12-23T22:42:27.641320Z -8be6e83ce22d5929b9b8ca74dc056060 -2011-10-11T10:31:58.000000Z -1331 -steineldar@google.com -has-props - - - - - - - - - - - - - - - - - - - - -4255 - diff --git a/contexts/data/lib/closure-library/closure/goog/fx/css3/.svn/prop-base/fx.js.svn-base b/contexts/data/lib/closure-library/closure/goog/fx/css3/.svn/prop-base/fx.js.svn-base deleted file mode 100644 index 530636b..0000000 --- a/contexts/data/lib/closure-library/closure/goog/fx/css3/.svn/prop-base/fx.js.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 15 -text/javascript -END diff --git a/contexts/data/lib/closure-library/closure/goog/fx/css3/.svn/prop-base/transition.js.svn-base b/contexts/data/lib/closure-library/closure/goog/fx/css3/.svn/prop-base/transition.js.svn-base deleted file mode 100644 index 530636b..0000000 --- a/contexts/data/lib/closure-library/closure/goog/fx/css3/.svn/prop-base/transition.js.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 15 -text/javascript -END diff --git a/contexts/data/lib/closure-library/closure/goog/fx/css3/.svn/prop-base/transition_test.html.svn-base b/contexts/data/lib/closure-library/closure/goog/fx/css3/.svn/prop-base/transition_test.html.svn-base deleted file mode 100644 index d356868..0000000 --- a/contexts/data/lib/closure-library/closure/goog/fx/css3/.svn/prop-base/transition_test.html.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 13 -svn:mime-type -V 9 -text/html -END diff --git a/contexts/data/lib/closure-library/closure/goog/fx/css3/.svn/text-base/fx.js.svn-base b/contexts/data/lib/closure-library/closure/goog/fx/css3/.svn/text-base/fx.js.svn-base deleted file mode 100644 index 0ca6428..0000000 --- a/contexts/data/lib/closure-library/closure/goog/fx/css3/.svn/text-base/fx.js.svn-base +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2011 The Closure Library Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS-IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @fileoverview A collection of CSS3 targeted animation, based on - * {@code goog.fx.css3.Transition}. - * - */ - -goog.provide('goog.fx.css3'); - -goog.require('goog.fx.css3.Transition'); - - - -/** - * Creates a transition to fade the element. - * @param {Element} element The element to fade. - * @param {number} duration Duration in seconds. - * @param {string} timing The CSS3 timing function. - * @param {number} startOpacity Starting opacity. - * @param {number} endOpacity Ending opacity. - * @return {goog.fx.css3.Transition} The transition object. - */ -goog.fx.css3.fade = function( - element, duration, timing, startOpacity, endOpacity) { - return new goog.fx.css3.Transition( - element, duration, {'opacity': startOpacity}, {'opacity': endOpacity}, - {property: 'opacity', duration: duration, timing: timing, delay: 0}); -}; - - -/** - * Creates a transition to fade in the element. - * @param {Element} element The element to fade in. - * @param {number} duration Duration in seconds. - * @return {goog.fx.css3.Transition} The transition object. - */ -goog.fx.css3.fadeIn = function(element, duration) { - return goog.fx.css3.fade(element, duration, 'ease-out', 0, 1); -}; - - -/** - * Creates a transition to fade out the element. - * @param {Element} element The element to fade out. - * @param {number} duration Duration in seconds. - * @return {goog.fx.css3.Transition} The transition object. - */ -goog.fx.css3.fadeOut = function(element, duration) { - return goog.fx.css3.fade(element, duration, 'ease-in', 1, 0); -}; diff --git a/contexts/data/lib/closure-library/closure/goog/fx/css3/.svn/text-base/transition.js.svn-base b/contexts/data/lib/closure-library/closure/goog/fx/css3/.svn/text-base/transition.js.svn-base deleted file mode 100644 index 768efb5..0000000 --- a/contexts/data/lib/closure-library/closure/goog/fx/css3/.svn/text-base/transition.js.svn-base +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright 2011 The Closure Library Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS-IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @fileoverview CSS3 transition base library. - * - */ - -goog.provide('goog.fx.css3.Transition'); - -goog.require('goog.Timer'); -goog.require('goog.fx.TransitionBase'); -goog.require('goog.style'); -goog.require('goog.style.transition'); - - - -/** - * A class to handle targeted CSS3 transition. This class - * handles common features required for targeted CSS3 transition. - * - * Browser that does not support CSS3 transition will still receive all - * the events fired by the transition object, but will not have any transition - * played. If the browser supports the final state as set in setFinalState - * method, the element will ends in the final state. - * - * Transitioning multiple properties with the same setting is possible - * by setting Css3Property's property to 'all'. Performing multiple - * transitions can be done via setting multiple initialStyle, - * finalStyle and transitions. Css3Property's delay can be used to - * delay one of the transition. Here is an example for a transition - * that expands on the width and then followed by the height: - * - * <pre> - * initialStyle: {width: 10px, height: 10px} - * finalStyle: {width: 100px, height: 100px} - * transitions: [ - * {property: width, duration: 1, timing: 'ease-in', delay: 0}, - * {property: height, duration: 1, timing: 'ease-in', delay: 1} - * ] - * </pre> - * - * @param {Element} element The element to be transitioned. - * @param {number} duration The duration of the transition in seconds. - * This should be the longest of all transitions. - * @param {Object} initialStyle Initial style properties of the element before - * animating. Set using {@code goog.style.setStyle}. - * @param {Object} finalStyle Final style properties of the element after - * animating. Set using {@code goog.style.setStyle}. - * @param {goog.style.transition.Css3Property| - * Array.<goog.style.transition.Css3Property>} transitions A single CSS3 - * transition property or an array of it. - * @extends {goog.fx.TransitionBase} - * @constructor - */ -goog.fx.css3.Transition = function( - element, duration, initialStyle, finalStyle, transitions) { - goog.base(this); - - /** - * @type {Element} - * @private - */ - this.element_ = element; - - /** - * @type {number} - * @private - */ - this.duration_ = duration; - - /** - * @type {Object} - * @private - */ - this.initialStyle_ = initialStyle; - - /** - * @type {Object} - * @private - */ - this.finalStyle_ = finalStyle; - - /** - * @type {Array.<goog.style.transition.Css3Property>} - * @private - */ - this.transitions_ = goog.isArray(transitions) ? transitions : [transitions]; -}; -goog.inherits(goog.fx.css3.Transition, goog.fx.TransitionBase); - - -/** - * Timer id to be used to cancel animation part-way. - * @type {number} - * @private - */ -goog.fx.css3.Transition.prototype.timerId_; - - -/** @override */ -goog.fx.css3.Transition.prototype.play = function() { - if (this.isPlaying()) { - return false; - } - - this.onBegin(); - this.onPlay(); - - this.startTime = goog.now(); - this.setStatePlaying(); - - if (goog.style.transition.isSupported()) { - goog.style.setStyle(this.element_, this.initialStyle_); - // Allow element to get updated to its initial state before installing - // CSS3 transition. - goog.Timer.callOnce(this.play_, undefined, this); - return true; - } else { - this.stop_(false); - return false; - } -}; - - -/** - * Helper method for play method. This needs to be executed on a timer. - * @private - */ -goog.fx.css3.Transition.prototype.play_ = function() { - goog.style.transition.set(this.element_, this.transitions_); - goog.style.setStyle(this.element_, this.finalStyle_); - this.timerId_ = goog.Timer.callOnce( - goog.bind(this.stop_, this, false), this.duration_ * 1000); -}; - - -/** @override */ -goog.fx.css3.Transition.prototype.stop = function() { - if (!this.isPlaying()) return; - - if (this.timerId_) { - goog.Timer.clear(this.timerId_); - this.timerId_ = 0; - } - this.stop_(true); -}; - - -/** - * Helper method for stop method. - * @param {boolean} stopped If the transition was stopped. - * @private - */ -goog.fx.css3.Transition.prototype.stop_ = function(stopped) { - goog.style.transition.removeAll(this.element_); - - // Make sure that we have reached the final style. - goog.style.setStyle(this.element_, this.finalStyle_); - - this.endTime = goog.now(); - this.setStateStopped(); - - if (stopped) { - this.onStop(); - } else { - this.onFinish(); - } - this.onEnd(); -}; - - -/** @override */ -goog.fx.css3.Transition.prototype.disposeInternal = function() { - this.stop(); - goog.base(this, 'disposeInternal'); -}; - - -/** - * Pausing CSS3 Transitions in not supported. - */ -goog.fx.css3.Transition.prototype.pause = function() { - goog.asserts.assert(false, 'Css3 transitions does not support pause action.'); -}; diff --git a/contexts/data/lib/closure-library/closure/goog/fx/css3/.svn/text-base/transition_test.html.svn-base b/contexts/data/lib/closure-library/closure/goog/fx/css3/.svn/text-base/transition_test.html.svn-base deleted file mode 100644 index f4b16f9..0000000 --- a/contexts/data/lib/closure-library/closure/goog/fx/css3/.svn/text-base/transition_test.html.svn-base +++ /dev/null @@ -1,174 +0,0 @@ -<!DOCTYPE html> -<html> -<!-- -Copyright 2011 The Closure Library Authors. All Rights Reserved. - -Use of this source code is governed by the Apache License, Version 2.0. -See the COPYING file for details. ---> -<!-- ---> -<head> -<meta http-equiv="X-UA-Compatible" content="IE=edge"> -<title>Closure Unit Tests - goog.fx.css3.Transition</title> -<script src="../../base.js"></script> -<script> - goog.require('goog.dispose'); - goog.require('goog.dom'); - goog.require('goog.events'); - goog.require('goog.fx.css3.Transition'); - goog.require('goog.style.transition'); - goog.require('goog.testing.MockClock'); - goog.require('goog.testing.jsunit'); -</script> -</head> -<body> -<script> - -var transition; -var element; -var mockClock; - - -function createTransition(element, duration) { - return new goog.fx.css3.Transition( - element, duration, {'opacity': 0}, {'opacity': 1}, - {property: 'opacity', duration: duration, timing: 'ease-in', delay: 0}); -} - - -function setUp() { - mockClock = new goog.testing.MockClock(true); - element = goog.dom.createElement('div'); - document.body.appendChild(element); -} - - -function tearDown() { - goog.dispose(transition); - goog.dispose(mockClock); - goog.dom.removeNode(element); -} - - -function testPlayEventFiredOnPlay() { - if (!goog.style.transition.isSupported()) return; - - transition = createTransition(element, 10); - var handlerCalled = false; - goog.events.listen(transition, goog.fx.Transition.EventType.PLAY, - function() { - handlerCalled = true; - }); - - transition.play(); - assertTrue(handlerCalled); -} - - -function testBeginEventFiredOnPlay() { - if (!goog.style.transition.isSupported()) return; - - transition = createTransition(element, 10); - var handlerCalled = false; - goog.events.listen(transition, goog.fx.Transition.EventType.BEGIN, - function() { - handlerCalled = true; - }); - - transition.play(); - assertTrue(handlerCalled); -} - - -function testFinishEvents() { - if (!goog.style.transition.isSupported()) return; - - transition = createTransition(element, 10); - var finishHandlerCalled = false; - var endHandlerCalled = false; - goog.events.listen(transition, goog.fx.Transition.EventType.FINISH, - function() { - finishHandlerCalled = true; - }); - goog.events.listen(transition, goog.fx.Transition.EventType.END, - function() { - endHandlerCalled = true; - }); - - transition.play(); - - mockClock.tick(10000); - - assertTrue(finishHandlerCalled); - assertTrue(endHandlerCalled); -} - - -function testStopEvents() { - if (!goog.style.transition.isSupported()) return; - - transition = createTransition(element, 10); - - var stopHandlerCalled = false; - var endHandlerCalled = false; - goog.events.listen(transition, goog.fx.Transition.EventType.STOP, - function() { - stopHandlerCalled = true; - }); - goog.events.listen(transition, goog.fx.Transition.EventType.END, - function() { - endHandlerCalled = true; - }); - - transition.play(); - transition.stop(); - assertTrue(stopHandlerCalled); - assertTrue(endHandlerCalled); -} - -function testUnsupportedEvents() { - if (goog.style.transition.isSupported()) return; - - transition = createTransition(element, 10); - - var stopHandlerCalled = false; - var finishHandlerCalled = false, endHandlerCalled = false; - var beginHandlerCalled = false, playHandlerCalled = false; - goog.events.listen(transition, goog.fx.Transition.EventType.BEGIN, - function() { - beginHandlerCalled = true; - }); - goog.events.listen(transition, goog.fx.Transition.EventType.PLAY, - function() { - playHandlerCalled = true; - }); - goog.events.listen(transition, goog.fx.Transition.EventType.FINISH, - function() { - finishHandlerCalled = true; - }); - goog.events.listen(transition, goog.fx.Transition.EventType.END, - function() { - endHandlerCalled = true; - }); - - goog.events.listen(transition, goog.fx.Transition.EventType.STOP, - function() { - stopHandlerCalled = true; - }); - - assertFalse(transition.play()); - - assertTrue(beginHandlerCalled); - assertTrue(playHandlerCalled); - assertTrue(endHandlerCalled); - assertTrue(finishHandlerCalled); - - transition.stop(); - - assertFalse(stopHandlerCalled); -} - -</script> -</body> -</html> diff --git a/contexts/data/lib/closure-library/closure/goog/fx/css3/fx.js b/contexts/data/lib/closure-library/closure/goog/fx/css3/fx.js index 0ca6428..04a28ea 100644 --- a/contexts/data/lib/closure-library/closure/goog/fx/css3/fx.js +++ b/contexts/data/lib/closure-library/closure/goog/fx/css3/fx.js @@ -23,7 +23,6 @@ goog.provide('goog.fx.css3'); goog.require('goog.fx.css3.Transition'); - /** * Creates a transition to fade the element. * @param {Element} element The element to fade. @@ -31,7 +30,7 @@ goog.require('goog.fx.css3.Transition'); * @param {string} timing The CSS3 timing function. * @param {number} startOpacity Starting opacity. * @param {number} endOpacity Ending opacity. - * @return {goog.fx.css3.Transition} The transition object. + * @return {!goog.fx.css3.Transition} The transition object. */ goog.fx.css3.fade = function( element, duration, timing, startOpacity, endOpacity) { @@ -45,7 +44,7 @@ goog.fx.css3.fade = function( * Creates a transition to fade in the element. * @param {Element} element The element to fade in. * @param {number} duration Duration in seconds. - * @return {goog.fx.css3.Transition} The transition object. + * @return {!goog.fx.css3.Transition} The transition object. */ goog.fx.css3.fadeIn = function(element, duration) { return goog.fx.css3.fade(element, duration, 'ease-out', 0, 1); @@ -56,7 +55,7 @@ goog.fx.css3.fadeIn = function(element, duration) { * Creates a transition to fade out the element. * @param {Element} element The element to fade out. * @param {number} duration Duration in seconds. - * @return {goog.fx.css3.Transition} The transition object. + * @return {!goog.fx.css3.Transition} The transition object. */ goog.fx.css3.fadeOut = function(element, duration) { return goog.fx.css3.fade(element, duration, 'ease-in', 1, 0); diff --git a/contexts/data/lib/closure-library/closure/goog/fx/css3/transition.js b/contexts/data/lib/closure-library/closure/goog/fx/css3/transition.js index 768efb5..b0da78c 100644 --- a/contexts/data/lib/closure-library/closure/goog/fx/css3/transition.js +++ b/contexts/data/lib/closure-library/closure/goog/fx/css3/transition.js @@ -125,7 +125,7 @@ goog.fx.css3.Transition.prototype.play = function() { goog.style.setStyle(this.element_, this.initialStyle_); // Allow element to get updated to its initial state before installing // CSS3 transition. - goog.Timer.callOnce(this.play_, undefined, this); + this.timerId_ = goog.Timer.callOnce(this.play_, undefined, this); return true; } else { this.stop_(false); @@ -150,10 +150,6 @@ goog.fx.css3.Transition.prototype.play_ = function() { goog.fx.css3.Transition.prototype.stop = function() { if (!this.isPlaying()) return; - if (this.timerId_) { - goog.Timer.clear(this.timerId_); - this.timerId_ = 0; - } this.stop_(true); }; @@ -166,6 +162,9 @@ goog.fx.css3.Transition.prototype.stop = function() { goog.fx.css3.Transition.prototype.stop_ = function(stopped) { goog.style.transition.removeAll(this.element_); + // Clear the timer. + goog.Timer.clear(this.timerId_); + // Make sure that we have reached the final style. goog.style.setStyle(this.element_, this.finalStyle_); @@ -190,6 +189,7 @@ goog.fx.css3.Transition.prototype.disposeInternal = function() { /** * Pausing CSS3 Transitions in not supported. + * @override */ goog.fx.css3.Transition.prototype.pause = function() { goog.asserts.assert(false, 'Css3 transitions does not support pause action.'); diff --git a/contexts/data/lib/closure-library/closure/goog/fx/css3/transition_test.html b/contexts/data/lib/closure-library/closure/goog/fx/css3/transition_test.html index f4b16f9..0f24cf8 100644 --- a/contexts/data/lib/closure-library/closure/goog/fx/css3/transition_test.html +++ b/contexts/data/lib/closure-library/closure/goog/fx/css3/transition_test.html @@ -13,6 +13,7 @@ See the COPYING file for details. <title>Closure Unit Tests - goog.fx.css3.Transition</title> <script src="../../base.js"></script> <script> + goog.require('goog.Timer'); goog.require('goog.dispose'); goog.require('goog.dom'); goog.require('goog.events'); @@ -20,6 +21,7 @@ See the COPYING file for details. goog.require('goog.style.transition'); goog.require('goog.testing.MockClock'); goog.require('goog.testing.jsunit'); + goog.require('goog.testing.recordFunction'); </script> </head> <body> @@ -81,7 +83,7 @@ function testBeginEventFiredOnPlay() { } -function testFinishEvents() { +function testFinishEventsFiredAfterFinish() { if (!goog.style.transition.isSupported()) return; transition = createTransition(element, 10); @@ -105,29 +107,7 @@ function testFinishEvents() { } -function testStopEvents() { - if (!goog.style.transition.isSupported()) return; - - transition = createTransition(element, 10); - - var stopHandlerCalled = false; - var endHandlerCalled = false; - goog.events.listen(transition, goog.fx.Transition.EventType.STOP, - function() { - stopHandlerCalled = true; - }); - goog.events.listen(transition, goog.fx.Transition.EventType.END, - function() { - endHandlerCalled = true; - }); - - transition.play(); - transition.stop(); - assertTrue(stopHandlerCalled); - assertTrue(endHandlerCalled); -} - -function testUnsupportedEvents() { +function testEventsWhenTransitionIsUnsupported() { if (goog.style.transition.isSupported()) return; transition = createTransition(element, 10); @@ -151,7 +131,6 @@ function testUnsupportedEvents() { function() { endHandlerCalled = true; }); - goog.events.listen(transition, goog.fx.Transition.EventType.STOP, function() { stopHandlerCalled = true; @@ -169,6 +148,77 @@ function testUnsupportedEvents() { assertFalse(stopHandlerCalled); } + +function testCallingStopDuringAnimationWorks() { + if (!goog.style.transition.isSupported()) return; + + transition = createTransition(element, 10); + + var stopHandler = goog.testing.recordFunction(); + var endHandler = goog.testing.recordFunction(); + var finishHandler = goog.testing.recordFunction(); + goog.events.listen(transition, goog.fx.Transition.EventType.STOP, + stopHandler); + goog.events.listen(transition, goog.fx.Transition.EventType.END, + endHandler); + goog.events.listen(transition, goog.fx.Transition.EventType.FINISH, + finishHandler); + + transition.play(); + mockClock.tick(1); + transition.stop(); + assertEquals(1, stopHandler.getCallCount()); + assertEquals(1, endHandler.getCallCount()); + mockClock.tick(10000); + assertEquals(0, finishHandler.getCallCount()); +} + + +function testCallingStopImmediatelyWorks() { + if (!goog.style.transition.isSupported()) return; + + transition = createTransition(element, 10); + + var stopHandler = goog.testing.recordFunction(); + var endHandler = goog.testing.recordFunction(); + var finishHandler = goog.testing.recordFunction(); + goog.events.listen(transition, goog.fx.Transition.EventType.STOP, + stopHandler); + goog.events.listen(transition, goog.fx.Transition.EventType.END, + endHandler); + goog.events.listen(transition, goog.fx.Transition.EventType.FINISH, + finishHandler); + + transition.play(); + transition.stop(); + assertEquals(1, stopHandler.getCallCount()); + assertEquals(1, endHandler.getCallCount()); + mockClock.tick(10000); + assertEquals(0, finishHandler.getCallCount()); +} + +function testCallingStopAfterAnimationDoesNothing() { + if (!goog.style.transition.isSupported()) return; + + transition = createTransition(element, 10); + + var stopHandler = goog.testing.recordFunction(); + var endHandler = goog.testing.recordFunction(); + var finishHandler = goog.testing.recordFunction(); + goog.events.listen(transition, goog.fx.Transition.EventType.STOP, + stopHandler); + goog.events.listen(transition, goog.fx.Transition.EventType.END, + endHandler); + goog.events.listen(transition, goog.fx.Transition.EventType.FINISH, + finishHandler); + + transition.play(); + mockClock.tick(10000); + transition.stop(); + assertEquals(0, stopHandler.getCallCount()); + assertEquals(1, endHandler.getCallCount()); + assertEquals(1, finishHandler.getCallCount()); +} </script> </body> </html> |