From 9a706febc9bb0e7318e07b0653028a009b4488d8 Mon Sep 17 00:00:00 2001 From: Frederik Ring Date: Mon, 24 May 2021 19:49:37 +0200 Subject: [PATCH] Swallow deprecation notices about window.webkitStorageInfo --- lib/chromium.js | 14 ++++++++++---- test/chromium-test.js | 6 ++++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/lib/chromium.js b/lib/chromium.js index d8f413a3..bc33844a 100644 --- a/lib/chromium.js +++ b/lib/chromium.js @@ -116,12 +116,18 @@ module.exports = function (b, opts) { var text = msg.text(); if (msg.type() !== 'log') { // Swallow SSL vertificate warning that occurs on navigation before - // the script is injected. + // the script is injected. Also swallow deprecation notices about + // window.webkitStorageInfo. text.split('\n').forEach(function (line) { - if (line.indexOf('SSL certificate') === -1) { - process.stderr.write(line); - process.stderr.write('\n'); + var skipLine = line.indexOf('SSL certificate') >= 0 + || line.indexOf( + '\'window.webkitStorageInfo\' is deprecated' + ) >= 0; + if (skipLine) { + return; } + process.stderr.write(line); + process.stderr.write('\n'); }); return; } diff --git a/test/chromium-test.js b/test/chromium-test.js index 6c2ae12a..adda94cd 100644 --- a/test/chromium-test.js +++ b/test/chromium-test.js @@ -139,7 +139,6 @@ describe('chromium', function () { assert.equal(code, 0); assert.equal(stdout, '# chromium:\n'); - // The sub-set lines actually relating to the console output. Other // lines may relate to internal Chrome errors, such as // '[0322/162300.874805:ERROR:command_buffer_proxy_impl.cc(125)] @@ -147,7 +146,10 @@ describe('chromium', function () { // GpuChannelMsg_CreateCommandBuffer.' var stderrLines = stderr .split('\n') - .filter(function (l) { return l.indexOf('INFO:CONSOLE') >= 0; }); + .filter(function (l) { + return l.indexOf('INFO:CONSOLE') >= 0 + && l.indexOf('window.webkitStorageInfo') === -1; + }); var expectedLines = [ 'ok 1 test passes', '# tests 1',