test compiler load using worker

pull/1/head
Aniket-Engg 5 years ago
parent 6ec50ea83a
commit 424ee06786
  1. 5
      src/app/tabs/compile-tab.js
  2. 9
      src/app/tabs/test-tab.js

@ -191,6 +191,11 @@ class CompileTab extends ViewPlugin {
return this.compileTabLogic.compileFile(fileName)
}
// This function is used for passing the compiler remix-tests
getCurrentVersion () {
return this.compilerContainer.data.selectedVersion
}
/*********
* SUB-COMPONENTS
*/

@ -28,6 +28,7 @@ module.exports = class TestTab extends ViewPlugin {
this.data = {}
this.appManager = appManager
this.renderer = renderer
this.baseurl = 'https://solc-bin.ethereum.org/bin'
appManager.event.on('activate', (name) => {
if (name === 'solidity') this.updateRunAction(fileManager.currentFile())
})
@ -151,7 +152,9 @@ module.exports = class TestTab extends ViewPlugin {
return new Promise((resolve, reject) => {
let runningTest = {}
runningTest[path] = { content }
remixTests.runTestSources(runningTest, () => {}, () => {}, (error, result) => {
let currentCompilerUrl = this.baseurl + '/' + this.compileTab.getCurrentVersion()
let usingWorker = this.compileTab.compilerContainer.browserSupportWorker()
remixTests.runTestSources(runningTest, currentCompilerUrl, usingWorker, () => {}, () => {}, (error, result) => {
if (error) return reject(error)
resolve(result)
}, (url, cb) => {
@ -165,7 +168,9 @@ module.exports = class TestTab extends ViewPlugin {
this.fileManager.getFile(testFilePath).then((content) => {
var runningTest = {}
runningTest[testFilePath] = { content }
remixTests.runTestSources(runningTest, (result) => { this.testCallback(result) }, (_err, result, cb) => { this.resultsCallback(_err, result, cb) }, (error, result) => {
let currentCompilerUrl = this.baseurl + '/' + this.compileTab.getCurrentVersion()
let usingWorker = this.compileTab.compilerContainer.browserSupportWorker()
remixTests.runTestSources(runningTest, currentCompilerUrl, usingWorker, (result) => { this.testCallback(result) }, (_err, result, cb) => { this.resultsCallback(_err, result, cb) }, (error, result) => {
this.updateFinalResult(error, result, testFilePath)
this.loading.hidden = true
callback(error)

Loading…
Cancel
Save