Skip to content

Commit 9ddeb25

Browse files
Lightning00BladeDevtools-frontend LUCI CQ
authored andcommitted
[VE] Fail E2E test on Unknown VE context
Report the error when running E2E test, that will catch some of the issue before getting merged. Bug: none Change-Id: I9cc984edf9ec61c60b175b5d27bc444151a9ae69 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6352082 Reviewed-by: Liviu Rau <[email protected]> Reviewed-by: Benedikt Meurer <[email protected]> Auto-Submit: Nikolay Vitkov <[email protected]> Commit-Queue: Nikolay Vitkov <[email protected]>
1 parent 8ef31f7 commit 9ddeb25

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

front_end/core/common/Settings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ export class Settings {
194194
*/
195195
createSetting<T>(key: string, defaultValue: T, storageType?: SettingStorageType): Setting<T> {
196196
const storage = this.storageFromType(storageType);
197-
let setting = (this.#registry.get(key) as Setting<T>);
197+
let setting = this.#registry.get(key) as Setting<T>;
198198
if (!setting) {
199199
setting = new Setting(key, defaultValue, this.#eventSupport, storage, this.#logSettingAccess);
200200
this.#registry.set(key, setting);

front_end/ui/visual_logging/KnownContextValues.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -914,6 +914,7 @@ export const knownContextValues = new Set([
914914
'copy-link-address',
915915
'copy-object',
916916
'copy-outer-html',
917+
'copy-payload',
917918
'copy-primitive',
918919
'copy-property',
919920
'copy-property-path',
@@ -1196,6 +1197,7 @@ export const knownContextValues = new Set([
11961197
'disable-paused-state-overlay',
11971198
'disable-self-xss-warning',
11981199
'disabled',
1200+
'disallowed-select-descendants-details',
11991201
'disconnect-from-network',
12001202
'display',
12011203
'display-override',
@@ -2031,6 +2033,7 @@ export const knownContextValues = new Set([
20312033
'lighthouse.audit.bypass',
20322034
'lighthouse.audit.canonical',
20332035
'lighthouse.audit.charset',
2036+
'lighthouse.audit.clickjacking-mitigation',
20342037
'lighthouse.audit.color-contrast',
20352038
'lighthouse.audit.crawlable-anchors',
20362039
'lighthouse.audit.critical-request-chains',
@@ -2060,6 +2063,7 @@ export const knownContextValues = new Set([
20602063
'lighthouse.audit.form-field-multiple-labels',
20612064
'lighthouse.audit.frame-title',
20622065
'lighthouse.audit.geolocation-on-start',
2066+
'lighthouse.audit.has-hsts',
20632067
'lighthouse.audit.heading-order',
20642068
'lighthouse.audit.hreflang',
20652069
'lighthouse.audit.html-has-lang',
@@ -2113,6 +2117,7 @@ export const knownContextValues = new Set([
21132117
'lighthouse.audit.object-alt',
21142118
'lighthouse.audit.offscreen-content-hidden',
21152119
'lighthouse.audit.offscreen-images',
2120+
'lighthouse.audit.origin-isolation',
21162121
'lighthouse.audit.paste-preventing-inputs',
21172122
'lighthouse.audit.prioritize-lcp-image',
21182123
'lighthouse.audit.redirects',
@@ -2197,6 +2202,7 @@ export const knownContextValues = new Set([
21972202
'linear-memory-inspector.toggle-value-settings',
21982203
'linear-memory-inspector.value-type-mode',
21992204
'linear-memory-inspector.viewer',
2205+
'link',
22002206
'link-in-explanation',
22012207
'linux',
22022208
'list-style',
@@ -2523,6 +2529,7 @@ export const knownContextValues = new Set([
25232529
'only-show-cookies-with-issues',
25242530
'only-show-third-party',
25252531
'opacity',
2532+
'open',
25262533
'open-ai-settings',
25272534
'open-elements-panel',
25282535
'open-folder',
@@ -2611,6 +2618,7 @@ export const knownContextValues = new Set([
26112618
'parentTreeItem',
26122619
'parse',
26132620
'partition-key-site',
2621+
'partitioning-blob-url-details',
26142622
'passive',
26152623
'paste',
26162624
'path',

front_end/ui/visual_logging/LoggingConfig.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
import * as Host from '../../core/host/host.js';
56
import * as Root from '../../core/root/root.js';
67

8+
import {DebugLoggingFormat} from './Debugging.js';
79
import {knownContextValues} from './KnownContextValues.js';
810

911
const LOGGING_ATTRIBUTE = 'jslog';
@@ -126,7 +128,8 @@ function checkContextValue(context: string|number|undefined): void {
126128
reportedUnknownVeContext.has(context)) {
127129
return;
128130
}
129-
if (Root.Runtime.Runtime.queryParam('debugFrontend')) {
131+
if (Root.Runtime.Runtime.queryParam('debugFrontend') || Host.InspectorFrontendHost.isUnderTest() ||
132+
localStorage.getItem('veDebugLoggingEnabled') === DebugLoggingFormat.TEST) {
130133
const stack = (new Error().stack || '').split('\n').slice(3).join('\n');
131134
console.error(`Unknown VE context: ${context}${stack}`);
132135
}

test/e2e_non_hosted/shared/frontend-helper.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ export interface DevtoolsSettings {
101101

102102
export const DEFAULT_DEVTOOLS_SETTINGS = {
103103
enabledDevToolsExperiments: [],
104-
devToolsSettings: {},
104+
devToolsSettings: {
105+
isUnderTest: true,
106+
},
105107
dockingMode: 'UNDOCKED',
106108
};
107109

0 commit comments

Comments
 (0)