<!--
  Any copyright is dedicated to the Public Domain.
  http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<html>
  <body>
  </body>
  <script>
    var promise = new Promise(resolve => {
      var observer = new PerformanceObserver(list => resolve(list));
      observer.observe({entryTypes: ["paint"]});
    });

    promise.then(list => {
      var perfEntries = list.getEntries();
      opener.is(list.getEntries().length, 1);
      opener.isDeeply(list.getEntries(),
                performance.getEntriesByType("paint"),
                "Observed 'paint' entries should equal to entries obtained by getEntriesByType.");
      opener.isDeeply(list.getEntries({name: "paint"}),
                performance.getEntriesByName("paint"),
                "getEntries with name filter should return correct results.");
      opener.isDeeply(list.getEntries({entryType: "paint"}),
                performance.getEntriesByType("paint"),
                "getEntries with entryType filter should return correct results.");
      opener.done();
    });

    const img = document.createElement("IMG");
    img.src = "http://example.org/tests/dom/performance/tests/logo.png";
    document.body.appendChild(img);

  </script>
</html>
