1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48

content / test / data / resource_loading / resource_loading_non_mobile.html [blame]

<!DOCTYPE html>
<html>
<head>
  <!-- Layout blocking CSS -->
  <link rel="stylesheet" href="style1.css">
  <link rel="stylesheet" href="style2.css">
  <!-- JS in layout blocking phase -->
  <script src="test1.js"></script>
  <script src="test2.js"></script>
</head>
<body>
  <script>

  var resourcesNumber = -1;
  window.onload = function () {
      resourcesNumber = window.performance.getEntriesByType("resource").length;
  };

  function getResourceNumber() {
    return new Promise(resolve => {
      setInterval(function() {
        if (resourcesNumber != -1) {
          resolve(resourcesNumber);
        }
      }, 300);
    });
  }

  function getResources() {
    return window.performance.getEntriesByType("resource")
      .map(e => JSON.stringify(e.toJSON())).join('|');;
  }
  </script>

  <picture>
      <source media="(min-width: 980px)" srcset="200.png">
      <img src="400.png">
  </picture>

  <img srcset = "635.png 635w, 1270.png 1270w"
            sizes = "(max-width: 600px) calc(100vw - 32px),
                     (max-width: 1000px) calc(66.67vw - 32px),
                     635px">
  <img src="img1.png">
  <img src="img2.png">
  <img src="img3.png">
</body>
</html>