Repository: GoogleChrome/lighthouse
Pull request #12757 (2021-07-07 16:18:15)

core: reference chromium main instead of master
fixes https://github.com/GoogleChrome/lighthouse/issues/12756


Patch:
diff --git a/clients/devtools-report-assets.js b/clients/devtools-report-assets.js
index d980ed47a..7a5c8fcb6 100644
--- a/clients/devtools-report-assets.js
+++ b/clients/devtools-report-assets.js
@@ -13,7 +13,7 @@
 
 /* global globalThis */
 
-// @ts-expect-error: globalThis.EXPORTED_CACHED_RESOURCES_ONLY_FOR_LIGHTHOUSE exists in Devtools. https://source.chromium.org/chromium/chromium/src/+/master:third_party/devtools-frontend/src/front_end/root/Runtime.js;l=1247-1250;drc=c4e2fefe3327aa9fe5f4398a1baddb8726c230d5
+// @ts-expect-error: globalThis.EXPORTED_CACHED_RESOURCES_ONLY_FOR_LIGHTHOUSE exists in Devtools. https://source.chromium.org/chromium/chromium/src/+/main:third_party/devtools-frontend/src/front_end/root/Runtime.js;l=1247-1250;drc=c4e2fefe3327aa9fe5f4398a1baddb8726c230d5
 const cachedResources = globalThis.EXPORTED_CACHED_RESOURCES_ONLY_FOR_LIGHTHOUSE;
 
 // Getters are necessary because the DevTools bundling processes
diff --git a/lighthouse-core/audits/autocomplete.js b/lighthouse-core/audits/autocomplete.js
index 078de1b9f..d7cbed424 100644
--- a/lighthouse-core/audits/autocomplete.js
+++ b/lighthouse-core/audits/autocomplete.js
@@ -63,11 +63,11 @@ const validAutocompleteTokens = ['name', 'honorific-prefix', 'given-name',
   'tel-local', 'tel-local-prefix', 'tel-local-suffix', 'tel-extension', 'email', 'impp', 'off',
   'additional-name-initial', 'home', 'work', 'mobile', 'fax', 'pager', 'shipping', 'billing'];
 
-/** @type {string[]} This array contains all autofull suggestions that have no prediction tied to it. Autofill predictions found at https://source.chromium.org/chromium/chromium/src/+/master:components/autofill/core/browser/field_types.h;l=26 */
+/** @type {string[]} This array contains all autofull suggestions that have no prediction tied to it. Autofill predictions found at https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/field_types.h;l=26 */
 const noPrediction = ['NO_SERVER_DATA', 'UNKNOWN_TYPE', 'EMPTY_TYPE', 'HTML_TYPE_UNSPECIFIED',
   'HTML_TYPE_UNRECOGNIZED'];
 
-/** This mapping contains all autofill predictions to corresponding autocomplete attributes. Autofill predictions are found at https://source.chromium.org/chromium/chromium/src/+/master:components/autofill/core/browser/field_types.h;l=34*/
+/** This mapping contains all autofill predictions to corresponding autocomplete attributes. Autofill predictions are found at https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/field_types.h;l=34*/
 const predictionTypesToTokens = {
   'NO_SERVER_DATA': str_(UIStrings.manualReview),
   'UNKNOWN_TYPE': str_(UIStrings.manualReview),
diff --git a/lighthouse-core/audits/dobetterweb/inspector-issues.js b/lighthouse-core/audits/dobetterweb/inspector-issues.js
index a569cf1e9..c416b1cc2 100644
--- a/lighthouse-core/audits/dobetterweb/inspector-issues.js
+++ b/lighthouse-core/audits/dobetterweb/inspector-issues.js
@@ -7,7 +7,7 @@
 /**
  * @fileoverview Audits a page to determine whether it generates issues in the Issues panel of Chrome Devtools.
  * The audit is meant to maintain parity with the Chrome Devtools Issues panel front end.
- * https://source.chromium.org/chromium/chromium/src/+/master:third_party/devtools-frontend/src/front_end/sdk/
+ * https://source.chromium.org/chromium/chromium/src/+/main:third_party/devtools-frontend/src/front_end/sdk/
  */
 
 'use strict';
diff --git a/lighthouse-core/audits/installable-manifest.js b/lighthouse-core/audits/installable-manifest.js
index 49a18f4a4..18a0d3767 100644
--- a/lighthouse-core/audits/installable-manifest.js
+++ b/lighthouse-core/audits/installable-manifest.js
@@ -105,7 +105,7 @@ const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings);
  *
  * Requirements based on Chrome Devtools' installability requirements.
  * Origin of logging:
- * https://source.chromium.org/chromium/chromium/src/+/master:chrome/browser/installable/installable_logging.cc
+ * https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/installable/installable_logging.cc
  * DevTools InstallabilityError implementation:
  * https://source.chromium.org/search?q=getInstallabilityErrorMessages&ss=chromium%2Fchromium%2Fsrc:third_party%2Fdevtools-frontend%2Fsrc%2Ffront_end%2Fresources%2F
  */
diff --git a/lighthouse-core/lib/minify-trace.js b/lighthouse-core/lib/minify-trace.js
index 380a0d271..a57c49f3c 100644
--- a/lighthouse-core/lib/minify-trace.js
+++ b/lighthouse-core/lib/minify-trace.js
@@ -74,7 +74,7 @@ const traceEventsToKeepInProcess = new Set([
   ...traceEventsToKeepInToplevelTask,
 
   // See the DevTools marker events
-  // https://source.chromium.org/chromium/chromium/src/+/master:third_party/devtools-frontend/src/front_end/timeline_model/TimelineModel.js?q=-f:out%20f:TimelineModel%20%22MarkLoad:%20%27%22&ss=chromium
+  // https://source.chromium.org/chromium/chromium/src/+/main:third_party/devtools-frontend/src/front_end/timeline_model/TimelineModel.js?q=-f:out%20f:TimelineModel%20%22MarkLoad:%20%27%22&ss=chromium
   'firstPaint',
   'firstContentfulPaint',
   'firstMeaningfulPaint',
diff --git a/lighthouse-core/lib/url-shim.js b/lighthouse-core/lib/url-shim.js
index 672ecb62c..bdd726018 100644
--- a/lighthouse-core/lib/url-shim.js
+++ b/lighthouse-core/lib/url-shim.js
@@ -202,7 +202,7 @@ class URLShim extends URL {
   /**
    * Use `NetworkRequest.isNonNetworkRequest(req)` if working with a request.
    * Note: the `protocol` field from CDP can be 'h2', 'http', (not 'https'!) or it'll be url's scheme.
-   *   https://source.chromium.org/chromium/chromium/src/+/master:content/browser/devtools/protocol/network_handler.cc;l=598-611;drc=56d4a9a9deb30be73adcee8737c73bcb2a5ab64f
+   *   https://source.chromium.org/chromium/chromium/src/+/main:content/browser/devtools/protocol/network_handler.cc;l=598-611;drc=56d4a9a9deb30be73adcee8737c73bcb2a5ab64f
    * However, a `new URL(href).protocol` has a colon suffix.
    *   https://url.spec.whatwg.org/#dom-url-protocol
    * A URL's `scheme` is specced as the `protocol` sans-colon, but isn't exposed on a URL object.
diff --git a/lighthouse-core/scripts/pptr-run-devtools.js b/lighthouse-core/scripts/pptr-run-devtools.js
index 049bad000..6ae584c47 100644
--- a/lighthouse-core/scripts/pptr-run-devtools.js
+++ b/lighthouse-core/scripts/pptr-run-devtools.js
@@ -35,7 +35,7 @@ const argv = yargs(process.argv.slice(2))
   .argv;
 
 /**
- * https://source.chromium.org/chromium/chromium/src/+/master:third_party/devtools-frontend/src/front_end/test_runner/TestRunner.js;l=170;drc=f59e6de269f4f50bca824f8ca678d5906c7d3dc8
+ * https://source.chromium.org/chromium/chromium/src/+/main:third_party/devtools-frontend/src/front_end/test_runner/TestRunner.js;l=170;drc=f59e6de269f4f50bca824f8ca678d5906c7d3dc8
  * @param {Record<string, function>} receiver
  * @param {string} methodName
  * @param {function} override


Test patch:
diff --git a/lighthouse-core/test/chromium-web-tests/README.md b/lighthouse-core/test/chromium-web-tests/README.md
index 3a8b58338..fb375a84e 100644
--- a/lighthouse-core/test/chromium-web-tests/README.md
+++ b/lighthouse-core/test/chromium-web-tests/README.md
@@ -18,23 +18,23 @@ yarn update:test-devtools
 
 <details>
   <summary> Install `requests`</summary>
-  
+
   Ensure you have `requests` module available globally on your python 2.7 install. New Macs do not come with pip for python 2.7 which is deprecated, so you might have to install that too.
-  
-  
+
+
   ```sh
   curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py
   python get-pip.py
   pip -m pip install requests
   ```
-  
+
 </details>
 
 ### Debugging
 
 * Want logs from Lighthouse? Add `log.log('status', '**** hello test output ' + JSON.stringify({obj}));` which will be visible in the `lighthouse-successful-run.js` output thanks to `LighthouseTestRunner.addStatusListener`.
 * Want logs from test files? Adding these flags to the invocation `yarn test-devtools --driver-logging --no-retry-failures` will print to terminal.
-* Want logs from the inspected page? Add `testRunner.setDumpConsoleMessages(true);` to a test file. (also, [beware](https://source.chromium.org/chromium/chromium/src/+/master:content/web_test/renderer/web_view_test_proxy.cc;l=125-129;drc=437e5d9a05535b9e2cd7b983f78b23ebc3d92b3f) w/e this is about)
+* Want logs from the inspected page? Add `testRunner.setDumpConsoleMessages(true);` to a test file. (also, [beware](https://source.chromium.org/chromium/chromium/src/+/main:content/web_test/renderer/web_view_test_proxy.cc;l=125-129;drc=437e5d9a05535b9e2cd7b983f78b23ebc3d92b3f) w/e this is about)
 
 
 ## How it works
@@ -47,7 +47,7 @@ Normally, running these webtests requires a full Chromium checkout. However, tha
 
 * `third_party/blink/tools`.
 * `third_party/blink/web_tests/fast/harness`
-* [`third_party/catapult/third_party/typ`](https://source.chromium.org/chromium/chromium/src/+/master:third_party/catapult/third_party/typ/)–necessary third party Python library
+* [`third_party/catapult/third_party/typ`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/catapult/third_party/typ/)–necessary third party Python library
 
 2) **Apply a few custom patches**
 
@@ -65,7 +65,7 @@ DevTools had a script for this, but it was removed. `download-content-shell.js`
 
 To run the devtools webtests, `run_web_tests.py` requires the inspector resources (the output of the frontend build process). These files are actually included in the content shell download from before, but instead we want to build the currently checked out Lighthouse, roll to DevTools, build DevTools, and use the newly created inspector files.
 
-`run_web_tests.py` normally serves these files by mounting the Chromium build folder for the DevTools output to the path `/inspector-sources` [1](https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/tools/blinkpy/web_tests/port/base.py;l=1280;drc=e8e4dcd1d1684251c33cda9b9fc93d7ea808e4bd) [2](https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/tools/blinkpy/web_tests/servers/apache_http.py;l=118;drc=32408e19204a7ffceebfe774d7e99f2041cf4338). Instead, we fetch the DevTools frontend, roll Lighthouse, build it, then copy the build output to the `inspector-sources` at the root of our `npx http-server` web server.
+`run_web_tests.py` normally serves these files by mounting the Chromium build folder for the DevTools output to the path `/inspector-sources` [1](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/tools/blinkpy/web_tests/port/base.py;l=1280;drc=e8e4dcd1d1684251c33cda9b9fc93d7ea808e4bd) [2](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/tools/blinkpy/web_tests/servers/apache_http.py;l=118;drc=32408e19204a7ffceebfe774d7e99f2041cf4338). Instead, we fetch the DevTools frontend, roll Lighthouse, build it, then copy the build output to the `inspector-sources` at the root of our `npx http-server` web server.
 
 ## Testing Lighthouse from DevTools
 
@@ -108,4 +108,4 @@ Simply make your changes in `.tmp/chromium-web-tests/blink_tools`, and run: `git
 
 #### How does the python module `typ` get added to python sys path?
 
-Via a [hack](https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/tools/blinkpy/web_tests/models/typ_types.py;l=7?q=add_typ_dir_to_sys_path).
+Via a [hack](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/tools/blinkpy/web_tests/models/typ_types.py;l=7?q=add_typ_dir_to_sys_path).
diff --git a/third-party/chromium-synchronization/installability-errors-test.js b/third-party/chromium-synchronization/installability-errors-test.js
index 276f3399c..633897b65 100644
--- a/third-party/chromium-synchronization/installability-errors-test.js
+++ b/third-party/chromium-synchronization/installability-errors-test.js
@@ -16,7 +16,7 @@ describe('installabilityErrors', () => {
 
   beforeAll(async () => {
     const installableLoggingGitTilesUrl =
-      'https://chromium.googlesource.com/chromium/src/+/master/components/webapps/browser/installable/installable_logging.cc?format=TEXT';
+      'https://chromium.googlesource.com/chromium/src/+/main/components/webapps/browser/installable/installable_logging.cc?format=TEXT';
     const resp = await fetch(installableLoggingGitTilesUrl);
     if (!resp.ok) {
       throw new Error(`Chromium source fetch failed: ${resp.status} ${resp.statusText}`);
@@ -25,7 +25,7 @@ describe('installabilityErrors', () => {
     const buff = Buffer.from(base64, 'base64');
     const text = buff.toString('utf-8');
 
-    // Apply some *beautiful* regexes to parse the C++ of https://chromium.googlesource.com/chromium/src/+/master/chrome/browser/installable/installable_logging.cc
+    // Apply some *beautiful* regexes to parse the C++ of https://chromium.googlesource.com/chromium/src/+/main/chrome/browser/installable/installable_logging.cc
     const handledErrorConsts = [...text.matchAll(/error_id = (k.*?);/g)].map(([_, match]) => match);
     const errorConstsToIdsCode = [...text.matchAll(/static const char k.*?Id\[\](.|\n)*?;/g)].map(
       ([match]) => match.replace(/\n/, '')