Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | <!DOCTYPE HTML> |
michael@0 | 2 | <html> |
michael@0 | 3 | <head> |
michael@0 | 4 | <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 5 | <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
michael@0 | 6 | </head> |
michael@0 | 7 | <body onload="doTest()"> |
michael@0 | 8 | <p id="display"> |
michael@0 | 9 | <canvas id="c" width="1" height="1"></canvas> |
michael@0 | 10 | <img id="img" src="image_red.png"> |
michael@0 | 11 | </p> |
michael@0 | 12 | <div id="content" style="display: none"> |
michael@0 | 13 | |
michael@0 | 14 | </div> |
michael@0 | 15 | <pre id="test"> |
michael@0 | 16 | <script type="application/javascript"> |
michael@0 | 17 | |
michael@0 | 18 | var c = document.getElementById("c"); |
michael@0 | 19 | var ctx = c.getContext("2d"); |
michael@0 | 20 | var img = document.getElementById("img"); |
michael@0 | 21 | |
michael@0 | 22 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 23 | |
michael@0 | 24 | function doTest() { |
michael@0 | 25 | ctx.drawImage(img, 0, 0); |
michael@0 | 26 | img.src = "image_green-1x1.png"; |
michael@0 | 27 | img.onload = function() { |
michael@0 | 28 | ctx.drawImage(img, 0, 0); |
michael@0 | 29 | var data = ctx.getImageData(0, 0, 1, 1).data; |
michael@0 | 30 | is(data[0], 0, "Red channel should be 0"); |
michael@0 | 31 | is(data[1], 255, "Green channel should be 1.0"); |
michael@0 | 32 | is(data[2], 0, "Blue channel should be 0") |
michael@0 | 33 | is(data[3], 255, "Alpha channel should be opaque"); |
michael@0 | 34 | |
michael@0 | 35 | SimpleTest.finish(); |
michael@0 | 36 | } |
michael@0 | 37 | } |
michael@0 | 38 | |
michael@0 | 39 | </script> |
michael@0 | 40 | </pre> |
michael@0 | 41 | </body> |
michael@0 | 42 | </html> |