From 4be8c169d45a84aaba2626423bbea1a6e97bb876 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Junod?= Date: Tue, 5 Aug 2008 11:44:36 +0000 Subject: [PATCH] test Strategy.activate and Strategy.deactivate git-svn-id: http://svn.openlayers.org/trunk/openlayers@7706 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- tests/Strategy.html | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/tests/Strategy.html b/tests/Strategy.html index 3f8ebe5bf5..4e16c3c30a 100644 --- a/tests/Strategy.html +++ b/tests/Strategy.html @@ -12,10 +12,31 @@ "new OpenLayers.Strategy returns object" ); t.eq(strategy.options, options, "constructor sets this.options"); } + + function test_activate(t) { + t.plan(1); + var options = { + activate: function() { + t.ok(true, "OpenLayer.Map.addLayer calls activate"); + } + }; + + var layer = new OpenLayers.Layer.Vector("Vector Layer", { + strategies: [new OpenLayers.Strategy(options)] + }); + + var map = new OpenLayers.Map('map'); + map.addLayer(layer); + } function test_destroy(t) { - t.plan(2); + t.plan(3); + var strategy = new OpenLayers.Strategy({ + deactivate: function() { + t.ok(true, "destroy calls deactivate"); + }, + options: {foo: 'bar'}, layer: 'foo' }); @@ -28,5 +49,6 @@ +