From c82704905dde87b195a5e15b6a3b9c0f0f225fa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Fri, 13 May 2011 22:03:55 +0000 Subject: [PATCH] fix Layer/Vector.html tests in FF4 (closes #3298) git-svn-id: http://svn.openlayers.org/trunk/openlayers@11968 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- tests/Layer/Vector.html | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/Layer/Vector.html b/tests/Layer/Vector.html index 30395638ff..76e0fa6ff0 100644 --- a/tests/Layer/Vector.html +++ b/tests/Layer/Vector.html @@ -685,9 +685,12 @@ "given graphicHeight and graphicWidth, both are set: width"); feature.style = customStyle5; layer.drawFeature(feature); - t.eq(root.firstChild.getAttributeNS(null, 'style'), - 'opacity: '+customStyle5.graphicOpacity.toString()+((OpenLayers.BROWSER_NAME == "opera" || OpenLayers.BROWSER_NAME == "safari") ? "" : ';'), - "graphicOpacity correctly set"); + // we use startsWith here as some browsers (at least Safari 3 and FireFox 4) + // do not append a semi-colon to the opacity string + t.ok(OpenLayers.String.startsWith( + root.firstChild.getAttributeNS(null, 'style'), + "opacity: " + customStyle5.graphicOpacity.toString()), + "graphicOpacity correctly set"); feature.style = customStyle6; layer.drawFeature(feature); var x = geometryX / renderer.getResolution() + renderer.left;