Merge origin/master into enable-webview
This commit is contained in:
commit
74b7afbec7
155 changed files with 796 additions and 644 deletions
|
@ -1114,6 +1114,23 @@ describe('BrowserWindow module', function () {
|
|||
})
|
||||
})
|
||||
|
||||
it('can get printer list', function (done) {
|
||||
w.destroy()
|
||||
w = new BrowserWindow({
|
||||
show: false,
|
||||
webPreferences: {
|
||||
sandbox: true,
|
||||
preload: preload
|
||||
}
|
||||
})
|
||||
w.loadURL('data:text/html,%3Ch1%3EHello%2C%20World!%3C%2Fh1%3E')
|
||||
w.webContents.once('did-finish-load', function () {
|
||||
const printers = w.webContents.getPrinters()
|
||||
assert.equal(Array.isArray(printers), true)
|
||||
done()
|
||||
})
|
||||
})
|
||||
|
||||
it('can print to PDF', function (done) {
|
||||
w.destroy()
|
||||
w = new BrowserWindow({
|
||||
|
|
|
@ -325,13 +325,16 @@ describe('webContents module', function () {
|
|||
})
|
||||
|
||||
describe('getOSProcessId()', function () {
|
||||
it('returns a valid procress id', function () {
|
||||
it('returns a valid procress id', function (done) {
|
||||
assert.strictEqual(w.webContents.getOSProcessId(), 0)
|
||||
|
||||
w.webContents.once('did-finish-load', () => {
|
||||
const pid = w.webContents.getOSProcessId()
|
||||
assert.equal(typeof pid, 'number')
|
||||
assert(pid > 0, `pid ${pid} is not greater than 0`)
|
||||
done()
|
||||
})
|
||||
w.loadURL('about:blank')
|
||||
const pid = w.webContents.getOSProcessId()
|
||||
assert(typeof pid === 'number', 'is a number')
|
||||
assert(pid > 0, 'superior to 0')
|
||||
})
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue