webview: api to get webcontents and associated host webcontents
This commit is contained in:
parent
537ead8917
commit
6fcc197db8
7 changed files with 46 additions and 5 deletions
|
@ -703,4 +703,17 @@ describe('<webview> tag', function() {
|
|||
document.body.appendChild(webview);
|
||||
});
|
||||
});
|
||||
|
||||
describe('<webview>.getWebContents', function() {
|
||||
it('can return the webcontents associated', function(done) {
|
||||
webview.addEventListener('did-finish-load', function() {
|
||||
const webviewContents = webview.getWebContents();
|
||||
assert(webviewContents);
|
||||
assert.equal(webviewContents.getURL(), 'about:blank');
|
||||
done();
|
||||
});
|
||||
webview.src = "about:blank";
|
||||
document.body.appendChild(webview);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue