web-apps/vendor/requirejs/tests/plugins/double.html

52 lines
1.1 KiB
HTML
Raw Normal View History

2016-03-11 00:48:53 +00:00
<!DOCTYPE html>
<html>
<head>
<title>require.js: Double Plugin Call Test</title>
<script type="text/javascript" src="../doh/runner.js"></script>
<script type="text/javascript" src="../doh/_browserRunner.js"></script>
<script type="text/javascript" src="../../require.js"></script>
<script>
var master = new doh.Deferred(),
count = 0;
function done() {
count += 1;
if (count === 2) {
master.callback(true);
}
}
doh.register(
"doublePluginCall",
[
{
name: "doublePluginCall",
timeout: 5000,
runTest: function() {
return master;
}
}
]
);
doh.run();
require(['double!foo'], function (foo) {
if (foo === 'x') {
done();
}
});
require(['double!foo'], function (foo) {
if (foo === 'x') {
done();
}
});
</script>
</head>
<body>
<h1>require.js: Double Plugin Call Test</h1>
<p>Check console for messages</p>
</body>
</html>