tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_videoFrame_mismatched_codedSize.html (822B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <title></title>
      5  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      6  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
      7 </head>
      8 <body>
      9 <script>
     10 let data = new Uint8Array([
     11  1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
     12 ]);
     13 // TODO: Crop the image instead of returning errors (Bug 1782128).
     14 try {
     15  // Bug 1793814: Remove eslint-disable-line below
     16  let frame = new VideoFrame(data, { // eslint-disable-line no-undef
     17    timestamp: 10,
     18    codedWidth: 3,
     19    codedHeight: 3,
     20    visibleRect: { x: 0, y: 0, width: 1, height: 1 },
     21    format: "RGBA",
     22  });
     23  frame.close();
     24  ok(false, "Should not create a VideoFrame from a mismatched-size buffer");
     25 } catch (e) {
     26  ok(e instanceof TypeError, "Should throw a TypeError");
     27 }
     28 </script>
     29 </body>
     30 </html>