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
This commit is contained in:
pgiraud
2010-02-15 12:41:23 +00:00
parent 5c03ebd729
commit 7a546bf5c5

View File

@@ -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");
}
</script>