From 6d2a5145c9ed5c99d2e3a39bfc7452be20e6fb80 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 28 Jun 2017 13:01:22 -0700 Subject: [PATCH] Assert loaded state --- spec/chromium-spec.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spec/chromium-spec.js b/spec/chromium-spec.js index 8281056ee649..e4a9f04d78ef 100644 --- a/spec/chromium-spec.js +++ b/spec/chromium-spec.js @@ -995,8 +995,9 @@ describe('chromium feature', function () { it('opens when loading a pdf resource as top level navigation', function (done) { createBrowserWindow({plugins: true}) - ipcMain.once('pdf-loaded', function (event, success) { - success ? done() : done(new Error(`Unexpected loading state: ${success}`)) + ipcMain.once('pdf-loaded', function (event, state) { + assert.equal(state, 'success') + done() }) w.webContents.on('page-title-updated', function () { const parsedURL = url.parse(w.webContents.getURL(), true)