Skip to content

Commit

Permalink
Add support for Node.js (fixes #3144)
Browse files Browse the repository at this point in the history
  • Loading branch information
past committed Feb 15, 2023
1 parent 3b63d16 commit 8637d34
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 6 deletions.
2 changes: 1 addition & 1 deletion shared/browsers.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var defaultBrowsers = []string{

// An extra list of known browsers.
var extraBrowsers = []string{
"android_webview", "chrome_android", "chrome_ios", "deno", "epiphany", "flow", "servo", "uc", "webkitgtk",
"android_webview", "chrome_android", "chrome_ios", "deno", "epiphany", "flow", "node.js", "servo", "uc", "webkitgtk",
}

var allBrowsers mapset.Set
Expand Down
2 changes: 2 additions & 0 deletions shared/browsers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ func TestGetDefaultBrowserNames(t *testing.T) {
assert.NotEqual(t, "deno", n)
assert.NotEqual(t, "epiphany", n)
assert.NotEqual(t, "flow", n)
assert.NotEqual(t, "node.js", n)
assert.NotEqual(t, "servo", n)
assert.NotEqual(t, "webkitgtk", n)
assert.NotEqual(t, "uc", n)
Expand All @@ -36,6 +37,7 @@ func TestIsBrowserName(t *testing.T) {
assert.True(t, IsBrowserName("edge"))
assert.True(t, IsBrowserName("firefox"))
assert.True(t, IsBrowserName("flow"))
assert.True(t, IsBrowserName("node.js"))
assert.True(t, IsBrowserName("safari"))
assert.True(t, IsBrowserName("chrome_android"))
assert.True(t, IsBrowserName("chrome_ios"))
Expand Down
2 changes: 2 additions & 0 deletions shared/product_spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ func (p ProductSpec) DisplayName() string {
return "Firefox"
case "flow":
return "Flow"
case "node.js":
return "Node.js"
case "safari":
return "Safari"
case "servo":
Expand Down
1 change: 1 addition & 0 deletions webapp/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ static/chromium_64x64.png
static/deno_64x64.png
static/edge*_64x64.png
static/firefox*_64x64.png
static/node.js_64x64.png
static/safari*_64x64.png
static/servo_64x64.png
static/uc_64x64.png
5 changes: 3 additions & 2 deletions webapp/components/product-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const DisplayNames = (() => {
m.set('chrome_ios', 'ChromeIOS');
m.set('deno', 'Deno');
m.set('flow', 'Flow');
m.set('node.js', 'Node.js');
m.set('servo', 'Servo');
m.set('uc', 'UC Browser');
m.set('webkitgtk', 'WebKitGTK');
Expand Down Expand Up @@ -43,7 +44,7 @@ const versionPatterns = Object.freeze({

// The set of all browsers known to the wpt.fyi UI.
const AllBrowserNames = Object.freeze(['android_webview', 'chrome_android', 'chrome_ios', 'chrome',
'deno', 'edge', 'firefox', 'flow', 'safari', 'servo', 'webkitgtk']);
'deno', 'edge', 'firefox', 'flow', 'node.js', 'safari', 'servo', 'webkitgtk']);

// The list of default browsers used in cases where the user has not otherwise
// chosen a set of browsers (e.g. which browsers to show runs for). Stored as
Expand Down Expand Up @@ -173,7 +174,7 @@ const ProductInfo = (superClass) => class extends superClass {
// chrome_android is mapped to chrome on wptrunner.
return '/static/chrome_64x64.png';

} else if (name !== 'deno' && name !== 'flow' && name !== 'servo') { // Deno, Flow & Servo do not have per-channel logos.
} else if (name !== 'deno' && name !== 'flow' && name !== 'node.js' && name !== 'servo') { // Products without per-channel logos.
let channel;
const candidates = ['beta', 'dev', 'canary', 'nightly', 'preview'];
for (const label of candidates) {
Expand Down
8 changes: 6 additions & 2 deletions webapp/components/wpt-amend-metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@ class AmendMetadata extends LoadingState(PathInfo(ProductInfo(PolymerElement)))

hasSearchURL(product) {
return product === 'chrome' || product === 'deno' || product === 'edge' ||
product === 'firefox' || product === 'safari' || product === 'servo' ||
product === 'webkitgtk';
product === 'firefox' || product === 'node.js' || product === 'safari' ||
product === 'servo' || product === 'webkitgtk';
}

getSearchURL(testName, product) {
Expand All @@ -317,6 +317,10 @@ class AmendMetadata extends LoadingState(PathInfo(ProductInfo(PolymerElement)))
return `https://bugzilla.mozilla.org/buglist.cgi?quicksearch="${testName}"`;
}

if (product === 'node.js') {
return `https://github.com/nodejs/node/issues?q="${testName}"`;
}

if (product === 'safari' || product === 'webkitgtk') {
return `https://bugs.webkit.org/buglist.cgi?quicksearch="${testName}"`;
}
Expand Down
13 changes: 13 additions & 0 deletions webapp/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"@browser-logos/firefox-beta": "4.1.3",
"@browser-logos/firefox-developer-edition": "3.0.5",
"@browser-logos/firefox-nightly": "3.0.5",
"@browser-logos/node.js": "1.0.1",
"@browser-logos/safari": "2.1.0",
"@browser-logos/safari-technology-preview": "2.0.2",
"@browser-logos/servo": "2.0.1",
Expand All @@ -49,7 +50,7 @@
"test": "wct --local chrome && wct --local firefox",
"lint": "eslint 'components/*.js' && eslint --plugin html 'components/test/*.html'",
"lint-fix": "eslint --fix 'components/**/*.js' && eslint --fix --plugin html 'components/test/*.html' ",
"postinstall": "cpy 'node_modules/@browser-logos/{chrome,chrome-beta,chrome-canary,chrome-dev,chromium,deno,edge,edge-beta,edge-canary,edge-dev,firefox,firefox-beta,firefox-nightly,safari,servo,uc}/*_64x64.png' static && cpy 'node_modules/@browser-logos/firefox-developer-edition/*_64x64.png' static --rename=firefox-dev_64x64.png && cpy 'node_modules/@browser-logos/safari/*_64x64.png' static --rename=safari-beta_64x64.png && cpy 'node_modules/@browser-logos/safari-technology-preview/*_64x64.png' static --rename=safari-dev_64x64.png && cpy 'node_modules/@browser-logos/safari-technology-preview/*_64x64.png' static --rename=safari-preview_64x64.png",
"postinstall": "cpy 'node_modules/@browser-logos/{chrome,chrome-beta,chrome-canary,chrome-dev,chromium,deno,edge,edge-beta,edge-canary,edge-dev,firefox,firefox-beta,firefox-nightly,node.js,safari,servo,uc}/*_64x64.png' static && cpy 'node_modules/@browser-logos/firefox-developer-edition/*_64x64.png' static --rename=firefox-dev_64x64.png && cpy 'node_modules/@browser-logos/safari/*_64x64.png' static --rename=safari-beta_64x64.png && cpy 'node_modules/@browser-logos/safari-technology-preview/*_64x64.png' static --rename=safari-dev_64x64.png && cpy 'node_modules/@browser-logos/safari-technology-preview/*_64x64.png' static --rename=safari-preview_64x64.png",
"wctp": "wct -p",
"wct": "wct"
},
Expand Down

0 comments on commit 8637d34

Please sign in to comment.