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:
@@ -10,12 +10,18 @@
|
|||||||
var script = document.getElementById("script");
|
var script = document.getElementById("script");
|
||||||
|
|
||||||
t.eq(OpenLayers._getScriptLocation(), "../", "Script location correctly detected.");
|
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");
|
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
|
// now pretend we're using a built script
|
||||||
OpenLayers._scriptName = "OpenLayers.js";
|
OpenLayers._scriptName = "OpenLayers.js";
|
||||||
t.eq(OpenLayers._getScriptLocation(), "../lib/", "not fooled by bogus paths");
|
t.eq(getScriptLocation(), "../lib/", "not fooled by bogus paths");
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user