From 017df93ffabfd4f8e65195fac7fdab983f501061 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 19 Dec 2016 15:48:32 -0800 Subject: [PATCH] Add failing spec for insertCSS --- spec/api-web-contents-spec.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spec/api-web-contents-spec.js b/spec/api-web-contents-spec.js index fc486be46dc1..ada1a1be46fe 100644 --- a/spec/api-web-contents-spec.js +++ b/spec/api-web-contents-spec.js @@ -268,4 +268,13 @@ describe('webContents module', function () { w.webContents.sendInputEvent({type: 'char', keyCode: 'Z', modifiers: ['shift', 'ctrl']}) }) }) + + it('supports inserting CSS', function (done) { + w.loadURL('about:blank') + w.webContents.insertCSS('body { background-repeat: round; }') + w.webContents.executeJavaScript('window.getComputedStyle(document.body).getPropertyValue("background-repeat")', (result) => { + assert.equal(result, 'round') + done() + }) + }) })