Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: update TS target and fix website css #3070

Merged
merged 3 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/bidiMapper/modules/network/NetworkProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export class NetworkProcessor {
const cacheDisabled = params.cacheBehavior === 'bypass';

await Promise.all(
[...contexts.values()].map((context) => {
contexts.values().map((context) => {
return context.cdpTarget.toggleSetCacheDisabled(cacheDisabled);
}),
);
Expand Down
24 changes: 16 additions & 8 deletions src/bidiMapper/modules/session/SubscriptionManager.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -664,9 +664,13 @@ describe('SubscriptionManager', () => {
});

describe('unroll events', () => {
function unrollEventsToArray(args: any[]) {
return [...unrollEvents(args)];
}

it('all Browsing Context events', () => {
expect(
unrollEvents([ChromiumBidi.BiDiModule.BrowsingContext]),
unrollEventsToArray([ChromiumBidi.BiDiModule.BrowsingContext]),
).to.have.members([
ChromiumBidi.BrowsingContext.EventNames.ContextCreated,
ChromiumBidi.BrowsingContext.EventNames.ContextDestroyed,
Expand All @@ -685,13 +689,15 @@ describe('SubscriptionManager', () => {
});

it('all Log events', () => {
expect(unrollEvents([ChromiumBidi.BiDiModule.Log])).to.have.members([
ChromiumBidi.Log.EventNames.LogEntryAdded,
]);
expect(
unrollEventsToArray([ChromiumBidi.BiDiModule.Log]),
).to.have.members([ChromiumBidi.Log.EventNames.LogEntryAdded]);
});

it('all Network events', () => {
expect(unrollEvents([ChromiumBidi.BiDiModule.Network])).to.have.members([
expect(
unrollEventsToArray([ChromiumBidi.BiDiModule.Network]),
).to.have.members([
ChromiumBidi.Network.EventNames.AuthRequired,
ChromiumBidi.Network.EventNames.BeforeRequestSent,
ChromiumBidi.Network.EventNames.FetchError,
Expand All @@ -701,7 +707,9 @@ describe('SubscriptionManager', () => {
});

it('all Script events', () => {
expect(unrollEvents([ChromiumBidi.BiDiModule.Script])).to.have.members([
expect(
unrollEventsToArray([ChromiumBidi.BiDiModule.Script]),
).to.have.members([
ChromiumBidi.Script.EventNames.Message,
ChromiumBidi.Script.EventNames.RealmCreated,
ChromiumBidi.Script.EventNames.RealmDestroyed,
Expand All @@ -710,7 +718,7 @@ describe('SubscriptionManager', () => {

it('discrete events', () => {
expect(
unrollEvents([
unrollEventsToArray([
ChromiumBidi.Script.EventNames.RealmCreated,
ChromiumBidi.Log.EventNames.LogEntryAdded,
]),
Expand All @@ -722,7 +730,7 @@ describe('SubscriptionManager', () => {

it('all and discrete events', () => {
expect(
unrollEvents([
unrollEventsToArray([
ChromiumBidi.BiDiModule.Log,
ChromiumBidi.Log.EventNames.LogEntryAdded,
]),
Expand Down
4 changes: 2 additions & 2 deletions src/bidiMapper/modules/session/SubscriptionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function cartesianProduct(...a: any[][]) {
/** Expands "AllEvents" events into atomic events. */
export function unrollEvents(
events: ChromiumBidi.EventNames[],
): ChromiumBidi.EventNames[] {
): Iterable<ChromiumBidi.EventNames> {
const allEvents = new Set<ChromiumBidi.EventNames>();

function addEvents(events: ChromiumBidi.EventNames[]) {
Expand Down Expand Up @@ -72,7 +72,7 @@ export function unrollEvents(
}
}

return [...allEvents.values()];
return allEvents.values();
}

export interface Subscription {
Expand Down
3 changes: 1 addition & 2 deletions tools/wpt-report-builder/formatter.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ function generateTestReport(map, parent) {
}

return `
<div class="divider"></div>
<div class="test-card">
<details>
<summary class="path ${
Expand Down Expand Up @@ -270,7 +269,7 @@ function generateSubtestReport(subtest) {
const name =
subtest.name ?? removeWebDriverBiDiPrefix(subtest.path).split('/').at(-1);

return `<div class="divider"></div>
return `
<div class="test-card test-card-subtest ${
subtest.status === 'PASS' ? 'pass' : 'fail'
}">
Expand Down
18 changes: 3 additions & 15 deletions tools/wpt-report-builder/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
max-width: 1200px;
}

.top > div > .test-card,
.top > div > .divider {
.top > div > .test-card {
margin-left: 0;
}
.test-card {
margin-left: 20px;
max-width: 1200px;
border: 1px solid #a0a0a0;
}
.test-card-subtest {
display: flex;
Expand All @@ -49,11 +49,6 @@
.test-name {
word-break: break-all;
}
.divider {
margin-left: 20px;
height: 1px;
background: #a0a0a0;
}
.non-collapsible-item {
padding-left: 27px;
padding-right: 15px;
Expand Down Expand Up @@ -165,9 +160,7 @@
const failures = document.querySelector('.failures');
let failureState = 'all';
const summaryQuery = '.test-card:has(> details > .path.pass)';
const summaryDividerQuery = `${summaryQuery} + .divider`;
const passingTestQuery = '.test-card.test-card-subtest.pass';
const passingTestDividerQuery = `${passingTestQuery} + .divider`;
failures.addEventListener('click', () => {
failures.innerText =
failureState.charAt(0).toUpperCase() + failureState.slice(1);
Expand All @@ -176,12 +169,7 @@
} else {
failureState = 'all';
}
for (const query of [
summaryQuery,
summaryDividerQuery,
passingTestQuery,
passingTestDividerQuery,
]) {
for (const query of [summaryQuery, passingTestQuery]) {
document
.querySelectorAll(query)
.forEach(
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"declaration": true,
"esModuleInterop": true,
"incremental": true,
"module": "ES2022",
"module": "ESNext",
"moduleResolution": "node",
"noFallthroughCasesInSwitch": true,
"noImplicitAny": true,
Expand All @@ -23,7 +23,7 @@
"strictFunctionTypes": true,
"strictNullChecks": true,
"strictPropertyInitialization": true,
"target": "ES2022",
"target": "ESNext",
"useUnknownInCatchVariables": true
}
}
Loading