mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
ci: add testing for mksnapshot (#15627)
* ci: add testing for mksnapshot
This commit is contained in:
committed by
GitHub
parent
edf063bae3
commit
9e2b7dbea5
20
spec/fixtures/snapshot-items-available.js
vendored
Normal file
20
spec/fixtures/snapshot-items-available.js
vendored
Normal 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
3
spec/fixtures/testsnap.js
vendored
Normal 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 }
|
||||
Reference in New Issue
Block a user