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

fix(webdriver): emit RequestServedFromCache for requests #12104

Merged
merged 4 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
169 changes: 169 additions & 0 deletions log.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@

Lightning00Blade marked this conversation as resolved.
Show resolved Hide resolved
> format:expectations
> node tools/sort-test-expectations.mjs

removing {
testIdPattern: '[screenshot.spec] Screenshots ElementHandle.screenshot should work with a rotated element',
platforms: [ 'darwin', 'linux', 'win32' ],
parameters: [ 'cdp', 'firefox', 'headless' ],
expectations: [ 'FAIL' ],
comment: 'TODO: add a comment explaining why this expectation is required (include links to issues)'
} already covered by {
testIdPattern: '[screenshot.spec] Screenshots ElementHandle.screenshot should work with a rotated element',
platforms: [ 'darwin', 'linux', 'win32' ],
parameters: [ 'cdp', 'firefox' ],
expectations: [ 'FAIL' ],
comment: 'TODO: add a comment explaining why this expectation is required (include links to issues)'
}
removing {
testIdPattern: '[screenshot.spec] Screenshots ElementHandle.screenshot should work with a rotated element',
platforms: [ 'darwin', 'linux', 'win32' ],
parameters: [ 'cdp', 'firefox', 'headful' ],
expectations: [ 'FAIL' ],
comment: 'TODO: add a comment explaining why this expectation is required (include links to issues)'
} already covered by {
testIdPattern: '[screenshot.spec] Screenshots ElementHandle.screenshot should work with a rotated element',
platforms: [ 'darwin', 'linux', 'win32' ],
parameters: [ 'cdp', 'firefox' ],
expectations: [ 'FAIL' ],
comment: 'TODO: add a comment explaining why this expectation is required (include links to issues)'
}
removing {
testIdPattern: '[screenshot.spec] Screenshots ElementHandle.screenshot should work for an element with an offset',
platforms: [ 'darwin', 'linux', 'win32' ],
parameters: [ 'cdp', 'firefox', 'headless' ],
expectations: [ 'FAIL' ],
comment: 'TODO: add a comment explaining why this expectation is required (include links to issues)'
} already covered by {
testIdPattern: '[screenshot.spec] Screenshots ElementHandle.screenshot should work for an element with an offset',
platforms: [ 'darwin', 'linux', 'win32' ],
parameters: [ 'cdp', 'firefox' ],
expectations: [ 'FAIL' ],
comment: 'TODO: add a comment explaining why this expectation is required (include links to issues)'
}
removing {
testIdPattern: '[screenshot.spec] Screenshots ElementHandle.screenshot should work for an element with an offset',
platforms: [ 'darwin', 'linux', 'win32' ],
parameters: [ 'cdp', 'firefox', 'headful' ],
expectations: [ 'FAIL' ],
comment: 'TODO: add a comment explaining why this expectation is required (include links to issues)'
} already covered by {
testIdPattern: '[screenshot.spec] Screenshots ElementHandle.screenshot should work for an element with an offset',
platforms: [ 'darwin', 'linux', 'win32' ],
parameters: [ 'cdp', 'firefox' ],
expectations: [ 'FAIL' ],
comment: 'TODO: add a comment explaining why this expectation is required (include links to issues)'
}
removing {
testIdPattern: '[launcher.spec] Launcher specs Puppeteer Puppeteer.launch userDataDir option restores preferences',
platforms: [ 'win32' ],
parameters: [ 'firefox', 'headless', 'webDriverBiDi' ],
expectations: [ 'SKIP' ],
comment: 'TODO: add a comment explaining why this expectation is required (include links to issues)'
} already covered by {
testIdPattern: '[launcher.spec] Launcher specs Puppeteer Puppeteer.launch *',
platforms: [ 'win32' ],
parameters: [ 'webDriverBiDi' ],
expectations: [ 'SKIP' ],
comment: 'TODO: add a comment explaining why this expectation is required (include links to issues)'
}
removing {
testIdPattern: '[network.spec] network Response.text should wait until response completes',
platforms: [ 'win32' ],
parameters: [ 'firefox', 'webDriverBiDi' ],
expectations: [ 'SKIP' ],
comment: 'TODO: add a comment explaining why this expectation is required (include links to issues)'
} already covered by {
testIdPattern: '[network.spec] network Response.text *',
platforms: [ 'darwin', 'linux', 'win32' ],
parameters: [ 'webDriverBiDi' ],
expectations: [ 'SKIP' ],
comment: 'TODO: add a comment explaining why this expectation is required (include links to issues)'
}
removing {
testIdPattern: '[network.spec] network Response.fromServiceWorker Response.fromServiceWorker',
platforms: [ 'win32' ],
parameters: [ 'firefox', 'webDriverBiDi' ],
expectations: [ 'SKIP' ],
comment: 'TODO: add a comment explaining why this expectation is required (include links to issues)'
} already covered by {
testIdPattern: '[network.spec] network Response.fromServiceWorker Response.fromServiceWorker',
platforms: [ 'darwin', 'linux', 'win32' ],
parameters: [ 'webDriverBiDi' ],
expectations: [ 'SKIP' ],
comment: 'TODO: add a comment explaining why this expectation is required (include links to issues)'
}
removing {
testIdPattern: '[network.spec] network Response.buffer should throw if the response does not have a body',
platforms: [ 'darwin', 'linux', 'win32' ],
parameters: [ 'chrome', 'webDriverBiDi' ],
expectations: [ 'SKIP' ],
comment: 'TODO: add a comment explaining why this expectation is required (include links to issues)'
} already covered by {
testIdPattern: '[network.spec] network Response.buffer *',
platforms: [ 'darwin', 'linux', 'win32' ],
parameters: [ 'webDriverBiDi' ],
expectations: [ 'SKIP' ],
comment: 'TODO: add a comment explaining why this expectation is required (include links to issues)'
}
removing {
testIdPattern: '[network.spec] network Network Events Page.Events.RequestServedFromCache',
platforms: [ 'darwin', 'linux', 'win32' ],
parameters: [ 'chrome', 'webDriverBiDi' ],
expectations: [ 'FAIL' ],
comment: 'TODO: add a comment explaining why this expectation is required (include links to issues)'
} already covered by {
testIdPattern: '[network.spec] network Network Events *',
platforms: [ 'darwin', 'linux', 'win32' ],
parameters: [ 'webDriverBiDi' ],
expectations: [ 'FAIL' ],
comment: 'TODO: add a comment explaining why this expectation is required (include links to issues)'
}
removing {
testIdPattern: '[launcher.spec] Launcher specs Puppeteer Puppeteer.launch can launch and close the browser',
platforms: [ 'win32' ],
parameters: [ 'firefox', 'webDriverBiDi' ],
expectations: [ 'SKIP' ],
comment: 'TODO: add a comment explaining why this expectation is required (include links to issues)'
} already covered by {
testIdPattern: '[launcher.spec] Launcher specs Puppeteer Puppeteer.launch *',
platforms: [ 'win32' ],
parameters: [ 'webDriverBiDi' ],
expectations: [ 'SKIP' ],
comment: 'TODO: add a comment explaining why this expectation is required (include links to issues)'
}
removing {
testIdPattern: '[browsercontext.spec] BrowserContext should have default context',
platforms: [ 'darwin', 'linux', 'win32' ],
parameters: [ 'firefox', 'webDriverBiDi' ],
expectations: [ 'PASS' ]
} already covered by {
testIdPattern: '[browsercontext.spec] BrowserContext should have default context',
platforms: [ 'darwin', 'linux', 'win32' ],
parameters: [ 'webDriverBiDi' ],
expectations: [ 'PASS' ]
}
removing {
testIdPattern: '[browsercontext.spec] BrowserContext should create new incognito context',
platforms: [ 'darwin', 'linux', 'win32' ],
parameters: [ 'firefox', 'webDriverBiDi' ],
expectations: [ 'PASS' ]
} already covered by {
testIdPattern: '[browsercontext.spec] BrowserContext should create new incognito context',
platforms: [ 'darwin', 'linux', 'win32' ],
parameters: [ 'webDriverBiDi' ],
expectations: [ 'PASS' ]
}
removing {
testIdPattern: '[network.spec] network Page.setBypassServiceWorker *',
platforms: [ 'win32' ],
parameters: [ 'firefox', 'webDriverBiDi' ],
expectations: [ 'SKIP' ],
comment: 'TODO: add a comment explaining why this expectation is required (include links to issues)'
} already covered by {
testIdPattern: '[network.spec] network Page.setBypassServiceWorker *',
platforms: [ 'darwin', 'linux', 'win32' ],
parameters: [ 'webDriverBiDi' ],
expectations: [ 'SKIP' ],
comment: 'TODO: add a comment explaining why this expectation is required (include links to issues)'
}
2 changes: 1 addition & 1 deletion packages/puppeteer-core/src/bidi/HTTPRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class BidiHTTPRequest extends HTTPRequest {
}

override resourceType(): ResourceType {
return this.initiator().type.toLowerCase() as ResourceType;
Lightning00Blade marked this conversation as resolved.
Show resolved Hide resolved
throw new UnsupportedOperation();
}

override method(): string {
Expand Down
6 changes: 6 additions & 0 deletions packages/puppeteer-core/src/bidi/HTTPResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ export class BidiHTTPResponse extends HTTPResponse {
}

#initialize() {
if (this.#data.fromCache) {
this.#request
.frame()
?.page()
.trustedEmitter.emit(PageEvent.RequestServedFromCache, this.#request);
}
this.#request.frame()?.page().trustedEmitter.emit(PageEvent.Response, this);
}

Expand Down