@@ -20,23 +20,16 @@ void main() {
20
20
21
21
late Directory tempDir;
22
22
late String sdkDirectory;
23
- late String soundSdkSummaryPath ;
23
+ late String sdkSummaryPath ;
24
24
late String compilerWorkerPath;
25
25
26
- // Missing sound assets
27
- late String soundSdkFullDillPath;
28
- late String soundAmdSdkJsPath;
29
- late String soundAmdSdkJsMapPath;
30
- late String soundDdcSdkJsPath;
31
- late String soundDdcSdkJsMapPath;
32
-
33
- // Missing weak assets
34
- late String weakSdkSummaryPath;
35
- late String weakSdkFullDillPath;
36
- late String weakAmdSdkJsPath;
37
- late String weakAmdSdkJsMapPath;
38
- late String weakDdcSdkJsPath;
39
- late String weakDdcSdkJsMapPath;
26
+ // Missing assets
27
+ late String sdkFullDillPath;
28
+ late String amdSdkJsPath;
29
+ late String amdSdkJsMapPath;
30
+ late String ddcSdkJsPath;
31
+ late String ddcSdkJsMapPath;
32
+
40
33
41
34
setUp (() async {
42
35
setCurrentLogWriter (debug: debug);
@@ -45,39 +38,24 @@ void main() {
45
38
sdkDirectory = tempDir.path;
46
39
final copySdkLayout = TestSdkLayout .createDefault (sdkDirectory);
47
40
48
- soundSdkSummaryPath = copySdkLayout.soundSummaryPath ;
41
+ sdkSummaryPath = copySdkLayout.summaryPath ;
49
42
compilerWorkerPath = copySdkLayout.dartdevcSnapshotPath;
50
43
51
44
// Copy the SDK directory into a temp directory.
52
45
await copyDirectory (TestSdkLayout .defaultSdkDirectory, sdkDirectory);
53
46
54
- // Simulate missing sound assets.
55
- soundSdkFullDillPath = copySdkLayout.soundFullDillPath;
56
- soundAmdSdkJsPath = copySdkLayout.soundAmdJsPath;
57
- soundAmdSdkJsMapPath = copySdkLayout.soundAmdJsMapPath;
58
- soundDdcSdkJsPath = copySdkLayout.soundDdcJsPath;
59
- soundDdcSdkJsMapPath = copySdkLayout.soundDdcJsMapPath;
60
-
61
- _deleteIfExists (soundSdkFullDillPath);
62
- _deleteIfExists (soundAmdSdkJsPath);
63
- _deleteIfExists (soundAmdSdkJsMapPath);
64
- _deleteIfExists (soundDdcSdkJsPath);
65
- _deleteIfExists (soundDdcSdkJsMapPath);
66
-
67
- // Simulate missing weak assets.
68
- weakSdkSummaryPath = copySdkLayout.weakSummaryPath;
69
- weakSdkFullDillPath = copySdkLayout.weakFullDillPath;
70
- weakAmdSdkJsPath = copySdkLayout.weakAmdJsPath;
71
- weakAmdSdkJsMapPath = copySdkLayout.weakAmdJsMapPath;
72
- weakDdcSdkJsPath = copySdkLayout.weakDdcJsPath;
73
- weakDdcSdkJsMapPath = copySdkLayout.weakDdcJsMapPath;
74
-
75
- _deleteIfExists (weakSdkSummaryPath);
76
- _deleteIfExists (weakSdkFullDillPath);
77
- _deleteIfExists (weakAmdSdkJsPath);
78
- _deleteIfExists (weakAmdSdkJsMapPath);
79
- _deleteIfExists (weakDdcSdkJsPath);
80
- _deleteIfExists (weakDdcSdkJsMapPath);
47
+ // Simulate missing assets.
48
+ sdkFullDillPath = copySdkLayout.fullDillPath;
49
+ amdSdkJsPath = copySdkLayout.amdJsPath;
50
+ amdSdkJsMapPath = copySdkLayout.amdJsMapPath;
51
+ ddcSdkJsPath = copySdkLayout.ddcJsPath;
52
+ ddcSdkJsMapPath = copySdkLayout.ddcJsMapPath;
53
+
54
+ _deleteIfExists (sdkFullDillPath);
55
+ _deleteIfExists (amdSdkJsPath);
56
+ _deleteIfExists (amdSdkJsMapPath);
57
+ _deleteIfExists (ddcSdkJsPath);
58
+ _deleteIfExists (ddcSdkJsMapPath);
81
59
});
82
60
83
61
tearDown (() {
@@ -102,30 +80,20 @@ void main() {
102
80
expect (configuration.sdkDirectory, equals (sdkDirectory));
103
81
expect (configuration.compilerWorkerPath, equals (compilerWorkerPath));
104
82
105
- expect (sdkLayout.soundSummaryPath, equals (soundSdkSummaryPath));
106
- expect (sdkLayout.soundFullDillPath, equals (soundSdkFullDillPath));
107
- expect (sdkLayout.soundAmdJsPath, equals (soundAmdSdkJsPath));
108
- expect (sdkLayout.soundAmdJsMapPath, equals (soundAmdSdkJsMapPath));
109
-
110
- expect (sdkLayout.weakSummaryPath, equals (weakSdkSummaryPath));
111
- expect (sdkLayout.weakFullDillPath, equals (weakSdkFullDillPath));
112
- expect (sdkLayout.weakAmdJsPath, equals (weakAmdSdkJsPath));
113
- expect (sdkLayout.weakAmdJsMapPath, equals (weakAmdSdkJsMapPath));
83
+ expect (sdkLayout.summaryPath, equals (sdkSummaryPath));
84
+ expect (sdkLayout.fullDillPath, equals (sdkFullDillPath));
85
+ expect (sdkLayout.amdJsPath, equals (amdSdkJsPath));
86
+ expect (sdkLayout.amdJsMapPath, equals (amdSdkJsMapPath));
114
87
115
88
// Validate that configuration files exist.
116
89
configuration.validateSdkDir ();
117
90
configuration.validate ();
118
91
119
92
// Validate all assets exist.
120
- expect (sdkLayout.soundSummaryPath, _exists);
121
- expect (sdkLayout.soundFullDillPath, _exists);
122
- expect (sdkLayout.soundAmdJsPath, _exists);
123
- expect (sdkLayout.soundAmdJsMapPath, _exists);
124
-
125
- expect (sdkLayout.weakSummaryPath, _exists);
126
- expect (sdkLayout.weakFullDillPath, _exists);
127
- expect (sdkLayout.weakAmdJsPath, _exists);
128
- expect (sdkLayout.weakAmdJsMapPath, _exists);
93
+ expect (sdkLayout.summaryPath, _exists);
94
+ expect (sdkLayout.fullDillPath, _exists);
95
+ expect (sdkLayout.amdJsPath, _exists);
96
+ expect (sdkLayout.amdJsMapPath, _exists);
129
97
});
130
98
131
99
test (
@@ -146,30 +114,20 @@ void main() {
146
114
expect (configuration.sdkDirectory, equals (sdkDirectory));
147
115
expect (configuration.compilerWorkerPath, equals (compilerWorkerPath));
148
116
149
- expect (sdkLayout.soundSummaryPath, equals (soundSdkSummaryPath));
150
- expect (sdkLayout.soundFullDillPath, equals (soundSdkFullDillPath));
151
- expect (sdkLayout.soundDdcJsPath, equals (soundDdcSdkJsPath));
152
- expect (sdkLayout.soundDdcJsMapPath, equals (soundDdcSdkJsMapPath));
153
-
154
- expect (sdkLayout.weakSummaryPath, equals (weakSdkSummaryPath));
155
- expect (sdkLayout.weakFullDillPath, equals (weakSdkFullDillPath));
156
- expect (sdkLayout.weakDdcJsPath, equals (weakDdcSdkJsPath));
157
- expect (sdkLayout.weakDdcJsMapPath, equals (weakDdcSdkJsMapPath));
117
+ expect (sdkLayout.summaryPath, equals (sdkSummaryPath));
118
+ expect (sdkLayout.fullDillPath, equals (sdkFullDillPath));
119
+ expect (sdkLayout.ddcJsPath, equals (ddcSdkJsPath));
120
+ expect (sdkLayout.ddcJsMapPath, equals (ddcSdkJsMapPath));
158
121
159
122
// Validate that configuration files exist.
160
123
configuration.validateSdkDir ();
161
124
configuration.validate ();
162
125
163
126
// Validate all assets exist.
164
- expect (sdkLayout.soundSummaryPath, _exists);
165
- expect (sdkLayout.soundFullDillPath, _exists);
166
- expect (sdkLayout.soundDdcJsPath, _exists);
167
- expect (sdkLayout.soundDdcJsMapPath, _exists);
168
-
169
- expect (sdkLayout.weakSummaryPath, _exists);
170
- expect (sdkLayout.weakFullDillPath, _exists);
171
- expect (sdkLayout.weakDdcJsPath, _exists);
172
- expect (sdkLayout.weakDdcJsMapPath, _exists);
127
+ expect (sdkLayout.summaryPath, _exists);
128
+ expect (sdkLayout.fullDillPath, _exists);
129
+ expect (sdkLayout.ddcJsPath, _exists);
130
+ expect (sdkLayout.ddcJsMapPath, _exists);
173
131
});
174
132
175
133
test ('Can generate missing SDK assets with canary features enabled' ,
@@ -184,11 +142,8 @@ void main() {
184
142
);
185
143
await assetGenerator.generateSdkAssets ();
186
144
187
- final soundSdk = File (soundAmdSdkJsPath).readAsStringSync ();
188
- expect (soundSdk, contains ('canary' ));
189
-
190
- final weakSdk = File (weakAmdSdkJsPath).readAsStringSync ();
191
- expect (weakSdk, contains ('canary' ));
145
+ final sdk = File (amdSdkJsPath).readAsStringSync ();
146
+ expect (sdk, contains ('canary' ));
192
147
});
193
148
194
149
test (
@@ -204,11 +159,8 @@ void main() {
204
159
);
205
160
await assetGenerator.generateSdkAssets ();
206
161
207
- final soundSdk = File (soundDdcSdkJsPath).readAsStringSync ();
208
- expect (soundSdk, contains ('canary' ));
209
-
210
- final weakSdk = File (weakDdcSdkJsPath).readAsStringSync ();
211
- expect (weakSdk, contains ('canary' ));
162
+ final sdk = File (ddcSdkJsPath).readAsStringSync ();
163
+ expect (sdk, contains ('canary' ));
212
164
});
213
165
});
214
166
}
0 commit comments