Revision 9936e8c644dfcfc1c02ba53fa26c501d64eccc11 authored by Yutaka Hirano on 21 November 2017, 10:42:44 UTC, committed by Chromium WPT Sync on 21 November 2017, 10:42:44 UTC
This CL introduces a mime type parser and stringifier to
wpt/XMLHttpRequest/send-content-type-charset in order to accept
implementations that are actually conforming to the spec but were rejected
by the test due to some text representation errors.

Bug: https://github.com/whatwg/mimesniff/issues/39
Change-Id: I99466e2e596bb9c1b7f11267ad4ff0a886913086
1 parent 93f495e
Raw File
single-entry-per-resource.html
<!DOCTYPE HTML>
<meta charset=utf-8>
<meta name="timeout" content="long">
<title>One resource when reusing data</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<script>
  var img_entries = 0;
  var observed = 0;
  var img_url = "resources/blue.png";
  var observer = new PerformanceObserver(
    function (entryList, obs) {
      var entries = entryList.getEntriesByType("resource");
      for (var i = 0; i < entries.length; ++i) {
        ++observed;
        if (entries[i].name.indexOf(img_url) != -1)
            ++img_entries;
      }
    });
  observer.observe({entryTypes: ["resource"]});
  window.onload = function() {
    // A timeout is needed as PerformanceObserver is not guaranteed to run before onload triggered.
    setTimeout(function() {
      test(function(){
        assert_equals(observed, 1);
        assert_equals(img_entries, 1);
      }, "Only one resource entry per resource");
    },0)
  };
  // Images are added dynamically to make sure the observer is registered before their download finishes.
  var img1 = document.createElement("img");
  img1.src = img_url;
  document.body.appendChild(img1);
  var img2 = document.createElement("img");
  img2.src = img_url;
  document.body.appendChild(img2);
</script>
<h1>One resource when reusing data</h1>
<p>
If the user agent is to reuse the data from another existing or completed fetch initiated from the current document, abort the remaining steps.
</p>
<div id="log"></div>
</body>

back to top