From 5efa075aca6237814667cf78fc04d68b77953f5b Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 12 Apr 2016 14:57:40 +0900 Subject: [PATCH] spec: preload attribute should work without script tag in page --- spec/webview-spec.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spec/webview-spec.js b/spec/webview-spec.js index 64b73d9d2202..c9f44747befa 100644 --- a/spec/webview-spec.js +++ b/spec/webview-spec.js @@ -155,6 +155,18 @@ describe(' tag', function () { webview.src = 'file://' + fixtures + '/pages/e.html' document.body.appendChild(webview) }) + + it('works without script tag in page', function (done) { + var listener = function (e) { + assert.equal(e.message, 'function object object') + webview.removeEventListener('console-message', listener) + done() + } + webview.addEventListener('console-message', listener) + webview.setAttribute('preload', fixtures + '/module/preload.js') + webview.src = 'file://' + fixtures + '/pages/base-page.html' + document.body.appendChild(webview) + }) }) describe('httpreferrer attribute', function () {