loader.js
9.88 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
define([
"dojo",
"doh",
"require",
"dojo/sniff",
"dojo/has!dojo-publish-privates?./loader/core",
"dojo/has!dojo-amd-factory-scan?./loader/modules",
"dojo/has!dojo-publish-privates?./loader/moduleIds",
"./loader/bootstrap"], function(dojo, doh, require, has){
if(doh.isBrowser){
doh.register("tests._base.loader.asyncWithDojoRequire", require.toUrl("./loader/asyncWithDojoRequire.html"));
doh.register("tests._base.loader.config?dojoConfig-djConfig-require", require.toUrl("./loader/config.html")+"?dojoConfig-djConfig-require");
doh.register("tests._base.loader.config?dojoConfig-require", require.toUrl("./loader/config.html")+"?dojoConfig-require");
doh.register("tests._base.loader.config?dojoConfig-djConfig", require.toUrl("./loader/config.html")+"?dojoConfig-djConfig");
doh.register("tests._base.loader.config?dojoConfig", require.toUrl("./loader/config.html")+"?dojoConfig");
doh.register("tests._base.loader.config?djConfig-require", require.toUrl("./loader/config.html")+"?djConfig-require");
doh.register("tests._base.loader.config?djConfig", require.toUrl("./loader/config.html")+"?djConfig");
doh.register("tests._base.loader.config?require", require.toUrl("./loader/config.html")+"?require");
if(has("dojo-publish-privates")){
doh.register("tests._base.loader.config?configApi.html", require.toUrl("./loader/configApi.html"));
}
doh.register("tests._base.loader.config?config-sniff.html", require.toUrl("./loader/config-sniff.html"));
doh.register("tests._base.loader.config?config-sniff-djConfig.html", require.toUrl("./loader/config-sniff-djConfig.html"));
doh.register("tests._base.loader.config?config-has.html", require.toUrl("./loader/config-has.html"));
//TODO: doh.register("tests._base.loader.cdn-load", require.toUrl("./loader/cdnTest.html"));
doh.register("tests._base.loader.loader-declareStepsOnProvide", require.toUrl("./loader/declareStepsOnProvide.html"));
doh.register("tests._base.loader.publish-require-result", require.toUrl("./loader/publishRequireResult.html"));
doh.register("tests._base.loader.no-publish-require-result", require.toUrl("./loader/publishRequireResult.html")+"?do-not-publish");
doh.register("tests._base.loader.top-level-module-by-paths", require.toUrl("./loader/paths.html"));
doh.register("tests._base.loader.xdomin-sync-1", require.toUrl("./loader/xdomain/xdomain.html"), {async:0, variation:1});
doh.register("tests._base.loader.xdomin-sync-2", require.toUrl("./loader/xdomain/xdomain.html"), {async:0, variation:2});
doh.register("tests._base.loader.xdomin-async-1", require.toUrl("./loader/xdomain/xdomain.html"), {async:"legacyAsync", variation:1});
doh.register("tests._base.loader.xdomin-async-2", require.toUrl("./loader/xdomain/xdomain.html"), {async:"legacyAsync", variation:2});
// the requirejs test suite. The following tests are not used:
//
// * baseUrl: dojo's baseUrl is different--it defaults to the dojo tree. See TODO
// * layers: dojo's build system does things differently
// * afterload: is not constructed in a way that works with doh
// * plugin/sync: this test seems like it will always fail in async mode; TODO check with James
//
doh.register("tests._base.loader.requirejs-simple-sync", require.toUrl("./loader/requirejs/simple.html"), {async:0});
doh.register("tests._base.loader.requirejs-simple-async", require.toUrl("./loader/requirejs/simple.html"), {async:1});
doh.register("tests._base.loader.requirejs-config-sync", require.toUrl("./loader/requirejs/config.html"), {async:0});
doh.register("tests._base.loader.requirejs-config-async", require.toUrl("./loader/requirejs/config.html"), {async:1});
if(has("dojo-requirejs-api")){
doh.register("tests._base.loader.requirejs-dataMain-sync", require.toUrl("./loader/requirejs/dataMain.html"), {async:0});
doh.register("tests._base.loader.requirejs-dataMain-async", require.toUrl("./loader/requirejs/dataMain.html"), {async:1});
}
doh.register("tests._base.loader.requirejs-simple-nohead-sync", require.toUrl("./loader/requirejs/simple-nohead.html"), {async:0});
doh.register("tests._base.loader.requirejs-simple-nohead-async", require.toUrl("./loader/requirejs/simple-nohead.html"), {async:1});
function compactPath(path){
var
result= [],
segment, lastSegment;
path= path.split("/");
while(path.length){
segment= path.shift();
if(segment==".." && result.length && lastSegment!=".."){
result.pop();
}else if(segment!="."){
result.push(lastSegment= segment);
} // else ignore "."
}
return result.join("/");
}
var
qstart= location.href.indexOf(location.search),
root= qstart!=-1 ? location.href.substring(0, qstart) : location.href,
setup= compactPath(root + "/../" + require.toUrl("./loader/requirejs/requirejs-setup.js")),
baseUrl= setup.substring(0, setup.length - "/requirejs-setup.js".length);
if(has("ie")>6){
doh.register("tests._base.loader.requirejs-simple-badbase-sync", require.toUrl("./loader/requirejs/simple-badbase.html"), {
async:0,
baseUrl:baseUrl,
setup:setup,
dojo:compactPath(root + "/../" + require.toUrl("../../dojo.js"))
});
}
doh.register("tests._base.loader.requirejs-simple-badbase-async", require.toUrl("./loader/requirejs/simple-badbase.html"), {
async:1,
baseUrl:baseUrl,
setup:setup,
dojo:compactPath(root + "/../" + require.toUrl("../../dojo.js"))
});
//doh.register("tests._base.loader.requirejs-circular-sync", require.toUrl("./loader/requirejs/circular.html"), {async:0});
doh.register("tests._base.loader.requirejs-circular-async", require.toUrl("./loader/requirejs/circular.html"), {async:1});
if(has("dojo-requirejs-api")){
doh.register("tests._base.loader.requirejs-depoverlap-sync", require.toUrl("./loader/requirejs/depoverlap.html"), {async:0});
doh.register("tests._base.loader.requirejs-depoverlap-async", require.toUrl("./loader/requirejs/depoverlap.html"), {async:1});
}
doh.register("tests._base.loader.requirejs-urlfetch-sync", require.toUrl("./loader/requirejs/urlfetch/urlfetch.html"), {async:0});
doh.register("tests._base.loader.requirejs-urlfetch-async", require.toUrl("./loader/requirejs/urlfetch/urlfetch.html"), {async:1});
if(has("dojo-amd-factory-scan")){
doh.register("tests._base.loader.requirejs-uniques-sync", require.toUrl("./loader/requirejs/uniques/uniques.html"), {async:0});
doh.register("tests._base.loader.requirejs-uniques-async", require.toUrl("./loader/requirejs/uniques/uniques.html"), {async:1});
}
//>>excludeStart("requireJSI18nTests", kwArgs.insertAbsMids);
doh.register("tests._base.loader.requirejs-i18nlocaleunknown-sync", require.toUrl("./loader/requirejs/i18n/i18n.html")+"?bundle=i18n!nls/fr-fr/colors", {async:0});
doh.register("tests._base.loader.requirejs-i18nlocaleunknown-async", require.toUrl("./loader/requirejs/i18n/i18n.html")+"?bundle=i18n!nls/fr-fr/colors", {async:1});
doh.register("tests._base.loader.requirejs-i18n-sync", require.toUrl("./loader/requirejs/i18n/i18n.html"), {async:0});
doh.register("tests._base.loader.requirejs-i18n-async", require.toUrl("./loader/requirejs/i18n/i18n.html"), {async:1});
doh.register("tests._base.loader.requirejs-i18nlocale-sync", require.toUrl("./loader/requirejs/i18n/i18n.html")+"?locale=en-us-surfer", {async:0});
doh.register("tests._base.loader.requirejs-i18nlocale-async", require.toUrl("./loader/requirejs/i18n/i18n.html")+"?locale=en-us-surfer", {async:1});
doh.register("tests._base.loader.requirejs-i18nbundle-sync", require.toUrl("./loader/requirejs/i18n/i18n.html")+"?bundle=i18n!nls/en-us-surfer/colors", {async:0});
doh.register("tests._base.loader.requirejs-i18nbundle-async", require.toUrl("./loader/requirejs/i18n/i18n.html")+"?bundle=i18n!nls/en-us-surfer/colors", {async:1});
doh.register("tests._base.loader.requirejs-i18ncommon-sync", require.toUrl("./loader/requirejs/i18n/common.html"), {async:0});
doh.register("tests._base.loader.requirejs-i18ncommon-async", require.toUrl("./loader/requirejs/i18n/common.html"), {async:1});
doh.register("tests._base.loader.requirejs-i18ncommonlocale-sync", require.toUrl("./loader/requirejs/i18n/common.html")+"?locale=en-us-surfer", {async:0});
doh.register("tests._base.loader.requirejs-i18ncommonlocale-async", require.toUrl("./loader/requirejs/i18n/common.html")+"?locale=en-us-surfer", {async:1});
//>>excludeEnd("requireJSI18nTests");
doh.register("tests._base.loader.requirejs-paths-sync", require.toUrl("./loader/requirejs/paths/paths.html"), {async:0});
doh.register("tests._base.loader.requirejs-paths-async", require.toUrl("./loader/requirejs/paths/paths.html"), {async:1});
doh.register("tests._base.loader.requirejs-relative-sync", require.toUrl("./loader/requirejs/relative/relative.html"), {async:0});
doh.register("tests._base.loader.requirejs-relative-async", require.toUrl("./loader/requirejs/relative/relative.html"), {async:1});
doh.register("tests._base.loader.requirejs-text-sync", require.toUrl("./loader/requirejs/text/text.html"), {async:0});
doh.register("tests._base.loader.requirejs-text-async", require.toUrl("./loader/requirejs/text/text.html"), {async:1});
doh.register("tests._base.loader.requirejs-text-sync", require.toUrl("./loader/requirejs/text/text.html"), {async:0, aliasTest:1});
doh.register("tests._base.loader.requirejs-text-async", require.toUrl("./loader/requirejs/text/text.html"), {async:1, aliasTest:1});
doh.register("tests._base.loader.requirejs-textOnly-sync", require.toUrl("./loader/requirejs/text/textOnly.html"), {async:0});
doh.register("tests._base.loader.requirejs-textOnly-async", require.toUrl("./loader/requirejs/text/textOnly.html"), {async:1});
doh.register("tests._base.loader.requirejs-exports-sync", require.toUrl("./loader/requirejs/exports/exports.html"), {async:0});
doh.register("tests._base.loader.requirejs-exports-async", require.toUrl("./loader/requirejs/exports/exports.html"), {async:1});
doh.register("tests._base.loader.require-config", require.toUrl("./loader/config/test.html"), {async:1});
}
});