mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
chore: remove deprecated capturer count APIs (#37148)
chore: remove deprecated incrementCapturerCount() / decrementCapturerCount() Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Milan Burda <miburda@microsoft.com>
This commit is contained in:
@@ -398,28 +398,8 @@ describe('BrowserView module', () => {
|
||||
});
|
||||
await view.webContents.loadFile(path.join(fixtures, 'pages', 'a.html'));
|
||||
|
||||
view.webContents.incrementCapturerCount();
|
||||
const image = await view.webContents.capturePage();
|
||||
expect(image.isEmpty()).to.equal(false);
|
||||
});
|
||||
|
||||
it('should increase the capturer count', () => {
|
||||
view = new BrowserView({
|
||||
webPreferences: {
|
||||
backgroundThrottling: false
|
||||
}
|
||||
});
|
||||
w.setBrowserView(view);
|
||||
view.setBounds({
|
||||
...w.getBounds(),
|
||||
x: 0,
|
||||
y: 0
|
||||
});
|
||||
|
||||
view.webContents.incrementCapturerCount();
|
||||
expect(view.webContents.isBeingCaptured()).to.be.true();
|
||||
view.webContents.decrementCapturerCount();
|
||||
expect(view.webContents.isBeingCaptured()).to.be.false();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1789,7 +1789,6 @@ describe('BrowserWindow module', () => {
|
||||
w.loadFile(path.join(fixtures, 'pages', 'a.html'));
|
||||
await emittedOnce(w, 'ready-to-show');
|
||||
|
||||
w.webContents.incrementCapturerCount();
|
||||
const image = await w.capturePage();
|
||||
expect(image.isEmpty()).to.equal(false);
|
||||
});
|
||||
@@ -1807,14 +1806,6 @@ describe('BrowserWindow module', () => {
|
||||
// Values can be 0,2,3,4, or 6. We want 6, which is RGB + Alpha
|
||||
expect(imgBuffer[25]).to.equal(6);
|
||||
});
|
||||
|
||||
it('should increase the capturer count', () => {
|
||||
const w = new BrowserWindow({ show: false });
|
||||
w.webContents.incrementCapturerCount();
|
||||
expect(w.webContents.isBeingCaptured()).to.be.true();
|
||||
w.webContents.decrementCapturerCount();
|
||||
expect(w.webContents.isBeingCaptured()).to.be.false();
|
||||
});
|
||||
});
|
||||
|
||||
describe('BrowserWindow.setProgressBar(progress)', () => {
|
||||
|
||||
Reference in New Issue
Block a user