electron/spec/fixtures/crash-cases/api-browser-destroy/index.js
Samuel Attard ba6d9291d2
build: add import/order eslint rule (#44108)
build: add import/order eslint rule (#44085)

* build: add import/order eslint rule

* chore: run lint:js --fix
2024-10-03 15:21:54 -07:00

26 lines
677 B
JavaScript

const { app, BrowserWindow, BrowserView } = require('electron');
const { expect } = require('chai');
function createWindow () {
// Create the browser window.
const mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
});
const view = new BrowserView();
mainWindow.addBrowserView(view);
view.webContents.destroy();
view.setBounds({ x: 0, y: 0, width: 0, height: 0 });
const bounds = view.getBounds();
expect(bounds).to.deep.equal({ x: 0, y: 0, width: 0, height: 0 });
view.setBackgroundColor('#56cc5b10');
}
app.on('ready', () => {
createWindow();
setTimeout(() => app.quit());
});