|
@@ -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
|