Browse Source

Add failing spec for insertCSS

Kevin Sawicki 8 years ago
parent
commit
017df93ffa
1 changed files with 9 additions and 0 deletions
  1. 9 0
      spec/api-web-contents-spec.js

+ 9 - 0
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()
+    })
+  })
 })