later.html revision 5bd2842e77bc6d9de48ca5f645025200c0da9e32
<html>
<head>
<title>Later Tests</title>
</head>
<body class="yui3-skin-sam">
<h1>Later Tests</h1>
<p><input type="button" value="Run Tests" id="btnRun" disabled="true" /></p>
<script type="text/javascript">
var YUI_config = {
gconfig: true
};
YUI({
filter: "debug",
logExclude: {Dom: true, Selector: true, Node: true, attribute: true, base: true, event: true, widget: true}
}).use("dump", "test", "console", function(Y) {
var button = Y.one('#btnRun');
// Set up the page
button.set("disabled", false);
Y.on("click", function() {
}, button);
var myConsole = new Y.Console().render();
var testCore = new Y.Test.Case({
name: "Lang tests",
test_later: function() {
var data = {
foo: 'bar'
}, count = 0;;
Y.Lang.later(0, null, function(o) {
count++;
Y.Assert.areEqual('bar', o.foo);
}, data)
setTimeout(function() {
Y.Assert.areEqual(1, count);
}, 5);
}
});
Y.Test.Runner.add(testCore);
});
</script>
</body>
</html>