Skip to content

Commit

Permalink
core(inspector-issues): add select element a11y issue to types (#16298)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamraine authored Jan 7, 2025
1 parent 1837726 commit 163e5d7
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 23 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/devtools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ jobs:
- name: Download depot tools
run: bash $GITHUB_WORKSPACE/lighthouse/core/test/devtools-tests/download-depot-tools.sh

# Since Ubuntu 23, dev builds of Chromium need this.
# https://chromium.googlesource.com/chromium/src/+/main/docs/security/apparmor-userns-restrictions.md
- run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0

- name: Load build artifacts
id: devtools-build-artifacts
uses: actions/cache@v3
Expand Down
1 change: 1 addition & 0 deletions core/gather/gatherers/inspector-issues.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class InspectorIssues extends BaseGatherer {
propertyRuleIssue: [],
quirksModeIssue: [],
cookieIssue: [],
selectElementAccessibilityIssue: [],
sharedArrayBufferIssue: [],
sharedDictionaryIssue: [],
stylesheetLoadingIssue: [],
Expand Down
34 changes: 18 additions & 16 deletions core/test/gather/gatherers/inspector-issues-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function mockBlockedByResponse(details) {
code: 'BlockedByResponseIssue',
details: {
blockedByResponseIssueDetails: {
request: {requestId: '1'},
request: {requestId: '1', url: 'https://example.com/1'},
reason: 'CorpNotSameOrigin',
...details,
},
Expand Down Expand Up @@ -177,9 +177,9 @@ describe('getArtifact', () => {
it('handles multiple types of inspector issues', async () => {
const gatherer = new InspectorIssues();
gatherer._issues = [
mockMixedContent({request: {requestId: '1'}}),
mockCookie({request: {requestId: '2'}}),
mockBlockedByResponse({request: {requestId: '3'}}),
mockMixedContent({request: {requestId: '1', url: 'https://example.com/1'}}),
mockCookie({request: {requestId: '2', url: 'https://example.com/2'}}),
mockBlockedByResponse({request: {requestId: '3', url: 'https://example.com/3'}}),
mockHeavyAd(),
mockCSP(),
mockDeprecation('AuthorizationCoveredByWildcard'),
Expand All @@ -199,13 +199,13 @@ describe('getArtifact', () => {

expect(artifact).toEqual({
mixedContentIssue: [{
request: {requestId: '1'},
request: {requestId: '1', url: 'https://example.com/1'},
resolutionStatus: 'MixedContentBlocked',
insecureURL: 'https://example.com',
mainResourceURL: 'https://example.com',
}],
cookieIssue: [{
request: {requestId: '2'},
request: {requestId: '2', url: 'https://example.com/2'},
cookie: {
name: 'name',
path: 'path',
Expand All @@ -217,7 +217,7 @@ describe('getArtifact', () => {
}],
bounceTrackingIssue: [],
blockedByResponseIssue: [{
request: {requestId: '3'},
request: {requestId: '3', url: 'https://example.com/3'},
reason: 'CorpNotSameOrigin',
}],
heavyAdIssue: [{
Expand Down Expand Up @@ -249,6 +249,7 @@ describe('getArtifact', () => {
navigatorUserAgentIssue: [],
propertyRuleIssue: [],
quirksModeIssue: [],
selectElementAccessibilityIssue: [],
sharedArrayBufferIssue: [],
sharedDictionaryIssue: [],
federatedAuthRequestIssue: [],
Expand All @@ -260,12 +261,12 @@ describe('getArtifact', () => {
it('dedupe by request id', async () => {
const gatherer = new InspectorIssues();
gatherer._issues = [
mockMixedContent({request: {requestId: '1'}}),
mockMixedContent({request: {requestId: '2'}}),
mockCookie({request: {requestId: '3'}}),
mockCookie({request: {requestId: '4'}}),
mockBlockedByResponse({request: {requestId: '5'}}),
mockBlockedByResponse({request: {requestId: '6'}}),
mockMixedContent({request: {requestId: '1', url: 'https://example.com/1'}}),
mockMixedContent({request: {requestId: '2', url: 'https://example.com/2'}}),
mockCookie({request: {requestId: '3', url: 'https://example.com/3'}}),
mockCookie({request: {requestId: '4', url: 'https://example.com/4'}}),
mockBlockedByResponse({request: {requestId: '5', url: 'https://example.com/5'}}),
mockBlockedByResponse({request: {requestId: '6', url: 'https://example.com/6'}}),
];
const devtoolsLog = networkRecordsToDevtoolsLog([
mockRequest({requestId: '1'}),
Expand All @@ -282,13 +283,13 @@ describe('getArtifact', () => {

expect(artifact).toEqual({
mixedContentIssue: [{
request: {requestId: '1'},
request: {requestId: '1', url: 'https://example.com/1'},
resolutionStatus: 'MixedContentBlocked',
insecureURL: 'https://example.com',
mainResourceURL: 'https://example.com',
}],
cookieIssue: [{
request: {requestId: '3'},
request: {requestId: '3', url: 'https://example.com/3'},
cookie: {
name: 'name',
path: 'path',
Expand All @@ -300,7 +301,7 @@ describe('getArtifact', () => {
}],
bounceTrackingIssue: [],
blockedByResponseIssue: [{
request: {requestId: '5'},
request: {requestId: '5', url: 'https://example.com/5'},
reason: 'CorpNotSameOrigin',
}],
heavyAdIssue: [],
Expand All @@ -315,6 +316,7 @@ describe('getArtifact', () => {
navigatorUserAgentIssue: [],
propertyRuleIssue: [],
quirksModeIssue: [],
selectElementAccessibilityIssue: [],
sharedArrayBufferIssue: [],
sharedDictionaryIssue: [],
federatedAuthRequestIssue: [],
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
"chrome-launcher": "^1.1.2",
"configstore": "^5.0.1",
"csp_evaluator": "1.1.1",
"devtools-protocol": "0.0.1312386",
"devtools-protocol": "0.0.1402036",
"enquirer": "^2.3.6",
"http-link-header": "^1.1.1",
"intl-messageformat": "^10.5.3",
Expand All @@ -211,8 +211,8 @@
"yargs-parser": "^21.0.0"
},
"resolutions": {
"puppeteer/**/devtools-protocol": "0.0.1312386",
"puppeteer-core/**/devtools-protocol": "0.0.1312386"
"puppeteer/**/devtools-protocol": "0.0.1402036",
"puppeteer-core/**/devtools-protocol": "0.0.1402036"
},
"repository": "GoogleChrome/lighthouse",
"keywords": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Array [
"navigatorUserAgentIssueDetails",
"propertyRuleIssueDetails",
"quirksModeIssueDetails",
"selectElementAccessibilityIssueDetails",
"sharedArrayBufferIssueDetails",
"sharedDictionaryIssueDetails",
"stylesheetLoadingIssueDetails",
Expand Down
1 change: 1 addition & 0 deletions types/artifacts.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,7 @@ declare module Artifacts {
propertyRuleIssue: Crdp.Audits.PropertyRuleIssueDetails[],
quirksModeIssue: Crdp.Audits.QuirksModeIssueDetails[];
cookieIssue: Crdp.Audits.CookieIssueDetails[];
selectElementAccessibilityIssue: Crdp.Audits.SelectElementAccessibilityIssueDetails[];
sharedArrayBufferIssue: Crdp.Audits.SharedArrayBufferIssueDetails[];
sharedDictionaryIssue: Crdp.Audits.SharedDictionaryIssueDetails[];
stylesheetLoadingIssue: Crdp.Audits.StylesheetLoadingIssueDetails[];
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2931,10 +2931,10 @@ delayed-stream@~1.0.0:
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk=

[email protected].1312386, [email protected].1367902:
version "0.0.1312386"
resolved "https://registry.yarnpkg.com/devtools-protocol/-/devtools-protocol-0.0.1312386.tgz#5ab824d6f1669ec6c6eb0fba047e73601d969052"
integrity sha512-DPnhUXvmvKT2dFA/j7B+riVLUt9Q6RKJlcppojL5CoRywJJKLDYnRlw0gTFKfgDPHP5E04UoB71SxoJlVZy8FA==
[email protected].1367902, [email protected].1402036:
version "0.0.1402036"
resolved "https://registry.yarnpkg.com/devtools-protocol/-/devtools-protocol-0.0.1402036.tgz#6f55044daed0ae5f0ec5c80c834b7b8edc822441"
integrity sha512-JwAYQgEvm3yD45CHB+RmF5kMbWtXBaOGwuxa87sZogHcLCv8c/IqnThaoQ1y60d7pXWjSKWQphPEc+1rAScVdg==

diff-sequences@^28.0.2:
version "28.0.2"
Expand Down

0 comments on commit 163e5d7

Please sign in to comment.