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:
Andrey Lushnikov 2018-11-01 18:51:56 -07:00 committed by GitHub
parent 3596c5f7e2
commit eca3c6bed2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,9 +16,13 @@
const path = require('path');
const os = require('os');
const fs = require('fs');
const rm = require('rimraf').sync;
const {helper} = require('../lib/helper');
const utils = require('./utils');
const {waitEvent} = utils;
const puppeteer = utils.requireRoot('index.js');
const mkdtempAsync = helper.promisify(fs.mkdtemp);
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']);
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);
// Write a cookie in headful chrome
const headfulBrowser = await puppeteer.launch(Object.assign({userDataDir}, headfulOptions));