do not assume that the browser won't add new script tags to the DOM before it's done with the evaluation of OpenLayers.js, r=fredj,ahocevar (closes #2873)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@10862 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Éric Lemoine
2010-10-27 10:26:05 +00:00
parent 3c57b6b36c
commit 8024e58177
4 changed files with 45 additions and 7 deletions
+18
View File
@@ -0,0 +1,18 @@
<html>
<head>
<script type="text/javascript">
OpenLayers = {singleFile: true}; // just to make the test run faster
document.write('<scr'+'ipt src="../lib/OpenLayers.js"></scr'+'ipt>');
document.write('<scr'+'ipt src="bogus/foo-/OpenLayers.js"></scr'+'ipt>');
</script>
<script type="text/javascript">
function test_OpenLayers(t) {
t.plan(1);
t.eq(OpenLayers._getScriptLocation(), "../lib/",
"Script location correctly detected, and not fooled by other scripts.");
}
</script>
</head>
<body>
</body>
</html>
+1
View File
@@ -159,6 +159,7 @@
<li>OpenLayers1.html</li>
<li>OpenLayers2.html</li>
<li>OpenLayers3.html</li>
<li>OpenLayers4.html</li>
<li>Popup.html</li>
<li>Popup/Anchored.html</li>
<li>Popup/AnchoredBubble.html</li>