<script src="/js-test-resources/js-test-pre.js"></script>
<script src="resources/cache-test.js"></script>
<body>
<script>

 //Redefine printResults function to print also response status.
function printResults(tests)
{
    for (var i = 0; i < tests.length; ++i) {
        var test = tests[i];
        debug("response headers: " + JSON.stringify(test.responseHeaders));
        if (test.expiresInFutureIn304)
            debug("response's 'Expires' header is overriden by future date in 304 response");
        if (test.requestHeaders)
            debug("request headers: " + JSON.stringify(test.requestHeaders));
        responseSource = internals.xhrResponseSource(test.xhr);
        debug("response source: " + responseSource);
	debug("response status: " + test.xhr.status);
        debug("");
    }
}


var testMatrix =
[
    [
	{ responseHeaders: {'Cache-control': 'max-age=100' } },
	{ responseHeaders: {'Cache-control': 'max-age=0' } },
    ],
    [
        { responseHeaders: {}},
        { responseHeaders: {'Range': 'bytes=2-4' } },
        { responseHeaders: {'Range': 'bytes=5-7' } },
    ]
];

description("Test that request with different Range header values work.");

var tests = generateTests(testMatrix);

runTests(tests);

</script>
<script src="/js-test-resources/js-test-post.js"></script>
