local1.js
3.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
xdomainExecSequence.push("local1-1");
// multiple dojo.provides should define multiple modules
var x1= dojo.provide("dojo.tests._base.loader.xdomain.local1");
var x2= dojo.provide("dojo.tests._base.loader.xdomain.local1SteppedOn");
var x3= dojo.provide("dojo.tests._base.loader.xdomain.local1NotSteppedOn");
xdomainExecSequence.push("local1-2");
// this puts the loader in xd loading mode
dojo.require("dojo.cookie");
xdomainExecSequence.push("local1-3");
// load a not xd module while in xd loading mode
dojo.require("dojo.tests._base.loader.xdomain.local1-dep");
xdomainExecSequence.push("local1-4");
// a loadInit that makes a calculation a later requireIf depends upon
dojo.loadInit(function(){
xdomainExecSequence.push("local1-5");
var dependentModule= dojo.getObject("dojo.tests._base.loader.xdomain.local1-runtimeDependent", true);
dependentModule.choice = 1;
});
xdomainExecSequence.push("local1-6");
// a couple of requireIf's, only one of which should result in a module being loaded
dojo.requireIf(dojo.getObject("dojo.tests._base.loader.xdomain.local1-runtimeDependent").choice==1, "dojo.tests._base.loader.xdomain.local1-runtimeDependent1");
xdomainExecSequence.push("local1-7");
dojo.requireIf(dojo.getObject("dojo.tests._base.loader.xdomain.local1-runtimeDependent").choice==2, "dojo.tests._base.loader.xdomain.local1-runtimeDependent2");
xdomainExecSequence.push("local1-8");
// platformRequire test
dojo.platformRequire({
browser:[
"dojo.tests._base.loader.xdomain.local1-browser",
["dojo.tests._base.loader.xdomain.local1-browser-skip", true]
]
});
// these are xd bundles which should be loaded async
xdomainExecSequence.push("local1-9");
dojo.requireLocalization("dojo", "colors");
xdomainExecSequence.push("local1-10");
dojo.requireLocalization("dojo", "colors", "fr");
xdomainExecSequence.push("local1-11");
dojo.requireLocalization("dojo", "colors");
xdomainExecSequence.push("local1-12");
// these are not xd bundles which should be loaded sync
dojo.requireLocalization("dojo.tests._base.loader", "amdBundle");
xdomainExecSequence.push("local1-13");
dojo.requireLocalization("dojo.tests._base.loader", "amdBundle", "ab");
xdomainExecSequence.push("local1-14");
dojo.requireLocalization("dojo.tests._base.loader", "syncBundle");
xdomainExecSequence.push("local1-15");
dojo.requireLocalization("dojo.tests._base.loader", "syncBundle", "ab");
xdomainExecSequence.push("local1-16");
// another loadInit; it should be executed immediately after the first load init
dojo.loadInit(function(){
xdomainExecSequence.push("local1-17");
var dependentModule= dojo.getObject("dojo.tests._base.loader.xdomain.local1-runtimeDependent");
dependentModule.status = "ok";
});
xdomainExecSequence.push("local1-18");
xdomainLog.push(
1, (x1===dojo.tests._base.loader.xdomain.local1),
2, (x1===dojo.getObject("dojo.tests._base.loader.xdomain.local1")),
3, (x2===dojo.tests._base.loader.xdomain.local1SteppedOn),
4, (x2===dojo.getObject("dojo.tests._base.loader.xdomain.local1SteppedOn")),
5, (x3===dojo.tests._base.loader.xdomain.local1NotSteppedOn),
6, (x3===dojo.getObject("dojo.tests._base.loader.xdomain.local1NotSteppedOn")));
x3.status = "local1NotSteppedOn";
dojo.tests._base.loader.xdomain.local1= "stepOnLocal1";
dojo.tests._base.loader.xdomain.local1SteppedOn= "stepOn1SteppedOn";
xdomainLog.push(
7, ("stepOnLocal1"===dojo.tests._base.loader.xdomain.local1),
8, ("stepOnLocal1"===dojo.getObject("dojo.tests._base.loader.xdomain.local1")),
9, ("stepOn1SteppedOn"===dojo.tests._base.loader.xdomain.local1SteppedOn),
10, ("stepOn1SteppedOn"===dojo.getObject("dojo.tests._base.loader.xdomain.local1SteppedOn")));