Bug 1281278 - test coverage for h2 push with brotli r=nwgh

MozReview-Commit-ID: 84LZRLsefJD

--HG--
extra : rebase_source : 44aff3361b08ef412ae747097ab6e68adcabb28f
This commit is contained in:
Patrick McManus 2017-04-06 13:40:26 -04:00
Родитель 4c2cc9870a
Коммит 01f6a3a07d
2 изменённых файлов: 7 добавлений и 4 удалений

Просмотреть файл

@ -728,6 +728,8 @@ Http2PushApiListener.prototype = {
pushChannel.asyncOpen2(this);
if (pushChannel.originalURI.spec == "https://localhost:" + serverPort + "/pushapi1/2") {
pushChannel.cancel(Components.results.NS_ERROR_ABORT);
} else if (pushChannel.originalURI.spec == "https://localhost:" + serverPort + "/pushapi1/3") {
do_check_true(pushChannel.getRequestHeader("Accept-Encoding").includes("br"));
}
},
@ -774,7 +776,7 @@ Http2PushApiListener.prototype = {
// 2 to see /pushapi1/1 with 1
// 3 to see /pushapi1/1 with 1 (again)
// 4 to see /pushapi1/2 that it will cancel
// 5 to see /pushapi1/3 with 3
// 5 to see /pushapi1/3 with 3 with brotli
function test_http2_pushapi_1() {
var chan = makeChan("https://localhost:" + serverPort + "/pushapi1");

Просмотреть файл

@ -344,14 +344,15 @@ function handleRequest(req, res) {
push3 = res.push(
{ hostname: 'localhost:' + serverPort, port: serverPort, path : '/pushapi1/3', method : 'GET',
headers: {'x-pushed-request': 'true'}});
headers: {'x-pushed-request': 'true', 'Accept-Encoding' : 'br'}});
push3.writeHead(200, {
'pushed' : 'yes',
'content-length' : 1,
'content-length' : 6,
'subresource' : '3',
'content-encoding' : 'br',
'X-Connection-Http2': 'yes'
});
push3.end('3');
push3.end(Buffer.from("8B0080330A03", 'hex')); // '3\n'
content = '0';
}