@@ -70,8 +70,9 @@ class TestInstallGalleryExtensionTask extends InstallGalleryExtensionTask {
70
70
constructor (
71
71
extension : IGalleryExtension ,
72
72
extensionDownloader : ExtensionsDownloader ,
73
+ disposables : DisposableStore ,
73
74
) {
74
- const instantiationService = new TestInstantiationService ( ) ;
75
+ const instantiationService = disposables . add ( new TestInstantiationService ( ) ) ;
75
76
const logService = instantiationService . stub ( ILogService , new NullLogService ( ) ) ;
76
77
const fileService = instantiationService . stub ( IFileService , new FileService ( logService ) ) ;
77
78
const fileSystemProvider = new InMemoryFileSystemProvider ( ) ;
@@ -131,7 +132,7 @@ suite('InstallGalleryExtensionTask Tests', () => {
131
132
teardown ( ( ) => disposables . clear ( ) ) ;
132
133
133
134
test ( 'if verification is enabled by default, the task completes' , async ( ) => {
134
- const testObject = new TestInstallGalleryExtensionTask ( aGalleryExtension ( 'a' , { isSigned : true } ) , anExtensionsDownloader ( { isSignatureVerificationEnabled : true , verificationResult : true , didExecute : true } ) ) ;
135
+ const testObject = new TestInstallGalleryExtensionTask ( aGalleryExtension ( 'a' , { isSigned : true } ) , anExtensionsDownloader ( { isSignatureVerificationEnabled : true , verificationResult : true , didExecute : true } ) , disposables ) ;
135
136
136
137
await testObject . run ( ) ;
137
138
@@ -140,7 +141,7 @@ suite('InstallGalleryExtensionTask Tests', () => {
140
141
} ) ;
141
142
142
143
test ( 'if verification is enabled in stable, the task completes' , async ( ) => {
143
- const testObject = new TestInstallGalleryExtensionTask ( aGalleryExtension ( 'a' , { isSigned : true } ) , anExtensionsDownloader ( { isSignatureVerificationEnabled : true , verificationResult : true , didExecute : true , quality : 'stable' } ) ) ;
144
+ const testObject = new TestInstallGalleryExtensionTask ( aGalleryExtension ( 'a' , { isSigned : true } ) , anExtensionsDownloader ( { isSignatureVerificationEnabled : true , verificationResult : true , didExecute : true , quality : 'stable' } ) , disposables ) ;
144
145
145
146
await testObject . run ( ) ;
146
147
@@ -149,7 +150,7 @@ suite('InstallGalleryExtensionTask Tests', () => {
149
150
} ) ;
150
151
151
152
test ( 'if verification is disabled by setting set to false, the task skips verification' , async ( ) => {
152
- const testObject = new TestInstallGalleryExtensionTask ( aGalleryExtension ( 'a' , { isSigned : true } ) , anExtensionsDownloader ( { isSignatureVerificationEnabled : false , verificationResult : 'error' , didExecute : false } ) ) ;
153
+ const testObject = new TestInstallGalleryExtensionTask ( aGalleryExtension ( 'a' , { isSigned : true } ) , anExtensionsDownloader ( { isSignatureVerificationEnabled : false , verificationResult : 'error' , didExecute : false } ) , disposables ) ;
153
154
154
155
await testObject . run ( ) ;
155
156
@@ -158,7 +159,7 @@ suite('InstallGalleryExtensionTask Tests', () => {
158
159
} ) ;
159
160
160
161
test ( 'if verification is disabled because the module is not loaded, the task skips verification' , async ( ) => {
161
- const testObject = new TestInstallGalleryExtensionTask ( aGalleryExtension ( 'a' , { isSigned : true } ) , anExtensionsDownloader ( { isSignatureVerificationEnabled : true , verificationResult : false , didExecute : false } ) ) ;
162
+ const testObject = new TestInstallGalleryExtensionTask ( aGalleryExtension ( 'a' , { isSigned : true } ) , anExtensionsDownloader ( { isSignatureVerificationEnabled : true , verificationResult : false , didExecute : false } ) , disposables ) ;
162
163
163
164
await testObject . run ( ) ;
164
165
@@ -168,7 +169,7 @@ suite('InstallGalleryExtensionTask Tests', () => {
168
169
169
170
test ( 'if verification fails to execute, the task completes' , async ( ) => {
170
171
const errorCode = 'ENOENT' ;
171
- const testObject = new TestInstallGalleryExtensionTask ( aGalleryExtension ( 'a' , { isSigned : true } ) , anExtensionsDownloader ( { isSignatureVerificationEnabled : true , verificationResult : errorCode , didExecute : false } ) ) ;
172
+ const testObject = new TestInstallGalleryExtensionTask ( aGalleryExtension ( 'a' , { isSigned : true } ) , anExtensionsDownloader ( { isSignatureVerificationEnabled : true , verificationResult : errorCode , didExecute : false } ) , disposables ) ;
172
173
173
174
await testObject . run ( ) ;
174
175
@@ -179,7 +180,7 @@ suite('InstallGalleryExtensionTask Tests', () => {
179
180
test ( 'if verification fails' , async ( ) => {
180
181
const errorCode = 'IntegrityCheckFailed' ;
181
182
182
- const testObject = new TestInstallGalleryExtensionTask ( aGalleryExtension ( 'a' , { isSigned : true } ) , anExtensionsDownloader ( { isSignatureVerificationEnabled : true , verificationResult : errorCode , didExecute : true } ) ) ;
183
+ const testObject = new TestInstallGalleryExtensionTask ( aGalleryExtension ( 'a' , { isSigned : true } ) , anExtensionsDownloader ( { isSignatureVerificationEnabled : true , verificationResult : errorCode , didExecute : true } ) , disposables ) ;
183
184
184
185
await testObject . run ( ) ;
185
186
@@ -188,7 +189,7 @@ suite('InstallGalleryExtensionTask Tests', () => {
188
189
} ) ;
189
190
190
191
test ( 'if verification succeeds, the task completes' , async ( ) => {
191
- const testObject = new TestInstallGalleryExtensionTask ( aGalleryExtension ( 'a' , { isSigned : true } ) , anExtensionsDownloader ( { isSignatureVerificationEnabled : true , verificationResult : true , didExecute : true } ) ) ;
192
+ const testObject = new TestInstallGalleryExtensionTask ( aGalleryExtension ( 'a' , { isSigned : true } ) , anExtensionsDownloader ( { isSignatureVerificationEnabled : true , verificationResult : true , didExecute : true } ) , disposables ) ;
192
193
193
194
await testObject . run ( ) ;
194
195
@@ -197,7 +198,7 @@ suite('InstallGalleryExtensionTask Tests', () => {
197
198
} ) ;
198
199
199
200
test ( 'task completes for unsigned extension' , async ( ) => {
200
- const testObject = new TestInstallGalleryExtensionTask ( aGalleryExtension ( 'a' , { isSigned : false } ) , anExtensionsDownloader ( { isSignatureVerificationEnabled : true , verificationResult : true , didExecute : false } ) ) ;
201
+ const testObject = new TestInstallGalleryExtensionTask ( aGalleryExtension ( 'a' , { isSigned : false } ) , anExtensionsDownloader ( { isSignatureVerificationEnabled : true , verificationResult : true , didExecute : false } ) , disposables ) ;
201
202
202
203
await testObject . run ( ) ;
203
204
@@ -206,7 +207,7 @@ suite('InstallGalleryExtensionTask Tests', () => {
206
207
} ) ;
207
208
208
209
test ( 'task completes for an unsigned extension even when signature verification throws error' , async ( ) => {
209
- const testObject = new TestInstallGalleryExtensionTask ( aGalleryExtension ( 'a' , { isSigned : false } ) , anExtensionsDownloader ( { isSignatureVerificationEnabled : true , verificationResult : 'error' , didExecute : true } ) ) ;
210
+ const testObject = new TestInstallGalleryExtensionTask ( aGalleryExtension ( 'a' , { isSigned : false } ) , anExtensionsDownloader ( { isSignatureVerificationEnabled : true , verificationResult : 'error' , didExecute : true } ) , disposables ) ;
210
211
211
212
await testObject . run ( ) ;
212
213
0 commit comments