Commit c831ba63 authored by Simon Zünd's avatar Simon Zünd Committed by Commit Bot

[devtools] Rename 'whitelist' to more inclusive term in web tests

Drive-by: Use {Set} instead for better readability.

R=petermarshall@chromium.org

Fixed: chromium:1097229
Change-Id: I9dff25e9beb1c1997a294aa441254ae549f9446b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2255608
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Auto-Submit: Simon Zünd <szuend@chromium.org>
Reviewed-by: default avatarPeter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#781212}
parent 954548a3
Tests that console logging dumps properly styled messages, and that the whole message gets the same style, regardless of multiple %c settings. Tests that console logging dumps properly styled messages, and that the whole message gets the same style, regardless of multiple %c settings.
console-format-style-whitelist.js:13 Colors are awesome. console-format-style-allowed.js:13 Colors are awesome.
Styled text #0: contain: paint; display: inline-block; max-width: 100%; color: blue; Styled text #0: contain: paint; display: inline-block; max-width: 100%; color: blue;
console-format-style-whitelist.js:14 So are fonts! console-format-style-allowed.js:14 So are fonts!
Styled text #0: contain: paint; display: inline-block; max-width: 100%; font: 1em Helvetica; Styled text #0: contain: paint; display: inline-block; max-width: 100%; font: 1em Helvetica;
console-format-style-whitelist.js:15 And borders and margins and paddings! console-format-style-allowed.js:15 And borders and margins and paddings!
Styled text #0: contain: paint; display: inline-block; max-width: 100%; border: 1px solid red; margin: 20px; padding: 10px; Styled text #0: contain: paint; display: inline-block; max-width: 100%; border: 1px solid red; margin: 20px; padding: 10px;
console-format-style-whitelist.js:16 text-* is fine by us! console-format-style-allowed.js:16 text-* is fine by us!
Styled text #0: contain: paint; display: inline-block; max-width: 100%; text-decoration: none; Styled text #0: contain: paint; display: inline-block; max-width: 100%; text-decoration: none;
console-format-style-whitelist.js:18 Display, on the other hand, is bad news. console-format-style-allowed.js:18 Display, on the other hand, is bad news.
Styled text #0: contain: paint; display: inline-block; max-width: 100%; Styled text #0: contain: paint; display: inline-block; max-width: 100%;
console-format-style-whitelist.js:19 And position too. console-format-style-allowed.js:19 And position too.
Styled text #0: contain: paint; display: inline-block; max-width: 100%; Styled text #0: contain: paint; display: inline-block; max-width: 100%;
...@@ -18,11 +18,11 @@ ...@@ -18,11 +18,11 @@
Array.from(categories).sort().forEach(category => TestRunner.addResult('Has category: ' + category)); Array.from(categories).sort().forEach(category => TestRunner.addResult('Has category: ' + category));
TestRunner.addResult(''); TestRunner.addResult('');
var whitelist = [ const expectedCommands = [
'Panel: Show Console', 'Drawer: Show Console', 'Appearance: Switch to dark theme', 'Panel: Show Console', 'Drawer: Show Console', 'Appearance: Switch to dark theme',
'Global: Auto-open DevTools for popups' 'Global: Auto-open DevTools for popups'
]; ];
whitelist.forEach(item => { expectedCommands.forEach(item => {
if (!commands.has(item)) if (!commands.has(item))
TestRunner.addResult(item + ' is MISSING'); TestRunner.addResult(item + ' is MISSING');
}); });
......
...@@ -55,19 +55,11 @@ ...@@ -55,19 +55,11 @@
}); });
urls.sort(); urls.sort();
var whiteList = [ const allowedUrls = new Set([
'debugger-test.js', 'dynamic-script.js', 'dynamic-scripts.js', 'evalSourceURL.js', 'inspector-test.js', 'debugger-test.js', 'dynamic-script.js', 'dynamic-scripts.js', 'evalSourceURL.js', 'inspector-test.js',
'scriptElementContentSourceURL.js' 'scriptElementContentSourceURL.js'
]; ]);
function filter(url) { urls = urls.filter(url => allowedUrls.has(url));
for (var i = 0; i < whiteList.length; ++i) {
if (url === whiteList[i])
return true;
}
return false;
}
urls = urls.filter(filter);
TestRunner.addResult('UISourceCodes:'); TestRunner.addResult('UISourceCodes:');
var lastURL; var lastURL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment