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 committed May 24, 2021
1 parent cea9e9f commit 9754f9d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
7 changes: 5 additions & 2 deletions lib/chromium.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,12 @@ 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) {
var skipLine = line.indexOf('SSL certificate') === -1
&& line.indexOf('window.webkitStorageInfo') === -1;
if (skipLine) {
process.stderr.write(line);
process.stderr.write('\n');
}
Expand Down
6 changes: 4 additions & 2 deletions test/chromium-test.js
Original file line number Diff line number Diff line change
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 9754f9d

Please sign in to comment.