mirror of
https://github.com/konvajs/konva.git
synced 2026-01-02 20:42:42 +08:00
setup data url hash for functional tests so that we can compare the visual result before and after a series of simulated events
This commit is contained in:
2
dist/kinetic-core.js
vendored
2
dist/kinetic-core.js
vendored
@@ -3,7 +3,7 @@
|
||||
* http://www.kineticjs.com/
|
||||
* Copyright 2012, Eric Rowell
|
||||
* Licensed under the MIT or GPL Version 2 licenses.
|
||||
* Date: Jun 15 2012
|
||||
* Date: Jun 16 2012
|
||||
*
|
||||
* Copyright (C) 2011 - 2012 by Eric Rowell
|
||||
*
|
||||
|
||||
2
dist/kinetic-core.min.js
vendored
2
dist/kinetic-core.min.js
vendored
@@ -3,7 +3,7 @@
|
||||
* http://www.kineticjs.com/
|
||||
* Copyright 2012, Eric Rowell
|
||||
* Licensed under the MIT or GPL Version 2 licenses.
|
||||
* Date: Jun 15 2012
|
||||
* Date: Jun 16 2012
|
||||
*
|
||||
* Copyright (C) 2011 - 2012 by Eric Rowell
|
||||
*
|
||||
|
||||
3
tests/assets/dataUrls.js
Normal file
3
tests/assets/dataUrls.js
Normal file
File diff suppressed because one or more lines are too long
@@ -3,6 +3,7 @@
|
||||
<head>
|
||||
<link rel="stylesheet" type="text/css"href="../base.css">
|
||||
<script src="../../dist/kinetic-core.js"></script>
|
||||
<script src="../assets/dataUrls.js"></script>
|
||||
<script src="../js/Test.js"></script>
|
||||
<script src="../js/functionalTests.js"></script>
|
||||
<script>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
Test.prototype.tests = {
|
||||
'DRAG AND DROP - test dragstart, dragmove, dragend': function(containerId) {
|
||||
var urls = dataUrls['DRAG AND DROP - test dragstart, dragmove, dragend'];
|
||||
|
||||
var stage = new Kinetic.Stage({
|
||||
container: containerId,
|
||||
width: 578,
|
||||
@@ -39,6 +41,9 @@ Test.prototype.tests = {
|
||||
circle.on('dragend', function() {
|
||||
dragEnd = true;
|
||||
});
|
||||
|
||||
stage.toDataURL(function(startDataUrl) {
|
||||
test(urls[0] === startDataUrl, 'start data url is incorrect');
|
||||
/*
|
||||
* simulate drag and drop
|
||||
*/
|
||||
@@ -70,6 +75,11 @@ Test.prototype.tests = {
|
||||
test(dragStart, 'dragstart event was not triggered');
|
||||
test(dragMove, 'dragmove event was not triggered');
|
||||
test(dragEnd, 'dragend event was not triggered');
|
||||
|
||||
stage.toDataURL(function(endDataUrl) {
|
||||
test(urls[1] === endDataUrl, 'end data url is incorrect');
|
||||
});
|
||||
}, 100);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user