feat(firefox-beta): roll to r1310 (#10954)
This commit is contained in:
Родитель
fcccac0c08
Коммит
2957b7b013
|
@ -18,7 +18,7 @@
|
|||
},
|
||||
{
|
||||
"name": "firefox-beta",
|
||||
"revision": "1309",
|
||||
"revision": "1310",
|
||||
"installByDefault": false
|
||||
},
|
||||
{
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
<!DOCTYPE html>
|
|
@ -1,4 +1,4 @@
|
|||
<script>
|
||||
<!DOCTYPE html> <script>
|
||||
console.error('Not a JS error');
|
||||
a();
|
||||
|
||||
|
|
|
@ -353,7 +353,7 @@ it('should set cookies for a frame', async ({ context, page, server }) => {
|
|||
expect(await page.frames()[1].evaluate('document.cookie')).toBe('frame-cookie=value');
|
||||
});
|
||||
|
||||
it('should(not) block third party cookies', async ({ context, page, server, browserName }) => {
|
||||
it('should(not) block third party cookies', async ({ context, page, server, browserName, browserMajorVersion }) => {
|
||||
await page.goto(server.EMPTY_PAGE);
|
||||
await page.evaluate(src => {
|
||||
let fulfill;
|
||||
|
@ -366,7 +366,7 @@ it('should(not) block third party cookies', async ({ context, page, server, brow
|
|||
}, server.CROSS_PROCESS_PREFIX + '/grid.html');
|
||||
await page.frames()[1].evaluate(`document.cookie = 'username=John Doe'`);
|
||||
await page.waitForTimeout(2000);
|
||||
const allowsThirdParty = browserName === 'firefox';
|
||||
const allowsThirdParty = browserName === 'firefox' && browserMajorVersion < 96;
|
||||
const cookies = await context.cookies(server.CROSS_PROCESS_PREFIX + '/grid.html');
|
||||
if (allowsThirdParty) {
|
||||
expect(cookies).toEqual([
|
||||
|
|
|
@ -21,13 +21,14 @@ it('should return no cookies in pristine browser context', async ({ context, pag
|
|||
expect(await context.cookies()).toEqual([]);
|
||||
});
|
||||
|
||||
it('should get a cookie', async ({ context, page, server, browserName }) => {
|
||||
it('should get a cookie', async ({ context, page, server, browserName, browserMajorVersion }) => {
|
||||
await page.goto(server.EMPTY_PAGE);
|
||||
const documentCookie = await page.evaluate(() => {
|
||||
document.cookie = 'username=John Doe';
|
||||
return document.cookie;
|
||||
});
|
||||
expect(documentCookie).toBe('username=John Doe');
|
||||
const defaultSameSiteCookieValue = browserName === 'chromium' || (browserName === 'firefox' && browserMajorVersion >= 96) ? 'Lax' : 'None';
|
||||
expect(await context.cookies()).toEqual([{
|
||||
name: 'username',
|
||||
value: 'John Doe',
|
||||
|
@ -36,11 +37,11 @@ it('should get a cookie', async ({ context, page, server, browserName }) => {
|
|||
expires: -1,
|
||||
httpOnly: false,
|
||||
secure: false,
|
||||
sameSite: browserName === 'chromium' ? 'Lax' : 'None',
|
||||
sameSite: defaultSameSiteCookieValue,
|
||||
}]);
|
||||
});
|
||||
|
||||
it('should get a non-session cookie', async ({ context, page, server, browserName }) => {
|
||||
it('should get a non-session cookie', async ({ context, page, server, browserName, browserMajorVersion }) => {
|
||||
await page.goto(server.EMPTY_PAGE);
|
||||
// @see https://en.wikipedia.org/wiki/Year_2038_problem
|
||||
const date = +(new Date('1/1/2038'));
|
||||
|
@ -50,6 +51,7 @@ it('should get a non-session cookie', async ({ context, page, server, browserNam
|
|||
return document.cookie;
|
||||
}, date);
|
||||
expect(documentCookie).toBe('username=John Doe');
|
||||
const defaultSameSiteCookieValue = browserName === 'chromium' || (browserName === 'firefox' && browserMajorVersion >= 96) ? 'Lax' : 'None';
|
||||
expect(await context.cookies()).toEqual([{
|
||||
name: 'username',
|
||||
value: 'John Doe',
|
||||
|
@ -58,7 +60,7 @@ it('should get a non-session cookie', async ({ context, page, server, browserNam
|
|||
expires: date / 1000,
|
||||
httpOnly: false,
|
||||
secure: false,
|
||||
sameSite: browserName === 'chromium' ? 'Lax' : 'None',
|
||||
sameSite: defaultSameSiteCookieValue,
|
||||
}]);
|
||||
});
|
||||
|
||||
|
@ -99,7 +101,7 @@ it('should properly report "Lax" sameSite cookie', async ({ context, page, serve
|
|||
expect(cookies[0].sameSite).toBe('Lax');
|
||||
});
|
||||
|
||||
it('should get multiple cookies', async ({ context, page, server, browserName }) => {
|
||||
it('should get multiple cookies', async ({ context, page, server, browserName, browserMajorVersion }) => {
|
||||
await page.goto(server.EMPTY_PAGE);
|
||||
const documentCookie = await page.evaluate(() => {
|
||||
document.cookie = 'username=John Doe';
|
||||
|
@ -107,6 +109,7 @@ it('should get multiple cookies', async ({ context, page, server, browserName })
|
|||
return document.cookie.split('; ').sort().join('; ');
|
||||
});
|
||||
const cookies = new Set(await context.cookies());
|
||||
const defaultSameSiteCookieValue = browserName === 'chromium' || (browserName === 'firefox' && browserMajorVersion >= 96) ? 'Lax' : 'None';
|
||||
expect(documentCookie).toBe('password=1234; username=John Doe');
|
||||
expect(cookies).toEqual(new Set([
|
||||
{
|
||||
|
@ -117,7 +120,7 @@ it('should get multiple cookies', async ({ context, page, server, browserName })
|
|||
expires: -1,
|
||||
httpOnly: false,
|
||||
secure: false,
|
||||
sameSite: browserName === 'chromium' ? 'Lax' : 'None',
|
||||
sameSite: defaultSameSiteCookieValue,
|
||||
},
|
||||
{
|
||||
name: 'username',
|
||||
|
@ -127,7 +130,7 @@ it('should get multiple cookies', async ({ context, page, server, browserName })
|
|||
expires: -1,
|
||||
httpOnly: false,
|
||||
secure: false,
|
||||
sameSite: browserName === 'chromium' ? 'Lax' : 'None',
|
||||
sameSite: defaultSameSiteCookieValue,
|
||||
},
|
||||
]));
|
||||
});
|
||||
|
|
|
@ -108,7 +108,7 @@ it('should fall back to context.route', async ({ browser, server }) => {
|
|||
await context.close();
|
||||
});
|
||||
|
||||
it('should support Set-Cookie header', async ({ contextFactory, server, browserName }) => {
|
||||
it('should support Set-Cookie header', async ({ contextFactory, server, browserName, browserMajorVersion }) => {
|
||||
it.fixme(browserName === 'webkit');
|
||||
|
||||
const context = await contextFactory();
|
||||
|
@ -123,8 +123,9 @@ it('should support Set-Cookie header', async ({ contextFactory, server, browserN
|
|||
});
|
||||
});
|
||||
await page.goto('https://example.com');
|
||||
const defaultSameSiteCookieValue = browserName === 'chromium' || (browserName === 'firefox' && browserMajorVersion >= 96) ? 'Lax' : 'None';
|
||||
expect(await context.cookies()).toEqual([{
|
||||
sameSite: browserName === 'chromium' ? 'Lax' : 'None',
|
||||
sameSite: defaultSameSiteCookieValue,
|
||||
name: 'name',
|
||||
value: 'value',
|
||||
domain: '.example.com',
|
||||
|
@ -153,7 +154,7 @@ it('should ignore secure Set-Cookie header for insecure requests', async ({ cont
|
|||
expect(await context.cookies()).toEqual([]);
|
||||
});
|
||||
|
||||
it('should use Set-Cookie header in future requests', async ({ contextFactory, server, browserName }) => {
|
||||
it('should use Set-Cookie header in future requests', async ({ contextFactory, server, browserName, browserMajorVersion }) => {
|
||||
it.fixme(browserName === 'webkit');
|
||||
|
||||
const context = await contextFactory();
|
||||
|
@ -169,8 +170,9 @@ it('should use Set-Cookie header in future requests', async ({ contextFactory, s
|
|||
});
|
||||
});
|
||||
await page.goto(server.EMPTY_PAGE);
|
||||
const defaultSameSiteCookieValue = browserName === 'chromium' || (browserName === 'firefox' && browserMajorVersion >= 96) ? 'Lax' : 'None';
|
||||
expect(await context.cookies()).toEqual([{
|
||||
sameSite: browserName === 'chromium' ? 'Lax' : 'None',
|
||||
sameSite: defaultSameSiteCookieValue,
|
||||
name: 'name',
|
||||
value: 'value',
|
||||
domain: 'localhost',
|
||||
|
|
|
@ -47,7 +47,9 @@ it('should scope context handles', async ({ browserType, server }) => {
|
|||
|
||||
const context = await browser.newContext();
|
||||
const page = await context.newPage();
|
||||
await page.goto(server.EMPTY_PAGE);
|
||||
// Firefox Beta 96 yields a console warning for the pages that
|
||||
// don't use `<!DOCTYPE HTML> tag.
|
||||
await page.goto(server.PREFIX + '/empty-standard-mode.html');
|
||||
await expectScopeState(browser, {
|
||||
_guid: '',
|
||||
objects: [
|
||||
|
|
|
@ -19,7 +19,7 @@ import { playwrightTest as it, expect } from './config/browserTest';
|
|||
import { verifyViewport } from './config/utils';
|
||||
import fs from 'fs';
|
||||
|
||||
it('context.cookies() should work', async ({ server, launchPersistent, browserName }) => {
|
||||
it('context.cookies() should work', async ({ server, launchPersistent, browserName, browserMajorVersion }) => {
|
||||
const { page } = await launchPersistent();
|
||||
await page.goto(server.EMPTY_PAGE);
|
||||
const documentCookie = await page.evaluate(() => {
|
||||
|
@ -27,6 +27,7 @@ it('context.cookies() should work', async ({ server, launchPersistent, browserNa
|
|||
return document.cookie;
|
||||
});
|
||||
expect(documentCookie).toBe('username=John Doe');
|
||||
const defaultSameSiteCookieValue = browserName === 'chromium' || (browserName === 'firefox' && browserMajorVersion >= 96) ? 'Lax' : 'None';
|
||||
expect(await page.context().cookies()).toEqual([{
|
||||
name: 'username',
|
||||
value: 'John Doe',
|
||||
|
@ -35,7 +36,7 @@ it('context.cookies() should work', async ({ server, launchPersistent, browserNa
|
|||
expires: -1,
|
||||
httpOnly: false,
|
||||
secure: false,
|
||||
sameSite: browserName === 'chromium' ? 'Lax' : 'None',
|
||||
sameSite: defaultSameSiteCookieValue,
|
||||
}]);
|
||||
});
|
||||
|
||||
|
@ -80,7 +81,7 @@ it('context.clearCookies() should work', async ({ server, launchPersistent }) =>
|
|||
expect(await page.evaluate('document.cookie')).toBe('');
|
||||
});
|
||||
|
||||
it('should(not) block third party cookies', async ({ server, launchPersistent, browserName }) => {
|
||||
it('should(not) block third party cookies', async ({ server, launchPersistent, browserName, browserMajorVersion }) => {
|
||||
const { page, context } = await launchPersistent();
|
||||
await page.goto(server.EMPTY_PAGE);
|
||||
await page.evaluate(src => {
|
||||
|
@ -97,7 +98,7 @@ it('should(not) block third party cookies', async ({ server, launchPersistent, b
|
|||
return document.cookie;
|
||||
});
|
||||
await page.waitForTimeout(2000);
|
||||
const allowsThirdParty = browserName === 'firefox';
|
||||
const allowsThirdParty = browserName === 'firefox' && browserMajorVersion <= 95;
|
||||
expect(documentCookie).toBe(allowsThirdParty ? 'username=John Doe' : '');
|
||||
const cookies = await context.cookies(server.CROSS_PROCESS_PREFIX + '/grid.html');
|
||||
if (allowsThirdParty) {
|
||||
|
|
|
@ -67,7 +67,7 @@ it('should close browser after context menu was triggered', async ({ browserType
|
|||
await browser.close();
|
||||
});
|
||||
|
||||
it('should(not) block third party cookies', async ({ browserType, server, browserName }) => {
|
||||
it('should(not) block third party cookies', async ({ browserType, server, browserName, browserMajorVersion }) => {
|
||||
const browser = await browserType.launch({ headless: false });
|
||||
const page = await browser.newPage();
|
||||
await page.goto(server.EMPTY_PAGE);
|
||||
|
@ -85,7 +85,7 @@ it('should(not) block third party cookies', async ({ browserType, server, browse
|
|||
return document.cookie;
|
||||
});
|
||||
await page.waitForTimeout(2000);
|
||||
const allowsThirdParty = browserName === 'firefox';
|
||||
const allowsThirdParty = browserName === 'firefox' && browserMajorVersion <= 95;
|
||||
expect(documentCookie).toBe(allowsThirdParty ? 'username=John Doe' : '');
|
||||
const cookies = await page.context().cookies(server.CROSS_PROCESS_PREFIX + '/grid.html');
|
||||
if (allowsThirdParty) {
|
||||
|
|
|
@ -104,9 +104,9 @@ it('should work when the event is canceled', async ({ page }) => {
|
|||
altKey: false,
|
||||
metaKey: false,
|
||||
});
|
||||
// give the page a chacne to scroll
|
||||
// Give the page a chance to scroll.
|
||||
await page.waitForTimeout(100);
|
||||
// ensure that it did not.
|
||||
// Ensure that it did not.
|
||||
expect(await page.evaluate('window.scrollY')).toBe(0);
|
||||
});
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче