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 54304c9
Show file tree
Hide file tree
Showing 3 changed files with 14 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
16 changes: 2 additions & 14 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 @@ -217,16 +216,10 @@ export class Network {
// otherwise set it to be pending until it is paused.
_handleRequestWillBeSent = async event => {
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 +302,7 @@ 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;
}
await this.#requestsLifeCycleHandler.get(requestId).responseReceived;
let request = this.#requests.get(requestId);
/* istanbul ignore if: race condition paranioa */
if (!request) return;
Expand Down
28 changes: 7 additions & 21 deletions packages/core/test/discovery.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('Discovery', () => {
captured = [];
await setupTest();
originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
jasmine.DEFAULT_TIMEOUT_INTERVAL = 80000;
jasmine.DEFAULT_TIMEOUT_INTERVAL = 30000;
delete process.env.PERCY_BROWSER_EXECUTABLE;
delete process.env.PERCY_GZIP;

Expand Down 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 54304c9

Please sign in to comment.