DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Mercurial (b6d82b1a6b02)

VCS Links

Line Code
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
<!DOCTYPE HTML>
<html>
<head>
  <meta charset="utf-8">
  <title>Test for createPattern with a broken image</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <script src="/tests/SimpleTest/WindowSnapshot.js"></script>
  <script type="application/javascript" src="file_drawWindow_common.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
  <script type="application/javascript">

  SimpleTest.waitForExplicitFinish();
  window.addEventListener("load", function(){
    var _thrown = undefined;

    try{
      var img = document.getElementById('broken.png');
      var ctx = document.getElementById('c').getContext('2d');
      var p = ctx.createPattern(img, 'repeat');
    } catch (e) {
      _thrown = e
    };

    ok(_thrown && _thrown.name == "InvalidStateError" && _thrown.code == DOMException.INVALID_STATE_ERR, "should throw InvalidStateError");

    SimpleTest.finish();
    });

  </script>
</head>
<body>
<canvas id="c" class="output" width="100" height="50"></canvas>
<img src="/images/broken.png" id="broken.png" class="resource"/>
</body>
</html>