Skip to content

Commit

Permalink
upgraded to 128
Browse files Browse the repository at this point in the history
  • Loading branch information
amandeepsingh333 committed Jan 13, 2025
1 parent cc9be3e commit dfbd74c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 40 deletions.
10 changes: 5 additions & 5 deletions packages/core/src/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,11 @@ export function chromium({

// default chromium revisions corresponds to v123.0.6312.58
chromium.revisions = {
linux: '1368524',
win64: '1368503',
win32: '1368516',
darwin: '1368518',
darwinArm: '1368521'
linux: '1331481',
win64: '1331469',
win32: '1331487',
darwin: '1331485',
darwinArm: '1331488'
};

// export the namespace by default
Expand Down
15 changes: 0 additions & 15 deletions packages/core/src/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class RequestLifeCycleHandler {
this.resolveResponseReceived = null;
this.requestWillBeSent = new Promise((resolve) => (this.resolveRequestWillBeSent = resolve));
this.responseReceived = new Promise((resolve) => (this.resolveResponseReceived = resolve));
this.isWorker = false;
}
}
// The Interceptor class creates common handlers for dealing with intercepting asset requests
Expand Down Expand Up @@ -219,14 +218,6 @@ export class Network {
let { requestId, request, type } = event;
// do not handle data urls
if (request.url.startsWith('data:')) return;

const isWorker = type === 'Worker' || request.url.endsWith('.js');
// Mark in the lifecycle handler if this is a worker request
this.#requestsLifeCycleHandler.get(requestId).isWorker = isWorker;
if (isWorker) {
this.log.debug(`Auto-resolving responseReceived for worker request: ${request.url}`);
this.#requestsLifeCycleHandler.get(requestId).resolveResponseReceived();
}
// Browsers handle URL encoding leniently.
// This code checks for issues such as `%` and leading spaces and warns the user accordingly.
decodeAndEncodeURLWithLogging(request.url, this.log, {
Expand Down Expand Up @@ -309,12 +300,6 @@ export class Network {
_handleLoadingFinished = async (session, event) => {
let { requestId } = event;
// wait for upto 2 seconds or check if response has been sent
const handler = this.#requestsLifeCycleHandler.get(requestId);

// For worker requests, we don't need to wait for responseReceived
if (!handler.isWorker) {
await handler.responseReceived;
}
let request = this.#requests.get(requestId);
/* istanbul ignore if: race condition paranioa */
if (!request) return;
Expand Down
26 changes: 6 additions & 20 deletions packages/core/test/discovery.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -808,28 +808,14 @@ describe('Discovery', () => {
self.addEventListener("message", async ({ data }) => {
let response = await fetch(new Request(data));
self.postMessage("done");
});
`]);
})`]);

server.reply('/', () => [200, 'text/html', dedent`
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<script>
let worker = new Worker("/worker.js");
worker.addEventListener("message", ({ data }) => {
document.body.classList.add(data);
});
setTimeout(() => {
worker.postMessage("http://localhost:8000/img.gif");
}, 100);
</script>
</body>
</html>
`]);
<!DOCTYPE html><html><head></head><body><script>
let worker = new Worker("/worker.js");
worker.addEventListener("message", ({ data }) => document.body.classList.add(data));
setTimeout(() => worker.postMessage("http://localhost:8000/img.gif"), 100);
</script></body></html>`]);

await percy.snapshot({
name: 'worker snapshot',
Expand Down

0 comments on commit dfbd74c

Please sign in to comment.