mirror of
https://github.com/konvajs/konva.git
synced 2025-09-19 10:47:59 +08:00
added throttling unit tests
This commit is contained in:
@@ -193,9 +193,7 @@ Test.prototype.tests = {
|
||||
width: 578,
|
||||
height: 200
|
||||
});
|
||||
var layer = new Kinetic.Layer({
|
||||
throttle: 100
|
||||
});
|
||||
var layer = new Kinetic.Layer();
|
||||
var rect = new Kinetic.Rect({
|
||||
x: 200,
|
||||
y: 100,
|
||||
@@ -1227,9 +1225,7 @@ Test.prototype.tests = {
|
||||
width: 578,
|
||||
height: 200
|
||||
});
|
||||
var layer = new Kinetic.Layer({
|
||||
throttle: 12
|
||||
});
|
||||
var layer = new Kinetic.Layer();
|
||||
var circle = new Kinetic.Circle({
|
||||
x: stage.getWidth() / 2,
|
||||
y: stage.getHeight() / 2,
|
||||
|
@@ -543,6 +543,30 @@ Test.prototype.tests = {
|
||||
// LAYERS tests
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
'LAYERS - add layer': function(containerId) {
|
||||
var stage = new Kinetic.Stage({
|
||||
container: containerId,
|
||||
width: 578,
|
||||
height: 200
|
||||
});
|
||||
var layer = new Kinetic.Layer();
|
||||
stage.add(layer);
|
||||
},
|
||||
'LAYERS - throttling': function(containerId) {
|
||||
var stage = new Kinetic.Stage({
|
||||
container: containerId,
|
||||
width: 578,
|
||||
height: 200
|
||||
});
|
||||
var layer = new Kinetic.Layer({
|
||||
throttle: 20
|
||||
});
|
||||
stage.add(layer);
|
||||
|
||||
test(layer.getThrottle() === 20, 'throttle should be 20');
|
||||
layer.setThrottle(13);
|
||||
test(layer.getThrottle() === 13, 'throttle should be 13');
|
||||
},
|
||||
'LAYERS - add layer': function(containerId) {
|
||||
var stage = new Kinetic.Stage({
|
||||
container: containerId,
|
||||
|
Reference in New Issue
Block a user