Skip to content

Commit b2791cb

Browse files
authored
Merge branch 'ChromeDevTools:main' into main
2 parents f4fbf2e + 582c08b commit b2791cb

File tree

480 files changed

+26698
-16434
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

480 files changed

+26698
-16434
lines changed

DEPS

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,24 @@ vars = {
1515
'build_revision': 'e13953ced04ed05f45aa3c961bd6d802aced74ec',
1616

1717
'buildtools_url': 'https://chromium.googlesource.com/chromium/src/buildtools.git',
18-
'buildtools_revision': '8f29aa25232198e7955c675f6f66d6d6e1f04d73',
18+
'buildtools_revision': '64b9f65d16a4de27d1d3e7d880ddc983f281151f',
1919

2020
'depot_tools_url': 'https://chromium.googlesource.com/chromium/tools/depot_tools.git',
21-
'depot_tools_revision': '3be09c6d74ab3e69c99a4dfef5cac79d075b7142',
21+
'depot_tools_revision': 'd255a8d41e7a2fdc6b50fee69e70014f875d47ef',
2222

2323
'inspector_protocol_url': 'https://chromium.googlesource.com/deps/inspector_protocol',
2424
'inspector_protocol_revision': '6d1ae0f13aae6ad381ca31b17b88a0f5af29ca94',
2525

2626
# Keeping track of the last time we rollerd the browser protocol files.
27-
'chromium_browser_protocol_revision' : '1cbea9a67e6b8a957e370ab258e26bbdae9cbd29',
27+
'chromium_browser_protocol_revision' : 'd2038f87e77355d9568c6446169e2e3f07197ee8',
2828

2929
'clang_format_url': 'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/clang/tools/clang-format.git',
3030
'clang_format_revision': '37f6e68a107df43b7d7e044fd36a13cbae3413f2',
3131

3232
'emscripten_tag': 'ade9d780ff17c88d81aa13860361743e3c1e1396',
3333

3434
# GN CIPD package version.
35-
'gn_version': 'git_revision:a84e399f9999003472192286abc03d752c9cb1f0',
35+
'gn_version': 'git_revision:e5c4d1881b85b82789b7013233a944cf1a46370f',
3636

3737
'cmake_version': 'version:2@3.21.3',
3838

@@ -49,7 +49,7 @@ vars = {
4949
# Chrome version used for tests. It should be regularly updated to
5050
# match the Canary version listed here:
5151
# https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions.json
52-
'chrome': '139.0.7211.0',
52+
'chrome': '139.0.7222.0',
5353

5454
# 'magic' text to tell depot_tools that git submodules should be accepted but
5555
# but parity with DEPS file is expected.
@@ -59,7 +59,7 @@ vars = {
5959
'non_git_source': 'True',
6060

6161
# siso CIPD package version
62-
'siso_version': 'git_revision:df8adf712c5b5605b438fdfcd44235107811e5ef',
62+
'siso_version': 'git_revision:963177240b1a36697c9762856f51ad36ab545ceb',
6363
}
6464

6565
# Only these hosts are allowed for dependencies in this DEPS file.

buildtools

Submodule buildtools updated from 8f29aa2 to 64b9f65

config/owner/INFRA_OWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
alexschulze@chromium.org
2+
alexrudenko@chromium.org
23
dsv@chromium.org
34
jacktfranklin@chromium.org
45
liviurau@chromium.org

eslint.config.mjs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import eslintPlugin from 'eslint-plugin-eslint-plugin';
77
import importPlugin from 'eslint-plugin-import';
88
import jsdocPlugin from 'eslint-plugin-jsdoc';
99
import mochaPlugin from 'eslint-plugin-mocha';
10-
import { defineConfig, globalIgnores } from 'eslint/config';
10+
import {defineConfig, globalIgnores} from 'eslint/config';
1111
import globals from 'globals';
12-
import { join } from 'path';
12+
import {join} from 'path';
1313
import typescriptEslint from 'typescript-eslint';
1414

1515
import rulesdirPlugin from './scripts/eslint_rules/rules-dir.mjs';
@@ -193,7 +193,7 @@ export default defineConfig([
193193
radix: 'error',
194194
'valid-typeof': 'error',
195195
'no-return-assign': ['error', 'always'],
196-
'no-implicit-coercion': ['error', { allow: ['!!'] }],
196+
'no-implicit-coercion': ['error', {allow: ['!!']}],
197197

198198
'no-array-constructor': 'error',
199199

@@ -305,11 +305,11 @@ export default defineConfig([
305305
parserOptions: {
306306
allowAutomaticSingleRunInference: true,
307307
project: join(
308-
import.meta.dirname,
309-
'config',
310-
'typescript',
311-
'tsconfig.eslint.json',
312-
),
308+
import.meta.dirname,
309+
'config',
310+
'typescript',
311+
'tsconfig.eslint.json',
312+
),
313313
},
314314
},
315315

@@ -554,12 +554,12 @@ export default defineConfig([
554554
{
555555
// Enforce that any import of models/trace/trace.js names the import Trace.
556556
modulePath: join(
557-
import.meta.dirname,
558-
'front_end',
559-
'models',
560-
'trace',
561-
'trace.js',
562-
),
557+
import.meta.dirname,
558+
'front_end',
559+
'models',
560+
'trace',
561+
'trace.js',
562+
),
563563
importName: 'Trace',
564564
},
565565
],
@@ -704,7 +704,7 @@ export default defineConfig([
704704
'rulesdir/prefer-sinon-assert': 'error',
705705
'rulesdir/prefer-url-string': 'error',
706706
'rulesdir/trace-engine-test-timeouts': 'error',
707-
'rulesdir/no-widget-show-document-body': 'error',
707+
'rulesdir/no-document-body-mutation': 'error',
708708
'rulesdir/enforce-custom-element-definitions-location': 'off',
709709
},
710710

front_end/core/common/Settings.test.ts

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,68 @@ describe('updateVersionFrom37To38', () => {
620620
});
621621
});
622622

623+
describe('updateVersionFrom38To39', () => {
624+
let settings: Common.Settings.Settings;
625+
let setting: Common.Settings.Setting<{title: string, i18nTitleKey: string}>;
626+
627+
beforeEach(() => {
628+
const mockStore = new MockStore();
629+
const syncedStorage = new Common.Settings.SettingsStorage({}, mockStore);
630+
const globalStorage = new Common.Settings.SettingsStorage({}, mockStore);
631+
const localStorage = new Common.Settings.SettingsStorage({}, mockStore);
632+
633+
settings = Common.Settings.Settings.instance({
634+
forceNew: true,
635+
syncedStorage,
636+
globalStorage,
637+
localStorage,
638+
});
639+
setting = settings.createSetting('preferred-network-condition', {title: 'Offline', i18nTitleKey: 'Offline'});
640+
});
641+
642+
afterEach(() => {
643+
Common.Settings.Settings.removeInstance();
644+
Common.Settings.resetSettings(); // Clear SettingsRegistrations.
645+
});
646+
647+
it('renames the preferred-network-condition for "Slow 3G"', async () => {
648+
setting.set({title: 'Slow 3G', i18nTitleKey: 'Slow 3G'});
649+
const versionController = new VersionController();
650+
versionController.updateVersionFrom38To39();
651+
const newSetting = await setting.forceGet();
652+
assert.strictEqual(newSetting.title, '3G');
653+
assert.strictEqual(newSetting.i18nTitleKey, '3G');
654+
});
655+
656+
it('renames the preferred-network-condition for "Fast 3G"', async () => {
657+
setting.set({title: 'Fast 3G', i18nTitleKey: 'Fast 3G'});
658+
const versionController = new VersionController();
659+
versionController.updateVersionFrom38To39();
660+
const newSetting = await setting.forceGet();
661+
assert.strictEqual(newSetting.title, 'Slow 4G');
662+
assert.strictEqual(newSetting.i18nTitleKey, 'Slow 4G');
663+
});
664+
665+
it('does not rename any other setting', async () => {
666+
setting.set({title: 'Slow 4G', i18nTitleKey: 'Slow 4G'});
667+
const versionController = new VersionController();
668+
versionController.updateVersionFrom38To39();
669+
const newSetting = await setting.forceGet();
670+
assert.strictEqual(newSetting.title, 'Slow 4G');
671+
assert.strictEqual(newSetting.i18nTitleKey, 'Slow 4G');
672+
});
673+
674+
it('deletes the setting if it does not parse as valid JSON', async () => {
675+
setting.set({title: 'Slow 4G', i18nTitleKey: 'Slow 4G'});
676+
sinon.stub(JSON, 'parse').callsFake(() => {
677+
throw new Error('Invalid JSON');
678+
});
679+
const versionController = new VersionController();
680+
versionController.updateVersionFrom38To39();
681+
assert.isFalse(settings.globalStorage.has('preferred-network-condition'));
682+
});
683+
});
684+
623685
describe('access logging', () => {
624686
let settings: Common.Settings.Settings;
625687
let logSettingAccess!: sinon.SinonSpy;

front_end/core/common/Settings.ts

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -438,11 +438,14 @@ export class Setting<V> {
438438
}
439439

440440
#maybeLogAccess(value: V): void {
441-
const valueToLog = typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean' ?
442-
value :
443-
this.#serializer?.stringify(value);
444-
if (valueToLog !== undefined && this.#logSettingAccess) {
445-
void this.#logSettingAccess(this.name, valueToLog);
441+
try {
442+
const valueToLog = typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean' ?
443+
value :
444+
this.#serializer?.stringify(value);
445+
if (valueToLog !== undefined && this.#logSettingAccess) {
446+
void this.#logSettingAccess(this.name, valueToLog);
447+
}
448+
} catch {
446449
}
447450
}
448451

@@ -671,7 +674,7 @@ export class VersionController {
671674
static readonly SYNCED_VERSION_SETTING_NAME = 'syncedInspectorVersion';
672675
static readonly LOCAL_VERSION_SETTING_NAME = 'localInspectorVersion';
673676

674-
static readonly CURRENT_VERSION = 38;
677+
static readonly CURRENT_VERSION = 39;
675678

676679
readonly #globalVersionSetting: Setting<number>;
677680
readonly #syncedVersionSetting: Setting<number>;
@@ -1322,6 +1325,40 @@ export class VersionController {
13221325
}
13231326
}
13241327

1328+
updateVersionFrom38To39(): void {
1329+
const PREFERRED_NETWORK_COND = 'preferred-network-condition';
1330+
// crrev.com/c/5582013 renamed "Slow 3G" to "3G" and "Fast 3G" => "Slow 4G".
1331+
// Any users with the old values need to have them moved to avoid breaking DevTools.
1332+
// Note: we load the raw value via the globalStorage here because
1333+
// `createSetting` creates if it is not present, and we do not want that;
1334+
// we only want to update existing, old values.
1335+
const setting = Settings.instance().globalStorage.get(PREFERRED_NETWORK_COND);
1336+
if (!setting) {
1337+
return;
1338+
}
1339+
try {
1340+
const networkSetting = JSON.parse(setting) as unknown as {
1341+
// Can't use SDK type here as it creates a common<>sdk circular
1342+
// dep. This type is not exhaustive but contains the fields we
1343+
// need.
1344+
title: string,
1345+
i18nTitleKey?: string,
1346+
};
1347+
if (networkSetting.title === 'Slow 3G') {
1348+
networkSetting.title = '3G';
1349+
networkSetting.i18nTitleKey = '3G';
1350+
Settings.instance().globalStorage.set(PREFERRED_NETWORK_COND, JSON.stringify(networkSetting));
1351+
} else if (networkSetting.title === 'Fast 3G') {
1352+
networkSetting.title = 'Slow 4G';
1353+
networkSetting.i18nTitleKey = 'Slow 4G';
1354+
Settings.instance().globalStorage.set(PREFERRED_NETWORK_COND, JSON.stringify(networkSetting));
1355+
}
1356+
} catch {
1357+
// If parsing the setting threw, it's in some invalid state, so remove it.
1358+
Settings.instance().globalStorage.remove(PREFERRED_NETWORK_COND);
1359+
}
1360+
}
1361+
13251362
/*
13261363
* Any new migration should be added before this comment.
13271364
*

0 commit comments

Comments
 (0)