chore: test with 1st quadrant of the window

This commit is contained in:
deepak1556
2025-08-28 10:24:17 +09:00
parent 60fcd3032a
commit f4a7e04c0b
2 changed files with 9 additions and 3 deletions

View File

@@ -78,9 +78,13 @@ function areColorsSimilar (
}
function displayCenter (display: Electron.Display): Electron.Point {
// On macOS, we get system prompt to ask permission for screen capture
// taking up space in the center. As a workaround, choose
// area of the application window which is not covered by the prompt.
// TODO: Remove this when the prompt situation is resolved.
return {
x: display.size.width / 2,
y: display.size.height / 2
x: display.size.width / (process.platform === 'darwin' ? 4 : 2),
y: display.size.height / (process.platform === 'darwin' ? 4 : 2)
};
}

View File

@@ -1,4 +1,4 @@
import { BrowserWindow, session, ipcMain, app, WebContents } from 'electron/main';
import { BrowserWindow, session, ipcMain, app, WebContents, screen } from 'electron/main';
import * as auth from 'basic-auth';
import { expect } from 'chai';
@@ -782,6 +782,7 @@ describe('<webview> tag', function () {
let w: BrowserWindow;
before(async () => {
const display = screen.getPrimaryDisplay();
w = new BrowserWindow({
webPreferences: {
webviewTag: true,
@@ -789,6 +790,7 @@ describe('<webview> tag', function () {
contextIsolation: false
}
});
w.setBounds(display.bounds);
await w.loadURL(`file://${fixtures}/pages/flex-webview.html`);
w.setBackgroundColor(WINDOW_BACKGROUND_COLOR);
});