Files
openlayers/test/index.html
Tim Schaub f1f319d6ad Preemptively set global properties
As mentioned in the comments, calling goog.getUid and goog.events.listen on the global object (as done in map.js and deviceorientation.js) set global properties.  To let Mocha check for other leaks, we preemptively set these properties.
2013-09-15 14:22:41 -06:00

59 lines
2.0 KiB
HTML

<!DOCTYPE html>
<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>
<!-- This script is provided by the debug server (start with `npm start`) -->
<script type="text/javascript" src="loader.js"></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.
*
* In addition, calling goog.events.listen on the global object (as done
* in deviceorientation.js) creates a second leak by setting
* goog.events.LISTENER_MAP_PROP_ on the global object.
*
* We preemptively set both of these properties so Mocha can compare the
* global before and after tests. The call to goog.events.listen also
* calls goog.getUid.
*/
goog.events.listen(this, 'test', function() {});
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>