def CheckContentHeaders(self, content_range_request, content_range_response,
                          content_length_response):
    self._tab.ExecuteJavaScript(
        """
        var loaded = false;
        var xmlhttp = new XMLHttpRequest();
        xmlhttp.onload = function(e) {
          loaded = true;
        };
        // Avoid cached content by appending unique URL param.
        xmlhttp.open('GET', {{ url }} + "?t=" + Date.now(), true);
        xmlhttp.setRequestHeader('Range', {{ range }});
        xmlhttp.send();
        """,
        url=self.UrlOfUnittestFile(self._test_filename),
        range='bytes=%s' % content_range_request)
    self._tab.WaitForJavaScriptCondition('loaded', timeout=5)
    content_range = self._tab.EvaluateJavaScript(
        'xmlhttp.getResponseHeader("Content-Range");')
    content_range_response = 'bytes %s/%d' % (content_range_response,
                                              self._test_file_size)
    self.assertEqual(content_range, content_range_response)
    content_length = self._tab.EvaluateJavaScript(
        'xmlhttp.getResponseHeader("Content-Length");')
    self.assertEqual(content_length, str(content_length_response))