this.isResolved = true;\r
}\r
this.begin = Math.floor( this.begin * this.fpms);\r
- var s = this.$activate.up();\r
- s.begin = this.begin;\r
- s.dur = this.dur;\r
- s.end = s.end.up();\r
- this.$$activate = s;\r
if (event) {\r
ele = event.id ? this.eventTarget.ownerDocument.getElementById(event.id)\r
: this.eventTarget;\r
\r
/*イベントのリスナーとして、parseメソッドで使う*/\r
listener: function(evt) {\r
- var s = this.$activate.up();\r
+ evt = evt || { timeStamp: 0 };\r
+ var s = this.$activate;\r
s.begin = this.begin;\r
- s.dur = this.dur;\r
- s.end = s.end.up();\r
- this.$$activate = s;\r
s.timeStamp = evt.timeStamp;\r
this.activeTime = s.call();\r
this.addLine(this);\r
- return this;\r
}\r
\r
/*$activate オブジェクト\r
} );\r
\r
describe("A listener method in $begin object", function() {\r
+ var obj = begin.up();\r
beforeEach( function() {\r
begin.string = "";\r
/*配列は初期化しておく*/\r
begin.timelines.length = 0;\r
+ obj.$activate = begin.$activate.up();\r
} );\r
/*境界条件を調べておく (limit value analysis)*/\r
it("should be this for the value (limit value analysis)", function() {\r
- var lis = begin.listener( {\r
+ obj.listener();\r
+ expect(obj.$activate.timeStamp).toBe(0);\r
+ \r
+ obj.listener( {\r
timeStamp: 0\r
} );\r
- expect(lis).toBe(begin);\r
- expect(lis.begin).toBe(0);\r
- expect(lis.activeTime).toBeNull();\r
- expect(lis.timelines.length).toBe(0);\r
+ expect(obj.begin).toBe(0);\r
+ expect(obj.activeTime).toBeNull();\r
+ expect(obj.timelines.length).toBe(0);\r
\r
- lis = begin.up().mix( {\r
- begin: 0,\r
- dur: "12"\r
+ obj.up().mix( {\r
+ begin: 1,\r
+ $activate: begin.$activate.up().mix( {\r
+ dur: "12"\r
+ } )\r
})\r
.listener( {\r
timeStamp: 0\r
} );\r
- expect(lis.begin).toBe(0);\r
- expect(lis.activeTime).toEqual(Math.floor(12000*lis.fpms));\r
+ expect(obj.$1.begin).toBe(1);\r
+ expect(obj.$1.activeTime).toEqual(Math.floor(12000*obj.fpms));\r
+ expect(obj.$1.$activate.begin).toBe(obj.$1.begin);\r
+ expect(obj.timelines[0]).toBe(obj.$1);\r
} );\r
/*同値分割をして、有効同値クラスを調べておく (Equivalence partitioning, the following is the valid partion)*/\r
it("should be this for the value (the valid partion)", function() {\r
+ obj.up().mix( {\r
+ begin: 1,\r
+ $activate: begin.$activate.up().mix( {\r
+ dur: "12"\r
+ } )\r
+ })\r
+ .listener( {\r
+ timeStamp: 0\r
+ } );\r
+ expect(obj.$1.begin).toBe(1);\r
+ expect(obj.$1.activeTime).toEqual(Math.floor(12000*obj.fpms));\r
\r
} );\r
/*無効同値クラスを調べておく (Equivalence partitioning, the following is the invalid partion)*/\r