Merge pull request #9108 from yuya-oc/add-macos-sheet-events
Add sheet-begin and sheet-end events to macOS BrowserWindow
This commit is contained in:
commit
dc8b43901b
8 changed files with 88 additions and 0 deletions
|
@ -1191,6 +1191,54 @@ describe('BrowserWindow module', function () {
|
|||
})
|
||||
})
|
||||
|
||||
describe('sheet-begin event', function () {
|
||||
if (process.platform !== 'darwin') {
|
||||
return
|
||||
}
|
||||
|
||||
let sheet = null
|
||||
|
||||
afterEach(function () {
|
||||
return closeWindow(sheet, {assertSingleWindow: false}).then(function () { sheet = null })
|
||||
})
|
||||
|
||||
it('emits when window opens a sheet', function (done) {
|
||||
w.show()
|
||||
w.once('sheet-begin', function () {
|
||||
sheet.close()
|
||||
done()
|
||||
})
|
||||
sheet = new BrowserWindow({
|
||||
modal: true,
|
||||
parent: w
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('sheet-end event', function () {
|
||||
if (process.platform !== 'darwin') {
|
||||
return
|
||||
}
|
||||
|
||||
let sheet = null
|
||||
|
||||
afterEach(function () {
|
||||
return closeWindow(sheet, {assertSingleWindow: false}).then(function () { sheet = null })
|
||||
})
|
||||
|
||||
it('emits when window has closed a sheet', function (done) {
|
||||
w.show()
|
||||
sheet = new BrowserWindow({
|
||||
modal: true,
|
||||
parent: w
|
||||
})
|
||||
w.once('sheet-end', function () {
|
||||
done()
|
||||
})
|
||||
sheet.close()
|
||||
})
|
||||
})
|
||||
|
||||
describe('beginFrameSubscription method', function () {
|
||||
// This test is too slow, only test it on CI.
|
||||
if (!isCI) return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue