feat(webkit): roll to r1637 (#13916)

This commit is contained in:
github-actions[bot] 2022-05-04 16:38:25 -07:00 committed by GitHub
parent c9429283d7
commit 969e6f2ada
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 5 deletions

View file

@ -28,7 +28,7 @@
}, },
{ {
"name": "webkit", "name": "webkit",
"revision": "1632", "revision": "1637",
"installByDefault": true, "installByDefault": true,
"revisionOverrides": { "revisionOverrides": {
"mac10.14": "1446", "mac10.14": "1446",

View file

@ -15,6 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import os from 'os';
import type { Route } from 'playwright-core'; import type { Route } from 'playwright-core';
import { test as it, expect } from './pageTest'; import { test as it, expect } from './pageTest';
@ -241,14 +242,15 @@ it('should be abortable', async ({ page, server }) => {
expect(failed).toBe(true); expect(failed).toBe(true);
}); });
it('should be abortable with custom error codes', async ({ page, server, browserName }) => { it('should be abortable with custom error codes', async ({ page, server, browserName, isMac }) => {
await page.route('**/*', route => route.abort('internetdisconnected')); await page.route('**/*', route => route.abort('internetdisconnected'));
let failedRequest = null; let failedRequest = null;
page.on('requestfailed', request => failedRequest = request); page.on('requestfailed', request => failedRequest = request);
await page.goto(server.EMPTY_PAGE).catch(e => {}); await page.goto(server.EMPTY_PAGE).catch(e => {});
expect(failedRequest).toBeTruthy(); expect(failedRequest).toBeTruthy();
const isFrozenWebKit = isMac && parseInt(os.release(), 10) < 20;
if (browserName === 'webkit') if (browserName === 'webkit')
expect(failedRequest.failure().errorText).toBe('Request intercepted'); expect(failedRequest.failure().errorText).toBe(isFrozenWebKit ? 'Request intercepted' : 'Blocked by Web Inspector');
else if (browserName === 'firefox') else if (browserName === 'firefox')
expect(failedRequest.failure().errorText).toBe('NS_ERROR_OFFLINE'); expect(failedRequest.failure().errorText).toBe('NS_ERROR_OFFLINE');
else else
@ -267,13 +269,14 @@ it('should send referer', async ({ page, server }) => {
expect(request.headers['referer']).toBe('http://google.com/'); expect(request.headers['referer']).toBe('http://google.com/');
}); });
it('should fail navigation when aborting main resource', async ({ page, server, browserName }) => { it('should fail navigation when aborting main resource', async ({ page, server, browserName, isMac }) => {
await page.route('**/*', route => route.abort()); await page.route('**/*', route => route.abort());
let error = null; let error = null;
await page.goto(server.EMPTY_PAGE).catch(e => error = e); await page.goto(server.EMPTY_PAGE).catch(e => error = e);
expect(error).toBeTruthy(); expect(error).toBeTruthy();
const isFrozenWebKit = isMac && parseInt(os.release(), 10) < 20;
if (browserName === 'webkit') if (browserName === 'webkit')
expect(error.message).toContain('Request intercepted'); expect(error.message).toContain(isFrozenWebKit ? 'Request intercepted' : 'Blocked by Web Inspector');
else if (browserName === 'firefox') else if (browserName === 'firefox')
expect(error.message).toContain('NS_ERROR_FAILURE'); expect(error.message).toContain('NS_ERROR_FAILURE');
else else