fix window view mock

This commit is contained in:
Fabian Jakobs 2011-07-27 16:47:49 +02:00
commit e949f67df2

View file

@ -38,6 +38,8 @@
define(function(require, exports, module) { define(function(require, exports, module) {
var Window = require("ace/model/window").Window;
exports.MockRenderer = exports.WindowViewMock = WindowViewMock = function(visibleRowCount) { exports.MockRenderer = exports.WindowViewMock = WindowViewMock = function(visibleRowCount) {
this.container = document.createElement("div"); this.container = document.createElement("div");
this.visibleRowCount = visibleRowCount || 20; this.visibleRowCount = visibleRowCount || 20;
@ -49,6 +51,8 @@ exports.MockRenderer = exports.WindowViewMock = WindowViewMock = function(visibl
}; };
this.isWindowViewMock = true; this.isWindowViewMock = true;
this.model = new Window();
}; };
@ -127,38 +131,28 @@ WindowViewMock.prototype.getScrollTopRow = function() {
return this.layerConfig.firstVisibleRow; return this.layerConfig.firstVisibleRow;
}; };
WindowViewMock.prototype.draw = function() { [
}; "draw",
"updateLines",
WindowViewMock.prototype.updateLines = function(startRow, endRow) { "updateBackMarkers",
}; "updateFrontMarkers",
"updateShowInvisibles",
WindowViewMock.prototype.updateBackMarkers = function() { "updatePrintMargin",
}; "updateShowGutter",
"updatePadding",
WindowViewMock.prototype.updateFrontMarkers = function() { "updateHorizScroll",
}; "updateTheme",
"updateCharacterSize",
WindowViewMock.prototype.setBreakpoints = function() { "setBreakpoints",
}; "onResize",
"updateFull",
WindowViewMock.prototype.onResize = function() { "updateText",
}; "showCursor",
"visualizeFocus",
WindowViewMock.prototype.updateFull = function() { "setAnnotations"
}; ].forEach(function(name) {
WindowViewMock.prototype[name] = function() {};
WindowViewMock.prototype.updateText = function() { })
};
WindowViewMock.prototype.showCursor = function() {
};
WindowViewMock.prototype.visualizeFocus = function() {
};
WindowViewMock.prototype.setAnnotations = function() {
};
WindowViewMock.prototype.textToScreenCoordinates = function() { WindowViewMock.prototype.textToScreenCoordinates = function() {
return { return {