1 | <html> |
---|
2 | <head> |
---|
3 | <script type="text/javascript"> |
---|
4 | var hasAlias; |
---|
5 | var dojoConfig= { |
---|
6 | async:1, |
---|
7 | waitSeconds:5 |
---|
8 | }; |
---|
9 | </script> |
---|
10 | <script |
---|
11 | type="text/javascript" |
---|
12 | src="../../../dojo.js" |
---|
13 | data-dojo-config="isDebug:1, async:1, waitSeconds:6, baseUrl:'../../../../dojo', cats:'dojo-config-dogs', a:2, b:[3,4,5]"></script> |
---|
14 | <script type="text/javascript"> |
---|
15 | require(["dojo", "doh", "dojo/has"], function(dojo, doh, has) { |
---|
16 | dojo.ready(function() { |
---|
17 | hasAlias= has; |
---|
18 | doh.register("dojoConfig-sniff-test", [ |
---|
19 | function expectDojoConfig(t) { |
---|
20 | // show that sniff overrides dojoConfig |
---|
21 | t.is(require.rawConfig.async, true); |
---|
22 | t.is(require.rawConfig.baseUrl, "../../../../dojo"); |
---|
23 | t.is(require.rawConfig.waitSeconds, 6); |
---|
24 | t.is(require.rawConfig.cats, 'dojo-config-dogs'); |
---|
25 | t.is(require.rawConfig.a, 2); |
---|
26 | t.is(require.rawConfig.b, [3,4,5]); |
---|
27 | |
---|
28 | t.is(require.async, true); |
---|
29 | t.is(require.baseUrl, "../../../../dojo/"); |
---|
30 | t.is(require.cats, undefined); |
---|
31 | t.is(require.a, undefined); |
---|
32 | t.is(require.b, undefined); |
---|
33 | |
---|
34 | t.is(dojo.config.baseUrl, "../../../../dojo/"); |
---|
35 | t.is(dojo.config.cats, 'dojo-config-dogs'); |
---|
36 | t.is(dojo.config.a, 2); |
---|
37 | t.is(dojo.config.b, [3,4,5]); |
---|
38 | } |
---|
39 | ]); |
---|
40 | doh.runOnLoad(); |
---|
41 | }); |
---|
42 | }); |
---|
43 | </script> |
---|
44 | </head> |
---|
45 | <body> |
---|
46 | </body> |
---|
47 | </html> |
---|
48 | |
---|