From 7a546bf5c55e58d3082f3a6b5d589d77b1eb707a Mon Sep 17 00:00:00 2001 From: pgiraud Date: Mon, 15 Feb 2010 12:41:23 +0000 Subject: [PATCH] fixed the unit tests on OpenLayers.js (broken since r9935), patch from Andreas who found a nice and clean way to bypass the cache system on _getScriptLocation for the tests, r=me,fredj (Closes #2389) git-svn-id: http://svn.openlayers.org/trunk/openlayers@10066 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- tests/OpenLayers.html | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/OpenLayers.html b/tests/OpenLayers.html index 89081d7983..2f62610176 100644 --- a/tests/OpenLayers.html +++ b/tests/OpenLayers.html @@ -10,12 +10,18 @@ var script = document.getElementById("script"); t.eq(OpenLayers._getScriptLocation(), "../", "Script location correctly detected."); + + // create a clone of OpenLayers._getScriptLocation + eval("var getScriptLocation = " + OpenLayers._getScriptLocation.toString()); + var scriptLocation; + script.setAttribute("src", "../lib/OpenLayers.js?foo"); - t.eq(OpenLayers._getScriptLocation(), "../", "Script location with search string correctly detected."); + t.eq(getScriptLocation(), "../", "Script location with search string correctly detected."); + scriptLocation = null; // now pretend we're using a built script OpenLayers._scriptName = "OpenLayers.js"; - t.eq(OpenLayers._getScriptLocation(), "../lib/", "not fooled by bogus paths"); + t.eq(getScriptLocation(), "../lib/", "not fooled by bogus paths"); }