The `goog.dom.ViewportSizeMonitor` (used in map.js) creates a global leak by setting `goog.UID_PROPERTY_` on the monitored window. In order to test that we don't have other global leaks, we preemptively set the property so Mocha can compare the global before and after our tests.
81 lines
2.4 KiB
HTML
81 lines
2.4 KiB
HTML
<!DOCTYPE html>
|
|
|
|
<!--
|
|
|
|
Note: we assume that Plovr is available at <hostname>:9810, where
|
|
<hostname> is the name of the host used for loading that page. This
|
|
can be overriden by setting plovr_host in the query string. E.g.
|
|
|
|
http://localhost/ol3/test/ol.html?plovr_host=192.168.1.2:9810
|
|
-->
|
|
|
|
|
|
<html>
|
|
<head>
|
|
<title>OL Spec Runner</title>
|
|
|
|
<meta charset="utf-8">
|
|
<link rel="stylesheet" type="text/css" href="mocha-1.8.1/mocha.css">
|
|
</head>
|
|
|
|
<body>
|
|
<div id="mocha"></div>
|
|
|
|
<script type="text/javascript" src="jquery-1.9.1/jquery.min.js"></script>
|
|
<!-- Extended expect.js w/ various methods, see #374 for the differences to 0.2.0 -->
|
|
<script type="text/javascript" src="expect-0.2.0-ol3/expect.js"></script>
|
|
<script type="text/javascript" src="sinon-1.6.0/sinon.js"></script>
|
|
<script type="text/javascript" src="mocha-1.8.1/mocha.js"></script>
|
|
<script type="text/javascript" src="test-extensions.js"></script>
|
|
<script>
|
|
mocha.setup({
|
|
ui: 'bdd',
|
|
bail: false
|
|
});
|
|
</script>
|
|
<script type="text/javascript" src="../build/proj4js/lib/proj4js-combined.js"></script>
|
|
|
|
<script type="text/javascript">
|
|
|
|
(function(doc, l) {
|
|
|
|
var regexResult = /[\\?&]plovr_host=([^&#]*)/.exec(l.href);
|
|
var plovrHost = (regexResult && regexResult[1]) ?
|
|
decodeURIComponent(regexResult[1]) : l.hostname ?
|
|
l.hostname + ':9810' : 'localhost:9810';
|
|
|
|
// Create the script tag which includes the derived variables from above
|
|
var script = '<sc' + 'ript type="text/javascript" '
|
|
+ 'src="http://' + plovrHost + '/compile?id=test&mode=RAW">'
|
|
+ '</scr' + 'ipt>';
|
|
|
|
// write out the script-tag to load the compiled result
|
|
doc.write(script);
|
|
|
|
})(document, location);
|
|
|
|
</script>
|
|
|
|
<script type="text/javascript">
|
|
|
|
/**
|
|
* The goog.dom.ViewportSizeMonitor (used in map.js) creates a global leak
|
|
* by setting goog.UID_PROPERTY_ on the monitored window. In order to test
|
|
* that we don't have other global leaks, we preemptively set the property
|
|
* so Mocha can compare the global before and after our tests.
|
|
*/
|
|
goog.getUid(this);
|
|
|
|
if (window.mochaPhantomJS) {
|
|
mochaPhantomJS.run();
|
|
} else {
|
|
mocha.run();
|
|
}
|
|
</script>
|
|
<!--
|
|
Tests should not depend on any specific markup and should instead create
|
|
whatever elements are needed (cleaning up when done).
|
|
-->
|
|
</body>
|
|
</html>
|