Skip to content

Commit

Permalink
Swallow deprecation notices about window.webkitStorageInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
m90 authored and mantoni committed May 25, 2021
1 parent 119d6f0 commit 9a706fe
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
14 changes: 10 additions & 4 deletions lib/chromium.js
Expand Up @@ -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;
}
Expand Down
6 changes: 4 additions & 2 deletions test/chromium-test.js
Expand Up @@ -139,15 +139,17 @@ 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)]
// ContextResult::kTransientFailure: Failed to send
// 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',
Expand Down

0 comments on commit 9a706fe

Please sign in to comment.