Replace goog.events.Event/EventTarget system with our own

This also removes goog.events.listen, goog.events.unlisten,
goog.events.unlistenByKey and goog.events.BrowserEvent.
This commit is contained in:
Andreas Hocevar
2016-01-29 16:29:46 +01:00
parent d87482e415
commit 3f2d79b7fe
110 changed files with 1143 additions and 733 deletions

View File

@@ -34,15 +34,15 @@
* that we don't have other global leaks, we preemptively set the property
* so Mocha can compare the global before and after our tests.
*
* In addition, calling goog.events.listen on the global object (as done
* In addition, calling ol.events.listen on the global object (as done
* in deviceorientation.js) creates a second leak by setting
* goog.events.LISTENER_MAP_PROP_ on the global object.
* ol.events.listenER_MAP_PROP_ on the global object.
*
* We preemptively set both of these properties so Mocha can compare the
* global before and after tests. The call to goog.events.listen also
* global before and after tests. The call to ol.events.listen also
* calls goog.getUid.
*/
goog.events.listen(this, 'test', function() {});
ol.events.listen(this, 'test', function() {});
var errors = [];
var runner = mocha.run(function(evt) {

View File

@@ -15,7 +15,7 @@ describe('ol.rendering.reproj.Image', function() {
return source.getImage(extent, resolution, pixelRatio, sourceProj);
});
if (image.getState() == ol.ImageState.IDLE) {
image.listen('change', function(e) {
ol.events.listen(image, 'change', function(e) {
if (image.getState() == ol.ImageState.LOADED) {
expect(imagesRequested).to.be(1);
resembleCanvas(image.getImage(), expectedUrl, IMAGE_TOLERANCE, done);
@@ -53,7 +53,7 @@ describe('ol.rendering.reproj.Image', function() {
});
});
goog.require('ol.extent');
goog.require('ol.events');
goog.require('ol.proj');
goog.require('ol.proj.EPSG3857');
goog.require('ol.reproj.Image');

View File

@@ -16,7 +16,7 @@ describe('ol.rendering.reproj.Tile', function() {
return source.getTile(z, x, y, pixelRatio, sourceProjection);
});
if (tile.getState() == ol.TileState.IDLE) {
tile.listen('change', function(e) {
ol.events.listen(tile, 'change', function(e) {
if (tile.getState() == ol.TileState.LOADED) {
expect(tilesRequested).to.be(expectedRequests);
resembleCanvas(tile.getImage(), expectedUrl, 7.5, done);
@@ -172,6 +172,7 @@ describe('ol.rendering.reproj.Tile', function() {
});
});
goog.require('ol.events');
goog.require('ol.proj');
goog.require('ol.reproj.Tile');
goog.require('ol.source.XYZ');