From: Kevin Sawicki Date: Thu, 3 Nov 2016 00:25:52 +0000 (-0700) Subject: Add failing spec for deleted guestinstance when moving webview X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=18e1de105f3470945be5d60d191fd0c761ec1491;p=platform%2Fframework%2Fweb%2Fcrosswalk-tizen.git Add failing spec for deleted guestinstance when moving webview --- diff --git a/spec/webview-spec.js b/spec/webview-spec.js index bd28344..cc848f9 100644 --- a/spec/webview-spec.js +++ b/spec/webview-spec.js @@ -1254,9 +1254,27 @@ describe(' tag', function () { document.body.appendChild(webview) }) + it('does not delete the guestinstance attribute when moving the webview to another parent node', function (done) { + webview.addEventListener('dom-ready', function domReadyListener () { + webview.addEventListener('did-attach', function () { + assert(webview.guestinstance != null) + assert(webview.getWebContents() != null) + done() + }) + + document.body.replaceChild(webview, div) + }) + webview.src = 'file://' + fixtures + '/pages/a.html' + + const div = document.createElement('div') + div.appendChild(webview) + document.body.appendChild(div) + }) + it('does not destroy the webContents when hiding/showing the webview (regression)', function (done) { webview.addEventListener('dom-ready', function domReadyListener () { const instance = webview.getAttribute('guestinstance') + assert(instance != null) // Wait for event directly since attach happens asynchronously over IPC ipcMain.once('ELECTRON_GUEST_VIEW_MANAGER_ATTACH_GUEST', function () {