fix tests

This commit is contained in:
nightwing 2014-06-09 23:44:27 +04:00
commit c5031db61c
3 changed files with 7 additions and 3 deletions

View file

@ -116,6 +116,7 @@ function DefaultHandlers(mouseHandler) {
else if (!this.$clickSelection) {
editor.selection.moveToPosition(pos);
}
this.select();
}.bind(this), 0);
if (editor.renderer.scroller.setCapture) {
editor.renderer.scroller.setCapture();

View file

@ -58,15 +58,17 @@ module.exports = {
next();
},
"test: double tap. issue #956" : function() {
"test: double tap. issue #956" : function(done) {
// mouse up fired immediately after mouse down
var target = this.editor.renderer.getMouseEventTarget();
target.dispatchEvent(MouseEvent("down", {x: 1, y: 1}));
target.dispatchEvent(MouseEvent("up", {x: 1, y: 1}));
target.dispatchEvent(MouseEvent("down", {x: 1, y: 1, detail: 2}));
target.dispatchEvent(MouseEvent("up", {x: 1, y: 1, detail: 2}));
assert.equal(this.editor.getSelectedText(), "Juhu");
setTimeout(function() {
assert.equal(this.editor.getSelectedText(), "Juhu");
done();
}.bind(this));
}
};

View file

@ -44,6 +44,7 @@ var testNames = [
"ace/mode/folding/xml_test",
"ace/mode/folding/coffee_test",
"ace/multi_select_test",
"ace/mouse/mouse_handler_test",
"ace/occur_test",
"ace/range_test",
"ace/range_list_test",