<body>
<script src=resources/subresource-test.js></script>
<script>

tests = [
    {
        description: 'No cache headers or Last-modified header',
        expectedResult: 'Uncached',
    },
    {
        testHeaders: {
            'Expires': '[now+10s]',
        },
        expectedResult: 'Cached',
    },
    {
        testHeaders: {
            'Expires': '[now-10s]',
        },
        expectedResult: 'Uncached',
    },
    {
        testHeaders: {
            'Expires': '[now+10s]',
            'Cache-control': 'must-revalidate',
        },
        expectedResult: 'Cached',
    },
    {
        testHeaders: {
            'Expires': '[now+10s]',
            'Cache-control': 'no-cache',
        },
        expectedResult: 'Uncached',
    },
    {
        testHeaders: {
            'Expires': '[now+10s]',
            'Cache-control': 'no-store',
        },
        expectedResult: 'Uncached',
    },
    {
        testHeaders: {
            'Expires': '[now+10s]',
            'Pragma': 'no-cache',
        },
        expectedResult: 'Uncached',
    },
    {
        testHeaders: {
            'Cache-control': 'max-age=10',
        },
        expectedResult: 'Cached',
    },
    {
        testHeaders: {
            'Cache-control': 'max-age=0',
        },
        expectedResult: 'Uncached',
    },
    {
        testHeaders: {
            'Cache-control': 'max-age=1',
        },
        delay: 1.5,
        expectedResult: 'Uncached',
    },
    {
        testHeaders: {
            'Cache-control': 'max-age=10, no-cache',
        },
        expectedResult: 'Uncached',
    }
];

runTests();

</script>
