webview: api to get webcontents and associated host webcontents

This commit is contained in:
Robo 2016-02-17 14:22:19 +05:30
parent 537ead8917
commit 6fcc197db8
7 changed files with 46 additions and 5 deletions

View file

@ -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);
});
});
});