Implement webContents.savePage API.

This commit is contained in:
Haojian Wu 2015-10-14 12:41:31 +08:00
parent ddea2fced4
commit facd0fbc08
8 changed files with 210 additions and 0 deletions

View file

@ -301,3 +301,15 @@ describe 'browser-window module', ->
assert.notEqual data.length, 0
w.webContents.endFrameSubscription()
done()
describe 'save page', ->
savePagePath = path.join fixtures, 'save_page.html'
it 'should save page', (done) ->
w.webContents.on 'did-finish-load', ->
w.webContents.savePage savePagePath, 'HTMLComplete', (error) ->
assert.equal error, null
assert fs.existsSync savePagePath
fs.unlinkSync savePagePath
done()
w.loadUrl "file://#{fixtures}/api/blank.html"