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
   49

content / test / data / gpu / pixel_svg_huge.html [blame]

<!DOCTYPE HTML>

<html>
<head>
<title>Huge SVG Must Display Correctly</title>
<style type="text/css">
.nomargin {
  margin: 0px auto;
}
</style>
<script>
// We manually send heartbeats while the SVG is loading since it can take a
// long time and we aren't making any function calls that could be wrapped.
function manuallySendHeartbeat() {
  if (wrapper !== undefined) {
    wrapper.sendHeartbeatThrottled();
  }
}

function sendResult(status, detail) {
  console.log(detail);
  if (window.domAutomationController) {
    window.domAutomationController.send(status);
  } else {
    console.log(status);
  }
}

// We do this logic in the page to simplify the page action and make
// it clearer that it's executed.
function scrollOutAndBack() {
  manuallySendHeartbeat();
  requestAnimationFrame(() => {
    window.scrollTo(1000, 1000);
    requestAnimationFrame(() => {
      window.scrollTo(0, 0);
      requestAnimationFrame(() => {
        sendResult("SUCCESS", "Test complete");
      });
    });
  });
}

</script>
</head>
<body>
<img src="lots-of-lines.svg" onload="scrollOutAndBack()"></img>
</body>
</html>