From d781df3290db06923ce2c76ee762b2cfc4021f78 Mon Sep 17 00:00:00 2001 From: juliandescottes Date: Sun, 29 Jan 2017 00:11:58 +0100 Subject: [PATCH] add drawing test for center tool --- src/js/devtools/DrawingTestRecorder.js | 2 +- test/drawing/DrawingTests.browser.js | 1 + test/drawing/DrawingTests.casper.js | 1 + test/drawing/tests/transform.center.json | 127 +++++++++++++++++++++++ 4 files changed, 130 insertions(+), 1 deletion(-) create mode 100644 test/drawing/tests/transform.center.json diff --git a/src/js/devtools/DrawingTestRecorder.js b/src/js/devtools/DrawingTestRecorder.js index 96ba50fc..de15ec66 100644 --- a/src/js/devtools/DrawingTestRecorder.js +++ b/src/js/devtools/DrawingTestRecorder.js @@ -64,7 +64,7 @@ events : this.events, initialState : this.initialState, png : png - }); + }, null, ' '); this.reset(); diff --git a/test/drawing/DrawingTests.browser.js b/test/drawing/DrawingTests.browser.js index 7fd58847..4cf74677 100644 --- a/test/drawing/DrawingTests.browser.js +++ b/test/drawing/DrawingTests.browser.js @@ -16,6 +16,7 @@ "stroke.json", "verticalpen.drawing.json", "dithering.basic.json", + "transform.center.json", "transform.clone.once.json", "transform.clone.twice.undo.once.json", "transform.rotate.once.alt.json", diff --git a/test/drawing/DrawingTests.casper.js b/test/drawing/DrawingTests.casper.js index 2ac40302..222da583 100644 --- a/test/drawing/DrawingTests.casper.js +++ b/test/drawing/DrawingTests.casper.js @@ -14,6 +14,7 @@ "stroke.json", "verticalpen.drawing.json", "dithering.basic.json", + "transform.center.json", "transform.clone.once.json", "transform.clone.twice.undo.once.json", "transform.rotate.once.alt.json", diff --git a/test/drawing/tests/transform.center.json b/test/drawing/tests/transform.center.json new file mode 100644 index 00000000..40103171 --- /dev/null +++ b/test/drawing/tests/transform.center.json @@ -0,0 +1,127 @@ +{ + "events": [ + { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 1, + "y": 0 + }, + "type": "mouse-event" + }, + { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 1, + "y": 0 + }, + "type": "mouse-event" + }, + { + "type": "instrumented-event", + "methodName": "addFrame", + "args": [] + }, + { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 1, + "y": 2 + }, + "type": "mouse-event" + }, + { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 1, + "y": 2 + }, + "type": "mouse-event" + }, + { + "type": "transformtool-event", + "toolId": "tool-center", + "event": { + "shiftKey": false, + "altKey": false, + "ctrlKey": false + } + }, + { + "type": "instrumented-event", + "methodName": "addFrame", + "args": [] + }, + { + "event": { + "type": "mousedown", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 2 + }, + "type": "mouse-event" + }, + { + "event": { + "type": "mouseup", + "button": 0, + "shiftKey": false, + "altKey": false, + "ctrlKey": false + }, + "coords": { + "x": 0, + "y": 2 + }, + "type": "mouse-event" + }, + { + "type": "transformtool-event", + "toolId": "tool-center", + "event": { + "shiftKey": true, + "altKey": false, + "ctrlKey": false + } + } + ], + "initialState": { + "size": { + "width": 3, + "height": 3 + }, + "primaryColor": "#000000", + "secondaryColor": "rgba(0, 0, 0, 0)", + "selectedTool": "tool-pen", + "penSize": 1 + }, + "png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAADCAYAAABBCiV2AAAAGUlEQVQYV2NkIAIwQtX8Z2BgwMmGSeA1DwCjQQMEFdnXsgAAAABJRU5ErkJggg==" +} \ No newline at end of file