• R/O
  • SSH
  • HTTPS

aaoh-kaze: Commit


Commit MetaInfo

Revision26 (tree)
Time2011-11-05 16:44:38
Authorfujishiro

Log Message

qunitにてテスト中

Change Summary

Incremental Difference

--- trunk/src/test1/base/js/aaoh.kaze-core-test.js (revision 25)
+++ trunk/src/test1/base/js/aaoh.kaze-core-test.js (revision 26)
@@ -108,7 +108,7 @@
108108 test('$(getElementById)', function() {
109109 var retVal = aaoh.kaze.Gadget.$('testElement');
110110
111- ok(retVal!= null, '$(getElementById)の取得確認');
111+ ok(retVal != null, '$(getElementById)の取得確認');
112112 });
113113
114114 // extend
@@ -172,10 +172,10 @@
172172 var retVal = aaoh.kaze.Gadget.getPosition();
173173
174174 if (aaoh.kaze.Type.isAIR()) {
175- ok(retVal!= null, 'getPositionの取得確認');
175+ ok(retVal != null, 'getPositionの取得確認');
176176
177177 } else {
178- ok(retVal== null, 'getPositionの取得確認');
178+ ok(retVal == null, 'getPositionの取得確認');
179179 }
180180 });
181181
@@ -240,10 +240,10 @@
240240 var retVal = aaoh.kaze.Gadget.getEvent();
241241
242242 if (aaoh.kaze.Type.isYahoo() || aaoh.kaze.Type.isGoogle()) {
243- ok(retVal!= null, 'getEventの取得確認');
243+ ok(retVal != null, 'getEventの取得確認');
244244
245245 } else {
246- ok(retVal== null, 'getEventの取得確認');
246+ ok(retVal == null, 'getEventの取得確認');
247247 }
248248 });
249249
--- trunk/src/test1/base/js/aaoh.kaze-animation-test.js (revision 25)
+++ trunk/src/test1/base/js/aaoh.kaze-animation-test.js (revision 26)
@@ -20,12 +20,18 @@
2020 test('aaoh.kaze.animation', function() {
2121 var val = !!aaoh.kaze.animation;
2222
23- ok(val, 'aaoh.kaze.animationの存在確認');
23+ ok(val, 'aaoh.kaze.animation縺ョ蟄伜惠遒コ隱?);
2424 });
2525
2626 // aaoh.kaze.animation.Animation
2727 module('aaoh.kaze.animation.Animation');
2828
29+test('Animation', function() {
30+ var ani = new aaoh.kaze.animation.Animation();
31+
32+ ok('Animation縺ョ險ュ螳夂「コ隱?);
33+});
34+
2935 // init
3036 test('init', function() {
3137 var callObj = null;
@@ -45,7 +51,7 @@
4551 startCallable, stopCallable, stepCallable
4652 );
4753
48- ok('initの設定確認');
54+ ok('init縺ョ險ュ螳夂「コ隱?);
4955 });
5056
5157 // start
@@ -67,11 +73,423 @@
6773 startCallable, stopCallable, stepCallable
6874 );
6975
70- ok('initの設定確認');
76+ ok('start縺ョ險ュ螳夂「コ隱?);
7177 });
7278
79+// stop
80+test('stop', function() {
81+ var callObj = null;
82+ var element = aaoh.kaze.Gadget.$('testText');
83+ var speed = 1;
84+ var startValue = 1;
85+ var stopValue = 9;
86+ var stepValue = 1;
87+ var startCallable = null;
88+ var stopCallable = null;
89+ var stepCallable = null;
7390
91+ var ani = new aaoh.kaze.animation.Animation();
92+ ani.init(
93+ callObj, element, speed,
94+ startValue, stopValue, stepValue,
95+ startCallable, stopCallable, stepCallable
96+ );
97+ ani.stop();
7498
75-//TODO
99+ ok('stop縺ョ險ュ螳夂「コ隱?);
100+});
76101
102+// step
103+test('step', function() {
104+ var callObj = null;
105+ var element = aaoh.kaze.Gadget.$('testText');
106+ var speed = 1;
107+ var startValue = 1;
108+ var stopValue = 9;
109+ var stepValue = 1;
110+ var startCallable = null;
111+ var stopCallable = null;
112+ var stepCallable = null;
113+
114+ var ani = new aaoh.kaze.animation.Animation();
115+ ani.init(
116+ callObj, element, speed,
117+ startValue, stopValue, stepValue,
118+ startCallable, stopCallable, stepCallable
119+ );
120+ ani.step();
121+
122+ ok('step縺ョ險ュ螳夂「コ隱?);
123+});
124+
125+// nextValue
126+test('nextValue', function() {
127+ var callObj = null;
128+ var element = aaoh.kaze.Gadget.$('testText');
129+ var speed = 1;
130+ var startValue = 1;
131+ var stopValue = 9;
132+ var stepValue = 1;
133+ var startCallable = null;
134+ var stopCallable = null;
135+ var stepCallable = null;
136+
137+ var ani = new aaoh.kaze.animation.Animation();
138+ ani.init(
139+ callObj, element, speed,
140+ startValue, stopValue, stepValue,
141+ startCallable, stopCallable, stepCallable
142+ );
143+ ani.nextValue();
144+
145+ ok('nextValue縺ョ險ュ螳夂「コ隱?);
146+});
147+
148+// aaoh.kaze.animation.FadeinAnimation
149+module('aaoh.kaze.animation.FadeinAnimation');
150+
151+test('FadeinAnimation', function() {
152+ var element = aaoh.kaze.Gadget.$('testText');
153+
154+ var ani = new aaoh.kaze.animation.FadeinAnimation(element);
155+
156+ ok('FadeinAnimation縺ョ險ュ螳夂「コ隱?);
157+});
158+
159+// startCallable
160+test('startCallable', function() {
161+ var element = aaoh.kaze.Gadget.$('testText');
162+
163+ var ani = new aaoh.kaze.animation.FadeinAnimation(element);
164+ ani.startCallable(element, 1);
165+
166+ ok('startCallable縺ョ險ュ螳夂「コ隱?);
167+});
168+
169+// stopCallable
170+test('stopCallable', function() {
171+ var element = aaoh.kaze.Gadget.$('testText');
172+
173+ var ani = new aaoh.kaze.animation.FadeinAnimation(element);
174+ ani.stopCallable(element, 1);
175+
176+ ok('stopCallable縺ョ險ュ螳夂「コ隱?);
177+});
178+
179+// stepCallable
180+test('stepCallable', function() {
181+ var element = aaoh.kaze.Gadget.$('testText');
182+
183+ var ani = new aaoh.kaze.animation.FadeinAnimation(element);
184+ ani.stepCallable(element, 1);
185+
186+ ok('stepCallable縺ョ險ュ螳夂「コ隱?);
187+});
188+
189+// aaoh.kaze.animation.FadeoutAnimation
190+module('aaoh.kaze.animation.FadeoutAnimation');
191+
192+test('FadeoutAnimation', function() {
193+ var element = aaoh.kaze.Gadget.$('testText');
194+
195+ var ani = new aaoh.kaze.animation.FadeoutAnimation(element);
196+
197+ ok('FadeoutAnimation縺ョ險ュ螳夂「コ隱?);
198+});
199+
200+// startCallable
201+test('startCallable', function() {
202+ var element = aaoh.kaze.Gadget.$('testText');
203+
204+ var ani = new aaoh.kaze.animation.FadeoutAnimation(element);
205+ ani.startCallable(element, 1);
206+
207+ ok('startCallable縺ョ險ュ螳夂「コ隱?);
208+});
209+
210+// stopCallable
211+test('stopCallable', function() {
212+ var element = aaoh.kaze.Gadget.$('testText');
213+
214+ var ani = new aaoh.kaze.animation.FadeoutAnimation(element);
215+ ani.stopCallable(element, 1);
216+
217+ ok('stopCallable縺ョ險ュ螳夂「コ隱?);
218+});
219+
220+// stepCallable
221+test('stepCallable', function() {
222+ var element = aaoh.kaze.Gadget.$('testText');
223+
224+ var ani = new aaoh.kaze.animation.FadeoutAnimation(element);
225+ ani.stepCallable(element, 1);
226+
227+ ok('stepCallable縺ョ險ュ螳夂「コ隱?);
228+ aaoh.kaze.Element.setOpacity(element, 100);
229+});
230+
231+// nextValue
232+test('nextValue', function() {
233+ var element = aaoh.kaze.Gadget.$('testText');
234+
235+ var ani = new aaoh.kaze.animation.FadeoutAnimation(element);
236+ var retVal = ani.nextValue();
237+
238+ same(retVal, null, 'nextValue縺ョ險ュ螳夂「コ隱?);
239+});
240+
241+// aaoh.kaze.animation.MoveAnimation
242+module('aaoh.kaze.animation.MoveAnimation');
243+
244+test('MoveAnimation', function() {
245+ var element = aaoh.kaze.Gadget.$('testText');
246+
247+ var ani = new aaoh.kaze.animation.MoveAnimation(element);
248+
249+ ok('MoveAnimation縺ョ險ュ螳夂「コ隱?);
250+});
251+
252+// startCallable
253+test('startCallable', function() {
254+ var element = aaoh.kaze.Gadget.$('testText');
255+
256+ var ani = new aaoh.kaze.animation.MoveAnimation(element);
257+ ani.startCallable(element, { x: 1, y: 1 });
258+
259+ ok('startCallable縺ョ險ュ螳夂「コ隱?);
260+});
261+
262+// stopCallable
263+test('stopCallable', function() {
264+ var element = aaoh.kaze.Gadget.$('testText');
265+
266+ var ani = new aaoh.kaze.animation.MoveAnimation(element);
267+ ani.stopCallable(element, { x: 1, y: 1 });
268+
269+ ok('stopCallable縺ョ險ュ螳夂「コ隱?);
270+});
271+
272+// stepCallable
273+test('stepCallable', function() {
274+ var element = aaoh.kaze.Gadget.$('testText');
275+
276+ var ani = new aaoh.kaze.animation.MoveAnimation(element);
277+ ani.stepCallable(element, { x: 1, y: 1 });
278+
279+ ok('stepCallable縺ョ險ュ螳夂「コ隱?);
280+});
281+
282+// nextValue
283+test('nextValue', function() {
284+ var element = aaoh.kaze.Gadget.$('testText');
285+
286+ var ani = new aaoh.kaze.animation.MoveAnimation(element);
287+ var retVal = ani.nextValue();
288+
289+ same(retVal, null, 'nextValue縺ョ險ュ螳夂「コ隱?);
290+});
291+
292+// aaoh.kaze.animation.ResizeAnimation
293+module('aaoh.kaze.animation.ResizeAnimation');
294+
295+test('ResizeAnimation', function() {
296+ var element = aaoh.kaze.Gadget.$('testText');
297+
298+ var ani = new aaoh.kaze.animation.ResizeAnimation(element);
299+
300+ ok('ResizeAnimation縺ョ險ュ螳夂「コ隱?);
301+});
302+
303+// startCallable
304+test('startCallable', function() {
305+ var element = aaoh.kaze.Gadget.$('testText');
306+
307+ var ani = new aaoh.kaze.animation.ResizeAnimation(element);
308+ ani.startCallable(element, { width: 1, height: 1 });
309+
310+ ok('startCallable縺ョ險ュ螳夂「コ隱?);
311+});
312+
313+// stopCallable
314+test('stopCallable', function() {
315+ var element = aaoh.kaze.Gadget.$('testText');
316+
317+ var ani = new aaoh.kaze.animation.ResizeAnimation(element);
318+ ani.stopCallable(element, { width: 1, height: 1 });
319+
320+ ok('stopCallable縺ョ險ュ螳夂「コ隱?);
321+});
322+
323+// stepCallable
324+test('stepCallable', function() {
325+ var element = aaoh.kaze.Gadget.$('testText');
326+
327+ var ani = new aaoh.kaze.animation.ResizeAnimation(element);
328+ ani.stepCallable(element, { width: 1, height: 1 });
329+
330+ ok('stepCallable縺ョ險ュ螳夂「コ隱?);
331+});
332+
333+// nextValue
334+test('nextValue', function() {
335+ var element = aaoh.kaze.Gadget.$('testText');
336+
337+ var ani = new aaoh.kaze.animation.ResizeAnimation(element);
338+ var retVal = ani.nextValue();
339+
340+ same(retVal, null, 'nextValue縺ョ險ュ螳夂「コ隱?);
341+ aaoh.kaze.Element.setSize(element, 150, 20);
342+});
343+
344+// aaoh.kaze.animation.BaseColorAnimation
345+module('aaoh.kaze.animation.BaseColorAnimation');
346+
347+test('BaseColorAnimation', function() {
348+ var ani = new aaoh.kaze.animation.BaseColorAnimation();
349+
350+ ok('BaseColorAnimation縺ョ險ュ螳夂「コ隱?);
351+});
352+
353+// nextValue
354+test('nextValue', function() {
355+ var ani = new aaoh.kaze.animation.BaseColorAnimation();
356+ var retVal = ani.nextValue();
357+
358+ same(retVal, null, 'nextValue縺ョ險ュ螳夂「コ隱?);
359+});
360+
361+// toRGB
362+test('nextValue', function() {
363+ var ani = new aaoh.kaze.animation.BaseColorAnimation();
364+ var retVal = ani.toRGB('#000000');
365+
366+ same(retVal.r_, 0, 'nextValue縺ョ險ュ螳夂「コ隱?);
367+ same(retVal.g_, 0, 'nextValue縺ョ險ュ螳夂「コ隱?);
368+ same(retVal.b_, 0, 'nextValue縺ョ險ュ螳夂「コ隱?);
369+});
370+
371+// aaoh.kaze.animation.ForegroundColorAnimation
372+module('aaoh.kaze.animation.ForegroundColorAnimation');
373+
374+test('ForegroundColorAnimation', function() {
375+ var element = aaoh.kaze.Gadget.$('testText');
376+
377+ var ani = new aaoh.kaze.animation.ForegroundColorAnimation(element);
378+
379+ ok('ForegroundColorAnimation縺ョ險ュ螳夂「コ隱?);
380+});
381+
382+// startCallable
383+test('startCallable', function() {
384+ var element = aaoh.kaze.Gadget.$('testText');
385+
386+ var ani = new aaoh.kaze.animation.ForegroundColorAnimation(element);
387+ ani.startCallable(element, new aaoh.kaze.Color('#000000'));
388+
389+ ok('startCallable縺ョ險ュ螳夂「コ隱?);
390+});
391+
392+// stopCallable
393+test('stopCallable', function() {
394+ var element = aaoh.kaze.Gadget.$('testText');
395+
396+ var ani = new aaoh.kaze.animation.ForegroundColorAnimation(element);
397+ ani.stopCallable(element, new aaoh.kaze.Color('#000000'));
398+
399+ ok('stopCallable縺ョ險ュ螳夂「コ隱?);
400+});
401+
402+// stepCallable
403+test('stepCallable', function() {
404+ var element = aaoh.kaze.Gadget.$('testText');
405+
406+ var ani = new aaoh.kaze.animation.ForegroundColorAnimation(element);
407+ ani.stepCallable(element, new aaoh.kaze.Color('#000000'));
408+
409+ ok('stepCallable縺ョ險ュ螳夂「コ隱?);
410+});
411+
412+// aaoh.kaze.animation.BackgroundColorAnimation
413+module('aaoh.kaze.animation.BackgroundColorAnimation');
414+
415+test('BackgroundColorAnimation', function() {
416+ var element = aaoh.kaze.Gadget.$('testText');
417+
418+ var ani = new aaoh.kaze.animation.BackgroundColorAnimation(element);
419+
420+ ok('BackgroundColorAnimation縺ョ險ュ螳夂「コ隱?);
421+});
422+
423+// startCallable
424+test('startCallable', function() {
425+ var element = aaoh.kaze.Gadget.$('testText');
426+
427+ var ani = new aaoh.kaze.animation.BackgroundColorAnimation(element);
428+ ani.startCallable(element, new aaoh.kaze.Color('#000000'));
429+
430+ ok('startCallable縺ョ險ュ螳夂「コ隱?);
431+});
432+
433+// stopCallable
434+test('stopCallable', function() {
435+ var element = aaoh.kaze.Gadget.$('testText');
436+
437+ var ani = new aaoh.kaze.animation.BackgroundColorAnimation(element);
438+ ani.stopCallable(element, new aaoh.kaze.Color('#000000'));
439+
440+ ok('stopCallable縺ョ險ュ螳夂「コ隱?);
441+});
442+
443+// stepCallable
444+test('stepCallable', function() {
445+ var element = aaoh.kaze.Gadget.$('testText');
446+
447+ var ani = new aaoh.kaze.animation.BackgroundColorAnimation(element);
448+ ani.stepCallable(element, new aaoh.kaze.Color('#000000'));
449+
450+ ok('stepCallable縺ョ險ュ螳夂「コ隱?);
451+});
452+
453+
454+// aaoh.kaze.animation.BorderColorAnimation
455+module('aaoh.kaze.animation.BorderColorAnimation');
456+
457+test('BorderColorAnimation', function() {
458+ var element = aaoh.kaze.Gadget.$('testText');
459+
460+ var ani = new aaoh.kaze.animation.BorderColorAnimation(element);
461+
462+ ok('BorderColorAnimation縺ョ險ュ螳夂「コ隱?);
463+});
464+
465+// startCallable
466+test('startCallable', function() {
467+ var element = aaoh.kaze.Gadget.$('testText');
468+
469+ var ani = new aaoh.kaze.animation.BorderColorAnimation(element);
470+ ani.startCallable(element, new aaoh.kaze.Color('#000000'));
471+
472+ ok('startCallable縺ョ險ュ螳夂「コ隱?);
473+});
474+
475+// stopCallable
476+test('stopCallable', function() {
477+ var element = aaoh.kaze.Gadget.$('testText');
478+
479+ var ani = new aaoh.kaze.animation.BorderColorAnimation(element);
480+ ani.stopCallable(element, new aaoh.kaze.Color('#000000'));
481+
482+ ok('stopCallable縺ョ險ュ螳夂「コ隱?);
483+});
484+
485+// stepCallable
486+test('stepCallable', function() {
487+ var element = aaoh.kaze.Gadget.$('testText');
488+
489+ var ani = new aaoh.kaze.animation.BorderColorAnimation(element);
490+ ani.stepCallable(element, new aaoh.kaze.Color('#000000'));
491+
492+ ok('stepCallable縺ョ險ュ螳夂「コ隱?);
493+});
494+
77495 })();
--- trunk/src/main1/lib/aaoh.kaze-animation.js (revision 25)
+++ trunk/src/main1/lib/aaoh.kaze-animation.js (revision 26)
@@ -436,7 +436,11 @@
436436 */
437437 aaoh.kaze.animation.MoveAnimation.prototype.
438438 nextValue = function() {
439- var retValue = { x:0, y: 0 };
439+ if (this.currentValue_ == null) {
440+ return null;
441+ }
442+
443+ var retValue = { x: 0, y: 0 };
440444 retValue.x = this.currentValue_.x + this.stepValue_.x;
441445 retValue.y = this.currentValue_.y + this.stepValue_.y;
442446 if (retValue.x >= this.stopValue_.x) {
@@ -546,7 +550,11 @@
546550 */
547551 aaoh.kaze.animation.ResizeAnimation.prototype.
548552 nextValue = function() {
549- var retValue = { width:0, height: 0 };
553+ if (this.currentValue_ == null) {
554+ return null;
555+ }
556+
557+ var retValue = { width: 0, height: 0 };
550558 retValue.width = this.currentValue_.width + this.stepValue_.width;
551559 retValue.height = this.currentValue_.height + this.stepValue_.height;
552560 if (retValue.width >= this.stopValue_.width) {
@@ -586,6 +594,9 @@
586594 */
587595 aaoh.kaze.animation.BaseColorAnimation.prototype.
588596 nextValue = function() {
597+ if (this.currentValue_ == null) {
598+ return null;
599+ }
589600 var retValue = new aaoh.kaze.Color();
590601
591602 retValue.r_ = this.currentValue_.r_ + this.stepValue_.r_;
@@ -684,7 +695,7 @@
684695 aaoh.kaze.animation.ForegroundColorAnimation.prototype.
685696 startCallable = function(element, startValue) {
686697
687- aaoh.kaze.Element.setForeground(element, color);
698+ aaoh.kaze.Element.setForeground(element, startValue);
688699 }
689700
690701 /**
@@ -696,7 +707,7 @@
696707 aaoh.kaze.animation.ForegroundColorAnimation.prototype.
697708 stopCallable = function(element, stopValue) {
698709
699- aaoh.kaze.Element.setForeground(element, color);
710+ aaoh.kaze.Element.setForeground(element, stopValue);
700711 }
701712
702713 /**
@@ -708,7 +719,7 @@
708719 aaoh.kaze.animation.ForegroundColorAnimation.prototype.
709720 stepCallable = function(element, nextValue) {
710721
711- aaoh.kaze.Element.setForeground(element, color);
722+ aaoh.kaze.Element.setForeground(element, nextValue);
712723 }
713724 })();
714725
@@ -766,7 +777,7 @@
766777 aaoh.kaze.animation.BackgroundColorAnimation.prototype.
767778 startCallable = function(element, startValue) {
768779
769- aaoh.kaze.Element.setForeground(element, color);
780+ aaoh.kaze.Element.setForeground(element, startValue);
770781 }
771782
772783 /**
@@ -778,7 +789,7 @@
778789 aaoh.kaze.animation.BackgroundColorAnimation.prototype.
779790 stopCallable = function(element, stopValue) {
780791
781- aaoh.kaze.Element.setForeground(element, color);
792+ aaoh.kaze.Element.setForeground(element, stopValue);
782793 }
783794
784795 /**
@@ -790,7 +801,7 @@
790801 aaoh.kaze.animation.BackgroundColorAnimation.prototype.
791802 stepCallable = function(element, nextValue) {
792803
793- aaoh.kaze.Element.setForeground(element, color);
804+ aaoh.kaze.Element.setForeground(element, nextValue);
794805 }
795806 })();
796807
@@ -848,7 +859,7 @@
848859 aaoh.kaze.animation.BorderColorAnimation.prototype.
849860 startCallable = function(element, startValue) {
850861
851- aaoh.kaze.Element.setForeground(element, color);
862+ aaoh.kaze.Element.setForeground(element, startValue);
852863 }
853864
854865 /**
@@ -860,7 +871,7 @@
860871 aaoh.kaze.animation.BorderColorAnimation.prototype.
861872 stopCallable = function(element, stopValue) {
862873
863- aaoh.kaze.Element.setForeground(element, color);
874+ aaoh.kaze.Element.setForeground(element, stopValue);
864875 }
865876
866877 /**
@@ -872,6 +883,6 @@
872883 aaoh.kaze.animation.BorderColorAnimation.prototype.
873884 stepCallable = function(element, nextValue) {
874885
875- aaoh.kaze.Element.setForeground(element, color);
886+ aaoh.kaze.Element.setForeground(element, nextValue);
876887 }
877888 })();
Show on old repository browser