test(cookies): cookies from headful now work in headless (#3481)
This patch enables cookie test. The actual upstream patch that fixed the issue: - https://crrev.com/599696 - Headless: support cookie encryption Fixes #921.
This commit is contained in:
parent
3596c5f7e2
commit
eca3c6bed2
@ -16,9 +16,13 @@
|
|||||||
|
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const os = require('os');
|
const os = require('os');
|
||||||
|
const fs = require('fs');
|
||||||
|
const rm = require('rimraf').sync;
|
||||||
|
const {helper} = require('../lib/helper');
|
||||||
const utils = require('./utils');
|
const utils = require('./utils');
|
||||||
const {waitEvent} = utils;
|
const {waitEvent} = utils;
|
||||||
const puppeteer = utils.requireRoot('index.js');
|
const puppeteer = utils.requireRoot('index.js');
|
||||||
|
const mkdtempAsync = helper.promisify(fs.mkdtemp);
|
||||||
|
|
||||||
const TMP_FOLDER = path.join(os.tmpdir(), 'pptr_tmp_folder-');
|
const TMP_FOLDER = path.join(os.tmpdir(), 'pptr_tmp_folder-');
|
||||||
|
|
||||||
@ -79,7 +83,7 @@ module.exports.addTests = function({testRunner, expect, defaultBrowserOptions})
|
|||||||
expect(pages).toEqual(['about:blank']);
|
expect(pages).toEqual(['about:blank']);
|
||||||
await browser.close();
|
await browser.close();
|
||||||
});
|
});
|
||||||
xit('headless should be able to read cookies written by headful', async({server}) => {
|
it('headless should be able to read cookies written by headful', async({server}) => {
|
||||||
const userDataDir = await mkdtempAsync(TMP_FOLDER);
|
const userDataDir = await mkdtempAsync(TMP_FOLDER);
|
||||||
// Write a cookie in headful chrome
|
// Write a cookie in headful chrome
|
||||||
const headfulBrowser = await puppeteer.launch(Object.assign({userDataDir}, headfulOptions));
|
const headfulBrowser = await puppeteer.launch(Object.assign({userDataDir}, headfulOptions));
|
||||||
|
Loading…
Reference in New Issue
Block a user