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:
@@ -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) {
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user