Skip to content

Commit 0b235be

Browse files
jrichter1dgolovin
authored andcommitted
Set progress to installing at the start of vbox installation
1 parent 241bdde commit 0b235be

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

browser/model/virtualbox.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ class VirtualBoxInstallWindows extends VirtualBoxInstall {
123123
}
124124

125125
installAfterRequirements(progress, success, failure) {
126+
progress.setStatus('Installing');
126127
let installer = new Installer(this.keyName, progress, success, failure);
127128
return this.importCertificate(installer
128129
).catch((error) => {
@@ -165,7 +166,6 @@ class VirtualBoxInstallWindows extends VirtualBoxInstall {
165166
}
166167

167168
installMsi(installer, resolve, reject) {
168-
installer.progress.setStatus('Installing');
169169
let msiFile = path.join(this.installerDataSvc.virtualBoxDir(), '/VirtualBox-' + this.version + '-r' + this.revision + '-MultiArch_amd64.msi');
170170
return installer.exec(['msiexec',
171171
'/i',

test/unit/model/virtualbox-test.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,19 @@ describe('Virtualbox installer', function() {
162162
installer.ipcRenderer = {on: function() {}};
163163
});
164164

165+
166+
it('should set progress to "Installing"', function() {
167+
sandbox.stub(Installer.prototype, 'exec').resolves();
168+
sandbox.stub(installer, 'configure').resolves();
169+
sandbox.stub(Platform, 'addToUserPath').resolves();
170+
171+
return installer.installAfterRequirements(fakeProgress, success, failure)
172+
.then(() => {
173+
expect(fakeProgress.setStatus).to.have.been.calledOnce;
174+
expect(fakeProgress.setStatus).to.have.been.calledWith('Installing');
175+
});
176+
});
177+
165178
it('should import the certificate from the executable', function() {
166179
sandbox.stub(child_process, 'execFile').yields('done');
167180

@@ -214,13 +227,6 @@ describe('Virtualbox installer', function() {
214227
reject = (argument) => { Promise.reject(argument); };
215228
});
216229

217-
it('should set progress to "Installing"', function() {
218-
installer.installMsi(helper, resolve, reject);
219-
220-
expect(fakeProgress.setStatus).to.have.been.calledOnce;
221-
expect(fakeProgress.setStatus).to.have.been.calledWith('Installing');
222-
});
223-
224230
it('should execute the msi installer', function() {
225231
let spy = sandbox.spy(Installer.prototype, 'exec');
226232

0 commit comments

Comments
 (0)