Skip to content

Commit

Permalink
[WIP] Remove Edge from the default browser set
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenmcgruer committed Mar 4, 2021
1 parent 31146ca commit 53d3853
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
22 changes: 21 additions & 1 deletion webapp/components/product-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/

const DisplayNames = (() => {
let m = new Map();
['chrome', 'chrome-experimental'].forEach(n => m.set(n, 'Chrome'));
Expand Down Expand Up @@ -42,7 +43,15 @@ const AllBrowserNames = Object.freeze(['chrome', 'edge', 'firefox', 'safari', 's
// 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
// an ordered list so that the first entry can be used as a consistent default.
const DefaultBrowserNames = Object.freeze(['chrome', 'edge', 'firefox', 'safari']);
//
// Historically Edge was included in the default browsers, but it was removed
// to show only one browser per engine
// (https://github.com/web-platform-tests/wpt.fyi/issues/1519). For user
// convenience, there is a flag to include it in the default set again.
const DefaultBrowserNames = edgeIsDefaultProduct()
? Object.freeze(['chrome', 'edge', 'firefox', 'safari'])
: Object.freeze(['chrome', 'firefox', 'safari']);
console.log(DefaultBrowserNames);
const DefaultProductSpecs = DefaultBrowserNames;

// The above sets, encoded as product objects. This avoids repeatedly calling
Expand All @@ -59,6 +68,17 @@ const SemanticLabels = [
{ property: '_source', values: Sources },
];

function edgeIsDefaultProduct() {
// Preferably we would use the WPTFlags class here, but it expects to be a
// super-class wrapping a Polymer element to work. Instead we use our
// knowledge of its internal implementation to go straight to local storage.
const value = localStorage.getItem('features.edgeIsDefaultProduct');
console.log(value);
console.log(value !== null);
console.log(JSON.parse(value));
return value !== null && JSON.parse(value);
}

function parseProductSpec(spec) {
// @sha (optional)
let revision = '';
Expand Down
6 changes: 6 additions & 0 deletions webapp/components/wpt-flags.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Object.defineProperty(wpt, 'ClientSideFeatures', {
'colorHomepage',
'diffFromAPI',
'displayMetadata',
'edgeIsDefaultProduct',
'experimentalByDefault',
'experimentalAligned',
'experimentalAlignedExceptEdge',
Expand Down Expand Up @@ -183,6 +184,11 @@ class WPTFlagsEditor extends FlagsEditorClass(/*environmentFlags*/ false) {
Use pass-rate colors on the homepage
</paper-checkbox>
</paper-item>
<paper-item>
<paper-checkbox checked="{{edgeIsDefaultProduct}}">
Include Edge as part of the default product set.
</paper-checkbox>
</paper-item>
<paper-item>
<paper-checkbox checked="{{structuredQueries}}">
Interpret query strings as structured queries over test names and test
Expand Down

0 comments on commit 53d3853

Please sign in to comment.