// some work on style sheets

This commit is contained in:
Kevin Granger
2013-07-18 18:51:24 +02:00
parent 02921dc9d0
commit 0b4512dbcb
1654 changed files with 171753 additions and 294 deletions
@@ -0,0 +1,54 @@
var globals = {};
var master = new doh.Deferred();
define('a', ['b'], function (b) {
globals.a = 'a';
});
define('b', function () {
return (globals.b = 'b');
});
define('c', function () {
globals.c = 'c';
});
//Register the test
doh.register(
"delayedDefine",
[
{
name: "delayedDefine",
timeout: 5000,
runTest: function () {
return master;
}
}
]
);
doh.run();
//At this point no require calls, so there should be no globals.
doh.is(undefined, globals.a);
doh.is(undefined, globals.b);
doh.is(undefined, globals.c);
require({
baseUrl: './'
},
['a'],
function(a) {
doh.is('a', globals.a);
doh.is('b', globals.b);
doh.is(undefined, globals.c);
setTimeout(function () {
//Make sure nothing new is defined after this require callback.
doh.is('a', globals.a);
doh.is('b', globals.b);
doh.is(undefined, globals.c);
master.callback(true);
}, 15);
}
);
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<title>require.js: Delayed Define Test</title>
<script type="text/javascript" src="../../require.js"></script>
<script type="text/javascript" src="../doh/runner.js"></script>
<script type="text/javascript" src="../doh/_browserRunner.js"></script>
<script type="text/javascript" src="delayedDefine-tests.js"></script>
</head>
<body>
<h1>require.js: Delayed Define Test</h1>
<p>Make sure define factories are not called until they are required. Documented
in <a href="https://github.com/jrburke/requirejs/issues/262">Issue 183</a>.</p>
<p>Check console for messages</p>
</body>
</html>