From 9f71fc29233e2c04cde2458ce3a54443f50d51b2 Mon Sep 17 00:00:00 2001 From: deepak1556 Date: Mon, 24 Dec 2018 07:01:51 +0530 Subject: [PATCH] chore: fix chromium-spec.js --- spec/chromium-spec.js | 22 ++++++++----------- spec/fixtures/pages/storage/cookie.html | 9 +++++--- spec/fixtures/pages/storage/indexed_db.html | 7 +++--- .../fixtures/pages/storage/local_storage.html | 7 ++---- 4 files changed, 21 insertions(+), 24 deletions(-) diff --git a/spec/chromium-spec.js b/spec/chromium-spec.js index 461389fb054c4..9ef8a7a05c0ff 100644 --- a/spec/chromium-spec.js +++ b/spec/chromium-spec.js @@ -1005,19 +1005,11 @@ describe('chromium feature', () => { }) it('cannot access localStorage', (done) => { - contents.on('crashed', (event, killed) => { - // Site isolation ON: process is killed for trying to access resources without permission. - if (process.platform !== 'win32') { - // Chromium on Windows does not set this flag correctly. - assert.strictEqual(killed, true, 'Process should\'ve been killed') - } - done() - }) ipcMain.once('local-storage-response', (event, message) => { - // Site isolation OFF: access is refused. assert.strictEqual( message, 'Failed to read the \'localStorage\' property from \'Window\': Access is denied for this document.') + done() }) contents.loadURL(protocolName + '://host/localStorage') }) @@ -1036,7 +1028,7 @@ describe('chromium feature', () => { ipcMain.once('web-sql-response', (event, error) => { assert.strictEqual( error, - 'An attempt was made to break through the security policy of the user agent.') + 'Failed to execute \'openDatabase\' on \'Window\': Access to the WebDatabase API is denied in this context.') done() }) contents.loadURL(`${protocolName}://host/WebSQL`) @@ -1044,15 +1036,19 @@ describe('chromium feature', () => { it('cannot access indexedDB', (done) => { ipcMain.once('indexed-db-response', (event, error) => { - assert.strictEqual(error, 'The user denied permission to access the database.') + assert.strictEqual( + error, + 'Failed to execute \'open\' on \'IDBFactory\': access to the Indexed Database API is denied in this context.') done() }) contents.loadURL(`${protocolName}://host/indexedDB`) }) it('cannot access cookie', (done) => { - ipcMain.once('cookie-response', (event, cookie) => { - assert(!cookie) + ipcMain.once('cookie-response', (event, error) => { + assert.strictEqual( + error, + 'Failed to set the \'cookie\' property on \'Document\': Access is denied for this document.') done() }) contents.loadURL(`${protocolName}://host/cookie`) diff --git a/spec/fixtures/pages/storage/cookie.html b/spec/fixtures/pages/storage/cookie.html index dc6a425f42e52..bae0969478a42 100644 --- a/spec/fixtures/pages/storage/cookie.html +++ b/spec/fixtures/pages/storage/cookie.html @@ -1,5 +1,8 @@ diff --git a/spec/fixtures/pages/storage/indexed_db.html b/spec/fixtures/pages/storage/indexed_db.html index 1515489ba0016..789553c6fb397 100644 --- a/spec/fixtures/pages/storage/indexed_db.html +++ b/spec/fixtures/pages/storage/indexed_db.html @@ -1,7 +1,8 @@ diff --git a/spec/fixtures/pages/storage/local_storage.html b/spec/fixtures/pages/storage/local_storage.html index 523ef20851830..fc9bab0090849 100644 --- a/spec/fixtures/pages/storage/local_storage.html +++ b/spec/fixtures/pages/storage/local_storage.html @@ -1,11 +1,8 @@