fix: native View
wrapper crash missing when adding child view (#43696)
fix: native View wrapper crash missing when adding child view Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
parent
2aa2611f76
commit
27aea84411
3 changed files with 29 additions and 7 deletions
|
@ -135,6 +135,20 @@ describe('WebContentsView', () => {
|
|||
expect(w.isFullScreen()).to.be.true('isFullScreen');
|
||||
});
|
||||
|
||||
it('can be added as a child of another View', async () => {
|
||||
const w = new BaseWindow();
|
||||
const v = new View();
|
||||
const wcv = new WebContentsView();
|
||||
|
||||
await wcv.webContents.loadURL('data:text/html,<div id="div">This is a simple div.</div>');
|
||||
|
||||
v.addChildView(wcv);
|
||||
w.contentView.addChildView(v);
|
||||
|
||||
expect(w.contentView.children).to.deep.equal([v]);
|
||||
expect(v.children).to.deep.equal([wcv]);
|
||||
});
|
||||
|
||||
describe('visibilityState', () => {
|
||||
async function haveVisibilityState (view: WebContentsView, state: string) {
|
||||
const docVisState = await view.webContents.executeJavaScript('document.visibilityState');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue