From 3eb34f587ec758a6aff28d63d0567cfe460f4100 Mon Sep 17 00:00:00 2001 From: tschaub Date: Mon, 2 Jan 2012 11:52:54 -0700 Subject: [PATCH] Add test for setOpacity. --- tests/Layer/WMS.html | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/Layer/WMS.html b/tests/Layer/WMS.html index 757c6b92b2..61c7f126e1 100644 --- a/tests/Layer/WMS.html +++ b/tests/Layer/WMS.html @@ -271,6 +271,25 @@ } + function test_setOpacity(t) { + t.plan(1); + + var layer = new OpenLayers.Layer.WMS( + null, "/bogus/wms", {layers: "mylayer"} + ); + var map = new OpenLayers.Map("map"); + map.addLayer(layer); + + map.zoomToMaxExtent(); + + layer.setOpacity(0.5); + t.delay_call(1, function() { + t.eq(parseFloat(layer.div.firstChild.style.opacity), 0.5, "opacity set"); + map.destroy(); + }); + } + + function test_Layer_WMS_noGutters (t) { t.plan(2); var map = new OpenLayers.Map('map');