mirror of
https://github.com/electron/electron.git
synced 2026-01-07 22:54:25 -05:00
chore: test with 1st quadrant of the window
This commit is contained in:
@@ -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)
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user