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