Skip to content

Commit

Permalink
test compiler load using worker
Browse files Browse the repository at this point in the history
  • Loading branch information
Aniket-Engg committed Sep 27, 2019
1 parent 6ec50ea commit 424ee06
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/app/tabs/compile-tab.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions src/app/tabs/test-tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -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())
})
Expand Down Expand Up @@ -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) => {
Expand All @@ -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)
Expand Down

0 comments on commit 424ee06

Please sign in to comment.