ci: add testing for mksnapshot (#15627)

* ci: add testing for mksnapshot
This commit is contained in:
John Kleinschmidt
2018-11-09 10:54:17 -04:00
committed by GitHub
parent edf063bae3
commit 9e2b7dbea5
6 changed files with 197 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
// Verifies that objects contained in custom snapshot are accessible in Electron.
const { app } = require('electron')
app.once('ready', () => {
try {
const testValue = f() // eslint-disable-line no-undef
if (testValue === 86) {
console.log('ok test snapshot successfully loaded.')
app.exit(0)
} else {
console.log('not ok test snapshot could not be successfully loaded.')
app.exit(1)
}
return
} catch (ex) {
console.log('Error running custom snapshot', ex)
app.exit(1)
}
})

3
spec/fixtures/testsnap.js vendored Normal file
View File

@@ -0,0 +1,3 @@
// taken from https://chromium.googlesource.com/v8/v8.git/+/HEAD/test/cctest/test-serialize.cc#1127
function f () { return g() * 2 } // eslint-disable-line no-unused-vars
function g () { return 43 }