diff --git a/platforms/ios/www/test/common/tests.css b/platforms/ios/www/test/common/tests.css new file mode 100644 index 0000000..4e9d41b --- /dev/null +++ b/platforms/ios/www/test/common/tests.css @@ -0,0 +1,137 @@ +html.fail { + background: #f66; +} +html.pass { + background: #6f6; +} +html.needs_check { + background: #99f; +} + +body { + font-size: small; + font-family: sans-serif; + color: black; + padding: 0; + margin: 0; +} + +a:link { + color: #00c; +} +a:visited { + color: #808; +} + +body.framed { + font-size: x-small; +} + +h1 { + font-size: larger; + margin: 0; + padding-left: 0.5em; + text-indent: -0.5em; +} + +p { + margin: 0; +} + +p.notes { + margin-bottom: 0.5em; + font-style: italic; +} + +ul { + margin: 0; + margin-left: 5px; + margin-bottom: 0.5em; + padding: 0; + padding-left: 1em; +} + +.refs { + font-style: italic; + margin-bottom: 0.5em; +} + +.refs ul { + display: inline; + margin: 0; + padding: 0; +} + +.refs li { + display: inline; + list-style-type: none; + margin: 0; + padding: 0; +} + +canvas { + display: none; + visibility: hidden; + border: 2px #f0f solid; + background: url(images/background.png); +} + +img.expected { + display: none; + border: 2px #f0f solid; + background: url(images/background.png); +} + +iframe { + border: 2px #f0f solid; +} + +.output { + display: none; +} + +.show_output .output, .needs_check .output { + display: block !important; + visibility: visible !important; +} + +.show_output #show_output { + display: none; +} + +.resource { + visibility: hidden; + height: 0; +} + +.fallback { + font-size: 2em; + font-weight: bold; + color: #a00; +} + + +html.minimal body { + color: white; +} +html.fail.minimal { + background: #f00; +} +html.pass.minimal { + background: #080; +} +html.needs_check.minimal { + background: #008; +} +.minimal #d { + display: none !important; +} +.minimal .expectedtext { + visibility: hidden !important; +} +#passtext, #failtext { + display: none; +} +.minimal.pass #passtext, .minimal.fail #failtext { + display: block; +} diff --git a/platforms/ios/www/test/common/tests.js b/platforms/ios/www/test/common/tests.js new file mode 100644 index 0000000..c14895b --- /dev/null +++ b/platforms/ios/www/test/common/tests.js @@ -0,0 +1,192 @@ +function _valToString(val) +{ + if (val === undefined || val === null) + return '[' + typeof(val) + ']'; + return val.toString() + '[' + typeof(val) + ']'; +} + +var _failed = false; +var _failedMessage = ""; +var _asserted = false; +function _warn(text) +{ + _failedMessage = text; + // TODO stack warnings incase multiple tests +} +function _fail(text) +{ + _warn(text); + _failed = true; +} + +function _assert(cond, text) +{ + _asserted = true; + if (! cond) + _fail('Failed assertion: ' + text); +} + +function _assertSame(a, b, text_a, text_b) +{ + _asserted = true; + if (a !== b) + _fail('Failed assertion ' + text_a + ' === ' + text_b + + ' (got ' + _valToString(a) + ', expected ' + _valToString(b) + ')'); +} + +function _assertDifferent(a, b, text_a, text_b) +{ + _asserted = true; + if (a === b) + _fail('Failed assertion ' + text_a + ' !== ' + text_b + + ' (got ' + _valToString(a) + ', expected not ' + _valToString(b) + ')'); +} + +function _assertEqual(a, b, text_a, text_b) +{ + _asserted = true; + if (a != b) + _fail('Failed assertion ' + text_a + ' == ' + text_b + + ' (got ' + _valToString(a) + ', expected ' + _valToString(b) + ')'); +} + +function _assertMatch(a, b, text_a, text_b) +{ + _asserted = true; + if (! a.match(b)) + _fail('Failed assertion ' + text_a + ' matches ' + text_b + + ' (got ' + _valToString(a) + ')'); +} + + +var _manual_check = false; + +function _requireManualCheck() +{ + _manual_check = true; +} + +function _crash() +{ + _fail('Aborted due to predicted crash'); +} + +function _getPixel(canvas, x,y) +{ + try { + var ctx = canvas.getContext('2d'); + var imgdata = ctx.getImageData(x, y, 1, 1); + return [ imgdata.data[0], imgdata.data[1], imgdata.data[2], imgdata.data[3] ]; + } catch (e) { + // probably a security exception caused by having drawn + // data: URLs onto the canvas + _manual_check = true; + return undefined; + } +} + +function _assertPixel(canvas, x,y, r,g,b,a, pos, colour) +{ + _asserted = true; + var c = _getPixel(canvas, x,y); + if (c && ! (c[0] == r && c[1] == g && c[2] == b && c[3] == a)) + _fail('Failed assertion: got pixel [' + c + '] at ('+x+','+y+'), expected ['+r+','+g+','+b+','+a+']'); +} + +function _assertPixelApprox(canvas, x,y, r,g,b,a, pos, colour, tolerance) +{ + _asserted = true; + var c = _getPixel(canvas, x,y); + if (c) + { + var diff = Math.max(Math.abs(c[0]-r), Math.abs(c[1]-g), Math.abs(c[2]-b), Math.abs(c[3]-a)); + if (diff > tolerance) + _fail('Failed assertion: got pixel [' + c + '] at ('+x+','+y+'), expected ['+r+','+g+','+b+','+a+'] +/- '+tolerance); + } +} + +function _addTest(test) +{ + _failed = false; + _manual_check = false; + _asserted = false; + var deferred = false; + window.deferTest = function () { deferred = true; }; + function endTest() + { + + if (_failed) // test failed + { + var msg = { result: "fail", message: "[" + tests[currentTest] + "] " + _failedMessage, testId: currentTest }; + wizCanvasMessenger.postMessage(msg, "mainView"); + } + else if (_manual_check || !_asserted) + { // test case explicitly asked for a manual check, or no automatic assertions were performed + + // TODO - alert checker + console.log("TEST REQUIRES MANUAL CHECK"); + /* + document.getElementById('d').innerHTML += '
  • Cannot automatically verify result'; + document.documentElement.className += ' needs_check'; + window._testStatus = ['check', document.getElementById('d').innerHTML]; + */ + + // For now, skip + var msg = { result: "success", testId: currentTest }; + wizCanvasMessenger.postMessage(msg, "mainView"); + + } + else // test succeeded + { + var msg = { result: "success", testId: currentTest }; + wizCanvasMessenger.postMessage(msg, "mainView"); + } + } + window.endTest = endTest; + window.wrapFunction = function (f) + { + return function() + { + try + { + f.apply(null, arguments); + } + catch (e) + { + _fail('Aborted with exception: ' + e.message); + } + endTest(); + } + } + + function loadTest() { + + try + { + var canvas = document.getElementById('canvas'); + var ctx = canvas.getContext('2d'); + // Prepare and clear canvas + + ctx.restore(); + ctx.globalAlpha = 1; + ctx.fillStyle = "#000"; + ctx.fillRect(0, 0, window.innerWidth, window.innerHeight); + ctx.save(); + + test(canvas, ctx); + } + catch (e) + { + _fail('Aborted with exception: ' + e.message); + deferred = false; // cancel any deference + } + + if (!deferred) { + endTest(); + } + + }; + + loadTest(); +} + diff --git a/platforms/ios/www/test/fonts/CanvasTest.sfd b/platforms/ios/www/test/fonts/CanvasTest.sfd new file mode 100644 index 0000000..6dbe8e2 --- /dev/null +++ b/platforms/ios/www/test/fonts/CanvasTest.sfd @@ -0,0 +1,321 @@ +SplineFontDB: 3.0 +FontName: CanvasTest +FullName: CanvasTest +FamilyName: CanvasTest +Weight: Medium +Copyright: Copyright (c) 2010 Philip Taylor.\n\nReleased under the MIT License: http://www.opensource.org/licenses/mit-license.php +UComments: "2010-2-26: Created." +Version: 001.000 +ItalicAngle: 0 +UnderlinePosition: -102 +UnderlineWidth: 51 +Ascent: 768 +Descent: 256 +LayerCount: 2 +Layer: 0 0 "Back" 1 +Layer: 1 0 "Fore" 0 +NeedsXUIDChange: 1 +XUID: [1021 923 651290676 15069128] +BaseHoriz: 4 'hang' 'ideo' 'math' 'romn' +BaseScript: 'DFLT' 3 512 128 384 0 +FSType: 0 +OS2Version: 0 +OS2_WeightWidthSlopeOnly: 0 +OS2_UseTypoMetrics: 1 +CreationTime: 1267213266 +ModificationTime: 1267289643 +OS2TypoAscent: 0 +OS2TypoAOffset: 1 +OS2TypoDescent: 0 +OS2TypoDOffset: 1 +OS2TypoLinegap: 92 +OS2WinAscent: 0 +OS2WinAOffset: 1 +OS2WinDescent: 0 +OS2WinDOffset: 1 +HheadAscent: 0 +HheadAOffset: 1 +HheadDescent: 0 +HheadDOffset: 1 +DEI: 91125 +LangName: 1033 +Encoding: ISO8859-1 +UnicodeInterp: none +NameList: Adobe Glyph List +DisplaySize: -24 +AntiAlias: 1 +FitToEm: 1 +WinInfo: 0 39 15 +BeginChars: 256 11 + +StartChar: A +Encoding: 65 65 0 +Width: 1024 +VWidth: 0 +Flags: H +LayerCount: 2 +Fore +SplineSet +0 768 m 25 + 1024 768 l 25 + 1024 0 l 29 + 0 0 l 25 + 0 768 l 25 +EndSplineSet +Validated: 1 +EndChar + +StartChar: B +Encoding: 66 66 1 +Width: 1024 +VWidth: 0 +Flags: H +LayerCount: 2 +Fore +SplineSet +0 0 m 29 + 1024 0 l 25 + 1024 -256 l 25 + 0 -256 l 25 + 0 0 l 29 +EndSplineSet +Validated: 1 +EndChar + +StartChar: C +Encoding: 67 67 2 +Width: 1024 +VWidth: 0 +Flags: H +LayerCount: 2 +Fore +SplineSet +280 1640 m 1 + 350 1735 l 1 + 493 1594 l 1 + 620 1745 l 1 + 705 1660 l 1 + 577 1511 l 1 + 715 1375 l 1 + 635 1280 l 1 + 498 1418 l 1 + 380 1280 l 1 + 305 1370 l 1 + 416 1502 l 1 + 280 1640 l 1 +0 768 m 25 + 1024 768 l 25 + 1024 -256 l 25 + 0 -256 l 25 + 0 768 l 25 +620 -340 m 1 + 705 -425 l 1 + 577 -574 l 1 + 715 -710 l 1 + 635 -805 l 1 + 498 -667 l 1 + 380 -805 l 1 + 305 -715 l 1 + 416 -583 l 1 + 280 -445 l 1 + 350 -350 l 1 + 493 -491 l 1 + 620 -340 l 1 +EndSplineSet +Validated: 1 +EndChar + +StartChar: D +Encoding: 68 68 3 +Width: 1024 +VWidth: 0 +Flags: HW +LayerCount: 2 +Fore +SplineSet +-1003 450 m 1 + -933 545 l 1 + -790 404 l 1 + -663 555 l 1 + -578 470 l 1 + -706 321 l 1 + -568 185 l 1 + -648 90 l 1 + -785 228 l 1 + -903 90 l 1 + -978 180 l 1 + -867 312 l 1 + -1003 450 l 1 +0 768 m 25 + 1024 768 l 25 + 1024 -256 l 25 + 0 -256 l 29 + 0 768 l 25 +1485 591 m 1 + 1570 506 l 1 + 1442 357 l 1 + 1580 221 l 1 + 1500 126 l 1 + 1363 264 l 1 + 1245 126 l 1 + 1170 216 l 1 + 1281 348 l 1 + 1145 486 l 1 + 1215 581 l 1 + 1358 440 l 1 + 1485 591 l 1 +EndSplineSet +Validated: 1 +EndChar + +StartChar: space +Encoding: 32 32 4 +Width: 1024 +VWidth: 0 +Flags: HW +LayerCount: 2 +EndChar + +StartChar: E +Encoding: 69 69 5 +Width: 1024 +VWidth: 0 +Flags: HW +LayerCount: 2 +Fore +SplineSet +0 768 m 25 + 1024 768 l 25 + 1024 -256 l 25 + 0 -256 l 25 + 0 768 l 25 +EndSplineSet +Validated: 1 +EndChar + +StartChar: uni000B +Encoding: 11 11 6 +Width: 1024 +VWidth: 0 +Flags: HW +LayerCount: 2 +Fore +SplineSet +28 644 m 1 + 98 739 l 1 + 241 598 l 1 + 368 749 l 1 + 453 664 l 1 + 325 515 l 1 + 463 379 l 1 + 383 284 l 1 + 246 422 l 1 + 128 284 l 1 + 53 374 l 1 + 164 506 l 1 + 28 644 l 1 +EndSplineSet +Validated: 1 +EndChar + +StartChar: uni000C +Encoding: 12 12 7 +Width: 1024 +VWidth: 0 +Flags: HW +LayerCount: 2 +Fore +SplineSet +28 644 m 1 + 98 739 l 1 + 241 598 l 1 + 368 749 l 1 + 453 664 l 1 + 325 515 l 1 + 463 379 l 1 + 383 284 l 1 + 246 422 l 1 + 128 284 l 1 + 53 374 l 1 + 164 506 l 1 + 28 644 l 1 +EndSplineSet +Validated: 1 +EndChar + +StartChar: uni000D +Encoding: 13 13 8 +Width: 1024 +VWidth: 0 +Flags: HW +LayerCount: 2 +Fore +SplineSet +28 644 m 1 + 98 739 l 1 + 241 598 l 1 + 368 749 l 1 + 453 664 l 1 + 325 515 l 1 + 463 379 l 1 + 383 284 l 1 + 246 422 l 1 + 128 284 l 1 + 53 374 l 1 + 164 506 l 1 + 28 644 l 1 +EndSplineSet +Validated: 1 +EndChar + +StartChar: uni000A +Encoding: 10 10 9 +Width: 1024 +VWidth: 0 +Flags: HW +LayerCount: 2 +Fore +SplineSet +28 644 m 1 + 98 739 l 1 + 241 598 l 1 + 368 749 l 1 + 453 664 l 1 + 325 515 l 1 + 463 379 l 1 + 383 284 l 1 + 246 422 l 1 + 128 284 l 1 + 53 374 l 1 + 164 506 l 1 + 28 644 l 1 +EndSplineSet +Validated: 1 +EndChar + +StartChar: uni0009 +Encoding: 9 9 10 +Width: 1024 +VWidth: 0 +Flags: HW +LayerCount: 2 +Fore +SplineSet +28 644 m 1 + 98 739 l 1 + 241 598 l 1 + 368 749 l 1 + 453 664 l 1 + 325 515 l 1 + 463 379 l 1 + 383 284 l 1 + 246 422 l 1 + 128 284 l 1 + 53 374 l 1 + 164 506 l 1 + 28 644 l 1 +EndSplineSet +Validated: 1 +EndChar +EndChars +EndSplineFont diff --git a/platforms/ios/www/test/fonts/CanvasTest.ttf b/platforms/ios/www/test/fonts/CanvasTest.ttf new file mode 100644 index 0000000..9023592 Binary files /dev/null and b/platforms/ios/www/test/fonts/CanvasTest.ttf differ diff --git a/platforms/ios/www/test/images/anim-gr.gif b/platforms/ios/www/test/images/anim-gr.gif new file mode 100644 index 0000000..45263e0 Binary files /dev/null and b/platforms/ios/www/test/images/anim-gr.gif differ diff --git a/platforms/ios/www/test/images/anim-gr.png b/platforms/ios/www/test/images/anim-gr.png new file mode 100644 index 0000000..925e2ef Binary files /dev/null and b/platforms/ios/www/test/images/anim-gr.png differ diff --git a/platforms/ios/www/test/images/anim-poster-gr.png b/platforms/ios/www/test/images/anim-poster-gr.png new file mode 100644 index 0000000..6941207 Binary files /dev/null and b/platforms/ios/www/test/images/anim-poster-gr.png differ diff --git a/platforms/ios/www/test/images/background.png b/platforms/ios/www/test/images/background.png new file mode 100644 index 0000000..6db6c6b Binary files /dev/null and b/platforms/ios/www/test/images/background.png differ diff --git a/platforms/ios/www/test/images/black-rectangle.png b/platforms/ios/www/test/images/black-rectangle.png new file mode 100644 index 0000000..a0bf1fe Binary files /dev/null and b/platforms/ios/www/test/images/black-rectangle.png differ diff --git a/platforms/ios/www/test/images/blue-area.png b/platforms/ios/www/test/images/blue-area.png new file mode 100644 index 0000000..570ae0f Binary files /dev/null and b/platforms/ios/www/test/images/blue-area.png differ diff --git a/platforms/ios/www/test/images/blue-border.png b/platforms/ios/www/test/images/blue-border.png new file mode 100644 index 0000000..8f8e41c Binary files /dev/null and b/platforms/ios/www/test/images/blue-border.png differ diff --git a/platforms/ios/www/test/images/blue.png b/platforms/ios/www/test/images/blue.png new file mode 100644 index 0000000..4498dd2 Binary files /dev/null and b/platforms/ios/www/test/images/blue.png differ diff --git a/platforms/ios/www/test/images/broken.png b/platforms/ios/www/test/images/broken.png new file mode 100644 index 0000000..f258101 Binary files /dev/null and b/platforms/ios/www/test/images/broken.png differ diff --git a/platforms/ios/www/test/images/canvas-line.png b/platforms/ios/www/test/images/canvas-line.png new file mode 100644 index 0000000..30f8f45 Binary files /dev/null and b/platforms/ios/www/test/images/canvas-line.png differ diff --git a/platforms/ios/www/test/images/fail.gif b/platforms/ios/www/test/images/fail.gif new file mode 100644 index 0000000..c4addcf Binary files /dev/null and b/platforms/ios/www/test/images/fail.gif differ diff --git a/platforms/ios/www/test/images/ggrr-256x256.png b/platforms/ios/www/test/images/ggrr-256x256.png new file mode 100644 index 0000000..0342e4a Binary files /dev/null and b/platforms/ios/www/test/images/ggrr-256x256.png differ diff --git a/platforms/ios/www/test/images/green-100x50.png b/platforms/ios/www/test/images/green-100x50.png new file mode 100644 index 0000000..2b7577d Binary files /dev/null and b/platforms/ios/www/test/images/green-100x50.png differ diff --git a/platforms/ios/www/test/images/green-16x16.png b/platforms/ios/www/test/images/green-16x16.png new file mode 100644 index 0000000..e19a3ff Binary files /dev/null and b/platforms/ios/www/test/images/green-16x16.png differ diff --git a/platforms/ios/www/test/images/green-1x1.png b/platforms/ios/www/test/images/green-1x1.png new file mode 100644 index 0000000..862d1dd Binary files /dev/null and b/platforms/ios/www/test/images/green-1x1.png differ diff --git a/platforms/ios/www/test/images/green-256x256.png b/platforms/ios/www/test/images/green-256x256.png new file mode 100644 index 0000000..b06945c Binary files /dev/null and b/platforms/ios/www/test/images/green-256x256.png differ diff --git a/platforms/ios/www/test/images/green-2x2.png b/platforms/ios/www/test/images/green-2x2.png new file mode 100644 index 0000000..adc0594 Binary files /dev/null and b/platforms/ios/www/test/images/green-2x2.png differ diff --git a/platforms/ios/www/test/images/green.png b/platforms/ios/www/test/images/green.png new file mode 100644 index 0000000..28a1faa Binary files /dev/null and b/platforms/ios/www/test/images/green.png differ diff --git a/platforms/ios/www/test/images/green.svg b/platforms/ios/www/test/images/green.svg new file mode 100644 index 0000000..d91971f --- /dev/null +++ b/platforms/ios/www/test/images/green.svg @@ -0,0 +1,3 @@ + + + diff --git a/platforms/ios/www/test/images/grgr-256x256.png b/platforms/ios/www/test/images/grgr-256x256.png new file mode 100644 index 0000000..b8c7189 Binary files /dev/null and b/platforms/ios/www/test/images/grgr-256x256.png differ diff --git a/platforms/ios/www/test/images/movie_300_frame_0.png b/platforms/ios/www/test/images/movie_300_frame_0.png new file mode 100644 index 0000000..b712825 Binary files /dev/null and b/platforms/ios/www/test/images/movie_300_frame_0.png differ diff --git a/platforms/ios/www/test/images/red-16x16.png b/platforms/ios/www/test/images/red-16x16.png new file mode 100644 index 0000000..9038fef Binary files /dev/null and b/platforms/ios/www/test/images/red-16x16.png differ diff --git a/platforms/ios/www/test/images/red-zeroheight.svg b/platforms/ios/www/test/images/red-zeroheight.svg new file mode 100644 index 0000000..de378d4 --- /dev/null +++ b/platforms/ios/www/test/images/red-zeroheight.svg @@ -0,0 +1,3 @@ + + + diff --git a/platforms/ios/www/test/images/red-zerosize.svg b/platforms/ios/www/test/images/red-zerosize.svg new file mode 100644 index 0000000..dcd3317 --- /dev/null +++ b/platforms/ios/www/test/images/red-zerosize.svg @@ -0,0 +1,3 @@ + + + diff --git a/platforms/ios/www/test/images/red-zerowidth.svg b/platforms/ios/www/test/images/red-zerowidth.svg new file mode 100644 index 0000000..66cff81 --- /dev/null +++ b/platforms/ios/www/test/images/red-zerowidth.svg @@ -0,0 +1,3 @@ + + + diff --git a/platforms/ios/www/test/images/red.png b/platforms/ios/www/test/images/red.png new file mode 100644 index 0000000..a6e195d Binary files /dev/null and b/platforms/ios/www/test/images/red.png differ diff --git a/platforms/ios/www/test/images/redtransparent.png b/platforms/ios/www/test/images/redtransparent.png new file mode 100644 index 0000000..75da08c Binary files /dev/null and b/platforms/ios/www/test/images/redtransparent.png differ diff --git a/platforms/ios/www/test/images/rgrg-256x256.png b/platforms/ios/www/test/images/rgrg-256x256.png new file mode 100644 index 0000000..e6fba3d Binary files /dev/null and b/platforms/ios/www/test/images/rgrg-256x256.png differ diff --git a/platforms/ios/www/test/images/rrgg-256x256.png b/platforms/ios/www/test/images/rrgg-256x256.png new file mode 100644 index 0000000..7f63515 Binary files /dev/null and b/platforms/ios/www/test/images/rrgg-256x256.png differ diff --git a/platforms/ios/www/test/images/smiley.png b/platforms/ios/www/test/images/smiley.png new file mode 100644 index 0000000..640a223 Binary files /dev/null and b/platforms/ios/www/test/images/smiley.png differ diff --git a/platforms/ios/www/test/images/threecolors.png b/platforms/ios/www/test/images/threecolors.png new file mode 100644 index 0000000..0643e6e Binary files /dev/null and b/platforms/ios/www/test/images/threecolors.png differ diff --git a/platforms/ios/www/test/images/transparent.png b/platforms/ios/www/test/images/transparent.png new file mode 100644 index 0000000..2b49869 Binary files /dev/null and b/platforms/ios/www/test/images/transparent.png differ diff --git a/platforms/ios/www/test/images/transparent50.png b/platforms/ios/www/test/images/transparent50.png new file mode 100644 index 0000000..55f8e69 Binary files /dev/null and b/platforms/ios/www/test/images/transparent50.png differ diff --git a/platforms/ios/www/test/images/yellow.png b/platforms/ios/www/test/images/yellow.png new file mode 100644 index 0000000..51e8aaf Binary files /dev/null and b/platforms/ios/www/test/images/yellow.png differ diff --git a/platforms/ios/www/test/images/yellow75.png b/platforms/ios/www/test/images/yellow75.png new file mode 100644 index 0000000..2bb82c9 Binary files /dev/null and b/platforms/ios/www/test/images/yellow75.png differ diff --git a/platforms/ios/www/test/index.html b/platforms/ios/www/test/index.html new file mode 100644 index 0000000..815ea45 --- /dev/null +++ b/platforms/ios/www/test/index.html @@ -0,0 +1,204 @@ + + + + + + + + + + + + + + + + + + +

    Ejecta Canvas Test Suite

    +

    +

    +

    +
    + + \ No newline at end of file diff --git a/platforms/ios/www/test/index.js b/platforms/ios/www/test/index.js new file mode 100644 index 0000000..88b1b7c --- /dev/null +++ b/platforms/ios/www/test/index.js @@ -0,0 +1,102 @@ +/* + * Ejecta Canvas Test Suite + * Author: @allyogilvie + * + * Original tests http://philip.html5.org/tests/canvas/suite/tests/ + */ +var w = window.innerWidth; +var h = window.innerHeight; +var w2 = w/2; +var h2 = h/2; + +var canvas = document.getElementById('canvas'); +canvas.width = w; +canvas.height = h; + +var ctx = canvas.getContext('2d'); + +ctx.globalAlpha = 1; +ctx.fillStyle = "#000"; +ctx.fillRect(0, 0, window.innerWidth, window.innerHeight); +ctx.save(); + +var currentTest = 0; + +ejecta.include("test/common/tests.js"); + +// Tests list +var tests = [ + +// Clear Rect + +"2d.canvas.reference.js", "2d.clearRect.basic.js", "2d.clearRect.clip.js", "2d.clearRect.globalalpha.js", "2d.clearRect.globalcomposite.js", "2d.clearRect.negative.js", /* "2d.clearRect.nonfinite.js", */ "2d.clearRect.path.js", /* "2d.clearRect.shadow.js", */ "2d.clearRect.transform.js", "2d.clearRect.zero.js", + +// Composite +/* +"2d.composite.canvas.copy.js", "2d.composite.canvas.destination-atop.js", "2d.composite.canvas.destination-in.js", "2d.composite.canvas.destination-out.js", "2d.composite.canvas.destination-over.js", "2d.composite.canvas.lighter.js", "2d.composite.canvas.source-atop.js", "2d.composite.canvas.source-in.js", "2d.composite.canvas.source-out.js", "2d.composite.canvas.source-over.js", "2d.composite.canvas.xor.js", "2d.composite.clip.copy.js", "2d.composite.clip.destination-atop.js", "2d.composite.clip.destination-in.js", "2d.composite.clip.destination-out.js", "2d.composite.clip.destination-over.js", "2d.composite.clip.lighter.js", "2d.composite.clip.source-atop.js", "2d.composite.clip.source-in.js", "2d.composite.clip.source-out.js", "2d.composite.clip.source-over.js", "2d.composite.clip.xor.js", "2d.composite.globalAlpha.canvas.js", "2d.composite.globalAlpha.canvaspattern.js", "2d.composite.globalAlpha.default.js", "2d.composite.globalAlpha.fill.js", "2d.composite.globalAlpha.image.js", "2d.composite.globalAlpha.imagepattern.js", "2d.composite.globalAlpha.invalid.js", "2d.composite.globalAlpha.range.js", "2d.composite.image.copy.js", "2d.composite.image.destination-atop.js", "2d.composite.image.destination-in.js", "2d.composite.image.destination-out.js", "2d.composite.image.destination-over.js", "2d.composite.image.lighter.js", "2d.composite.image.source-atop.js", "2d.composite.image.source-in.js", "2d.composite.image.source-out.js", "2d.composite.image.source-over.js", "2d.composite.image.xor.js", "2d.composite.operation.casesensitive.js", "2d.composite.operation.clear.js", "2d.composite.operation.darker.js", "2d.composite.operation.default.js", "2d.composite.operation.get.js", "2d.composite.operation.highlight.js", "2d.composite.operation.nullsuffix.js", "2d.composite.operation.over.js", "2d.composite.operation.unrecognised.js", "2d.composite.solid.copy.js", "2d.composite.solid.destination-atop.js", "2d.composite.solid.destination-in.js", "2d.composite.solid.destination-out.js", "2d.composite.solid.destination-over.js", "2d.composite.solid.lighter.js", "2d.composite.solid.source-atop.js", "2d.composite.solid.source-in.js", "2d.composite.solid.source-over.js", "2d.composite.solid.xor.js", "2d.composite.transparent.copy.js", "2d.composite.transparent.destination-in.js", "2d.composite.transparent.destination-out.js", "2d.composite.transparent.destination-over.js", "2d.composite.transparent.lighter.js", "2d.composite.transparent.source-atop.js", "2d.composite.transparent.source-in.js", "2d.composite.transparent.source-out.js", "2d.composite.transparent.source-over.js", "2d.composite.transparent.xor.js", "2d.composite.uncovered.fill.copy.js", "2d.composite.uncovered.fill.destination-atop.js", "2d.composite.uncovered.fill.destination-in.js", "2d.composite.uncovered.fill.source-in.js", "2d.composite.uncovered.fill.source-out.js", "2d.composite.uncovered.image.copy.js", "2d.composite.uncovered.image.destination-atop.js", "2d.composite.uncovered.image.destination-in.js", "2d.composite.uncovered.image.source-in.js", "2d.composite.uncovered.image.source-out.js", "2d.composite.uncovered.nocontext.copy.js", "2d.composite.uncovered.nocontext.destination-atop.js", "2d.composite.uncovered.nocontext.destination-in.js", "2d.composite.uncovered.nocontext.source-in.js", "2d.composite.uncovered.nocontext.source-out.js", "2d.composite.uncovered.pattern.copy.js", "2d.composite.uncovered.pattern.destination-atop.js", "2d.composite.uncovered.pattern.destination-in.js", "2d.composite.uncovered.pattern.source-in.js", "2d.composite.uncovered.pattern.source-out.js", +*/ +"2d.coordinatespace.js", + +// Draw Image + +"2d.drawImage.3arg.js", "2d.drawImage.5arg.js", "2d.drawImage.9arg.basic.js", "2d.drawImage.9arg.destpos.js", "2d.drawImage.9arg.destsize.js", "2d.drawImage.9arg.sourcepos.js", "2d.drawImage.9arg.sourcesize.js", "2d.drawImage.alpha.js", "2d.drawImage.animated.apng.js", /* "2d.drawImage.animated.gif.js", */ "2d.drawImage.animated.poster.js", "2d.drawImage.broken.js", "2d.drawImage.canvas.js", "2d.drawImage.clip.js", /* "2d.drawImage.composite.js", */ "2d.drawImage.floatsource.js", "2d.drawImage.incomplete.js", "2d.drawImage.negativedest.js", "2d.drawImage.negativedir.js", "2d.drawImage.negativesource.js", /* "2d.drawImage.nonfinite.js", */ "2d.drawImage.nowrap.js", /* "2d.drawImage.null.js", */ "2d.drawImage.outsidesource.js", "2d.drawImage.path.js", /* "2d.drawImage.transform.js", "2d.drawImage.wrongtype.js", "2d.drawImage.zerocanvas.js", "2d.drawImage.zerosource.js", */ + +// Fill Rect + +"2d.fillRect.basic.js", "2d.fillRect.clip.js", "2d.fillRect.negative.js", /* "2d.fillRect.nonfinite.js", */ "2d.fillRect.path.js", /* "2d.fillRect.shadow.js", */ "2d.fillRect.transform.js", "2d.fillRect.zero.js", + +// Fill Style +/* +"2d.fillStyle.default.js", "2d.fillStyle.get.semitransparent.js", "2d.fillStyle.get.solid.js", "2d.fillStyle.get.transparent.js", "2d.fillStyle.invalidstring.js", "2d.fillStyle.invalidtype.js", "2d.fillStyle.parse.hex3.js", "2d.fillStyle.parse.hex6.js", "2d.fillStyle.parse.hsl-1.js", "2d.fillStyle.parse.hsl-2.js", "2d.fillStyle.parse.hsl-3.js", "2d.fillStyle.parse.hsl-4.js", "2d.fillStyle.parse.hsl-5.js", "2d.fillStyle.parse.hsl-clamp-1.js", "2d.fillStyle.parse.hsl-clamp-2.js", "2d.fillStyle.parse.hsl-clamp-3.js", "2d.fillStyle.parse.hsl-clamp-4.js", "2d.fillStyle.parse.hsla-1.js", "2d.fillStyle.parse.hsla-2.js", "2d.fillStyle.parse.hsla-clamp-1.js", "2d.fillStyle.parse.hsla-clamp-2.js", "2d.fillStyle.parse.hsla-clamp-3.js", "2d.fillStyle.parse.hsla-clamp-4.js", "2d.fillStyle.parse.hsla-clamp-5.js", "2d.fillStyle.parse.hsla-clamp-6.js", "2d.fillStyle.parse.html4.js", "2d.fillStyle.parse.invalid.hex1.js", "2d.fillStyle.parse.invalid.hex2.js", "2d.fillStyle.parse.invalid.hex3.js", "2d.fillStyle.parse.invalid.hex4.js", "2d.fillStyle.parse.invalid.hex5.js", "2d.fillStyle.parse.invalid.hex6.js", "2d.fillStyle.parse.invalid.hex7.js", "2d.fillStyle.parse.invalid.hex8.js", "2d.fillStyle.parse.invalid.hsl-1.js", "2d.fillStyle.parse.invalid.hsl-2.js", "2d.fillStyle.parse.invalid.hsl-3.js", "2d.fillStyle.parse.invalid.hsl-4.js", "2d.fillStyle.parse.invalid.hsl-5.js", "2d.fillStyle.parse.invalid.hsla-1.js", "2d.fillStyle.parse.invalid.hsla-2.js", "2d.fillStyle.parse.invalid.name-1.js", "2d.fillStyle.parse.invalid.name-2.js", "2d.fillStyle.parse.invalid.name-3.js", "2d.fillStyle.parse.invalid.rgb-1.js", "2d.fillStyle.parse.invalid.rgb-2.js", "2d.fillStyle.parse.invalid.rgb-3.js", "2d.fillStyle.parse.invalid.rgb-4.js", "2d.fillStyle.parse.invalid.rgb-5.js", "2d.fillStyle.parse.invalid.rgb-6.js", "2d.fillStyle.parse.invalid.rgb-7.js", "2d.fillStyle.parse.invalid.rgba-1.js", "2d.fillStyle.parse.invalid.rgba-2.js", "2d.fillStyle.parse.invalid.rgba-3.js", "2d.fillStyle.parse.invalid.rgba-4.js", "2d.fillStyle.parse.invalid.rgba-5.js", "2d.fillStyle.parse.rgb-clamp-1.js", "2d.fillStyle.parse.rgb-clamp-2.js", "2d.fillStyle.parse.rgb-clamp-3.js", "2d.fillStyle.parse.rgb-clamp-4.js", "2d.fillStyle.parse.rgb-clamp-5.js", "2d.fillStyle.parse.rgb-num.js", "2d.fillStyle.parse.rgb-percent.js", "2d.fillStyle.parse.rgba-clamp-1.js", "2d.fillStyle.parse.rgba-clamp-2.js", "2d.fillStyle.parse.rgba-num-1.js", "2d.fillStyle.parse.rgba-num-2.js", "2d.fillStyle.parse.rgba-percent.js", "2d.fillStyle.parse.rgba-solid-1.js", "2d.fillStyle.parse.rgba-solid-2.js", "2d.fillStyle.parse.svg-1.js", "2d.fillStyle.parse.svg-2.js", "2d.fillStyle.parse.system.js", "2d.fillStyle.parse.transparent-1.js", "2d.fillStyle.parse.transparent-2.js", +*/ + +// Get context + +"2d.getcontext.exists.js", "2d.getcontext.shared.js", "2d.getcontext.unique.js", + +// Gradient + +"2d.gradient.empty.js", /* "2d.gradient.interpolate.alpha.js", "2d.gradient.interpolate.colour.js", "2d.gradient.interpolate.colouralpha.js", "2d.gradient.interpolate.multiple.js", "2d.gradient.interpolate.outside.js", "2d.gradient.interpolate.overlap.js", "2d.gradient.interpolate.overlap2.js", "2d.gradient.interpolate.solid.js", */ "2d.gradient.interpolate.vertical.js", /* "2d.gradient.interpolate.zerosize.js", "2d.gradient.linear.nonfinite.js", */ "2d.gradient.linear.transform.1.js", "2d.gradient.linear.transform.2.js", "2d.gradient.linear.transform.3.js", /* "2d.gradient.object.compare.js", */ "2d.gradient.object.crosscanvas.js", /* "2d.gradient.object.invalidcolour.js", "2d.gradient.object.invalidoffset.js", "2d.gradient.object.return.js", "2d.gradient.object.update.js", */ "2d.gradient.radial.cone.behind.js", /* "2d.gradient.radial.cone.beside.js", */ "2d.gradient.radial.cone.bottom.js", "2d.gradient.radial.cone.cylinder.js", "2d.gradient.radial.cone.front.js", "2d.gradient.radial.cone.shape1.js", /* "2d.gradient.radial.cone.shape2.js", */ "2d.gradient.radial.cone.top.js", /* "2d.gradient.radial.equal.js", */ "2d.gradient.radial.inside1.js", /* "2d.gradient.radial.inside2.js", "2d.gradient.radial.inside3.js", "2d.gradient.radial.negative.js", */ "2d.gradient.radial.outside1.js", /* "2d.gradient.radial.outside2.js", "2d.gradient.radial.outside3.js", */ "2d.gradient.radial.touch1.js", /* "2d.gradient.radial.touch2.js", */ "2d.gradient.radial.touch3.js", "2d.gradient.radial.transform.1.js", "2d.gradient.radial.transform.2.js", "2d.gradient.radial.transform.3.js", + +/* +"2d.imageData.create1.basic.js", "2d.imageData.create1.initial.js", "2d.imageData.create1.type.js", "2d.imageData.create1.zero.js", "2d.imageData.create2.basic.js", "2d.imageData.create2.initial.js", "2d.imageData.create2.large.js", "2d.imageData.create2.negative.js", "2d.imageData.create2.nonfinite.js", "2d.imageData.create2.round.js", "2d.imageData.create2.tiny.js", "2d.imageData.create2.type.js", "2d.imageData.create2.zero.js", "2d.imageData.get.basic.js", "2d.imageData.get.clamp.js", "2d.imageData.get.length.js", "2d.imageData.get.nonfinite.js", "2d.imageData.get.nonpremul.js", "2d.imageData.get.order.alpha.js", "2d.imageData.get.order.cols.js", "2d.imageData.get.order.rgb.js", "2d.imageData.get.order.rows.js", "2d.imageData.get.range.js", "2d.imageData.get.source.negative.js", "2d.imageData.get.source.outside.js", "2d.imageData.get.source.size.js", "2d.imageData.get.tiny.js", "2d.imageData.get.type.js", "2d.imageData.get.unaffected.js", "2d.imageData.get.zero.js", "2d.imageData.object.ctor.js", "2d.imageData.object.nan.js", "2d.imageData.object.properties.js", "2d.imageData.object.readonly.js", "2d.imageData.object.round.js", "2d.imageData.object.set.js", "2d.imageData.object.string.js", "2d.imageData.object.undefined.js", "2d.imageData.object.wrap.js", "2d.imageData.put.alpha.js", "2d.imageData.put.basic.js", "2d.imageData.put.clip.js", "2d.imageData.put.created.js", "2d.imageData.put.cross.js", "2d.imageData.put.dirty.negative.js", "2d.imageData.put.dirty.outside.js", "2d.imageData.put.dirty.rect1.js", "2d.imageData.put.dirty.rect2.js", "2d.imageData.put.dirty.zero.js", "2d.imageData.put.modified.js", "2d.imageData.put.nonfinite.js", "2d.imageData.put.null.js", "2d.imageData.put.path.js", "2d.imageData.put.unaffected.js", "2d.imageData.put.unchanged.js", "2d.imageData.put.wrongtype.js", "2d.line.cap.butt.js", "2d.line.cap.closed.js", "2d.line.cap.invalid.js", "2d.line.cap.open.js", "2d.line.cap.round.js", "2d.line.cap.square.js", "2d.line.cap.valid.js", "2d.line.cross.js", "2d.line.defaults.js", "2d.line.join.bevel.js", "2d.line.join.closed.js", "2d.line.join.invalid.js", "2d.line.join.miter.js", "2d.line.join.open.js", "2d.line.join.parallel.js", "2d.line.join.round.js", "2d.line.join.valid.js", "2d.line.miter.acute.js", "2d.line.miter.exceeded.js", "2d.line.miter.invalid.js", "2d.line.miter.lineedge.js", "2d.line.miter.obtuse.js", "2d.line.miter.rightangle.js", "2d.line.miter.valid.js", "2d.line.miter.within.js", "2d.line.union.js", "2d.line.width.basic.js", "2d.line.width.invalid.js", "2d.line.width.scaledefault.js", "2d.line.width.transformed.js", "2d.line.width.valid.js", "2d.missingargs.js", "2d.path.arc.angle.1.js", "2d.path.arc.angle.2.js", "2d.path.arc.angle.3.js", "2d.path.arc.angle.4.js", "2d.path.arc.angle.5.js", "2d.path.arc.angle.6.js", "2d.path.arc.empty.js", "2d.path.arc.end.js", "2d.path.arc.negative.js", "2d.path.arc.nonempty.js", "2d.path.arc.nonfinite.js", "2d.path.arc.scale.1.js", "2d.path.arc.scale.2.js", "2d.path.arc.selfintersect.1.js", "2d.path.arc.selfintersect.2.js", "2d.path.arc.shape.1.js", "2d.path.arc.shape.2.js", "2d.path.arc.shape.3.js", "2d.path.arc.shape.4.js", "2d.path.arc.shape.5.js", "2d.path.arc.twopie.1.js", "2d.path.arc.twopie.2.js", "2d.path.arc.twopie.3.js", "2d.path.arc.twopie.4.js", "2d.path.arc.zero.1.js", "2d.path.arc.zero.2.js", "2d.path.arc.zeroradius.js", "2d.path.arcTo.coincide.1.js", "2d.path.arcTo.coincide.2.js", "2d.path.arcTo.collinear.1.js", "2d.path.arcTo.collinear.2.js", "2d.path.arcTo.collinear.3.js", "2d.path.arcTo.ensuresubpath.1.js", "2d.path.arcTo.ensuresubpath.2.js", "2d.path.arcTo.negative.js", "2d.path.arcTo.nonfinite.js", "2d.path.arcTo.scale.js", "2d.path.arcTo.shape.curve1.js", "2d.path.arcTo.shape.curve2.js", "2d.path.arcTo.shape.end.js", "2d.path.arcTo.shape.start.js", "2d.path.arcTo.transformation.js", "2d.path.arcTo.zero.1.js", "2d.path.arcTo.zero.2.js", "2d.path.beginPath.js", "2d.path.bezierCurveTo.basic.js", "2d.path.bezierCurveTo.ensuresubpath.1.js", "2d.path.bezierCurveTo.ensuresubpath.2.js", "2d.path.bezierCurveTo.nonfinite.js", "2d.path.bezierCurveTo.scaled.js", "2d.path.bezierCurveTo.shape.js", "2d.path.clip.basic.1.js", "2d.path.clip.basic.2.js", "2d.path.clip.empty.js", "2d.path.clip.intersect.js", "2d.path.clip.unaffected.js", "2d.path.clip.winding.1.js", "2d.path.clip.winding.2.js", "2d.path.closePath.empty.js", "2d.path.closePath.newline.js", "2d.path.closePath.nextpoint.js", "2d.path.fill.closed.basic.js", "2d.path.fill.closed.unaffected.js", "2d.path.fill.overlap.js", "2d.path.fill.winding.add.js", "2d.path.fill.winding.subtract.1.js", "2d.path.fill.winding.subtract.2.js", "2d.path.fill.winding.subtract.3.js", "2d.path.initial.js", "2d.path.isPointInPath.arc.js", "2d.path.isPointInPath.basic.1.js", "2d.path.isPointInPath.basic.2.js", "2d.path.isPointInPath.bezier.js", "2d.path.isPointInPath.bigarc.js", "2d.path.isPointInPath.edge.js", "2d.path.isPointInPath.empty.js", "2d.path.isPointInPath.nonfinite.js", "2d.path.isPointInPath.outside.js", "2d.path.isPointInPath.subpath.js", "2d.path.isPointInPath.transform.1.js", "2d.path.isPointInPath.transform.2.js", "2d.path.isPointInPath.transform.3.js", "2d.path.isPointInPath.unclosed.js", "2d.path.isPointInPath.winding.js", "2d.path.lineTo.basic.js", "2d.path.lineTo.ensuresubpath.1.js", "2d.path.lineTo.ensuresubpath.2.js", "2d.path.lineTo.nextpoint.js", "2d.path.lineTo.nonfinite.js", "2d.path.moveTo.basic.js", "2d.path.moveTo.multiple.js", "2d.path.moveTo.newsubpath.js", "2d.path.moveTo.nonfinite.js", "2d.path.quadraticCurveTo.basic.js", "2d.path.quadraticCurveTo.ensuresubpath.1.js", "2d.path.quadraticCurveTo.ensuresubpath.2.js", "2d.path.quadraticCurveTo.nonfinite.js", "2d.path.quadraticCurveTo.scaled.js", "2d.path.quadraticCurveTo.shape.js", "2d.path.rect.basic.js", "2d.path.rect.closed.js", "2d.path.rect.end.1.js", "2d.path.rect.end.2.js", "2d.path.rect.negative.js", "2d.path.rect.newsubpath.js", "2d.path.rect.nonfinite.js", "2d.path.rect.selfintersect.js", "2d.path.rect.winding.js", "2d.path.rect.zero.1.js", "2d.path.rect.zero.2.js", "2d.path.rect.zero.3.js", "2d.path.rect.zero.4.js", "2d.path.rect.zero.5.js", "2d.path.rect.zero.6.js", "2d.path.stroke.empty.js", "2d.path.stroke.overlap.js", "2d.path.stroke.prune.arc.js", "2d.path.stroke.prune.closed.js", "2d.path.stroke.prune.corner.js", "2d.path.stroke.prune.curve.js", "2d.path.stroke.prune.line.js", "2d.path.stroke.prune.rect.js", "2d.path.stroke.scale1.js", "2d.path.stroke.scale2.js", "2d.path.stroke.skew.js", "2d.path.stroke.unaffected.js", "2d.path.stroke.union.js", "2d.path.transformation.basic.js", "2d.path.transformation.changing.js", "2d.path.transformation.multiple.js", "2d.pattern.animated.gif.js", "2d.pattern.basic.canvas.js", "2d.pattern.basic.image.js", "2d.pattern.basic.nocontext.js", "2d.pattern.basic.type.js", "2d.pattern.basic.zerocanvas.js", "2d.pattern.crosscanvas.js", "2d.pattern.image.broken.js", "2d.pattern.image.incomplete.js", "2d.pattern.image.null.js", "2d.pattern.image.string.js", "2d.pattern.image.undefined.js", "2d.pattern.modify.canvas1.js", "2d.pattern.modify.canvas2.js", "2d.pattern.modify.image1.js", "2d.pattern.modify.image2.js", "2d.pattern.paint.norepeat.basic.js", "2d.pattern.paint.norepeat.coord1.js", "2d.pattern.paint.norepeat.coord2.js", "2d.pattern.paint.norepeat.coord3.js", "2d.pattern.paint.norepeat.outside.js", "2d.pattern.paint.orientation.canvas.js", "2d.pattern.paint.orientation.image.js", "2d.pattern.paint.repeat.basic.js", "2d.pattern.paint.repeat.coord1.js", "2d.pattern.paint.repeat.coord2.js", "2d.pattern.paint.repeat.coord3.js", "2d.pattern.paint.repeat.outside.js", "2d.pattern.paint.repeatx.basic.js", "2d.pattern.paint.repeatx.coord1.js", "2d.pattern.paint.repeatx.outside.js", "2d.pattern.paint.repeaty.basic.js", "2d.pattern.paint.repeaty.coord1.js", "2d.pattern.paint.repeaty.outside.js", "2d.pattern.repeat.case.js", "2d.pattern.repeat.empty.js", "2d.pattern.repeat.null.js", "2d.pattern.repeat.nullsuffix.js", "2d.pattern.repeat.undefined.js", "2d.pattern.repeat.unrecognised.js", "2d.scaled.js", "2d.shadow.alpha.1.js", "2d.shadow.alpha.2.js", "2d.shadow.alpha.3.js", "2d.shadow.alpha.4.js", "2d.shadow.alpha.5.js", "2d.shadow.attributes.shadowBlur.initial.js", "2d.shadow.attributes.shadowBlur.invalid.js", "2d.shadow.attributes.shadowBlur.valid.js", "2d.shadow.attributes.shadowColor.initial.js", "2d.shadow.attributes.shadowColor.invalid.js", "2d.shadow.attributes.shadowColor.valid.js", "2d.shadow.attributes.shadowOffset.initial.js", "2d.shadow.attributes.shadowOffset.invalid.js", "2d.shadow.attributes.shadowOffset.valid.js", "2d.shadow.blur.high.js", "2d.shadow.blur.low.js", "2d.shadow.canvas.alpha.js", "2d.shadow.canvas.basic.js", "2d.shadow.canvas.transparent.1.js", "2d.shadow.canvas.transparent.2.js", "2d.shadow.clip.1.js", "2d.shadow.clip.2.js", "2d.shadow.clip.3.js", "2d.shadow.composite.1.js", "2d.shadow.composite.2.js", "2d.shadow.composite.3.js", "2d.shadow.enable.blur.js", "2d.shadow.enable.off.1.js", "2d.shadow.enable.off.2.js", "2d.shadow.enable.x.js", "2d.shadow.enable.y.js", "2d.shadow.gradient.alpha.js", "2d.shadow.gradient.basic.js", "2d.shadow.gradient.transparent.1.js", "2d.shadow.gradient.transparent.2.js", "2d.shadow.image.alpha.js", "2d.shadow.image.basic.js", "2d.shadow.image.scale.js", "2d.shadow.image.section.js", "2d.shadow.image.transparent.1.js", "2d.shadow.image.transparent.2.js", "2d.shadow.offset.negativeX.js", "2d.shadow.offset.negativeY.js", "2d.shadow.offset.positiveX.js", "2d.shadow.offset.positiveY.js", "2d.shadow.outside.js", "2d.shadow.pattern.alpha.js", "2d.shadow.pattern.basic.js", "2d.shadow.pattern.transparent.1.js", "2d.shadow.pattern.transparent.2.js", "2d.shadow.stroke.basic.js", "2d.shadow.stroke.cap.1.js", "2d.shadow.stroke.cap.2.js", "2d.shadow.stroke.join.1.js", "2d.shadow.stroke.join.2.js", "2d.shadow.stroke.join.3.js", "2d.shadow.transform.1.js", "2d.shadow.transform.2.js", "2d.state.saverestore.bitmap.js", "2d.state.saverestore.clip.js", "2d.state.saverestore.fillStyle.js", "2d.state.saverestore.font.js", "2d.state.saverestore.globalAlpha.js", "2d.state.saverestore.globalCompositeOperation.js", "2d.state.saverestore.lineCap.js", "2d.state.saverestore.lineJoin.js", "2d.state.saverestore.lineWidth.js", "2d.state.saverestore.miterLimit.js", "2d.state.saverestore.path.js", "2d.state.saverestore.shadowBlur.js", "2d.state.saverestore.shadowColor.js", "2d.state.saverestore.shadowOffsetX.js", "2d.state.saverestore.shadowOffsetY.js", "2d.state.saverestore.stack.js", "2d.state.saverestore.stackdepth.js", "2d.state.saverestore.strokeStyle.js", "2d.state.saverestore.textAlign.js", "2d.state.saverestore.textBaseline.js", "2d.state.saverestore.transformation.js", "2d.state.saverestore.underflow.js", "2d.strokeRect.basic.js", "2d.strokeRect.clip.js", "2d.strokeRect.globalalpha.js", "2d.strokeRect.globalcomposite.js", "2d.strokeRect.negative.js", "2d.strokeRect.nonfinite.js", "2d.strokeRect.path.js", "2d.strokeRect.shadow.js", "2d.strokeRect.transform.js", "2d.strokeRect.zero.1.js", "2d.strokeRect.zero.2.js", "2d.strokeRect.zero.3.js", "2d.strokeRect.zero.4.js", "2d.strokeRect.zero.5.js", "2d.strokeStyle.default.js", "2d.text.align.default.js", "2d.text.align.invalid.js", "2d.text.align.valid.js", "2d.text.baseline.default.js", "2d.text.baseline.invalid.js", "2d.text.baseline.valid.js", "2d.text.draw.align.center.js", "2d.text.draw.align.end.ltr.js", "2d.text.draw.align.end.rtl.js", "2d.text.draw.align.left.js", "2d.text.draw.align.right.js", "2d.text.draw.align.start.ltr.js", "2d.text.draw.align.start.rtl.js", "2d.text.draw.baseline.alphabetic.js", "2d.text.draw.baseline.bottom.js", "2d.text.draw.baseline.hanging.js", "2d.text.draw.baseline.ideographic.js", "2d.text.draw.baseline.middle.js", "2d.text.draw.baseline.top.js", "2d.text.draw.fill.basic.js", "2d.text.draw.fill.maxWidth.bound.js", "2d.text.draw.fill.maxWidth.fontface.js", "2d.text.draw.fill.maxWidth.large.js", "2d.text.draw.fill.maxWidth.small.js", "2d.text.draw.fill.maxWidth.zero.js", "2d.text.draw.fill.rtl.js", "2d.text.draw.fill.unaffected.js", "2d.text.draw.fontface.js", "2d.text.draw.fontface.notinpage.js", "2d.text.draw.fontface.repeat.js", "2d.text.draw.kern.consistent.js", "2d.text.draw.space.basic.js", "2d.text.draw.space.collapse.end.js", "2d.text.draw.space.collapse.nonspace.js", "2d.text.draw.space.collapse.other.js", "2d.text.draw.space.collapse.space.js", "2d.text.draw.space.collapse.start.js", "2d.text.draw.stroke.basic.js", "2d.text.draw.stroke.unaffected.js", "2d.text.font.default.js", "2d.text.font.parse.basic.js", "2d.text.font.parse.complex.js", "2d.text.font.parse.invalid.js", "2d.text.font.parse.size.percentage.default.js", "2d.text.font.parse.size.percentage.js", "2d.text.font.parse.system.js", "2d.text.measure.width.basic.js", "2d.text.measure.width.empty.js", "2d.text.measure.width.space.js", "2d.transformation.order.js", "2d.transformation.rotate.direction.js", "2d.transformation.rotate.nonfinite.js", "2d.transformation.rotate.radians.js", "2d.transformation.rotate.wrap.js", "2d.transformation.rotate.wrapnegative.js", "2d.transformation.rotate.zero.js", "2d.transformation.scale.basic.js", "2d.transformation.scale.large.js", "2d.transformation.scale.multiple.js", "2d.transformation.scale.negative.js", "2d.transformation.scale.nonfinite.js", "2d.transformation.scale.zero.js", "2d.transformation.setTransform.multiple.js", "2d.transformation.setTransform.nonfinite.js", "2d.transformation.setTransform.skewed.js", "2d.transformation.transform.identity.js", "2d.transformation.transform.multiply.js", "2d.transformation.transform.nonfinite.js", "2d.transformation.transform.skewed.js", "2d.transformation.translate.basic.js", "2d.transformation.translate.nonfinite.js", "2d.voidreturn.js", "context.casesensitive.js", "context.emptystring.js", "context.unrecognised.badname.js", "context.unrecognised.badsuffix.js", "context.unrecognised.nullsuffix.js", "context.unrecognised.unicode.js", "fallback.basic.js", "fallback.multiple.js", "fallback.nested.js", "framed.2d.canvas.readonly.js", "framed.2d.canvas.reference.js", "framed.2d.clearRect.basic.js", "framed.2d.clearRect.clip.js", "framed.2d.clearRect.globalalpha.js", "framed.2d.clearRect.globalcomposite.js", "framed.2d.clearRect.negative.js", "framed.2d.clearRect.nonfinite.js", "framed.2d.clearRect.path.js", "framed.2d.clearRect.shadow.js", "framed.2d.clearRect.transform.js", "framed.2d.clearRect.zero.js", "framed.2d.composite.canvas.copy.js", "framed.2d.composite.canvas.destination-atop.js", "framed.2d.composite.canvas.destination-in.js", "framed.2d.composite.canvas.destination-out.js", "framed.2d.composite.canvas.destination-over.js", "framed.2d.composite.canvas.lighter.js", "framed.2d.composite.canvas.source-atop.js", "framed.2d.composite.canvas.source-in.js", "framed.2d.composite.canvas.source-out.js", "framed.2d.composite.canvas.source-over.js", "framed.2d.composite.canvas.xor.js", "framed.2d.composite.clip.copy.js", "framed.2d.composite.clip.destination-atop.js", "framed.2d.composite.clip.destination-in.js", "framed.2d.composite.clip.destination-out.js", "framed.2d.composite.clip.destination-over.js", "framed.2d.composite.clip.lighter.js", "framed.2d.composite.clip.source-atop.js", "framed.2d.composite.clip.source-in.js", "framed.2d.composite.clip.source-out.js", "framed.2d.composite.clip.source-over.js", "framed.2d.composite.clip.xor.js", "framed.2d.composite.globalAlpha.canvas.js", "framed.2d.composite.globalAlpha.canvaspattern.js", "framed.2d.composite.globalAlpha.default.js", "framed.2d.composite.globalAlpha.fill.js", "framed.2d.composite.globalAlpha.image.js", "framed.2d.composite.globalAlpha.imagepattern.js", "framed.2d.composite.globalAlpha.invalid.js", "framed.2d.composite.globalAlpha.range.js", "framed.2d.composite.image.copy.js", "framed.2d.composite.image.destination-atop.js", "framed.2d.composite.image.destination-in.js", "framed.2d.composite.image.destination-out.js", "framed.2d.composite.image.destination-over.js", "framed.2d.composite.image.lighter.js", "framed.2d.composite.image.source-atop.js", "framed.2d.composite.image.source-in.js", "framed.2d.composite.image.source-out.js", "framed.2d.composite.image.source-over.js", "framed.2d.composite.image.xor.js", "framed.2d.composite.operation.casesensitive.js", "framed.2d.composite.operation.clear.js", "framed.2d.composite.operation.darker.js", "framed.2d.composite.operation.default.js", "framed.2d.composite.operation.get.js", "framed.2d.composite.operation.highlight.js", "framed.2d.composite.operation.nullsuffix.js", "framed.2d.composite.operation.over.js", "framed.2d.composite.operation.unrecognised.js", "framed.2d.composite.solid.copy.js", "framed.2d.composite.solid.destination-atop.js", "framed.2d.composite.solid.destination-in.js", "framed.2d.composite.solid.destination-out.js", "framed.2d.composite.solid.destination-over.js", "framed.2d.composite.solid.lighter.js", "framed.2d.composite.solid.source-atop.js", "framed.2d.composite.solid.source-in.js", "framed.2d.composite.solid.source-out.js", "framed.2d.composite.solid.source-over.js", "framed.2d.composite.solid.xor.js", "framed.2d.composite.transparent.copy.js", "framed.2d.composite.transparent.destination-atop.js", "framed.2d.composite.transparent.destination-in.js", "framed.2d.composite.transparent.destination-out.js", "framed.2d.composite.transparent.destination-over.js", "framed.2d.composite.transparent.lighter.js", "framed.2d.composite.transparent.source-atop.js", "framed.2d.composite.transparent.source-in.js", "framed.2d.composite.transparent.source-out.js", "framed.2d.composite.transparent.source-over.js", "framed.2d.composite.transparent.xor.js", "framed.2d.composite.uncovered.fill.copy.js", "framed.2d.composite.uncovered.fill.destination-atop.js", "framed.2d.composite.uncovered.fill.destination-in.js", "framed.2d.composite.uncovered.fill.source-in.js", "framed.2d.composite.uncovered.fill.source-out.js", "framed.2d.composite.uncovered.image.copy.js", "framed.2d.composite.uncovered.image.destination-atop.js", "framed.2d.composite.uncovered.image.destination-in.js", "framed.2d.composite.uncovered.image.source-in.js", "framed.2d.composite.uncovered.image.source-out.js", "framed.2d.composite.uncovered.nocontext.copy.js", "framed.2d.composite.uncovered.nocontext.destination-atop.js", "framed.2d.composite.uncovered.nocontext.destination-in.js", "framed.2d.composite.uncovered.nocontext.source-in.js", "framed.2d.composite.uncovered.nocontext.source-out.js", "framed.2d.composite.uncovered.pattern.copy.js", "framed.2d.composite.uncovered.pattern.destination-atop.js", "framed.2d.composite.uncovered.pattern.destination-in.js", "framed.2d.composite.uncovered.pattern.source-in.js", "framed.2d.composite.uncovered.pattern.source-out.js", "framed.2d.coordinatespace.js", "framed.2d.drawImage.3arg.js", "framed.2d.drawImage.5arg.js", "framed.2d.drawImage.9arg.basic.js", "framed.2d.drawImage.9arg.destpos.js", "framed.2d.drawImage.9arg.destsize.js", "framed.2d.drawImage.9arg.sourcepos.js", "framed.2d.drawImage.9arg.sourcesize.js", "framed.2d.drawImage.alpha.js", "framed.2d.drawImage.animated.apng.js", "framed.2d.drawImage.animated.gif.js", "framed.2d.drawImage.animated.poster.js", "framed.2d.drawImage.broken.js", "framed.2d.drawImage.canvas.js", "framed.2d.drawImage.clip.js", "framed.2d.drawImage.composite.js", "framed.2d.drawImage.floatsource.js", "framed.2d.drawImage.incomplete.js", "framed.2d.drawImage.negativedest.js", "framed.2d.drawImage.negativedir.js", "framed.2d.drawImage.negativesource.js", "framed.2d.drawImage.nonfinite.js", "framed.2d.drawImage.nowrap.js", "framed.2d.drawImage.null.js", "framed.2d.drawImage.outsidesource.js", "framed.2d.drawImage.path.js", "framed.2d.drawImage.self.1.js", "framed.2d.drawImage.self.2.js", "framed.2d.drawImage.transform.js", "framed.2d.drawImage.wrongtype.js", "framed.2d.drawImage.zerocanvas.js", "framed.2d.drawImage.zerosource.js", "framed.2d.fillRect.basic.js", "framed.2d.fillRect.clip.js", "framed.2d.fillRect.negative.js", "framed.2d.fillRect.nonfinite.js", "framed.2d.fillRect.path.js", "framed.2d.fillRect.shadow.js", "framed.2d.fillRect.transform.js", "framed.2d.fillRect.zero.js", "framed.2d.fillStyle.default.js", "framed.2d.fillStyle.get.semitransparent.js", "framed.2d.fillStyle.get.solid.js", "framed.2d.fillStyle.get.transparent.js", "framed.2d.fillStyle.invalidstring.js", "framed.2d.fillStyle.invalidtype.js", "framed.2d.fillStyle.parse.current.basic.js", "framed.2d.fillStyle.parse.current.changed.js", "framed.2d.fillStyle.parse.current.removed.js", "framed.2d.fillStyle.parse.hex3.js", "framed.2d.fillStyle.parse.hex6.js", "framed.2d.fillStyle.parse.hsl-1.js", "framed.2d.fillStyle.parse.hsl-2.js", "framed.2d.fillStyle.parse.hsl-3.js", "framed.2d.fillStyle.parse.hsl-4.js", "framed.2d.fillStyle.parse.hsl-5.js", "framed.2d.fillStyle.parse.hsl-clamp-1.js", "framed.2d.fillStyle.parse.hsl-clamp-2.js", "framed.2d.fillStyle.parse.hsl-clamp-3.js", "framed.2d.fillStyle.parse.hsl-clamp-4.js", "framed.2d.fillStyle.parse.hsla-1.js", "framed.2d.fillStyle.parse.hsla-2.js", "framed.2d.fillStyle.parse.hsla-clamp-1.js", "framed.2d.fillStyle.parse.hsla-clamp-2.js", "framed.2d.fillStyle.parse.hsla-clamp-3.js", "framed.2d.fillStyle.parse.hsla-clamp-4.js", "framed.2d.fillStyle.parse.hsla-clamp-5.js", "framed.2d.fillStyle.parse.hsla-clamp-6.js", "framed.2d.fillStyle.parse.html4.js", "framed.2d.fillStyle.parse.invalid.hex1.js", "framed.2d.fillStyle.parse.invalid.hex2.js", "framed.2d.fillStyle.parse.invalid.hex3.js", "framed.2d.fillStyle.parse.invalid.hex4.js", "framed.2d.fillStyle.parse.invalid.hex5.js", "framed.2d.fillStyle.parse.invalid.hex6.js", "framed.2d.fillStyle.parse.invalid.hex7.js", "framed.2d.fillStyle.parse.invalid.hex8.js", "framed.2d.fillStyle.parse.invalid.hsl-1.js", "framed.2d.fillStyle.parse.invalid.hsl-2.js", "framed.2d.fillStyle.parse.invalid.hsl-3.js", "framed.2d.fillStyle.parse.invalid.hsl-4.js", "framed.2d.fillStyle.parse.invalid.hsl-5.js", "framed.2d.fillStyle.parse.invalid.hsla-1.js", "framed.2d.fillStyle.parse.invalid.hsla-2.js", "framed.2d.fillStyle.parse.invalid.name-1.js", "framed.2d.fillStyle.parse.invalid.name-2.js", "framed.2d.fillStyle.parse.invalid.name-3.js", "framed.2d.fillStyle.parse.invalid.rgb-1.js", "framed.2d.fillStyle.parse.invalid.rgb-2.js", "framed.2d.fillStyle.parse.invalid.rgb-3.js", "framed.2d.fillStyle.parse.invalid.rgb-4.js", "framed.2d.fillStyle.parse.invalid.rgb-5.js", "framed.2d.fillStyle.parse.invalid.rgb-6.js", "framed.2d.fillStyle.parse.invalid.rgb-7.js", "framed.2d.fillStyle.parse.invalid.rgba-1.js", "framed.2d.fillStyle.parse.invalid.rgba-2.js", "framed.2d.fillStyle.parse.invalid.rgba-3.js", "framed.2d.fillStyle.parse.invalid.rgba-4.js", "framed.2d.fillStyle.parse.invalid.rgba-5.js", "framed.2d.fillStyle.parse.rgb-clamp-1.js", "framed.2d.fillStyle.parse.rgb-clamp-2.js", "framed.2d.fillStyle.parse.rgb-clamp-3.js", "framed.2d.fillStyle.parse.rgb-clamp-4.js", "framed.2d.fillStyle.parse.rgb-clamp-5.js", "framed.2d.fillStyle.parse.rgb-num.js", "framed.2d.fillStyle.parse.rgb-percent.js", "framed.2d.fillStyle.parse.rgba-clamp-1.js", "framed.2d.fillStyle.parse.rgba-clamp-2.js", "framed.2d.fillStyle.parse.rgba-num-1.js", "framed.2d.fillStyle.parse.rgba-num-2.js", "framed.2d.fillStyle.parse.rgba-percent.js", "framed.2d.fillStyle.parse.rgba-solid-1.js", "framed.2d.fillStyle.parse.rgba-solid-2.js", "framed.2d.fillStyle.parse.svg-1.js", "framed.2d.fillStyle.parse.svg-2.js", "framed.2d.fillStyle.parse.system.js", "framed.2d.fillStyle.parse.transparent-1.js", "framed.2d.fillStyle.parse.transparent-2.js", "framed.2d.getcontext.exists.js", "framed.2d.getcontext.shared.js", "framed.2d.getcontext.unique.js", "framed.2d.gradient.empty.js", "framed.2d.gradient.interpolate.alpha.js", "framed.2d.gradient.interpolate.colour.js", "framed.2d.gradient.interpolate.colouralpha.js", "framed.2d.gradient.interpolate.multiple.js", "framed.2d.gradient.interpolate.outside.js", "framed.2d.gradient.interpolate.overlap.js", "framed.2d.gradient.interpolate.overlap2.js", "framed.2d.gradient.interpolate.solid.js", "framed.2d.gradient.interpolate.vertical.js", "framed.2d.gradient.interpolate.zerosize.js", "framed.2d.gradient.linear.nonfinite.js", "framed.2d.gradient.linear.transform.1.js", "framed.2d.gradient.linear.transform.2.js", "framed.2d.gradient.linear.transform.3.js", "framed.2d.gradient.object.compare.js", "framed.2d.gradient.object.crosscanvas.js", "framed.2d.gradient.object.invalidcolour.js", "framed.2d.gradient.object.invalidoffset.js", "framed.2d.gradient.object.return.js", "framed.2d.gradient.object.update.js", "framed.2d.gradient.radial.cone.behind.js", "framed.2d.gradient.radial.cone.beside.js", "framed.2d.gradient.radial.cone.bottom.js", "framed.2d.gradient.radial.cone.cylinder.js", "framed.2d.gradient.radial.cone.front.js", "framed.2d.gradient.radial.cone.shape1.js", "framed.2d.gradient.radial.cone.shape2.js", "framed.2d.gradient.radial.cone.top.js", "framed.2d.gradient.radial.equal.js", "framed.2d.gradient.radial.inside1.js", "framed.2d.gradient.radial.inside2.js", "framed.2d.gradient.radial.inside3.js", "framed.2d.gradient.radial.negative.js", "framed.2d.gradient.radial.nonfinite.js", "framed.2d.gradient.radial.outside1.js", "framed.2d.gradient.radial.outside2.js", "framed.2d.gradient.radial.outside3.js", "framed.2d.gradient.radial.touch1.js", "framed.2d.gradient.radial.touch2.js", "framed.2d.gradient.radial.touch3.js", "framed.2d.gradient.radial.transform.1.js", "framed.2d.gradient.radial.transform.2.js", "framed.2d.gradient.radial.transform.3.js", "framed.2d.imageData.create1.basic.js", "framed.2d.imageData.create1.initial.js", "framed.2d.imageData.create1.type.js", "framed.2d.imageData.create1.zero.js", "framed.2d.imageData.create2.basic.js", "framed.2d.imageData.create2.initial.js", "framed.2d.imageData.create2.large.js", "framed.2d.imageData.create2.negative.js", "framed.2d.imageData.create2.nonfinite.js", "framed.2d.imageData.create2.round.js", "framed.2d.imageData.create2.tiny.js", "framed.2d.imageData.create2.type.js", "framed.2d.imageData.create2.zero.js", "framed.2d.imageData.get.basic.js", "framed.2d.imageData.get.clamp.js", "framed.2d.imageData.get.length.js", "framed.2d.imageData.get.nonfinite.js", "framed.2d.imageData.get.nonpremul.js", "framed.2d.imageData.get.order.alpha.js", "framed.2d.imageData.get.order.cols.js", "framed.2d.imageData.get.order.rgb.js", "framed.2d.imageData.get.order.rows.js", "framed.2d.imageData.get.range.js", "framed.2d.imageData.get.source.negative.js", "framed.2d.imageData.get.source.outside.js", "framed.2d.imageData.get.source.size.js", "framed.2d.imageData.get.tiny.js", "framed.2d.imageData.get.type.js", "framed.2d.imageData.get.unaffected.js", "framed.2d.imageData.get.zero.js", "framed.2d.imageData.object.ctor.js", "framed.2d.imageData.object.nan.js", "framed.2d.imageData.object.properties.js", "framed.2d.imageData.object.readonly.js", "framed.2d.imageData.object.round.js", "framed.2d.imageData.object.set.js", "framed.2d.imageData.object.string.js", "framed.2d.imageData.object.undefined.js", "framed.2d.imageData.object.wrap.js", "framed.2d.imageData.put.alpha.js", "framed.2d.imageData.put.basic.js", "framed.2d.imageData.put.clip.js", "framed.2d.imageData.put.created.js", "framed.2d.imageData.put.cross.js", "framed.2d.imageData.put.dirty.negative.js", "framed.2d.imageData.put.dirty.outside.js", "framed.2d.imageData.put.dirty.rect1.js", "framed.2d.imageData.put.dirty.rect2.js", "framed.2d.imageData.put.dirty.zero.js", "framed.2d.imageData.put.modified.js", "framed.2d.imageData.put.nonfinite.js", "framed.2d.imageData.put.null.js", "framed.2d.imageData.put.path.js", "framed.2d.imageData.put.unaffected.js", "framed.2d.imageData.put.unchanged.js", "framed.2d.imageData.put.wrongtype.js", "framed.2d.line.cap.butt.js", "framed.2d.line.cap.closed.js", "framed.2d.line.cap.invalid.js", "framed.2d.line.cap.open.js", "framed.2d.line.cap.round.js", "framed.2d.line.cap.square.js", "framed.2d.line.cap.valid.js", "framed.2d.line.cross.js", "framed.2d.line.defaults.js", "framed.2d.line.join.bevel.js", "framed.2d.line.join.closed.js", "framed.2d.line.join.invalid.js", "framed.2d.line.join.miter.js", "framed.2d.line.join.open.js", "framed.2d.line.join.parallel.js", "framed.2d.line.join.round.js", "framed.2d.line.join.valid.js", "framed.2d.line.miter.acute.js", "framed.2d.line.miter.exceeded.js", "framed.2d.line.miter.invalid.js", "framed.2d.line.miter.lineedge.js", "framed.2d.line.miter.obtuse.js", "framed.2d.line.miter.rightangle.js", "framed.2d.line.miter.valid.js", "framed.2d.line.miter.within.js", "framed.2d.line.union.js", "framed.2d.line.width.basic.js", "framed.2d.line.width.invalid.js", "framed.2d.line.width.scaledefault.js", "framed.2d.line.width.transformed.js", "framed.2d.line.width.valid.js", "framed.2d.missingargs.js", "framed.2d.path.arc.angle.1.js", "framed.2d.path.arc.angle.2.js", "framed.2d.path.arc.angle.3.js", "framed.2d.path.arc.angle.4.js", "framed.2d.path.arc.angle.5.js", "framed.2d.path.arc.angle.6.js", "framed.2d.path.arc.empty.js", "framed.2d.path.arc.end.js", "framed.2d.path.arc.negative.js", "framed.2d.path.arc.nonempty.js", "framed.2d.path.arc.nonfinite.js", "framed.2d.path.arc.scale.1.js", "framed.2d.path.arc.scale.2.js", "framed.2d.path.arc.selfintersect.1.js", "framed.2d.path.arc.selfintersect.2.js", "framed.2d.path.arc.shape.1.js", "framed.2d.path.arc.shape.2.js", "framed.2d.path.arc.shape.3.js", "framed.2d.path.arc.shape.4.js", "framed.2d.path.arc.shape.5.js", "framed.2d.path.arc.twopie.1.js", "framed.2d.path.arc.twopie.2.js", "framed.2d.path.arc.twopie.3.js", "framed.2d.path.arc.twopie.4.js", "framed.2d.path.arc.zeroradius.js", "framed.2d.path.arcTo.coincide.1.js", "framed.2d.path.arcTo.collinear.2.js", "framed.2d.path.arcTo.negative.js", "framed.2d.path.arcTo.nonfinite.js", "framed.2d.path.arcTo.scale.js", "framed.2d.path.arcTo.shape.curve1.js", "framed.2d.path.arcTo.shape.curve2.js", "framed.2d.path.arcTo.shape.end.js", "framed.2d.path.arcTo.shape.start.js", "framed.2d.path.arcTo.transformation.js", "framed.2d.path.arcTo.zero.1.js", "framed.2d.path.arcTo.zero.2.js", "framed.2d.path.beginPath.js", "framed.2d.path.bezierCurveTo.basic.js", "framed.2d.path.bezierCurveTo.ensuresubpath.1.js", "framed.2d.path.bezierCurveTo.ensuresubpath.2.js", "framed.2d.path.bezierCurveTo.nonfinite.js", "framed.2d.path.bezierCurveTo.scaled.js", "framed.2d.path.bezierCurveTo.shape.js", "framed.2d.path.clip.basic.1.js", "framed.2d.path.clip.basic.2.js", "framed.2d.path.clip.empty.js", "framed.2d.path.clip.intersect.js", "framed.2d.path.clip.unaffected.js", "framed.2d.path.clip.winding.1.js", "framed.2d.path.clip.winding.2.js", "framed.2d.path.closePath.empty.js", "framed.2d.path.closePath.newline.js", "framed.2d.path.closePath.nextpoint.js", "framed.2d.path.fill.closed.basic.js", "framed.2d.path.fill.closed.unaffected.js", "framed.2d.path.fill.overlap.js", "framed.2d.path.fill.winding.add.js", "framed.2d.path.fill.winding.subtract.1.js", "framed.2d.path.fill.winding.subtract.2.js", "framed.2d.path.fill.winding.subtract.3.js", "framed.2d.path.initial.js", "framed.2d.path.isPointInPath.arc.js", "framed.2d.path.isPointInPath.basic.1.js", "framed.2d.path.isPointInPath.basic.2.js", "framed.2d.path.isPointInPath.bezier.js", "framed.2d.path.isPointInPath.bigarc.js", "framed.2d.path.isPointInPath.edge.js", "framed.2d.path.isPointInPath.empty.js", "framed.2d.path.isPointInPath.nonfinite.js", "framed.2d.path.isPointInPath.outside.js", "framed.2d.path.isPointInPath.subpath.js", "framed.2d.path.isPointInPath.transform.1.js", "framed.2d.path.isPointInPath.transform.2.js", "framed.2d.path.isPointInPath.transform.3.js", "framed.2d.path.isPointInPath.unclosed.js", "framed.2d.path.isPointInPath.winding.js", "framed.2d.path.lineTo.basic.js", "framed.2d.path.lineTo.ensuresubpath.1.js", "framed.2d.path.lineTo.ensuresubpath.2.js", "framed.2d.path.lineTo.nextpoint.js", "framed.2d.path.lineTo.nonfinite.js", "framed.2d.path.moveTo.basic.js", "framed.2d.path.moveTo.multiple.js", "framed.2d.path.moveTo.newsubpath.js", "framed.2d.path.moveTo.nonfinite.js", "framed.2d.path.quadraticCurveTo.basic.js", "framed.2d.path.quadraticCurveTo.ensuresubpath.1.js", "framed.2d.path.quadraticCurveTo.ensuresubpath.2.js", "framed.2d.path.quadraticCurveTo.nonfinite.js", "framed.2d.path.quadraticCurveTo.scaled.js", "framed.2d.path.quadraticCurveTo.shape.js", "framed.2d.path.rect.basic.js", "framed.2d.path.rect.closed.js", "framed.2d.path.rect.end.1.js", "framed.2d.path.rect.end.2.js", "framed.2d.path.rect.negative.js", "framed.2d.path.rect.newsubpath.js", "framed.2d.path.rect.nonfinite.js", "framed.2d.path.rect.selfintersect.js", "framed.2d.path.rect.winding.js", "framed.2d.path.rect.zero.1.js", "framed.2d.path.rect.zero.2.js", "framed.2d.path.rect.zero.3.js", "framed.2d.path.rect.zero.4.js", "framed.2d.path.rect.zero.5.js", "framed.2d.path.rect.zero.6.js", "framed.2d.path.stroke.empty.js", "framed.2d.path.stroke.overlap.js", "framed.2d.path.stroke.prune.arc.js", "framed.2d.path.stroke.prune.closed.js", "framed.2d.path.stroke.prune.corner.js", "framed.2d.path.stroke.prune.curve.js", "framed.2d.path.stroke.prune.line.js", "framed.2d.path.stroke.prune.rect.js", "framed.2d.path.stroke.scale1.js", "framed.2d.path.stroke.scale2.js", "framed.2d.path.stroke.skew.js", "framed.2d.path.stroke.unaffected.js", "framed.2d.path.stroke.union.js", "framed.2d.path.transformation.basic.js", "framed.2d.path.transformation.changing.js", "framed.2d.path.transformation.multiple.js", "framed.2d.pattern.animated.gif.js", "framed.2d.pattern.basic.canvas.js", "framed.2d.pattern.basic.image.js", "framed.2d.pattern.basic.nocontext.js", "framed.2d.pattern.basic.type.js", "framed.2d.pattern.basic.zerocanvas.js", "framed.2d.pattern.crosscanvas.js", "framed.2d.pattern.image.broken.js", "framed.2d.pattern.image.incomplete.js", "framed.2d.pattern.image.null.js", "framed.2d.pattern.image.string.js", "framed.2d.pattern.image.undefined.js", "framed.2d.pattern.modify.canvas1.js", "framed.2d.pattern.modify.canvas2.js", "framed.2d.pattern.modify.image1.js", "framed.2d.pattern.modify.image2.js", "framed.2d.pattern.paint.norepeat.basic.js", "framed.2d.pattern.paint.norepeat.coord1.js", "framed.2d.pattern.paint.norepeat.coord2.js", "framed.2d.pattern.paint.norepeat.coord3.js", "framed.2d.pattern.paint.norepeat.outside.js", "framed.2d.pattern.paint.orientation.canvas.js", "framed.2d.pattern.paint.orientation.image.js", "framed.2d.pattern.paint.repeat.basic.js", "framed.2d.pattern.paint.repeat.coord1.js", "framed.2d.pattern.paint.repeat.coord2.js", "framed.2d.pattern.paint.repeat.coord3.js", "framed.2d.pattern.paint.repeat.outside.js", "framed.2d.pattern.paint.repeatx.basic.js", "framed.2d.pattern.paint.repeatx.coord1.js", "framed.2d.pattern.paint.repeatx.outside.js", "framed.2d.pattern.paint.repeaty.basic.js", "framed.2d.pattern.paint.repeaty.coord1.js", "framed.2d.pattern.paint.repeaty.outside.js", "framed.2d.pattern.repeat.case.js", "framed.2d.pattern.repeat.empty.js", "framed.2d.pattern.repeat.null.js", "framed.2d.pattern.repeat.nullsuffix.js", "framed.2d.pattern.repeat.undefined.js", "framed.2d.pattern.repeat.unrecognised.js", "framed.2d.scaled.js", "framed.2d.shadow.alpha.1.js", "framed.2d.shadow.alpha.2.js", "framed.2d.shadow.alpha.3.js", "framed.2d.shadow.alpha.4.js", "framed.2d.shadow.alpha.5.js", "framed.2d.shadow.attributes.shadowBlur.initial.js", "framed.2d.shadow.attributes.shadowBlur.invalid.js", "framed.2d.shadow.attributes.shadowBlur.valid.js", "framed.2d.shadow.attributes.shadowColor.initial.js", "framed.2d.shadow.attributes.shadowColor.invalid.js", "framed.2d.shadow.attributes.shadowColor.valid.js", "framed.2d.shadow.attributes.shadowOffset.initial.js", "framed.2d.shadow.attributes.shadowOffset.invalid.js", "framed.2d.shadow.attributes.shadowOffset.valid.js", "framed.2d.shadow.blur.high.js", "framed.2d.shadow.blur.low.js", "framed.2d.shadow.canvas.alpha.js", "framed.2d.shadow.canvas.basic.js", "framed.2d.shadow.canvas.transparent.1.js", "framed.2d.shadow.canvas.transparent.2.js", "framed.2d.shadow.clip.1.js", "framed.2d.shadow.clip.2.js", "framed.2d.shadow.clip.3.js", "framed.2d.shadow.composite.1.js", "framed.2d.shadow.composite.2.js", "framed.2d.shadow.composite.3.js", "framed.2d.shadow.enable.blur.js", "framed.2d.shadow.enable.off.1.js", "framed.2d.shadow.enable.off.2.js", "framed.2d.shadow.enable.x.js", "framed.2d.shadow.enable.y.js", "framed.2d.shadow.gradient.alpha.js", "framed.2d.shadow.gradient.basic.js", "framed.2d.shadow.gradient.transparent.1.js", "framed.2d.shadow.gradient.transparent.2.js", "framed.2d.shadow.image.alpha.js", "framed.2d.shadow.image.basic.js", "framed.2d.shadow.image.scale.js", "framed.2d.shadow.image.section.js", "framed.2d.shadow.image.transparent.1.js", "framed.2d.shadow.image.transparent.2.js", "framed.2d.shadow.offset.negativeX.js", "framed.2d.shadow.offset.negativeY.js", "framed.2d.shadow.offset.positiveX.js", "framed.2d.shadow.offset.positiveY.js", "framed.2d.shadow.outside.js", "framed.2d.shadow.pattern.alpha.js", "framed.2d.shadow.pattern.basic.js", "framed.2d.shadow.pattern.transparent.1.js", "framed.2d.shadow.pattern.transparent.2.js", "framed.2d.shadow.stroke.basic.js", "framed.2d.shadow.stroke.cap.1.js", "framed.2d.shadow.stroke.cap.2.js", "framed.2d.shadow.stroke.join.1.js", "framed.2d.shadow.stroke.join.2.js", "framed.2d.shadow.stroke.join.3.js", "framed.2d.shadow.transform.1.js", "framed.2d.shadow.transform.2.js", "framed.2d.state.saverestore.bitmap.js", "framed.2d.state.saverestore.clip.js", "framed.2d.state.saverestore.fillStyle.js", "framed.2d.state.saverestore.font.js", "framed.2d.state.saverestore.globalAlpha.js", "framed.2d.state.saverestore.globalCompositeOperation.js", "framed.2d.state.saverestore.lineCap.js", "framed.2d.state.saverestore.lineJoin.js", "framed.2d.state.saverestore.lineWidth.js", "framed.2d.state.saverestore.miterLimit.js", "framed.2d.state.saverestore.path.js", "framed.2d.state.saverestore.shadowBlur.js", "framed.2d.state.saverestore.shadowColor.js", "framed.2d.state.saverestore.shadowOffsetX.js", "framed.2d.state.saverestore.shadowOffsetY.js", "framed.2d.state.saverestore.stack.js", "framed.2d.state.saverestore.stackdepth.js", "framed.2d.state.saverestore.strokeStyle.js", "framed.2d.state.saverestore.textAlign.js", "framed.2d.state.saverestore.textBaseline.js", "framed.2d.state.saverestore.transformation.js", "framed.2d.state.saverestore.underflow.js", "framed.2d.strokeRect.basic.js", "framed.2d.strokeRect.clip.js", "framed.2d.strokeRect.globalalpha.js", "framed.2d.strokeRect.globalcomposite.js", "framed.2d.strokeRect.negative.js", "framed.2d.strokeRect.nonfinite.js", "framed.2d.strokeRect.path.js", "framed.2d.strokeRect.shadow.js", "framed.2d.strokeRect.transform.js", "framed.2d.strokeRect.zero.1.js", "framed.2d.strokeRect.zero.2.js", "framed.2d.strokeRect.zero.3.js", "framed.2d.strokeRect.zero.4.js", "framed.2d.strokeRect.zero.5.js", "framed.2d.strokeStyle.default.js", "framed.2d.text.align.default.js", "framed.2d.text.align.invalid.js", "framed.2d.text.align.valid.js", "framed.2d.text.baseline.default.js", "framed.2d.text.baseline.invalid.js", "framed.2d.text.baseline.valid.js", "framed.2d.text.draw.align.center.js", "framed.2d.text.draw.align.end.ltr.js", "framed.2d.text.draw.align.end.rtl.js", "framed.2d.text.draw.align.left.js", "framed.2d.text.draw.align.right.js", "framed.2d.text.draw.align.start.ltr.js", "framed.2d.text.draw.align.start.rtl.js", "framed.2d.text.draw.baseline.alphabetic.js", "framed.2d.text.draw.baseline.bottom.js", "framed.2d.text.draw.baseline.hanging.js", "framed.2d.text.draw.baseline.ideographic.js", "framed.2d.text.draw.baseline.middle.js", "framed.2d.text.draw.baseline.top.js", "framed.2d.text.draw.fill.basic.js", "framed.2d.text.draw.fill.maxWidth.bound.js", "framed.2d.text.draw.fill.maxWidth.fontface.js", "framed.2d.text.draw.fill.maxWidth.large.js", "framed.2d.text.draw.fill.maxWidth.small.js", "framed.2d.text.draw.fill.maxWidth.zero.js", "framed.2d.text.draw.fill.rtl.js", "framed.2d.text.draw.fill.unaffected.js", "framed.2d.text.draw.fontface.js", "framed.2d.text.draw.fontface.notinpage.js", "framed.2d.text.draw.fontface.repeat.js", "framed.2d.text.draw.space.collapse.end.js", "framed.2d.text.draw.space.collapse.nonspace.js", "framed.2d.text.draw.space.collapse.other.js", "framed.2d.text.draw.space.collapse.space.js", "framed.2d.text.draw.space.collapse.start.js", "framed.2d.text.font.default.js", "framed.2d.text.font.parse.basic.js", "framed.2d.text.font.parse.complex.js", "framed.2d.text.font.parse.size.percentage.default.js", "framed.2d.text.font.parse.system.js", "framed.2d.transformation.order.js", "framed.2d.transformation.rotate.radians.js", "framed.2d.transformation.rotate.wrap.js", "framed.2d.transformation.rotate.wrapnegative.js", "framed.2d.transformation.rotate.zero.js", "framed.2d.transformation.scale.basic.js", "framed.2d.transformation.scale.large.js", "framed.2d.transformation.scale.multiple.js", "framed.2d.transformation.scale.negative.js", "framed.2d.transformation.scale.nonfinite.js", "framed.2d.transformation.scale.zero.js", "framed.2d.transformation.setTransform.multiple.js", "framed.2d.transformation.setTransform.nonfinite.js", "framed.2d.transformation.setTransform.skewed.js", "framed.2d.transformation.transform.identity.js", "framed.2d.transformation.transform.multiply.js", "framed.2d.transformation.transform.nonfinite.js", "framed.2d.transformation.transform.skewed.js", "framed.2d.transformation.translate.basic.js", "framed.2d.transformation.translate.nonfinite.js", "framed.2d.voidreturn.js", "framed.context.casesensitive.js", "framed.context.emptystring.js", "framed.context.unrecognised.badname.js", "framed.context.unrecognised.badsuffix.js", "framed.context.unrecognised.nullsuffix.js", "framed.context.unrecognised.unicode.js", "framed.fallback.multiple.js", "framed.fallback.nested.js", "framed.initial.colour.js", "framed.initial.reset.2dstate.js", "framed.initial.reset.clip.js", "framed.initial.reset.different.js", "framed.initial.reset.gradient.js", "framed.initial.reset.path.js", "framed.initial.reset.pattern.js", "framed.initial.reset.same.js", "framed.initial.reset.transform.js", "framed.security.dataURI.js", "framed.security.drawImage.canvas.js", "framed.security.drawImage.image.js", "framed.security.pattern.canvas.fillStyle.js", "framed.security.pattern.canvas.strokeStyle.js", "framed.security.pattern.canvas.timing.js", "framed.security.pattern.create.js", "framed.security.pattern.image.fillStyle.js", "framed.security.pattern.image.strokeStyle.js", "framed.security.reset.js", "framed.size.attributes.default.js", "framed.size.attributes.get.js", "framed.size.attributes.idl.js", "framed.size.attributes.idl.set.zero.js", "framed.size.attributes.parse.decimal.js", "framed.size.attributes.parse.em.js", "framed.size.attributes.parse.empty.js", "framed.size.attributes.parse.exp.js", "framed.size.attributes.parse.hex.js", "framed.size.attributes.parse.junk.js", "framed.size.attributes.parse.octal.js", "framed.size.attributes.parse.onlyspace.js", "framed.size.attributes.parse.plus.js", "framed.size.attributes.parse.space.js", "framed.size.attributes.parse.whitespace.js", "framed.size.attributes.parse.zero.js", "framed.size.attributes.reflect.setcontent.js", "framed.size.attributes.reflect.setidlzero.js", "framed.size.attributes.removed.js", "framed.size.attributes.set.js", "framed.size.attributes.setAttribute.em.js", "framed.size.attributes.setAttribute.empty.js", "framed.size.attributes.setAttribute.exp.js", "framed.size.attributes.setAttribute.junk.js", "framed.size.attributes.setAttribute.minus.js", "framed.size.attributes.setAttribute.onlyspace.js", "framed.size.attributes.setAttribute.percent.js", "framed.size.attributes.setAttribute.space.js", "framed.size.attributes.setAttribute.trailingjunk.js", "framed.size.attributes.setAttribute.whitespace.js", "framed.size.attributes.style.js", "framed.toDataURL.arguments.1.js", "framed.toDataURL.arguments.2.js", "framed.toDataURL.arguments.3.js", "framed.toDataURL.bogustype.js", "framed.toDataURL.default.js", "framed.toDataURL.jpeg.alpha.js", "framed.toDataURL.jpeg.primarycolours.js", "framed.toDataURL.jpeg.quality.basic.js", "framed.toDataURL.jpeg.quality.notnumber.js", "framed.toDataURL.jpeg.quality.outsiderange.js", "framed.toDataURL.lowercase.unicode.js", "framed.toDataURL.nocontext.js", "framed.toDataURL.png.complexcolours.js", "framed.toDataURL.png.js", "framed.toDataURL.png.primarycolours.js", "framed.toDataURL.unrecognised.js", "framed.toDataURL.zerosize.js", "framed.type.delete.js", "framed.type.exists.js", "framed.type.extend.js", "framed.type.name.js", "framed.type.prototype.js", "framed.type.replace.js", "index.2d.canvas.js", "index.2d.clearRect.js", "index.2d.composite.canvas.js", "index.2d.composite.clip.js", "index.2d.composite.globalAlpha.js", "index.2d.composite.js", "index.2d.composite.image.js", "index.2d.composite.operation.js", "index.2d.composite.solid.js", "index.2d.composite.transparent.js", "index.2d.composite.uncovered.fill.js", "index.2d.composite.uncovered.js", "index.2d.composite.uncovered.image.js", "index.2d.composite.uncovered.nocontext.js", "index.2d.composite.uncovered.pattern.js", "index.2d.drawImage.9arg.js", "index.2d.drawImage.animated.js", "index.2d.drawImage.js", "index.2d.drawImage.self.js", "index.2d.fillRect.js", "index.2d.fillStyle.get.js", "index.2d.fillStyle.js", "index.2d.fillStyle.parse.current.js", "index.2d.fillStyle.parse.js", "index.2d.fillStyle.parse.invalid.js", "index.2d.getcontext.js", "index.2d.gradient.js", "index.2d.gradient.interpolate.js", "index.2d.gradient.linear.js", "index.2d.gradient.linear.transform.js", "index.2d.gradient.object.js", "index.2d.gradient.radial.cone.js", "index.2d.gradient.radial.js", "index.2d.gradient.radial.transform.js", "index.2d.js", "index.2d.imageData.create1.js", "index.2d.imageData.create2.js", "index.2d.imageData.get.js", "index.2d.imageData.get.order.js", "index.2d.imageData.get.source.js", "index.2d.imageData.js", "index.2d.imageData.object.js", "index.2d.imageData.put.dirty.js", "index.2d.imageData.put.js", "index.2d.line.join.js", "index.2d.line.miter.js", "index.2d.line.width.js", "index.2d.path.arc.angle.js", "index.2d.path.arc.js", "index.2d.path.arc.scale.js", "index.2d.path.arc.selfintersect.js", "index.2d.path.arc.shape.js", "index.2d.path.arc.twopie.js", "index.2d.path.arc.zero.js", "index.2d.path.arcTo.coincide.js", "index.2d.path.arcTo.collinear.js", "index.2d.path.arcTo.ensuresubpath.js", "index.2d.path.arcTo.js", "index.2d.path.arcTo.shape.js", "index.2d.path.arcTo.zero.js", "index.2d.path.bezierCurveTo.ensuresubpath.js", "index.2d.path.bezierCurveTo.js", "index.2d.path.clip.basic.js", "index.2d.path.clip.js", "index.2d.path.clip.winding.js", "index.2d.path.closePath.js", "index.2d.path.fill.closed.js", "index.2d.path.fill.js", "index.2d.path.fill.winding.js", "index.2d.path.fill.winding.subtract.js", "index.2d.path.js", "index.2d.path.isPointInPath.basic.js", "index.2d.path.isPointInPath.js", "index.2d.path.isPointInPath.transform.js", "index.2d.path.lineTo.ensuresubpath.js", "index.2d.path.lineTo.js", "index.2d.path.moveTo.js", "index.2d.path.quadraticCurveTo.ensuresubpath.js", "index.2d.path.quadraticCurveTo.js", "index.2d.path.rect.end.js", "index.2d.path.rect.js", "index.2d.path.rect.zero.js", "index.2d.path.stroke.js", "index.2d.path.stroke.prune.js", "index.2d.path.transformation.js", "index.2d.pattern.animated.js", "index.2d.pattern.basic.js", "index.2d.pattern.js", "index.2d.pattern.image.js", "index.2d.pattern.modify.js", "index.2d.pattern.paint.js", "index.2d.pattern.paint.norepeat.js", "index.2d.pattern.paint.orientation.js", "index.2d.pattern.paint.repeat.js", "index.2d.pattern.paint.repeatx.js", "index.2d.pattern.paint.repeaty.js", "index.2d.pattern.repeat.js", "index.2d.shadow.alpha.js", "index.2d.shadow.attributes.js", "index.2d.shadow.attributes.shadowBlur.js", "index.2d.shadow.attributes.shadowColor.js", "index.2d.shadow.attributes.shadowOffset.js", "index.2d.shadow.blur.js", "index.2d.shadow.canvas.js", "index.2d.shadow.canvas.transparent.js", "index.2d.shadow.clip.js", "index.2d.shadow.composite.js", "index.2d.shadow.enable.js", "index.2d.shadow.enable.off.js", "index.2d.shadow.gradient.js", "index.2d.shadow.gradient.transparent.js", "index.2d.shadow.js", "index.2d.shadow.image.js", "index.2d.shadow.image.transparent.js", "index.2d.shadow.offset.js", "index.2d.shadow.pattern.js", "index.2d.shadow.pattern.transparent.js", "index.2d.shadow.stroke.cap.js", "index.2d.shadow.stroke.js", "index.2d.shadow.stroke.join.js", "index.2d.shadow.transform.js", "index.2d.state.js", "index.2d.state.saverestore.js", "index.2d.strokeRect.js", "index.2d.strokeRect.zero.js", "index.2d.strokeStyle.js", "index.2d.text.align.js", "index.2d.text.baseline.js", "index.2d.text.draw.align.end.js", "index.2d.text.draw.align.js", "index.2d.text.draw.align.start.js", "index.2d.text.draw.baseline.js", "index.2d.text.draw.fill.js", "index.2d.text.draw.fill.maxWidth.js", "index.2d.text.draw.fontface.js", "index.2d.text.draw.js", "index.2d.text.draw.kern.js", "index.2d.text.draw.space.collapse.js", "index.2d.text.draw.stroke.js", "index.2d.text.font.js", "index.2d.text.font.parse.js", "index.2d.text.font.parse.size.js", "index.2d.text.font.parse.size.percentage.js", "index.2d.text.js", "index.2d.text.measure.js", "index.2d.text.measure.width.js", "index.2d.transformation.js", "index.2d.transformation.rotate.js", "index.2d.transformation.scale.js", "index.2d.transformation.setTransform.js", "index.2d.transformation.transform.js", "index.2d.transformation.translate.js", "index.all.js", "index.context.js", "index.context.unrecognised.js", "index.fallback.js", "index.js", "index.initial.js", "index.initial.reset.js", "index.security.drawImage.js", "index.security.js", "index.security.pattern.canvas.js", "index.security.pattern.js", "index.security.pattern.image.js", "index.size.attributes.js", "index.size.attributes.idl.set.js", "index.size.attributes.parse.js", "index.size.attributes.reflect.js", "index.size.attributes.setAttribute.js", "index.size.js", "index.toDataURL.arguments.js", "index.toDataURL.js", "index.toDataURL.jpeg.js", "index.toDataURL.jpeg.quality.js", "index.toDataURL.lowercase.js", "index.type.js", "initial.colour.js", "initial.reset.2dstate.js", "initial.reset.different.js", "initial.reset.gradient.js", "initial.reset.path.js", "initial.reset.pattern.js", "initial.reset.same.js", "initial.reset.transform.js", "minimal.2d.canvas.readonly.js", "minimal.2d.canvas.reference.js", "minimal.2d.clearRect.basic.js", "minimal.2d.clearRect.clip.js", "minimal.2d.clearRect.globalalpha.js", "minimal.2d.clearRect.globalcomposite.js", "minimal.2d.clearRect.negative.js", "minimal.2d.clearRect.nonfinite.js", "minimal.2d.clearRect.path.js", "minimal.2d.clearRect.shadow.js", "minimal.2d.clearRect.transform.js", "minimal.2d.clearRect.zero.js", "minimal.2d.composite.canvas.copy.js", "minimal.2d.composite.canvas.destination-atop.js", "minimal.2d.composite.canvas.destination-in.js", "minimal.2d.composite.canvas.destination-out.js", "minimal.2d.composite.canvas.destination-over.js", "minimal.2d.composite.canvas.lighter.js", "minimal.2d.composite.canvas.source-atop.js", "minimal.2d.composite.canvas.source-in.js", "minimal.2d.composite.canvas.source-out.js", "minimal.2d.composite.canvas.source-over.js", "minimal.2d.composite.canvas.xor.js", "minimal.2d.composite.clip.copy.js", "minimal.2d.composite.clip.destination-atop.js", "minimal.2d.composite.clip.destination-in.js", "minimal.2d.composite.clip.destination-out.js", "minimal.2d.composite.clip.destination-over.js", "minimal.2d.composite.clip.lighter.js", "minimal.2d.composite.clip.source-atop.js", "minimal.2d.composite.clip.source-in.js", "minimal.2d.composite.clip.source-out.js", "minimal.2d.composite.clip.source-over.js", "minimal.2d.composite.clip.xor.js", "minimal.2d.composite.globalAlpha.canvas.js", "minimal.2d.composite.globalAlpha.canvaspattern.js", "minimal.2d.composite.globalAlpha.default.js", "minimal.2d.composite.globalAlpha.fill.js", "minimal.2d.composite.globalAlpha.image.js", "minimal.2d.composite.globalAlpha.imagepattern.js", "minimal.2d.composite.globalAlpha.invalid.js", "minimal.2d.composite.globalAlpha.range.js", "minimal.2d.composite.image.copy.js", "minimal.2d.composite.image.destination-atop.js", "minimal.2d.composite.image.destination-in.js", "minimal.2d.composite.image.destination-out.js", "minimal.2d.composite.image.destination-over.js", "minimal.2d.composite.image.lighter.js", "minimal.2d.composite.image.source-atop.js", "minimal.2d.composite.image.source-in.js", "minimal.2d.composite.image.source-out.js", "minimal.2d.composite.image.source-over.js", "minimal.2d.composite.image.xor.js", "minimal.2d.composite.operation.casesensitive.js", "minimal.2d.composite.operation.clear.js", "minimal.2d.composite.operation.darker.js", "minimal.2d.composite.operation.default.js", "minimal.2d.composite.operation.get.js", "minimal.2d.composite.operation.highlight.js", "minimal.2d.composite.operation.nullsuffix.js", "minimal.2d.composite.operation.over.js", "minimal.2d.composite.operation.unrecognised.js", "minimal.2d.composite.solid.copy.js", "minimal.2d.composite.solid.destination-atop.js", "minimal.2d.composite.solid.destination-in.js", "minimal.2d.composite.solid.destination-out.js", "minimal.2d.composite.solid.destination-over.js", "minimal.2d.composite.solid.lighter.js", "minimal.2d.composite.solid.source-atop.js", "minimal.2d.composite.solid.source-in.js", "minimal.2d.composite.solid.source-out.js", "minimal.2d.composite.solid.source-over.js", "minimal.2d.composite.solid.xor.js", "minimal.2d.composite.transparent.copy.js", "minimal.2d.composite.transparent.destination-atop.js", "minimal.2d.composite.transparent.destination-in.js", "minimal.2d.composite.transparent.destination-out.js", "minimal.2d.composite.transparent.destination-over.js", "minimal.2d.composite.transparent.lighter.js", "minimal.2d.composite.transparent.source-atop.js", "minimal.2d.composite.transparent.source-in.js", "minimal.2d.composite.transparent.source-out.js", "minimal.2d.composite.transparent.source-over.js", "minimal.2d.composite.transparent.xor.js", "minimal.2d.composite.uncovered.fill.copy.js", "minimal.2d.composite.uncovered.fill.destination-atop.js", "minimal.2d.composite.uncovered.fill.destination-in.js", "minimal.2d.composite.uncovered.fill.source-in.js", "minimal.2d.composite.uncovered.fill.source-out.js", "minimal.2d.composite.uncovered.image.destination-atop.js", "minimal.2d.composite.uncovered.image.destination-in.js", "minimal.2d.composite.uncovered.image.source-in.js", "minimal.2d.composite.uncovered.image.source-out.js", "minimal.2d.composite.uncovered.nocontext.copy.js", "minimal.2d.composite.uncovered.nocontext.destination-atop.js", "minimal.2d.composite.uncovered.nocontext.destination-in.js", "minimal.2d.composite.uncovered.nocontext.source-in.js", "minimal.2d.composite.uncovered.nocontext.source-out.js", "minimal.2d.composite.uncovered.pattern.copy.js", "minimal.2d.composite.uncovered.pattern.destination-atop.js", "minimal.2d.composite.uncovered.pattern.destination-in.js", "minimal.2d.composite.uncovered.pattern.source-in.js", "minimal.2d.composite.uncovered.pattern.source-out.js", "minimal.2d.coordinatespace.js", "minimal.2d.drawImage.3arg.js", "minimal.2d.drawImage.5arg.js", "minimal.2d.drawImage.9arg.basic.js", "minimal.2d.drawImage.9arg.destpos.js", "minimal.2d.drawImage.9arg.destsize.js", "minimal.2d.drawImage.9arg.sourcepos.js", "minimal.2d.drawImage.9arg.sourcesize.js", "minimal.2d.drawImage.alpha.js", "minimal.2d.drawImage.animated.apng.js", "minimal.2d.drawImage.animated.gif.js", "minimal.2d.drawImage.animated.poster.js", "minimal.2d.drawImage.broken.js", "minimal.2d.drawImage.canvas.js", "minimal.2d.drawImage.clip.js", "minimal.2d.drawImage.composite.js", "minimal.2d.drawImage.floatsource.js", "minimal.2d.drawImage.incomplete.js", "minimal.2d.drawImage.negativedest.js", "minimal.2d.drawImage.negativedir.js", "minimal.2d.drawImage.negativesource.js", "minimal.2d.drawImage.nonfinite.js", "minimal.2d.drawImage.nowrap.js", "minimal.2d.drawImage.null.js", "minimal.2d.drawImage.outsidesource.js", "minimal.2d.drawImage.path.js", "minimal.2d.drawImage.self.1.js", "minimal.2d.drawImage.self.2.js", "minimal.2d.drawImage.transform.js", "minimal.2d.drawImage.wrongtype.js", "minimal.2d.drawImage.zerocanvas.js", "minimal.2d.drawImage.zerosource.js", "minimal.2d.fillRect.basic.js", "minimal.2d.fillRect.clip.js", "minimal.2d.fillRect.negative.js", "minimal.2d.fillRect.nonfinite.js", "minimal.2d.fillRect.path.js", "minimal.2d.fillRect.shadow.js", "minimal.2d.fillRect.transform.js", "minimal.2d.fillRect.zero.js", "minimal.2d.fillStyle.default.js", "minimal.2d.fillStyle.get.semitransparent.js", "minimal.2d.fillStyle.get.solid.js", "minimal.2d.fillStyle.get.transparent.js", "minimal.2d.fillStyle.invalidstring.js", "minimal.2d.fillStyle.invalidtype.js", "minimal.2d.fillStyle.parse.current.basic.js", "minimal.2d.fillStyle.parse.current.changed.js", "minimal.2d.fillStyle.parse.current.removed.js", "minimal.2d.fillStyle.parse.hex3.js", "minimal.2d.fillStyle.parse.hex6.js", "minimal.2d.fillStyle.parse.hsl-1.js", "minimal.2d.fillStyle.parse.hsl-2.js", "minimal.2d.fillStyle.parse.hsl-3.js", "minimal.2d.fillStyle.parse.hsl-4.js", "minimal.2d.fillStyle.parse.hsl-5.js", "minimal.2d.fillStyle.parse.hsl-clamp-1.js", "minimal.2d.fillStyle.parse.hsl-clamp-2.js", "minimal.2d.fillStyle.parse.hsl-clamp-3.js", "minimal.2d.fillStyle.parse.hsl-clamp-4.js", "minimal.2d.fillStyle.parse.hsla-1.js", "minimal.2d.fillStyle.parse.hsla-2.js", "minimal.2d.fillStyle.parse.hsla-clamp-1.js", "minimal.2d.fillStyle.parse.hsla-clamp-2.js", "minimal.2d.fillStyle.parse.hsla-clamp-3.js", "minimal.2d.fillStyle.parse.hsla-clamp-4.js", "minimal.2d.fillStyle.parse.hsla-clamp-5.js", "minimal.2d.fillStyle.parse.hsla-clamp-6.js", "minimal.2d.fillStyle.parse.html4.js", "minimal.2d.fillStyle.parse.invalid.hex1.js", "minimal.2d.fillStyle.parse.invalid.hex2.js", "minimal.2d.fillStyle.parse.invalid.hex4.js", "minimal.2d.fillStyle.parse.invalid.hex5.js", "minimal.2d.fillStyle.parse.invalid.hex7.js", "minimal.2d.fillStyle.parse.invalid.hex8.js", "minimal.2d.fillStyle.parse.invalid.hsl-2.js", "minimal.2d.fillStyle.parse.invalid.hsl-3.js", "minimal.2d.fillStyle.parse.invalid.hsl-4.js", "minimal.2d.fillStyle.parse.invalid.hsl-5.js", "minimal.2d.fillStyle.parse.invalid.hsla-1.js", "minimal.2d.fillStyle.parse.invalid.hsla-2.js", "minimal.2d.fillStyle.parse.invalid.name-1.js", "minimal.2d.fillStyle.parse.invalid.name-2.js", "minimal.2d.fillStyle.parse.invalid.name-3.js", "minimal.2d.fillStyle.parse.invalid.rgb-3.js", "minimal.2d.fillStyle.parse.invalid.rgb-4.js", "minimal.2d.fillStyle.parse.invalid.rgb-5.js", "minimal.2d.fillStyle.parse.invalid.rgb-7.js", "minimal.2d.fillStyle.parse.invalid.rgba-1.js", "minimal.2d.fillStyle.parse.invalid.rgba-3.js", "minimal.2d.fillStyle.parse.invalid.rgba-4.js", "minimal.2d.fillStyle.parse.invalid.rgba-5.js", "minimal.2d.fillStyle.parse.rgb-clamp-1.js", "minimal.2d.fillStyle.parse.rgb-clamp-2.js", "minimal.2d.fillStyle.parse.rgb-clamp-5.js", "minimal.2d.fillStyle.parse.rgb-num.js", "minimal.2d.fillStyle.parse.rgb-percent.js", "minimal.2d.fillStyle.parse.rgba-clamp-2.js", "minimal.2d.fillStyle.parse.rgba-num-1.js", "minimal.2d.fillStyle.parse.rgba-num-2.js", "minimal.2d.fillStyle.parse.rgba-percent.js", "minimal.2d.fillStyle.parse.rgba-solid-2.js", "minimal.2d.fillStyle.parse.svg-1.js", "minimal.2d.fillStyle.parse.svg-2.js", "minimal.2d.fillStyle.parse.system.js", "minimal.2d.fillStyle.parse.transparent-1.js", "minimal.2d.fillStyle.parse.transparent-2.js", "minimal.2d.getcontext.exists.js", "minimal.2d.getcontext.shared.js", "minimal.2d.getcontext.unique.js", "minimal.2d.gradient.empty.js", "minimal.2d.gradient.interpolate.colouralpha.js", "minimal.2d.gradient.interpolate.multiple.js", "minimal.2d.gradient.interpolate.outside.js", "minimal.2d.gradient.interpolate.overlap.js", "minimal.2d.gradient.interpolate.overlap2.js", "minimal.2d.gradient.interpolate.solid.js", "minimal.2d.gradient.interpolate.vertical.js", "minimal.2d.gradient.interpolate.zerosize.js", "minimal.2d.gradient.linear.nonfinite.js", "minimal.2d.gradient.linear.transform.1.js", "minimal.2d.gradient.linear.transform.2.js", "minimal.2d.gradient.linear.transform.3.js", "minimal.2d.gradient.object.compare.js", "minimal.2d.gradient.object.crosscanvas.js", "minimal.2d.gradient.object.invalidcolour.js", "minimal.2d.gradient.object.invalidoffset.js", "minimal.2d.gradient.object.return.js", "minimal.2d.gradient.object.update.js", "minimal.2d.gradient.radial.cone.behind.js", "minimal.2d.gradient.radial.cone.beside.js", "minimal.2d.gradient.radial.cone.bottom.js", "minimal.2d.gradient.radial.cone.cylinder.js", "minimal.2d.gradient.radial.cone.front.js", "minimal.2d.gradient.radial.cone.shape1.js", "minimal.2d.gradient.radial.cone.shape2.js", "minimal.2d.gradient.radial.cone.top.js", "minimal.2d.gradient.radial.equal.js", "minimal.2d.gradient.radial.inside1.js", "minimal.2d.gradient.radial.inside2.js", "minimal.2d.gradient.radial.inside3.js", "minimal.2d.gradient.radial.negative.js", "minimal.2d.gradient.radial.nonfinite.js", "minimal.2d.gradient.radial.outside1.js", "minimal.2d.gradient.radial.outside2.js", "minimal.2d.gradient.radial.outside3.js", "minimal.2d.gradient.radial.touch1.js", "minimal.2d.gradient.radial.touch2.js", "minimal.2d.gradient.radial.touch3.js", "minimal.2d.gradient.radial.transform.1.js", "minimal.2d.gradient.radial.transform.2.js", "minimal.2d.gradient.radial.transform.3.js", "minimal.2d.imageData.create1.basic.js", "minimal.2d.imageData.create1.initial.js", "minimal.2d.imageData.create1.type.js", "minimal.2d.imageData.create1.zero.js", "minimal.2d.imageData.create2.basic.js", "minimal.2d.imageData.create2.initial.js", "minimal.2d.imageData.create2.large.js", "minimal.2d.imageData.create2.negative.js", "minimal.2d.imageData.create2.nonfinite.js", "minimal.2d.imageData.create2.round.js", "minimal.2d.imageData.create2.tiny.js", "minimal.2d.imageData.create2.type.js", "minimal.2d.imageData.create2.zero.js", "minimal.2d.imageData.get.basic.js", "minimal.2d.imageData.get.clamp.js", "minimal.2d.imageData.get.length.js", "minimal.2d.imageData.get.nonfinite.js", "minimal.2d.imageData.get.nonpremul.js", "minimal.2d.imageData.get.order.alpha.js", "minimal.2d.imageData.get.order.cols.js", "minimal.2d.imageData.get.order.rgb.js", "minimal.2d.imageData.get.order.rows.js", "minimal.2d.imageData.get.range.js", "minimal.2d.imageData.get.source.negative.js", "minimal.2d.imageData.get.source.outside.js", "minimal.2d.imageData.get.source.size.js", "minimal.2d.imageData.get.tiny.js", "minimal.2d.imageData.get.type.js", "minimal.2d.imageData.get.unaffected.js", "minimal.2d.imageData.get.zero.js", "minimal.2d.imageData.object.ctor.js", "minimal.2d.imageData.object.nan.js", "minimal.2d.imageData.object.properties.js", "minimal.2d.imageData.object.readonly.js", "minimal.2d.imageData.object.round.js", "minimal.2d.imageData.object.set.js", "minimal.2d.imageData.object.string.js", "minimal.2d.imageData.object.undefined.js", "minimal.2d.imageData.object.wrap.js", "minimal.2d.imageData.put.alpha.js", "minimal.2d.imageData.put.basic.js", "minimal.2d.imageData.put.clip.js", "minimal.2d.imageData.put.created.js", "minimal.2d.imageData.put.cross.js", "minimal.2d.imageData.put.dirty.negative.js", "minimal.2d.imageData.put.dirty.outside.js", "minimal.2d.imageData.put.dirty.rect1.js", "minimal.2d.imageData.put.dirty.rect2.js", "minimal.2d.imageData.put.dirty.zero.js", "minimal.2d.imageData.put.modified.js", "minimal.2d.imageData.put.nonfinite.js", "minimal.2d.imageData.put.null.js", "minimal.2d.imageData.put.path.js", "minimal.2d.imageData.put.unaffected.js", "minimal.2d.imageData.put.unchanged.js", "minimal.2d.imageData.put.wrongtype.js", "minimal.2d.line.cap.butt.js", "minimal.2d.line.cap.closed.js", "minimal.2d.line.cap.invalid.js", "minimal.2d.line.cap.open.js", "minimal.2d.line.cap.round.js", "minimal.2d.line.cap.square.js", "minimal.2d.line.cap.valid.js", "minimal.2d.line.cross.js", "minimal.2d.line.defaults.js", "minimal.2d.line.join.bevel.js", "minimal.2d.line.join.closed.js", "minimal.2d.line.join.invalid.js", "minimal.2d.line.join.miter.js", "minimal.2d.line.join.open.js", "minimal.2d.line.join.parallel.js", "minimal.2d.line.join.round.js", "minimal.2d.line.join.valid.js", "minimal.2d.line.miter.acute.js", "minimal.2d.line.miter.exceeded.js", "minimal.2d.line.miter.invalid.js", "minimal.2d.line.miter.lineedge.js", "minimal.2d.line.miter.obtuse.js", "minimal.2d.line.miter.rightangle.js", "minimal.2d.line.miter.valid.js", "minimal.2d.line.miter.within.js", "minimal.2d.line.union.js", "minimal.2d.line.width.basic.js", "minimal.2d.line.width.invalid.js", "minimal.2d.line.width.scaledefault.js", "minimal.2d.line.width.transformed.js", "minimal.2d.line.width.valid.js", "minimal.2d.missingargs.js", "minimal.2d.path.arc.angle.1.js", "minimal.2d.path.arc.angle.2.js", "minimal.2d.path.arc.angle.3.js", "minimal.2d.path.arc.angle.4.js", "minimal.2d.path.arc.angle.5.js", "minimal.2d.path.arc.angle.6.js", "minimal.2d.path.arc.empty.js", "minimal.2d.path.arc.end.js", "minimal.2d.path.arc.negative.js", "minimal.2d.path.arc.nonempty.js", "minimal.2d.path.arc.nonfinite.js", "minimal.2d.path.arc.scale.1.js", "minimal.2d.path.arc.scale.2.js", "minimal.2d.path.arc.selfintersect.1.js", "minimal.2d.path.arc.selfintersect.2.js", "minimal.2d.path.arc.shape.1.js", "minimal.2d.path.arc.shape.2.js", "minimal.2d.path.arc.shape.3.js", "minimal.2d.path.arc.shape.4.js", "minimal.2d.path.arc.shape.5.js", "minimal.2d.path.arc.twopie.1.js", "minimal.2d.path.arc.twopie.2.js", "minimal.2d.path.arc.twopie.3.js", "minimal.2d.path.arc.twopie.4.js", "minimal.2d.path.arc.zero.1.js", "minimal.2d.path.arc.zero.2.js", "minimal.2d.path.arc.zeroradius.js", "minimal.2d.path.arcTo.coincide.1.js", "minimal.2d.path.arcTo.coincide.2.js", "minimal.2d.path.arcTo.collinear.1.js", "minimal.2d.path.arcTo.collinear.2.js", "minimal.2d.path.arcTo.collinear.3.js", "minimal.2d.path.arcTo.ensuresubpath.1.js", "minimal.2d.path.arcTo.ensuresubpath.2.js", "minimal.2d.path.arcTo.negative.js", "minimal.2d.path.arcTo.nonfinite.js", "minimal.2d.path.arcTo.scale.js", "minimal.2d.path.arcTo.shape.curve1.js", "minimal.2d.path.arcTo.shape.curve2.js", "minimal.2d.path.arcTo.shape.end.js", "minimal.2d.path.arcTo.shape.start.js", "minimal.2d.path.arcTo.transformation.js", "minimal.2d.path.arcTo.zero.1.js", "minimal.2d.path.arcTo.zero.2.js", "minimal.2d.path.beginPath.js", "minimal.2d.path.bezierCurveTo.basic.js", "minimal.2d.path.bezierCurveTo.ensuresubpath.1.js", "minimal.2d.path.bezierCurveTo.ensuresubpath.2.js", "minimal.2d.path.bezierCurveTo.nonfinite.js", "minimal.2d.path.bezierCurveTo.scaled.js", "minimal.2d.path.bezierCurveTo.shape.js", "minimal.2d.path.clip.basic.1.js", "minimal.2d.path.clip.basic.2.js", "minimal.2d.path.clip.empty.js", "minimal.2d.path.clip.intersect.js", "minimal.2d.path.clip.unaffected.js", "minimal.2d.path.clip.winding.1.js", "minimal.2d.path.clip.winding.2.js", "minimal.2d.path.closePath.empty.js", "minimal.2d.path.closePath.newline.js", "minimal.2d.path.closePath.nextpoint.js", "minimal.2d.path.fill.closed.basic.js", "minimal.2d.path.fill.closed.unaffected.js", "minimal.2d.path.fill.overlap.js", "minimal.2d.path.fill.winding.add.js", "minimal.2d.path.fill.winding.subtract.1.js", "minimal.2d.path.fill.winding.subtract.2.js", "minimal.2d.path.fill.winding.subtract.3.js", "minimal.2d.path.initial.js", "minimal.2d.path.isPointInPath.arc.js", "minimal.2d.path.isPointInPath.basic.1.js", "minimal.2d.path.isPointInPath.basic.2.js", "minimal.2d.path.isPointInPath.bezier.js", "minimal.2d.path.isPointInPath.bigarc.js", "minimal.2d.path.isPointInPath.edge.js", "minimal.2d.path.isPointInPath.empty.js", "minimal.2d.path.isPointInPath.nonfinite.js", "minimal.2d.path.isPointInPath.outside.js", "minimal.2d.path.isPointInPath.subpath.js", "minimal.2d.path.isPointInPath.transform.1.js", "minimal.2d.path.isPointInPath.transform.2.js", "minimal.2d.path.isPointInPath.transform.3.js", "minimal.2d.path.isPointInPath.unclosed.js", "minimal.2d.path.isPointInPath.winding.js", "minimal.2d.path.lineTo.basic.js", "minimal.2d.path.lineTo.ensuresubpath.1.js", "minimal.2d.path.lineTo.ensuresubpath.2.js", "minimal.2d.path.lineTo.nextpoint.js", "minimal.2d.path.lineTo.nonfinite.js", "minimal.2d.path.moveTo.basic.js", "minimal.2d.path.moveTo.multiple.js", "minimal.2d.path.moveTo.newsubpath.js", "minimal.2d.path.moveTo.nonfinite.js", "minimal.2d.path.quadraticCurveTo.basic.js", "minimal.2d.path.quadraticCurveTo.ensuresubpath.1.js", "minimal.2d.path.quadraticCurveTo.ensuresubpath.2.js", "minimal.2d.path.quadraticCurveTo.nonfinite.js", "minimal.2d.path.quadraticCurveTo.scaled.js", "minimal.2d.path.quadraticCurveTo.shape.js", "minimal.2d.path.rect.basic.js", "minimal.2d.path.rect.closed.js", "minimal.2d.path.rect.end.1.js", "minimal.2d.path.rect.end.2.js", "minimal.2d.path.rect.negative.js", "minimal.2d.path.rect.newsubpath.js", "minimal.2d.path.rect.nonfinite.js", "minimal.2d.path.rect.selfintersect.js", "minimal.2d.path.rect.winding.js", "minimal.2d.path.rect.zero.1.js", "minimal.2d.path.rect.zero.2.js", "minimal.2d.path.rect.zero.3.js", "minimal.2d.path.rect.zero.4.js", "minimal.2d.path.rect.zero.5.js", "minimal.2d.path.rect.zero.6.js", "minimal.2d.path.stroke.empty.js", "minimal.2d.path.stroke.overlap.js", "minimal.2d.path.stroke.prune.arc.js", "minimal.2d.path.stroke.prune.closed.js", "minimal.2d.path.stroke.prune.corner.js", "minimal.2d.path.stroke.prune.curve.js", "minimal.2d.path.stroke.prune.line.js", "minimal.2d.path.stroke.prune.rect.js", "minimal.2d.path.stroke.scale1.js", "minimal.2d.path.stroke.scale2.js", "minimal.2d.path.stroke.skew.js", "minimal.2d.path.stroke.unaffected.js", "minimal.2d.path.stroke.union.js", "minimal.2d.path.transformation.basic.js", "minimal.2d.path.transformation.changing.js", "minimal.2d.path.transformation.multiple.js", "minimal.2d.pattern.animated.gif.js", "minimal.2d.pattern.basic.canvas.js", "minimal.2d.pattern.basic.image.js", "minimal.2d.pattern.basic.nocontext.js", "minimal.2d.pattern.basic.type.js", "minimal.2d.pattern.basic.zerocanvas.js", "minimal.2d.pattern.crosscanvas.js", "minimal.2d.pattern.image.broken.js", "minimal.2d.pattern.image.incomplete.js", "minimal.2d.pattern.image.null.js", "minimal.2d.pattern.image.string.js", "minimal.2d.pattern.image.undefined.js", "minimal.2d.pattern.modify.canvas1.js", "minimal.2d.pattern.modify.canvas2.js", "minimal.2d.pattern.modify.image1.js", "minimal.2d.pattern.modify.image2.js", "minimal.2d.pattern.paint.norepeat.basic.js", "minimal.2d.pattern.paint.norepeat.coord1.js", "minimal.2d.pattern.paint.norepeat.coord2.js", "minimal.2d.pattern.paint.norepeat.coord3.js", "minimal.2d.pattern.paint.norepeat.outside.js", "minimal.2d.pattern.paint.orientation.canvas.js", "minimal.2d.pattern.paint.orientation.image.js", "minimal.2d.pattern.paint.repeat.basic.js", "minimal.2d.pattern.paint.repeat.coord1.js", "minimal.2d.pattern.paint.repeat.coord2.js", "minimal.2d.pattern.paint.repeat.coord3.js", "minimal.2d.pattern.paint.repeat.outside.js", "minimal.2d.pattern.paint.repeatx.basic.js", "minimal.2d.pattern.paint.repeatx.coord1.js", "minimal.2d.pattern.paint.repeatx.outside.js", "minimal.2d.pattern.paint.repeaty.basic.js", "minimal.2d.pattern.paint.repeaty.coord1.js", "minimal.2d.pattern.paint.repeaty.outside.js", "minimal.2d.pattern.repeat.case.js", "minimal.2d.pattern.repeat.empty.js", "minimal.2d.pattern.repeat.null.js", "minimal.2d.pattern.repeat.nullsuffix.js", "minimal.2d.pattern.repeat.undefined.js", "minimal.2d.pattern.repeat.unrecognised.js", "minimal.2d.scaled.js", "minimal.2d.shadow.alpha.1.js", "minimal.2d.shadow.alpha.2.js", "minimal.2d.shadow.alpha.3.js", "minimal.2d.shadow.alpha.4.js", "minimal.2d.shadow.alpha.5.js", "minimal.2d.shadow.attributes.shadowBlur.initial.js", "minimal.2d.shadow.attributes.shadowBlur.invalid.js", "minimal.2d.shadow.attributes.shadowBlur.valid.js", "minimal.2d.shadow.attributes.shadowColor.initial.js", "minimal.2d.shadow.attributes.shadowColor.invalid.js", "minimal.2d.shadow.attributes.shadowColor.valid.js", "minimal.2d.shadow.attributes.shadowOffset.initial.js", "minimal.2d.shadow.attributes.shadowOffset.invalid.js", "minimal.2d.shadow.attributes.shadowOffset.valid.js", "minimal.2d.shadow.blur.high.js", "minimal.2d.shadow.blur.low.js", "minimal.2d.shadow.canvas.alpha.js", "minimal.2d.shadow.canvas.basic.js", "minimal.2d.shadow.canvas.transparent.1.js", "minimal.2d.shadow.canvas.transparent.2.js", "minimal.2d.shadow.clip.1.js", "minimal.2d.shadow.clip.2.js", "minimal.2d.shadow.clip.3.js", "minimal.2d.shadow.composite.1.js", "minimal.2d.shadow.composite.2.js", "minimal.2d.shadow.composite.3.js", "minimal.2d.shadow.enable.blur.js", "minimal.2d.shadow.enable.off.1.js", "minimal.2d.shadow.enable.off.2.js", "minimal.2d.shadow.enable.x.js", "minimal.2d.shadow.enable.y.js", "minimal.2d.shadow.gradient.alpha.js", "minimal.2d.shadow.gradient.basic.js", "minimal.2d.shadow.gradient.transparent.1.js", "minimal.2d.shadow.gradient.transparent.2.js", "minimal.2d.shadow.image.alpha.js", "minimal.2d.shadow.image.basic.js", "minimal.2d.shadow.image.scale.js", "minimal.2d.shadow.image.section.js", "minimal.2d.shadow.image.transparent.1.js", "minimal.2d.shadow.image.transparent.2.js", "minimal.2d.shadow.offset.negativeX.js", "minimal.2d.shadow.offset.negativeY.js", "minimal.2d.shadow.offset.positiveX.js", "minimal.2d.shadow.offset.positiveY.js", "minimal.2d.shadow.outside.js", "minimal.2d.shadow.pattern.alpha.js", "minimal.2d.shadow.pattern.basic.js", "minimal.2d.shadow.pattern.transparent.1.js", "minimal.2d.shadow.pattern.transparent.2.js", "minimal.2d.shadow.stroke.basic.js", "minimal.2d.shadow.stroke.cap.1.js", "minimal.2d.shadow.stroke.cap.2.js", "minimal.2d.shadow.stroke.join.1.js", "minimal.2d.shadow.stroke.join.2.js", "minimal.2d.shadow.stroke.join.3.js", "minimal.2d.shadow.transform.1.js", "minimal.2d.shadow.transform.2.js", "minimal.2d.state.saverestore.bitmap.js", "minimal.2d.state.saverestore.clip.js", "minimal.2d.state.saverestore.fillStyle.js", "minimal.2d.state.saverestore.font.js", "minimal.2d.state.saverestore.globalAlpha.js", "minimal.2d.state.saverestore.globalCompositeOperation.js", "minimal.2d.state.saverestore.lineCap.js", "minimal.2d.state.saverestore.lineJoin.js", "minimal.2d.state.saverestore.lineWidth.js", "minimal.2d.state.saverestore.miterLimit.js", "minimal.2d.state.saverestore.path.js", "minimal.2d.state.saverestore.shadowBlur.js", "minimal.2d.state.saverestore.shadowColor.js", "minimal.2d.state.saverestore.shadowOffsetX.js", "minimal.2d.state.saverestore.shadowOffsetY.js", "minimal.2d.state.saverestore.stack.js", "minimal.2d.state.saverestore.stackdepth.js", "minimal.2d.state.saverestore.strokeStyle.js", "minimal.2d.state.saverestore.textAlign.js", "minimal.2d.state.saverestore.textBaseline.js", "minimal.2d.state.saverestore.transformation.js", "minimal.2d.state.saverestore.underflow.js", "minimal.2d.strokeRect.basic.js", "minimal.2d.strokeRect.clip.js", "minimal.2d.strokeRect.globalalpha.js", "minimal.2d.strokeRect.globalcomposite.js", "minimal.2d.strokeRect.negative.js", "minimal.2d.strokeRect.nonfinite.js", "minimal.2d.strokeRect.path.js", "minimal.2d.strokeRect.shadow.js", "minimal.2d.strokeRect.transform.js", "minimal.2d.strokeRect.zero.1.js", "minimal.2d.strokeRect.zero.2.js", "minimal.2d.strokeRect.zero.3.js", "minimal.2d.strokeRect.zero.4.js", "minimal.2d.strokeRect.zero.5.js", "minimal.2d.strokeStyle.default.js", "minimal.2d.text.align.default.js", "minimal.2d.text.align.invalid.js", "minimal.2d.text.align.valid.js", "minimal.2d.text.baseline.default.js", "minimal.2d.text.baseline.invalid.js", "minimal.2d.text.baseline.valid.js", "minimal.2d.text.draw.align.center.js", "minimal.2d.text.draw.align.end.ltr.js", "minimal.2d.text.draw.align.end.rtl.js", "minimal.2d.text.draw.align.left.js", "minimal.2d.text.draw.align.right.js", "minimal.2d.text.draw.align.start.ltr.js", "minimal.2d.text.draw.align.start.rtl.js", "minimal.2d.text.draw.baseline.alphabetic.js", "minimal.2d.text.draw.baseline.bottom.js", "minimal.2d.text.draw.baseline.hanging.js", "minimal.2d.text.draw.baseline.ideographic.js", "minimal.2d.text.draw.baseline.middle.js", "minimal.2d.text.draw.baseline.top.js", "minimal.2d.text.draw.fill.basic.js", "minimal.2d.text.draw.fill.maxWidth.bound.js", "minimal.2d.text.draw.fill.maxWidth.fontface.js", "minimal.2d.text.draw.fill.maxWidth.large.js", "minimal.2d.text.draw.fill.maxWidth.small.js", "minimal.2d.text.draw.fill.maxWidth.zero.js", "minimal.2d.text.draw.fill.rtl.js", "minimal.2d.text.draw.fill.unaffected.js", "minimal.2d.text.draw.fontface.js", "minimal.2d.text.draw.fontface.notinpage.js", "minimal.2d.text.draw.fontface.repeat.js", "minimal.2d.text.draw.kern.consistent.js", "minimal.2d.text.draw.space.basic.js", "minimal.2d.text.draw.space.collapse.end.js", "minimal.2d.text.draw.space.collapse.nonspace.js", "minimal.2d.text.draw.space.collapse.other.js", "minimal.2d.text.draw.space.collapse.space.js", "minimal.2d.text.draw.space.collapse.start.js", "minimal.2d.text.draw.stroke.basic.js", "minimal.2d.text.draw.stroke.unaffected.js", "minimal.2d.text.font.default.js", "minimal.2d.text.font.parse.basic.js", "minimal.2d.text.font.parse.complex.js", "minimal.2d.text.font.parse.invalid.js", "minimal.2d.text.font.parse.size.percentage.default.js", "minimal.2d.text.font.parse.size.percentage.js", "minimal.2d.text.font.parse.system.js", "minimal.2d.text.measure.width.basic.js", "minimal.2d.text.measure.width.empty.js", "minimal.2d.text.measure.width.space.js", "minimal.2d.transformation.order.js", "minimal.2d.transformation.rotate.direction.js", "minimal.2d.transformation.rotate.nonfinite.js", "minimal.2d.transformation.rotate.radians.js", "minimal.2d.transformation.rotate.wrap.js", "minimal.2d.transformation.rotate.wrapnegative.js", "minimal.2d.transformation.rotate.zero.js", "minimal.2d.transformation.scale.basic.js", "minimal.2d.transformation.scale.large.js", "minimal.2d.transformation.scale.multiple.js", "minimal.2d.transformation.scale.negative.js", "minimal.2d.transformation.scale.nonfinite.js", "minimal.2d.transformation.scale.zero.js", "minimal.2d.transformation.setTransform.multiple.js", "minimal.2d.transformation.setTransform.nonfinite.js", "minimal.2d.transformation.setTransform.skewed.js", "minimal.2d.transformation.transform.identity.js", "minimal.2d.transformation.transform.multiply.js", "minimal.2d.transformation.transform.nonfinite.js", "minimal.2d.transformation.transform.skewed.js", "minimal.2d.transformation.translate.basic.js", "minimal.2d.transformation.translate.nonfinite.js", "minimal.2d.voidreturn.js", "minimal.context.casesensitive.js", "minimal.context.emptystring.js", "minimal.context.unrecognised.badname.js", "minimal.context.unrecognised.badsuffix.js", "minimal.context.unrecognised.nullsuffix.js", "minimal.context.unrecognised.unicode.js", "minimal.fallback.basic.js", "minimal.fallback.multiple.js", "minimal.fallback.nested.js", "minimal.initial.colour.js", "minimal.initial.reset.2dstate.js", "minimal.initial.reset.clip.js", "minimal.initial.reset.different.js", "minimal.initial.reset.gradient.js", "minimal.initial.reset.path.js", "minimal.initial.reset.pattern.js", "minimal.initial.reset.same.js", "minimal.initial.reset.transform.js", "minimal.security.dataURI.js", "minimal.security.drawImage.canvas.js", "minimal.security.drawImage.image.js", "minimal.security.pattern.canvas.fillStyle.js", "minimal.security.pattern.canvas.strokeStyle.js", "minimal.security.pattern.canvas.timing.js", "minimal.security.pattern.create.js", "minimal.security.pattern.cross.js", "minimal.security.pattern.image.fillStyle.js", "minimal.security.pattern.image.strokeStyle.js", "minimal.security.reset.js", "minimal.size.attributes.default.js", "minimal.size.attributes.get.js", "minimal.size.attributes.idl.js", "minimal.size.attributes.idl.set.zero.js", "minimal.size.attributes.parse.decimal.js", "minimal.size.attributes.parse.em.js", "minimal.size.attributes.parse.empty.js", "minimal.size.attributes.parse.exp.js", "minimal.size.attributes.parse.hex.js", "minimal.size.attributes.parse.junk.js", "minimal.size.attributes.parse.minus.js", "minimal.size.attributes.parse.octal.js", "minimal.size.attributes.parse.onlyspace.js", "minimal.size.attributes.parse.percent.js", "minimal.size.attributes.parse.plus.js", "minimal.size.attributes.parse.space.js", "minimal.size.attributes.parse.trailingjunk.js", "minimal.size.attributes.parse.whitespace.js", "minimal.size.attributes.parse.zero.js", "minimal.size.attributes.reflect.setcontent.js", "minimal.size.attributes.reflect.setidl.js", "minimal.size.attributes.reflect.setidlzero.js", "minimal.size.attributes.removed.js", "minimal.size.attributes.set.js", "minimal.size.attributes.setAttribute.decimal.js", "minimal.size.attributes.setAttribute.em.js", "minimal.size.attributes.setAttribute.empty.js", "minimal.size.attributes.setAttribute.exp.js", "minimal.size.attributes.setAttribute.hex.js", "minimal.size.attributes.setAttribute.junk.js", "minimal.size.attributes.setAttribute.minus.js", "minimal.size.attributes.setAttribute.octal.js", "minimal.size.attributes.setAttribute.onlyspace.js", "minimal.size.attributes.setAttribute.percent.js", "minimal.size.attributes.setAttribute.plus.js", "minimal.size.attributes.setAttribute.space.js", "minimal.size.attributes.setAttribute.trailingjunk.js", "minimal.size.attributes.setAttribute.whitespace.js", "minimal.size.attributes.setAttribute.zero.js", "minimal.size.attributes.style.js", "minimal.toDataURL.arguments.1.js", "minimal.toDataURL.arguments.2.js", "minimal.toDataURL.arguments.3.js", "minimal.toDataURL.bogustype.js", "minimal.toDataURL.default.js", "minimal.toDataURL.jpeg.alpha.js", "minimal.toDataURL.jpeg.primarycolours.js", "minimal.toDataURL.jpeg.quality.basic.js", "minimal.toDataURL.jpeg.quality.notnumber.js", "minimal.toDataURL.jpeg.quality.outsiderange.js", "minimal.toDataURL.lowercase.ascii.js", "minimal.toDataURL.lowercase.unicode.js", "minimal.toDataURL.nocontext.js", "minimal.toDataURL.png.complexcolours.js", "minimal.toDataURL.png.js", "minimal.toDataURL.png.primarycolours.js", "minimal.toDataURL.unrecognised.js", "minimal.toDataURL.zerosize.js", "minimal.type.delete.js", "minimal.type.exists.js", "minimal.type.extend.js", "minimal.type.name.js", "minimal.type.prototype.js", "minimal.type.replace.js", "reportgen.js", "results.js", "security.dataURI.js", "security.drawImage.canvas.js", "security.drawImage.image.js", "security.pattern.canvas.fillStyle.js", "security.pattern.canvas.strokeStyle.js", "security.pattern.canvas.timing.js", "security.pattern.create.js", "security.pattern.cross.js", "security.pattern.image.fillStyle.js", "security.pattern.image.strokeStyle.js", "security.reset.js", "size.attributes.default.js", "size.attributes.get.js", "size.attributes.idl.js", "size.attributes.idl.set.zero.js", "size.attributes.parse.decimal.js", "size.attributes.parse.em.js", "size.attributes.parse.empty.js", "size.attributes.parse.exp.js", "size.attributes.parse.hex.js", "size.attributes.parse.junk.js", "size.attributes.parse.minus.js", "size.attributes.parse.octal.js", "size.attributes.parse.onlyspace.js", "size.attributes.parse.percent.js", "size.attributes.parse.plus.js", "size.attributes.parse.space.js", "size.attributes.parse.trailingjunk.js", "size.attributes.parse.whitespace.js", "size.attributes.parse.zero.js", "size.attributes.reflect.setcontent.js", "size.attributes.reflect.setidl.js", "size.attributes.reflect.setidlzero.js", "size.attributes.removed.js", "size.attributes.set.js", "size.attributes.setAttribute.decimal.js", "size.attributes.setAttribute.em.js", "size.attributes.setAttribute.empty.js", "size.attributes.setAttribute.exp.js", "size.attributes.setAttribute.hex.js", "size.attributes.setAttribute.junk.js", "size.attributes.setAttribute.minus.js", "size.attributes.setAttribute.octal.js", "size.attributes.setAttribute.onlyspace.js", "size.attributes.setAttribute.percent.js", "size.attributes.setAttribute.plus.js", "size.attributes.setAttribute.space.js", "size.attributes.setAttribute.trailingjunk.js", "size.attributes.setAttribute.whitespace.js", "size.attributes.setAttribute.zero.js", "size.attributes.style.js", "spec.js", "tmp_1_2d.composite.uncovered.image.copy.js", "tmp_2_2d.composite.uncovered.image.copy.js", "toDataURL.arguments.1.js", "toDataURL.arguments.2.js", "toDataURL.arguments.3.js", "toDataURL.bogustype.js", "toDataURL.default.js", "toDataURL.jpeg.alpha.js", "toDataURL.jpeg.primarycolours.js", "toDataURL.jpeg.quality.basic.js", "toDataURL.jpeg.quality.notnumber.js", "toDataURL.jpeg.quality.outsiderange.js", "toDataURL.lowercase.ascii.js", "toDataURL.lowercase.unicode.js", "toDataURL.nocontext.js", "toDataURL.png.complexcolours.js", "toDataURL.png.js", "toDataURL.png.primarycolours.js", "toDataURL.unrecognised.js", "toDataURL.zerosize.js", "type.delete.js", "type.exists.js", "type.extend.js", "type.name.js", "type.prototype.js", "type.replace.js" +*/ +]; + +// Loads next test +function loadTest(testId) { + // Check test exists + if (tests.length === testId) { + // End of tests + console.log("[index.js] End of tests ----------------------------"); + var msg = { result: "finished" }; + wizCanvasMessenger.postMessage(msg, "mainView"); + return; + } + + // New test + console.log("[index.js] Loading new test: " + tests[testId]); + + // Set currentTest + currentTest = testId; + + // Set title + var msg = { newTest: tests[testId] }; + wizCanvasMessenger.postMessage(msg, "mainView"); + + try { + ejecta.include("test/tests/" + tests[testId]); + } catch (e) { + console.log("ERROR in test: " + testId + " - " + e); + console.log("Loading next test..."); + loadTest(testId + 1); + } +} + +wizCanvasMessenger.addEventListener('message', function (e) { + if (e.data.nextTestId) { + loadTest(e.data.nextTestId); + } +}); + +loadTest(currentTest); diff --git a/platforms/ios/www/test/tests-todo/2d.clearRect.nonfinite.js b/platforms/ios/www/test/tests-todo/2d.clearRect.nonfinite.js new file mode 100644 index 0000000..5347945 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.clearRect.nonfinite.js @@ -0,0 +1,33 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.clearRect(Infinity, 0, 100, 50); +ctx.clearRect(-Infinity, 0, 100, 50); +ctx.clearRect(NaN, 0, 100, 50); +ctx.clearRect(0, Infinity, 100, 50); +ctx.clearRect(0, -Infinity, 100, 50); +ctx.clearRect(0, NaN, 100, 50); +ctx.clearRect(0, 0, Infinity, 50); +ctx.clearRect(0, 0, -Infinity, 50); +ctx.clearRect(0, 0, NaN, 50); +ctx.clearRect(0, 0, 100, Infinity); +ctx.clearRect(0, 0, 100, -Infinity); +ctx.clearRect(0, 0, 100, NaN); +ctx.clearRect(Infinity, Infinity, 100, 50); +ctx.clearRect(Infinity, Infinity, Infinity, 50); +ctx.clearRect(Infinity, Infinity, Infinity, Infinity); +ctx.clearRect(Infinity, Infinity, 100, Infinity); +ctx.clearRect(Infinity, 0, Infinity, 50); +ctx.clearRect(Infinity, 0, Infinity, Infinity); +ctx.clearRect(Infinity, 0, 100, Infinity); +ctx.clearRect(0, Infinity, Infinity, 50); +ctx.clearRect(0, Infinity, Infinity, Infinity); +ctx.clearRect(0, Infinity, 100, Infinity); +ctx.clearRect(0, 0, Infinity, Infinity); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.clearRect.shadow.js b/platforms/ios/www/test/tests-todo/2d.clearRect.shadow.js new file mode 100644 index 0000000..152d3dd --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.clearRect.shadow.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = '#f00'; +ctx.shadowBlur = 0; +ctx.shadowOffsetX = 0; +ctx.shadowOffsetY = 50; +ctx.clearRect(0, -50, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.canvas.copy.js b/platforms/ios/www/test/tests-todo/2d.composite.canvas.copy.js new file mode 100644 index 0000000..f49e023 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.canvas.copy.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + + +var canvas2 = document.createElement('canvas'); +canvas2.width = canvas.width; +canvas2.height = canvas.height; +var ctx2 = canvas2.getContext('2d'); +ctx2.drawImage('test/images/yellow75.png', 0, 0); +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'copy'; +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 255,255,0,191, "50,25", "255,255,0,191", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.canvas.destination-atop.js b/platforms/ios/www/test/tests-todo/2d.composite.canvas.destination-atop.js new file mode 100644 index 0000000..ca6fa84 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.canvas.destination-atop.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + + +var canvas2 = document.createElement('canvas'); +canvas2.width = canvas.width; +canvas2.height = canvas.height; +var ctx2 = canvas2.getContext('2d'); +ctx2.drawImage('test/images/yellow75.png', 0, 0); +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-atop'; +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 127,255,127,191, "50,25", "127,255,127,191", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.canvas.destination-in.js b/platforms/ios/www/test/tests-todo/2d.composite.canvas.destination-in.js new file mode 100644 index 0000000..fa7fea7 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.canvas.destination-in.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + + +var canvas2 = document.createElement('canvas'); +canvas2.width = canvas.width; +canvas2.height = canvas.height; +var ctx2 = canvas2.getContext('2d'); +ctx2.drawImage('test/images/yellow75.png', 0, 0); +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-in'; +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 0,255,255,95, "50,25", "0,255,255,95", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.canvas.destination-out.js b/platforms/ios/www/test/tests-todo/2d.composite.canvas.destination-out.js new file mode 100644 index 0000000..0bde83d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.canvas.destination-out.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + + +var canvas2 = document.createElement('canvas'); +canvas2.width = canvas.width; +canvas2.height = canvas.height; +var ctx2 = canvas2.getContext('2d'); +ctx2.drawImage('test/images/yellow75.png', 0, 0); +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-out'; +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 0,255,255,31, "50,25", "0,255,255,31", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.canvas.destination-over.js b/platforms/ios/www/test/tests-todo/2d.composite.canvas.destination-over.js new file mode 100644 index 0000000..aa3395b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.canvas.destination-over.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + + +var canvas2 = document.createElement('canvas'); +canvas2.width = canvas.width; +canvas2.height = canvas.height; +var ctx2 = canvas2.getContext('2d'); +ctx2.drawImage('test/images/yellow75.png', 0, 0); +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-over'; +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 109,255,145,223, "50,25", "109,255,145,223", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.canvas.lighter.js b/platforms/ios/www/test/tests-todo/2d.composite.canvas.lighter.js new file mode 100644 index 0000000..d2c1865 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.canvas.lighter.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + + +var canvas2 = document.createElement('canvas'); +canvas2.width = canvas.width; +canvas2.height = canvas.height; +var ctx2 = canvas2.getContext('2d'); +ctx2.drawImage('test/images/yellow75.png', 0, 0); +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'lighter'; +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 191,255,127,255, "50,25", "191,255,127,255", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.canvas.source-atop.js b/platforms/ios/www/test/tests-todo/2d.composite.canvas.source-atop.js new file mode 100644 index 0000000..92c4999 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.canvas.source-atop.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + + +var canvas2 = document.createElement('canvas'); +canvas2.width = canvas.width; +canvas2.height = canvas.height; +var ctx2 = canvas2.getContext('2d'); +ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0); +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-atop'; +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 191,255,63,127, "50,25", "191,255,63,127", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.canvas.source-in.js b/platforms/ios/www/test/tests-todo/2d.composite.canvas.source-in.js new file mode 100644 index 0000000..1aa5c4c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.canvas.source-in.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + + +var canvas2 = document.createElement('canvas'); +canvas2.width = canvas.width; +canvas2.height = canvas.height; +var ctx2 = canvas2.getContext('2d'); +ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0); +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-in'; +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 255,255,0,95, "50,25", "255,255,0,95", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.canvas.source-out.js b/platforms/ios/www/test/tests-todo/2d.composite.canvas.source-out.js new file mode 100644 index 0000000..d182826 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.canvas.source-out.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + + +var canvas2 = document.createElement('canvas'); +canvas2.width = canvas.width; +canvas2.height = canvas.height; +var ctx2 = canvas2.getContext('2d'); +ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0); +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-out'; +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 255,255,0,95, "50,25", "255,255,0,95", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.canvas.source-over.js b/platforms/ios/www/test/tests-todo/2d.composite.canvas.source-over.js new file mode 100644 index 0000000..9a050b6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.canvas.source-over.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + + +var canvas2 = document.createElement('canvas'); +canvas2.width = canvas.width; +canvas2.height = canvas.height; +var ctx2 = canvas2.getContext('2d'); +ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0); +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-over'; +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 218,255,36,223, "50,25", "218,255,36,223", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.canvas.xor.js b/platforms/ios/www/test/tests-todo/2d.composite.canvas.xor.js new file mode 100644 index 0000000..f7069b6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.canvas.xor.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + + +var canvas2 = document.createElement('canvas'); +canvas2.width = canvas.width; +canvas2.height = canvas.height; +var ctx2 = canvas2.getContext('2d'); +ctx2.drawImage('test/images/yellow75.png', 0, 0); +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'xor'; +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 191,255,63,127, "50,25", "191,255,63,127", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.clip.copy.js b/platforms/ios/www/test/tests-todo/2d.composite.clip.copy.js new file mode 100644 index 0000000..f3dfba4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.clip.copy.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'copy'; +ctx.rect(-20, -20, 10, 10); +ctx.clip(); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.clip.destination-atop.js b/platforms/ios/www/test/tests-todo/2d.composite.clip.destination-atop.js new file mode 100644 index 0000000..70645dc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.clip.destination-atop.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-atop'; +ctx.rect(-20, -20, 10, 10); +ctx.clip(); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.clip.destination-in.js b/platforms/ios/www/test/tests-todo/2d.composite.clip.destination-in.js new file mode 100644 index 0000000..f6f0e76 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.clip.destination-in.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-in'; +ctx.rect(-20, -20, 10, 10); +ctx.clip(); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.clip.destination-out.js b/platforms/ios/www/test/tests-todo/2d.composite.clip.destination-out.js new file mode 100644 index 0000000..b21df0b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.clip.destination-out.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-out'; +ctx.rect(-20, -20, 10, 10); +ctx.clip(); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.clip.destination-over.js b/platforms/ios/www/test/tests-todo/2d.composite.clip.destination-over.js new file mode 100644 index 0000000..1877ee6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.clip.destination-over.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-over'; +ctx.rect(-20, -20, 10, 10); +ctx.clip(); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.clip.lighter.js b/platforms/ios/www/test/tests-todo/2d.composite.clip.lighter.js new file mode 100644 index 0000000..a8f2b0e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.clip.lighter.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'lighter'; +ctx.rect(-20, -20, 10, 10); +ctx.clip(); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.clip.source-atop.js b/platforms/ios/www/test/tests-todo/2d.composite.clip.source-atop.js new file mode 100644 index 0000000..d086776 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.clip.source-atop.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-atop'; +ctx.rect(-20, -20, 10, 10); +ctx.clip(); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.clip.source-in.js b/platforms/ios/www/test/tests-todo/2d.composite.clip.source-in.js new file mode 100644 index 0000000..34fe397 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.clip.source-in.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-in'; +ctx.rect(-20, -20, 10, 10); +ctx.clip(); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.clip.source-out.js b/platforms/ios/www/test/tests-todo/2d.composite.clip.source-out.js new file mode 100644 index 0000000..977a39c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.clip.source-out.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-out'; +ctx.rect(-20, -20, 10, 10); +ctx.clip(); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.clip.source-over.js b/platforms/ios/www/test/tests-todo/2d.composite.clip.source-over.js new file mode 100644 index 0000000..8d49d2e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.clip.source-over.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-over'; +ctx.rect(-20, -20, 10, 10); +ctx.clip(); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.clip.xor.js b/platforms/ios/www/test/tests-todo/2d.composite.clip.xor.js new file mode 100644 index 0000000..4b3e980 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.clip.xor.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'xor'; +ctx.rect(-20, -20, 10, 10); +ctx.clip(); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.globalAlpha.canvas.js b/platforms/ios/www/test/tests-todo/2d.composite.globalAlpha.canvas.js new file mode 100644 index 0000000..e11ab64 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.globalAlpha.canvas.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = '#f00'; +ctx2.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalAlpha = 0.01; // avoid any potential alpha=0 optimisations +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 2,253,0,255, "50,25", "2,253,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.globalAlpha.canvaspattern.js b/platforms/ios/www/test/tests-todo/2d.composite.globalAlpha.canvaspattern.js new file mode 100644 index 0000000..d3eb366 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.globalAlpha.canvaspattern.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = '#f00'; +ctx2.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = ctx.createPattern(canvas2, 'no-repeat'); +ctx.globalAlpha = 0.01; // avoid any potential alpha=0 optimisations +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 2,253,0,255, "50,25", "2,253,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.globalAlpha.default.js b/platforms/ios/www/test/tests-todo/2d.composite.globalAlpha.default.js new file mode 100644 index 0000000..af46748 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.globalAlpha.default.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(ctx.globalAlpha, 1.0, "ctx.globalAlpha", "1.0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.globalAlpha.fill.js b/platforms/ios/www/test/tests-todo/2d.composite.globalAlpha.fill.js new file mode 100644 index 0000000..c310590 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.globalAlpha.fill.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalAlpha = 0.01; // avoid any potential alpha=0 optimisations +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 2,253,0,255, "50,25", "2,253,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.globalAlpha.image.js b/platforms/ios/www/test/tests-todo/2d.composite.globalAlpha.image.js new file mode 100644 index 0000000..479dedd --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.globalAlpha.image.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalAlpha = 0.01; // avoid any potential alpha=0 optimisations +ctx.drawImage(document.getElementById('red.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 2,253,0,255, "50,25", "2,253,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.globalAlpha.imagepattern.js b/platforms/ios/www/test/tests-todo/2d.composite.globalAlpha.imagepattern.js new file mode 100644 index 0000000..d269796 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.globalAlpha.imagepattern.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = ctx.createPattern(document.getElementById('red.png'), 'no-repeat'); +ctx.globalAlpha = 0.01; // avoid any potential alpha=0 optimisations +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 2,253,0,255, "50,25", "2,253,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.globalAlpha.invalid.js b/platforms/ios/www/test/tests-todo/2d.composite.globalAlpha.invalid.js new file mode 100644 index 0000000..e53a289 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.globalAlpha.invalid.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.globalAlpha = 0.5; +var a = ctx.globalAlpha; // might not be exactly 0.5, if it is rounded/quantised, so remember for future comparisons +ctx.globalAlpha = Infinity; +_assertEqual(ctx.globalAlpha, a, "ctx.globalAlpha", "a"); +ctx.globalAlpha = -Infinity; +_assertEqual(ctx.globalAlpha, a, "ctx.globalAlpha", "a"); +ctx.globalAlpha = NaN; +_assertEqual(ctx.globalAlpha, a, "ctx.globalAlpha", "a"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.globalAlpha.range.js b/platforms/ios/www/test/tests-todo/2d.composite.globalAlpha.range.js new file mode 100644 index 0000000..60c8901 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.globalAlpha.range.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.globalAlpha = 0.5; +var a = ctx.globalAlpha; // might not be exactly 0.5, if it is rounded/quantised, so remember for future comparisons +ctx.globalAlpha = 1.1; +_assertEqual(ctx.globalAlpha, a, "ctx.globalAlpha", "a"); +ctx.globalAlpha = -0.1; +_assertEqual(ctx.globalAlpha, a, "ctx.globalAlpha", "a"); +ctx.globalAlpha = 0; +_assertEqual(ctx.globalAlpha, 0, "ctx.globalAlpha", "0"); +ctx.globalAlpha = 1; +_assertEqual(ctx.globalAlpha, 1, "ctx.globalAlpha", "1"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.image.copy.js b/platforms/ios/www/test/tests-todo/2d.composite.image.copy.js new file mode 100644 index 0000000..92d325f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.image.copy.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'copy'; +ctx.drawImage(document.getElementById('yellow75.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 255,255,0,191, "50,25", "255,255,0,191", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.image.destination-atop.js b/platforms/ios/www/test/tests-todo/2d.composite.image.destination-atop.js new file mode 100644 index 0000000..18836f6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.image.destination-atop.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-atop'; +ctx.drawImage(document.getElementById('yellow75.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 127,255,127,191, "50,25", "127,255,127,191", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.image.destination-in.js b/platforms/ios/www/test/tests-todo/2d.composite.image.destination-in.js new file mode 100644 index 0000000..6b424df --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.image.destination-in.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-in'; +ctx.drawImage(document.getElementById('yellow75.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 0,255,255,95, "50,25", "0,255,255,95", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.image.destination-out.js b/platforms/ios/www/test/tests-todo/2d.composite.image.destination-out.js new file mode 100644 index 0000000..d78d191 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.image.destination-out.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-out'; +ctx.drawImage(document.getElementById('yellow75.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 0,255,255,31, "50,25", "0,255,255,31", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.image.destination-over.js b/platforms/ios/www/test/tests-todo/2d.composite.image.destination-over.js new file mode 100644 index 0000000..9bdbd52 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.image.destination-over.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-over'; +ctx.drawImage(document.getElementById('yellow75.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 109,255,145,223, "50,25", "109,255,145,223", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.image.lighter.js b/platforms/ios/www/test/tests-todo/2d.composite.image.lighter.js new file mode 100644 index 0000000..5b3fdcf --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.image.lighter.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'lighter'; +ctx.drawImage(document.getElementById('yellow75.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 191,255,127,255, "50,25", "191,255,127,255", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.image.source-atop.js b/platforms/ios/www/test/tests-todo/2d.composite.image.source-atop.js new file mode 100644 index 0000000..90157da --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.image.source-atop.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-atop'; +ctx.drawImage(document.getElementById('yellow75.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 191,255,63,127, "50,25", "191,255,63,127", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.image.source-in.js b/platforms/ios/www/test/tests-todo/2d.composite.image.source-in.js new file mode 100644 index 0000000..76a2bf5 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.image.source-in.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-in'; +ctx.drawImage(document.getElementById('yellow75.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 255,255,0,95, "50,25", "255,255,0,95", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.image.source-out.js b/platforms/ios/www/test/tests-todo/2d.composite.image.source-out.js new file mode 100644 index 0000000..2b09cd8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.image.source-out.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-out'; +ctx.drawImage(document.getElementById('yellow75.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 255,255,0,95, "50,25", "255,255,0,95", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.image.source-over.js b/platforms/ios/www/test/tests-todo/2d.composite.image.source-over.js new file mode 100644 index 0000000..dcd3291 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.image.source-over.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-over'; +ctx.drawImage(document.getElementById('yellow75.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 218,255,36,223, "50,25", "218,255,36,223", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.image.xor.js b/platforms/ios/www/test/tests-todo/2d.composite.image.xor.js new file mode 100644 index 0000000..2ae1fa5 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.image.xor.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'xor'; +ctx.drawImage(document.getElementById('yellow75.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 191,255,63,127, "50,25", "191,255,63,127", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.operation.casesensitive.js b/platforms/ios/www/test/tests-todo/2d.composite.operation.casesensitive.js new file mode 100644 index 0000000..bc185fc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.operation.casesensitive.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +ctx.globalCompositeOperation = 'xor'; +ctx.globalCompositeOperation = 'Source-over'; +_assertEqual(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.operation.clear.js b/platforms/ios/www/test/tests-todo/2d.composite.operation.clear.js new file mode 100644 index 0000000..b44825e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.operation.clear.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +ctx.globalCompositeOperation = 'xor'; +ctx.globalCompositeOperation = 'clear'; +_assertEqual(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.operation.darker.js b/platforms/ios/www/test/tests-todo/2d.composite.operation.darker.js new file mode 100644 index 0000000..c93ed3b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.operation.darker.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +ctx.globalCompositeOperation = 'xor'; +ctx.globalCompositeOperation = 'darker'; +_assertEqual(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.operation.default.js b/platforms/ios/www/test/tests-todo/2d.composite.operation.default.js new file mode 100644 index 0000000..cc02047 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.operation.default.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertEqual(ctx.globalCompositeOperation, 'source-over', "ctx.globalCompositeOperation", "'source-over'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.operation.get.js b/platforms/ios/www/test/tests-todo/2d.composite.operation.get.js new file mode 100644 index 0000000..faa06dc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.operation.get.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +var modes = ['source-atop', 'source-in', 'source-out', 'source-over', + 'destination-atop', 'destination-in', 'destination-out', 'destination-over', + 'lighter', 'copy', 'xor']; +for (var i = 0; i < modes.length; ++i) +{ + ctx.globalCompositeOperation = modes[i]; + _assertEqual(ctx.globalCompositeOperation, modes[i], "ctx.globalCompositeOperation", "modes[\""+(i)+"\"]"); +} + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.operation.highlight.js b/platforms/ios/www/test/tests-todo/2d.composite.operation.highlight.js new file mode 100644 index 0000000..33f45c8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.operation.highlight.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +ctx.globalCompositeOperation = 'xor'; +ctx.globalCompositeOperation = 'highlight'; +_assertEqual(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.operation.nullsuffix.js b/platforms/ios/www/test/tests-todo/2d.composite.operation.nullsuffix.js new file mode 100644 index 0000000..62e8c42 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.operation.nullsuffix.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +ctx.globalCompositeOperation = 'xor'; +ctx.globalCompositeOperation = 'source-over\0'; +_assertEqual(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.operation.over.js b/platforms/ios/www/test/tests-todo/2d.composite.operation.over.js new file mode 100644 index 0000000..464c3c9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.operation.over.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +ctx.globalCompositeOperation = 'xor'; +ctx.globalCompositeOperation = 'over'; +_assertEqual(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.operation.unrecognised.js b/platforms/ios/www/test/tests-todo/2d.composite.operation.unrecognised.js new file mode 100644 index 0000000..00c853b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.operation.unrecognised.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +ctx.globalCompositeOperation = 'xor'; +ctx.globalCompositeOperation = 'nonexistent'; +_assertEqual(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.solid.copy.js b/platforms/ios/www/test/tests-todo/2d.composite.solid.copy.js new file mode 100644 index 0000000..0c143dc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.solid.copy.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'copy'; +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 255,255,0,255, "50,25", "255,255,0,255", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.solid.destination-atop.js b/platforms/ios/www/test/tests-todo/2d.composite.solid.destination-atop.js new file mode 100644 index 0000000..d5e7f62 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.solid.destination-atop.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-atop'; +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,255,255,255, "50,25", "0,255,255,255", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.solid.destination-in.js b/platforms/ios/www/test/tests-todo/2d.composite.solid.destination-in.js new file mode 100644 index 0000000..2d7733a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.solid.destination-in.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-in'; +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,255,255,255, "50,25", "0,255,255,255", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.solid.destination-out.js b/platforms/ios/www/test/tests-todo/2d.composite.solid.destination-out.js new file mode 100644 index 0000000..cbfded4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.solid.destination-out.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-out'; +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.solid.destination-over.js b/platforms/ios/www/test/tests-todo/2d.composite.solid.destination-over.js new file mode 100644 index 0000000..3d94ca4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.solid.destination-over.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-over'; +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,255,255,255, "50,25", "0,255,255,255", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.solid.lighter.js b/platforms/ios/www/test/tests-todo/2d.composite.solid.lighter.js new file mode 100644 index 0000000..ee3fe61 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.solid.lighter.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'lighter'; +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 255,255,255,255, "50,25", "255,255,255,255", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.solid.source-atop.js b/platforms/ios/www/test/tests-todo/2d.composite.solid.source-atop.js new file mode 100644 index 0000000..41d0df3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.solid.source-atop.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-atop'; +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 255,255,0,255, "50,25", "255,255,0,255", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.solid.source-in.js b/platforms/ios/www/test/tests-todo/2d.composite.solid.source-in.js new file mode 100644 index 0000000..71b94de --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.solid.source-in.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-in'; +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 255,255,0,255, "50,25", "255,255,0,255", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.solid.source-over.js b/platforms/ios/www/test/tests-todo/2d.composite.solid.source-over.js new file mode 100644 index 0000000..969f474 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.solid.source-over.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-over'; +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 255,255,0,255, "50,25", "255,255,0,255", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.solid.xor.js b/platforms/ios/www/test/tests-todo/2d.composite.solid.xor.js new file mode 100644 index 0000000..6f15f72 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.solid.xor.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'xor'; +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.transparent.copy.js b/platforms/ios/www/test/tests-todo/2d.composite.transparent.copy.js new file mode 100644 index 0000000..dec49c9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.transparent.copy.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'copy'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,255,191, "50,25", "0,0,255,191", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.transparent.destination-in.js b/platforms/ios/www/test/tests-todo/2d.composite.transparent.destination-in.js new file mode 100644 index 0000000..11c86d8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.transparent.destination-in.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-in'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,255,0,95, "50,25", "0,255,0,95", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.transparent.destination-out.js b/platforms/ios/www/test/tests-todo/2d.composite.transparent.destination-out.js new file mode 100644 index 0000000..c350691 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.transparent.destination-out.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-out'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,255,0,31, "50,25", "0,255,0,31", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.transparent.destination-over.js b/platforms/ios/www/test/tests-todo/2d.composite.transparent.destination-over.js new file mode 100644 index 0000000..01bd9e2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.transparent.destination-over.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-over'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,145,109,223, "50,25", "0,145,109,223", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.transparent.lighter.js b/platforms/ios/www/test/tests-todo/2d.composite.transparent.lighter.js new file mode 100644 index 0000000..fac6a7d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.transparent.lighter.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'lighter'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,127,191,255, "50,25", "0,127,191,255", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.transparent.source-atop.js b/platforms/ios/www/test/tests-todo/2d.composite.transparent.source-atop.js new file mode 100644 index 0000000..c878090 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.transparent.source-atop.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-atop'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,63,191,127, "50,25", "0,63,191,127", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.transparent.source-in.js b/platforms/ios/www/test/tests-todo/2d.composite.transparent.source-in.js new file mode 100644 index 0000000..5855881 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.transparent.source-in.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-in'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,255,95, "50,25", "0,0,255,95", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.transparent.source-out.js b/platforms/ios/www/test/tests-todo/2d.composite.transparent.source-out.js new file mode 100644 index 0000000..bca551e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.transparent.source-out.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-out'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,255,95, "50,25", "0,0,255,95", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.transparent.source-over.js b/platforms/ios/www/test/tests-todo/2d.composite.transparent.source-over.js new file mode 100644 index 0000000..cc36cb9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.transparent.source-over.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-over'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,36,218,223, "50,25", "0,36,218,223", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.transparent.xor.js b/platforms/ios/www/test/tests-todo/2d.composite.transparent.xor.js new file mode 100644 index 0000000..d3e4a0a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.transparent.xor.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'xor'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,63,191,127, "50,25", "0,63,191,127", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.uncovered.fill.copy.js b/platforms/ios/www/test/tests-todo/2d.composite.uncovered.fill.copy.js new file mode 100644 index 0000000..b1ca3a2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.uncovered.fill.copy.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'copy'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.translate(0, 25); +ctx.fillRect(0, 50, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.uncovered.fill.destination-atop.js b/platforms/ios/www/test/tests-todo/2d.composite.uncovered.fill.destination-atop.js new file mode 100644 index 0000000..f76e616 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.uncovered.fill.destination-atop.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-atop'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.translate(0, 25); +ctx.fillRect(0, 50, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.uncovered.fill.destination-in.js b/platforms/ios/www/test/tests-todo/2d.composite.uncovered.fill.destination-in.js new file mode 100644 index 0000000..2613ed3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.uncovered.fill.destination-in.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-in'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.translate(0, 25); +ctx.fillRect(0, 50, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.uncovered.fill.source-in.js b/platforms/ios/www/test/tests-todo/2d.composite.uncovered.fill.source-in.js new file mode 100644 index 0000000..15d10f3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.uncovered.fill.source-in.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-in'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.translate(0, 25); +ctx.fillRect(0, 50, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.uncovered.fill.source-out.js b/platforms/ios/www/test/tests-todo/2d.composite.uncovered.fill.source-out.js new file mode 100644 index 0000000..653121b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.uncovered.fill.source-out.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-out'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.translate(0, 25); +ctx.fillRect(0, 50, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.uncovered.image.copy.js b/platforms/ios/www/test/tests-todo/2d.composite.uncovered.image.copy.js new file mode 100644 index 0000000..624786c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.uncovered.image.copy.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'copy'; +ctx.drawImage(document.getElementById('yellow.png'), 40, 40, 10, 10, 40, 50, 10, 10); +_assertPixelApprox(canvas, 15,15, 0,0,0,0, "15,15", "0,0,0,0", 5); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.uncovered.image.destination-atop.js b/platforms/ios/www/test/tests-todo/2d.composite.uncovered.image.destination-atop.js new file mode 100644 index 0000000..509aff6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.uncovered.image.destination-atop.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-atop'; +ctx.drawImage(document.getElementById('yellow.png'), 40, 40, 10, 10, 40, 50, 10, 10); +_assertPixelApprox(canvas, 15,15, 0,0,0,0, "15,15", "0,0,0,0", 5); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.uncovered.image.destination-in.js b/platforms/ios/www/test/tests-todo/2d.composite.uncovered.image.destination-in.js new file mode 100644 index 0000000..451a51b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.uncovered.image.destination-in.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-in'; +ctx.drawImage(document.getElementById('yellow.png'), 40, 40, 10, 10, 40, 50, 10, 10); +_assertPixelApprox(canvas, 15,15, 0,0,0,0, "15,15", "0,0,0,0", 5); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.uncovered.image.source-in.js b/platforms/ios/www/test/tests-todo/2d.composite.uncovered.image.source-in.js new file mode 100644 index 0000000..7b81106 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.uncovered.image.source-in.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-in'; +ctx.drawImage(document.getElementById('yellow.png'), 40, 40, 10, 10, 40, 50, 10, 10); +_assertPixelApprox(canvas, 15,15, 0,0,0,0, "15,15", "0,0,0,0", 5); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.uncovered.image.source-out.js b/platforms/ios/www/test/tests-todo/2d.composite.uncovered.image.source-out.js new file mode 100644 index 0000000..44df955 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.uncovered.image.source-out.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-out'; +ctx.drawImage(document.getElementById('yellow.png'), 40, 40, 10, 10, 40, 50, 10, 10); +_assertPixelApprox(canvas, 15,15, 0,0,0,0, "15,15", "0,0,0,0", 5); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.uncovered.nocontext.copy.js b/platforms/ios/www/test/tests-todo/2d.composite.uncovered.nocontext.copy.js new file mode 100644 index 0000000..339105c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.uncovered.nocontext.copy.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'copy'; +var canvas2 = document.createElement('canvas'); +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.uncovered.nocontext.destination-atop.js b/platforms/ios/www/test/tests-todo/2d.composite.uncovered.nocontext.destination-atop.js new file mode 100644 index 0000000..91a09c9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.uncovered.nocontext.destination-atop.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-atop'; +var canvas2 = document.createElement('canvas'); +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.uncovered.nocontext.destination-in.js b/platforms/ios/www/test/tests-todo/2d.composite.uncovered.nocontext.destination-in.js new file mode 100644 index 0000000..5c2d617 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.uncovered.nocontext.destination-in.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-in'; +var canvas2 = document.createElement('canvas'); +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.uncovered.nocontext.source-in.js b/platforms/ios/www/test/tests-todo/2d.composite.uncovered.nocontext.source-in.js new file mode 100644 index 0000000..1de64cb --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.uncovered.nocontext.source-in.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-in'; +var canvas2 = document.createElement('canvas'); +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.uncovered.nocontext.source-out.js b/platforms/ios/www/test/tests-todo/2d.composite.uncovered.nocontext.source-out.js new file mode 100644 index 0000000..bfc1901 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.uncovered.nocontext.source-out.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-out'; +var canvas2 = document.createElement('canvas'); +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.uncovered.pattern.copy.js b/platforms/ios/www/test/tests-todo/2d.composite.uncovered.pattern.copy.js new file mode 100644 index 0000000..cdb9d7a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.uncovered.pattern.copy.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'copy'; +ctx.fillStyle = ctx.createPattern(document.getElementById('yellow.png'), 'no-repeat'); +ctx.fillRect(0, 50, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.uncovered.pattern.destination-atop.js b/platforms/ios/www/test/tests-todo/2d.composite.uncovered.pattern.destination-atop.js new file mode 100644 index 0000000..c1c63a8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.uncovered.pattern.destination-atop.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-atop'; +ctx.fillStyle = ctx.createPattern(document.getElementById('yellow.png'), 'no-repeat'); +ctx.fillRect(0, 50, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.uncovered.pattern.destination-in.js b/platforms/ios/www/test/tests-todo/2d.composite.uncovered.pattern.destination-in.js new file mode 100644 index 0000000..e69936f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.uncovered.pattern.destination-in.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-in'; +ctx.fillStyle = ctx.createPattern(document.getElementById('yellow.png'), 'no-repeat'); +ctx.fillRect(0, 50, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.uncovered.pattern.source-in.js b/platforms/ios/www/test/tests-todo/2d.composite.uncovered.pattern.source-in.js new file mode 100644 index 0000000..b211541 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.uncovered.pattern.source-in.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-in'; +ctx.fillStyle = ctx.createPattern(document.getElementById('yellow.png'), 'no-repeat'); +ctx.fillRect(0, 50, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.composite.uncovered.pattern.source-out.js b/platforms/ios/www/test/tests-todo/2d.composite.uncovered.pattern.source-out.js new file mode 100644 index 0000000..e84e1f0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.composite.uncovered.pattern.source-out.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-out'; +ctx.fillStyle = ctx.createPattern(document.getElementById('yellow.png'), 'no-repeat'); +ctx.fillRect(0, 50, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.drawImage.animated.gif.js b/platforms/ios/www/test/tests-todo/2d.drawImage.animated.gif.js new file mode 100644 index 0000000..cadb26c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.drawImage.animated.gif.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + deferTest(); + + var animgr = new Image(); + animgr.src = 'test/images/anim-gr.gif'; + animgr.onload = function () { + draw(); + } + + function draw () { + setTimeout(wrapFunction(function () { + ctx.drawImage(animgr, 0, 0); + _assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + }), 500); + } +}); diff --git a/platforms/ios/www/test/tests-todo/2d.drawImage.nonfinite.js b/platforms/ios/www/test/tests-todo/2d.drawImage.nonfinite.js new file mode 100644 index 0000000..e190bc8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.drawImage.nonfinite.js @@ -0,0 +1,316 @@ +_addTest(function(canvas, ctx) { + var redImage = new Image(); + redImage.src = 'test/images/red.png'; + redImage.onload = function () { + draw(); + } + + function draw () { + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + var red = redImage; + ctx.drawImage(red, Infinity, 0); + ctx.drawImage(red, -Infinity, 0); + ctx.drawImage(red, NaN, 0); + ctx.drawImage(red, 0, Infinity); + ctx.drawImage(red, 0, -Infinity); + ctx.drawImage(red, 0, NaN); + ctx.drawImage(red, Infinity, Infinity); + ctx.drawImage(red, Infinity, 0, 100, 50); + ctx.drawImage(red, -Infinity, 0, 100, 50); + ctx.drawImage(red, NaN, 0, 100, 50); + ctx.drawImage(red, 0, Infinity, 100, 50); + ctx.drawImage(red, 0, -Infinity, 100, 50); + ctx.drawImage(red, 0, NaN, 100, 50); + ctx.drawImage(red, 0, 0, Infinity, 50); + ctx.drawImage(red, 0, 0, -Infinity, 50); + ctx.drawImage(red, 0, 0, NaN, 50); + ctx.drawImage(red, 0, 0, 100, Infinity); + ctx.drawImage(red, 0, 0, 100, -Infinity); + ctx.drawImage(red, 0, 0, 100, NaN); + ctx.drawImage(red, Infinity, Infinity, 100, 50); + ctx.drawImage(red, Infinity, Infinity, Infinity, 50); + ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity); + ctx.drawImage(red, Infinity, Infinity, 100, Infinity); + ctx.drawImage(red, Infinity, 0, Infinity, 50); + ctx.drawImage(red, Infinity, 0, Infinity, Infinity); + ctx.drawImage(red, Infinity, 0, 100, Infinity); + ctx.drawImage(red, 0, Infinity, Infinity, 50); + ctx.drawImage(red, 0, Infinity, Infinity, Infinity); + ctx.drawImage(red, 0, Infinity, 100, Infinity); + ctx.drawImage(red, 0, 0, Infinity, Infinity); + ctx.drawImage(red, Infinity, 0, 100, 50, 0, 0, 100, 50); + ctx.drawImage(red, -Infinity, 0, 100, 50, 0, 0, 100, 50); + ctx.drawImage(red, NaN, 0, 100, 50, 0, 0, 100, 50); + ctx.drawImage(red, 0, Infinity, 100, 50, 0, 0, 100, 50); + ctx.drawImage(red, 0, -Infinity, 100, 50, 0, 0, 100, 50); + ctx.drawImage(red, 0, NaN, 100, 50, 0, 0, 100, 50); + ctx.drawImage(red, 0, 0, Infinity, 50, 0, 0, 100, 50); + ctx.drawImage(red, 0, 0, -Infinity, 50, 0, 0, 100, 50); + ctx.drawImage(red, 0, 0, NaN, 50, 0, 0, 100, 50); + ctx.drawImage(red, 0, 0, 100, Infinity, 0, 0, 100, 50); + ctx.drawImage(red, 0, 0, 100, -Infinity, 0, 0, 100, 50); + ctx.drawImage(red, 0, 0, 100, NaN, 0, 0, 100, 50); + ctx.drawImage(red, 0, 0, 100, 50, Infinity, 0, 100, 50); + ctx.drawImage(red, 0, 0, 100, 50, -Infinity, 0, 100, 50); + ctx.drawImage(red, 0, 0, 100, 50, NaN, 0, 100, 50); + ctx.drawImage(red, 0, 0, 100, 50, 0, Infinity, 100, 50); + ctx.drawImage(red, 0, 0, 100, 50, 0, -Infinity, 100, 50); + ctx.drawImage(red, 0, 0, 100, 50, 0, NaN, 100, 50); + ctx.drawImage(red, 0, 0, 100, 50, 0, 0, Infinity, 50); + ctx.drawImage(red, 0, 0, 100, 50, 0, 0, -Infinity, 50); + ctx.drawImage(red, 0, 0, 100, 50, 0, 0, NaN, 50); + ctx.drawImage(red, 0, 0, 100, 50, 0, 0, 100, Infinity); + ctx.drawImage(red, 0, 0, 100, 50, 0, 0, 100, -Infinity); + ctx.drawImage(red, 0, 0, 100, 50, 0, 0, 100, NaN); + ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, 0, 100, 50); + ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, 0, 100, 50); + ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, 0, 100, 50); + ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, 0, 100, 50); + ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, 100, 50); + ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, 50); + ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); + ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, 100, Infinity); + ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, 0, Infinity, 50); + ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, 0, Infinity, Infinity); + ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, 0, 100, Infinity); + ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, Infinity, 100, 50); + ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, Infinity, Infinity, 50); + ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, Infinity, Infinity, Infinity); + ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, Infinity, 100, Infinity); + ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, 0, Infinity, 50); + ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, 0, Infinity, Infinity); + ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, 0, 100, Infinity); + ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, 0, 100, 50); + ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, Infinity, 100, 50); + ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, Infinity, Infinity, 50); + ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, Infinity, Infinity, Infinity); + ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, Infinity, 100, Infinity); + ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, 0, Infinity, 50); + ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, 0, Infinity, Infinity); + ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, 0, 100, Infinity); + ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, Infinity, 100, 50); + ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, Infinity, Infinity, 50); + ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, Infinity, Infinity, Infinity); + ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, Infinity, 100, Infinity); + ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, 0, Infinity, 50); + ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, 0, Infinity, Infinity); + ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, 0, 100, Infinity); + ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, 0, 100, 50); + ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, 0, 100, 50); + ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, Infinity, 100, 50); + ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, Infinity, Infinity, 50); + ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, Infinity, Infinity, Infinity); + ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, Infinity, 100, Infinity); + ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, 0, Infinity, 50); + ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, 0, Infinity, Infinity); + ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, 0, 100, Infinity); + ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, Infinity, 100, 50); + ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, Infinity, Infinity, 50); + ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, Infinity, Infinity, Infinity); + ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, Infinity, 100, Infinity); + ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, 0, Infinity, 50); + ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, 0, Infinity, Infinity); + ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, 0, 100, Infinity); + ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, 0, 100, 50); + ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, Infinity, 100, 50); + ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, Infinity, Infinity, 50); + ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, Infinity, Infinity, Infinity); + ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, Infinity, 100, Infinity); + ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, 0, Infinity, 50); + ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, 0, Infinity, Infinity); + ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, 0, 100, Infinity); + ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, Infinity, 100, 50); + ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, Infinity, Infinity, 50); + ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, Infinity, Infinity, Infinity); + ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, Infinity, 100, Infinity); + ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, 0, Infinity, 50); + ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, 0, Infinity, Infinity); + ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, 0, 100, Infinity); + ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, 0, 100, 50); + ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, 0, 100, 50); + ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, 0, 100, 50); + ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, Infinity, 100, 50); + ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, Infinity, Infinity, 50); + ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); + ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, Infinity, 100, Infinity); + ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, 0, Infinity, 50); + ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, 0, Infinity, Infinity); + ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, 0, 100, Infinity); + ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, Infinity, 100, 50); + ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, Infinity, Infinity, 50); + ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, Infinity, Infinity, Infinity); + ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, Infinity, 100, Infinity); + ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, 0, Infinity, 50); + ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, 0, Infinity, Infinity); + ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, 0, 100, Infinity); + ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, 0, 100, 50); + ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, Infinity, 100, 50); + ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, Infinity, Infinity, 50); + ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, Infinity, Infinity, Infinity); + ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, Infinity, 100, Infinity); + ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, 0, Infinity, 50); + ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, 0, Infinity, Infinity); + ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, 0, 100, Infinity); + ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, Infinity, 100, 50); + ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, Infinity, Infinity, 50); + ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, Infinity, Infinity, Infinity); + ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, Infinity, 100, Infinity); + ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, 0, Infinity, 50); + ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, 0, Infinity, Infinity); + ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, 0, 100, Infinity); + ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, 0, 100, 50); + ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, 0, 100, 50); + ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, Infinity, 100, 50); + ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, Infinity, Infinity, 50); + ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, Infinity, Infinity, Infinity); + ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, Infinity, 100, Infinity); + ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, 0, Infinity, 50); + ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, 0, Infinity, Infinity); + ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, 0, 100, Infinity); + ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, Infinity, 100, 50); + ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, Infinity, Infinity, 50); + ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, Infinity, Infinity, Infinity); + ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, Infinity, 100, Infinity); + ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, 0, Infinity, 50); + ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, 0, Infinity, Infinity); + ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, 0, 100, Infinity); + ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, 0, 100, 50); + ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, Infinity, 100, 50); + ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, Infinity, Infinity, 50); + ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, Infinity, Infinity, Infinity); + ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, Infinity, 100, Infinity); + ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, 0, Infinity, 50); + ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, 0, Infinity, Infinity); + ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, 0, 100, Infinity); + ctx.drawImage(red, Infinity, 0, 100, 50, 0, Infinity, 100, 50); + ctx.drawImage(red, Infinity, 0, 100, 50, 0, Infinity, Infinity, 50); + ctx.drawImage(red, Infinity, 0, 100, 50, 0, Infinity, Infinity, Infinity); + ctx.drawImage(red, Infinity, 0, 100, 50, 0, Infinity, 100, Infinity); + ctx.drawImage(red, Infinity, 0, 100, 50, 0, 0, Infinity, 50); + ctx.drawImage(red, Infinity, 0, 100, 50, 0, 0, Infinity, Infinity); + ctx.drawImage(red, Infinity, 0, 100, 50, 0, 0, 100, Infinity); + ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, 0, 100, 50); + ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, 0, 100, 50); + ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, 0, 100, 50); + ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, Infinity, 100, 50); + ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, 50); + ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); + ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, Infinity, 100, Infinity); + ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, 0, Infinity, 50); + ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, 0, Infinity, Infinity); + ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, 0, 100, Infinity); + ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, Infinity, 100, 50); + ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, Infinity, Infinity, 50); + ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, Infinity, Infinity, Infinity); + ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, Infinity, 100, Infinity); + ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, 0, Infinity, 50); + ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, 0, Infinity, Infinity); + ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, 0, 100, Infinity); + ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, 0, 100, 50); + ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, Infinity, 100, 50); + ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, Infinity, Infinity, 50); + ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, Infinity, Infinity, Infinity); + ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, Infinity, 100, Infinity); + ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, 0, Infinity, 50); + ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, 0, Infinity, Infinity); + ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, 0, 100, Infinity); + ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, Infinity, 100, 50); + ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, Infinity, Infinity, 50); + ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, Infinity, Infinity, Infinity); + ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, Infinity, 100, Infinity); + ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, 0, Infinity, 50); + ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, 0, Infinity, Infinity); + ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, 0, 100, Infinity); + ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, 0, 100, 50); + ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, 0, 100, 50); + ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, Infinity, 100, 50); + ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, Infinity, Infinity, 50); + ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, Infinity, Infinity, Infinity); + ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, Infinity, 100, Infinity); + ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, 0, Infinity, 50); + ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, 0, Infinity, Infinity); + ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, 0, 100, Infinity); + ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, Infinity, 100, 50); + ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, Infinity, Infinity, 50); + ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, Infinity, Infinity, Infinity); + ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, Infinity, 100, Infinity); + ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, 0, Infinity, 50); + ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, 0, Infinity, Infinity); + ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, 0, 100, Infinity); + ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, 0, 100, 50); + ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, Infinity, 100, 50); + ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, Infinity, Infinity, 50); + ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, Infinity, Infinity, Infinity); + ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, Infinity, 100, Infinity); + ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, 0, Infinity, 50); + ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, 0, Infinity, Infinity); + ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, 0, 100, Infinity); + ctx.drawImage(red, 0, Infinity, 100, 50, 0, Infinity, 100, 50); + ctx.drawImage(red, 0, Infinity, 100, 50, 0, Infinity, Infinity, 50); + ctx.drawImage(red, 0, Infinity, 100, 50, 0, Infinity, Infinity, Infinity); + ctx.drawImage(red, 0, Infinity, 100, 50, 0, Infinity, 100, Infinity); + ctx.drawImage(red, 0, Infinity, 100, 50, 0, 0, Infinity, 50); + ctx.drawImage(red, 0, Infinity, 100, 50, 0, 0, Infinity, Infinity); + ctx.drawImage(red, 0, Infinity, 100, 50, 0, 0, 100, Infinity); + ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, 0, 100, 50); + ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, 0, 100, 50); + ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, Infinity, 100, 50); + ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, Infinity, Infinity, 50); + ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); + ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, Infinity, 100, Infinity); + ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, 0, Infinity, 50); + ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, 0, Infinity, Infinity); + ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, 0, 100, Infinity); + ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, Infinity, 100, 50); + ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, Infinity, Infinity, 50); + ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, Infinity, Infinity, Infinity); + ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, Infinity, 100, Infinity); + ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, 0, Infinity, 50); + ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, 0, Infinity, Infinity); + ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, 0, 100, Infinity); + ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, 0, 100, 50); + ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, Infinity, 100, 50); + ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, Infinity, Infinity, 50); + ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, Infinity, Infinity, Infinity); + ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, Infinity, 100, Infinity); + ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, 0, Infinity, 50); + ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, 0, Infinity, Infinity); + ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, 0, 100, Infinity); + ctx.drawImage(red, 0, 0, Infinity, 50, 0, Infinity, 100, 50); + ctx.drawImage(red, 0, 0, Infinity, 50, 0, Infinity, Infinity, 50); + ctx.drawImage(red, 0, 0, Infinity, 50, 0, Infinity, Infinity, Infinity); + ctx.drawImage(red, 0, 0, Infinity, 50, 0, Infinity, 100, Infinity); + ctx.drawImage(red, 0, 0, Infinity, 50, 0, 0, Infinity, 50); + ctx.drawImage(red, 0, 0, Infinity, 50, 0, 0, Infinity, Infinity); + ctx.drawImage(red, 0, 0, Infinity, 50, 0, 0, 100, Infinity); + ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, 0, 100, 50); + ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, Infinity, 100, 50); + ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, Infinity, Infinity, 50); + ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, Infinity, Infinity, Infinity); + ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, Infinity, 100, Infinity); + ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, 0, Infinity, 50); + ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, 0, Infinity, Infinity); + ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, 0, 100, Infinity); + ctx.drawImage(red, 0, 0, 100, Infinity, 0, Infinity, 100, 50); + ctx.drawImage(red, 0, 0, 100, Infinity, 0, Infinity, Infinity, 50); + ctx.drawImage(red, 0, 0, 100, Infinity, 0, Infinity, Infinity, Infinity); + ctx.drawImage(red, 0, 0, 100, Infinity, 0, Infinity, 100, Infinity); + ctx.drawImage(red, 0, 0, 100, Infinity, 0, 0, Infinity, 50); + ctx.drawImage(red, 0, 0, 100, Infinity, 0, 0, Infinity, Infinity); + ctx.drawImage(red, 0, 0, 100, Infinity, 0, 0, 100, Infinity); + ctx.drawImage(red, 0, 0, 100, 50, Infinity, Infinity, 100, 50); + ctx.drawImage(red, 0, 0, 100, 50, Infinity, Infinity, Infinity, 50); + ctx.drawImage(red, 0, 0, 100, 50, Infinity, Infinity, Infinity, Infinity); + ctx.drawImage(red, 0, 0, 100, 50, Infinity, Infinity, 100, Infinity); + ctx.drawImage(red, 0, 0, 100, 50, Infinity, 0, Infinity, 50); + ctx.drawImage(red, 0, 0, 100, 50, Infinity, 0, Infinity, Infinity); + ctx.drawImage(red, 0, 0, 100, 50, Infinity, 0, 100, Infinity); + ctx.drawImage(red, 0, 0, 100, 50, 0, Infinity, Infinity, 50); + ctx.drawImage(red, 0, 0, 100, 50, 0, Infinity, Infinity, Infinity); + ctx.drawImage(red, 0, 0, 100, 50, 0, Infinity, 100, Infinity); + ctx.drawImage(red, 0, 0, 100, 50, 0, 0, Infinity, Infinity); + _assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + } + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.drawImage.null.js b/platforms/ios/www/test/tests-todo/2d.drawImage.null.js new file mode 100644 index 0000000..34de2e4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.drawImage.null.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.drawImage(null, 0, 0); +} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail("Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TYPE_MISMATCH_ERR: ctx.drawImage(null, 0, 0)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.drawImage.wrongtype.js b/platforms/ios/www/test/tests-todo/2d.drawImage.wrongtype.js new file mode 100644 index 0000000..64fb6e4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.drawImage.wrongtype.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.drawImage(undefined, 0, 0); +} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail("Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TYPE_MISMATCH_ERR: ctx.drawImage(undefined, 0, 0)"); } +try { var _thrown = false; + ctx.drawImage(0, 0, 0); +} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail("Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TYPE_MISMATCH_ERR: ctx.drawImage(0, 0, 0)"); } +try { var _thrown = false; + ctx.drawImage("", 0, 0); +} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail("Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TYPE_MISMATCH_ERR: ctx.drawImage(\"\", 0, 0)"); } +try { var _thrown = false; + ctx.drawImage(document.createElement('p'), 0, 0); +} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail("Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TYPE_MISMATCH_ERR: ctx.drawImage(document.createElement('p'), 0, 0)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.drawImage.zerocanvas.js b/platforms/ios/www/test/tests-todo/2d.drawImage.zerocanvas.js new file mode 100644 index 0000000..2282f8e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.drawImage.zerocanvas.js @@ -0,0 +1,28 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var canvas2 = document.createElement('canvas'); +canvas2.width = 0; +canvas2.height = 10; +try { var _thrown = false; + ctx.drawImage(canvas2, 0, 0); +} catch (e) { if (e.code != DOMException.INVALID_STATE_ERR) _fail("Failed assertion: expected exception of type INVALID_STATE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INVALID_STATE_ERR: ctx.drawImage(canvas2, 0, 0)"); } + +canvas2.width = 10; +canvas2.height = 0; +try { var _thrown = false; + ctx.drawImage(canvas2, 0, 0); +} catch (e) { if (e.code != DOMException.INVALID_STATE_ERR) _fail("Failed assertion: expected exception of type INVALID_STATE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INVALID_STATE_ERR: ctx.drawImage(canvas2, 0, 0)"); } + +canvas2.width = 0; +canvas2.height = 0; +try { var _thrown = false; + ctx.drawImage(canvas2, 0, 0); +} catch (e) { if (e.code != DOMException.INVALID_STATE_ERR) _fail("Failed assertion: expected exception of type INVALID_STATE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INVALID_STATE_ERR: ctx.drawImage(canvas2, 0, 0)"); } + +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.drawImage.zerosource.js b/platforms/ios/www/test/tests-todo/2d.drawImage.zerosource.js new file mode 100644 index 0000000..7a1be5d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.drawImage.zerosource.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + var redImage = new Image(); + redImage.src = 'test/images/red.png'; + redImage.onload = function () { + draw(); + } + + function draw () { + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + try { var _thrown = false; + ctx.drawImage(redImage, 10, 10, 0, 1, 0, 0, 100, 50); + } catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 10, 10, 0, 1, 0, 0, 100, 50)"); } + try { var _thrown = false; + ctx.drawImage(redImage, 10, 10, 1, 0, 0, 0, 100, 50); + } catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 10, 10, 1, 0, 0, 0, 100, 50)"); } + try { var _thrown = false; + ctx.drawImage(redImage, 10, 10, 0, 0, 0, 0, 100, 50); + } catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 10, 10, 0, 0, 0, 0, 100, 50)"); } + _assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + } + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillRect.nonfinite.js b/platforms/ios/www/test/tests-todo/2d.fillRect.nonfinite.js new file mode 100644 index 0000000..c224f49 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillRect.nonfinite.js @@ -0,0 +1,34 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#f00'; +ctx.fillRect(Infinity, 0, 100, 50); +ctx.fillRect(-Infinity, 0, 100, 50); +ctx.fillRect(NaN, 0, 100, 50); +ctx.fillRect(0, Infinity, 100, 50); +ctx.fillRect(0, -Infinity, 100, 50); +ctx.fillRect(0, NaN, 100, 50); +ctx.fillRect(0, 0, Infinity, 50); +ctx.fillRect(0, 0, -Infinity, 50); +ctx.fillRect(0, 0, NaN, 50); +ctx.fillRect(0, 0, 100, Infinity); +ctx.fillRect(0, 0, 100, -Infinity); +ctx.fillRect(0, 0, 100, NaN); +ctx.fillRect(Infinity, Infinity, 100, 50); +ctx.fillRect(Infinity, Infinity, Infinity, 50); +ctx.fillRect(Infinity, Infinity, Infinity, Infinity); +ctx.fillRect(Infinity, Infinity, 100, Infinity); +ctx.fillRect(Infinity, 0, Infinity, 50); +ctx.fillRect(Infinity, 0, Infinity, Infinity); +ctx.fillRect(Infinity, 0, 100, Infinity); +ctx.fillRect(0, Infinity, Infinity, 50); +ctx.fillRect(0, Infinity, Infinity, Infinity); +ctx.fillRect(0, Infinity, 100, Infinity); +ctx.fillRect(0, 0, Infinity, Infinity); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillRect.shadow.js b/platforms/ios/www/test/tests-todo/2d.fillRect.shadow.js new file mode 100644 index 0000000..8847506 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillRect.shadow.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = '#0f0'; +ctx.shadowBlur = 0; +ctx.shadowOffsetX = 0; +ctx.shadowOffsetY = 50; +ctx.fillRect(0, -50, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.default.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.default.js new file mode 100644 index 0000000..f13a597 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.default.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { +var canvas2 = document.createElement('canvas'); +var ctx2 = canvas2.getContext('2d'); +_assertEqual(ctx2.fillStyle, '#000000', "ctx.fillStyle", "'#000000'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.get.semitransparent.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.get.semitransparent.js new file mode 100644 index 0000000..ae13c6e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.get.semitransparent.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = 'rgba(255,255,255,0.45)'; +_assertMatch(ctx.fillStyle, /^rgba\(255, 255, 255, 0\.4\d+\)$/, "ctx.fillStyle", "/^rgba\\(255, 255, 255, 0\\.4\\d+\\)$/"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.get.solid.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.get.solid.js new file mode 100644 index 0000000..b466c83 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.get.solid.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#fa0'; +_assertSame(ctx.fillStyle, '#ffaa00', "ctx.fillStyle", "'#ffaa00'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.get.transparent.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.get.transparent.js new file mode 100644 index 0000000..ce98d44 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.get.transparent.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = 'rgba(0,0,0,0)'; +_assertEqual(ctx.fillStyle, 'rgba(0, 0, 0, 0.0)', "ctx.fillStyle", "'rgba(0, 0, 0, 0.0)'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.invalidstring.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.invalidstring.js new file mode 100644 index 0000000..45031cc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.invalidstring.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.fillStyle = 'invalid'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.invalidtype.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.invalidtype.js new file mode 100644 index 0000000..3d098f4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.invalidtype.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.fillStyle = null; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hex3.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hex3.js new file mode 100644 index 0000000..74b4b25 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hex3.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hex6.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hex6.js new file mode 100644 index 0000000..e076f53 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hex6.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = '#00fF00'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsl-1.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsl-1.js new file mode 100644 index 0000000..0b48479 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsl-1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(120, 100%, 50%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsl-2.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsl-2.js new file mode 100644 index 0000000..1210c7f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsl-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl( -240 , 100% , 50% )'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsl-3.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsl-3.js new file mode 100644 index 0000000..5fbfea0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsl-3.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(360120, 100%, 50%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsl-4.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsl-4.js new file mode 100644 index 0000000..f2b086a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsl-4.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(-360240, 100%, 50%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsl-5.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsl-5.js new file mode 100644 index 0000000..d8c7c27 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsl-5.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(120.0, 100.0%, 50.0%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsl-clamp-1.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsl-clamp-1.js new file mode 100644 index 0000000..375c1f2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsl-clamp-1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(120, 200%, 50%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsl-clamp-2.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsl-clamp-2.js new file mode 100644 index 0000000..c0a6b5b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsl-clamp-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(120, -200%, 49.9%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 127,127,127,255, "50,25", "127,127,127,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsl-clamp-3.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsl-clamp-3.js new file mode 100644 index 0000000..6bb9a8d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsl-clamp-3.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(120, 100%, 200%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 255,255,255,255, "50,25", "255,255,255,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsl-clamp-4.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsl-clamp-4.js new file mode 100644 index 0000000..091eb3c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsl-clamp-4.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(120, 100%, -200%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,0,0,255, "50,25", "0,0,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsla-1.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsla-1.js new file mode 100644 index 0000000..da51825 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsla-1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsla(120, 100%, 50%, 0.499)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,127, "50,25", "0,255,0,127"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsla-2.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsla-2.js new file mode 100644 index 0000000..b746602 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsla-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsla( 120.0 , 100.0% , 50.0% , 1 )'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsla-clamp-1.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsla-clamp-1.js new file mode 100644 index 0000000..97f9eec --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsla-clamp-1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsla(120, 200%, 50%, 1)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsla-clamp-2.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsla-clamp-2.js new file mode 100644 index 0000000..a479c09 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsla-clamp-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsla(120, -200%, 49.9%, 1)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 127,127,127,255, "50,25", "127,127,127,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsla-clamp-3.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsla-clamp-3.js new file mode 100644 index 0000000..69af398 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsla-clamp-3.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsla(120, 100%, 200%, 1)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 255,255,255,255, "50,25", "255,255,255,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsla-clamp-4.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsla-clamp-4.js new file mode 100644 index 0000000..bca6ff3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsla-clamp-4.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsla(120, 100%, -200%, 1)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,0,0,255, "50,25", "0,0,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsla-clamp-5.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsla-clamp-5.js new file mode 100644 index 0000000..9d1a095 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsla-clamp-5.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsla(120, 100%, 50%, 2)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsla-clamp-6.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsla-clamp-6.js new file mode 100644 index 0000000..488477a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.hsla-clamp-6.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsla(120, 100%, 0%, -2)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.html4.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.html4.js new file mode 100644 index 0000000..945cc00 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.html4.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'limE'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hex1.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hex1.js new file mode 100644 index 0000000..85949a0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hex1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = '#f'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hex2.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hex2.js new file mode 100644 index 0000000..d028340 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hex2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = '#f0'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hex3.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hex3.js new file mode 100644 index 0000000..17fa794 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hex3.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = '#g00'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hex4.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hex4.js new file mode 100644 index 0000000..1abcd75 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hex4.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = '#ff00'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hex5.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hex5.js new file mode 100644 index 0000000..8a59b56 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hex5.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = '#ff000'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hex6.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hex6.js new file mode 100644 index 0000000..a296b00 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hex6.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = '#fg0000'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hex7.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hex7.js new file mode 100644 index 0000000..6ef24b8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hex7.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = '#ff0000f'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hex8.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hex8.js new file mode 100644 index 0000000..cca73d9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hex8.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = '#ff0000ff'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hsl-1.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hsl-1.js new file mode 100644 index 0000000..1722e76 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hsl-1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'hsl(0%, 100%, 50%)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hsl-2.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hsl-2.js new file mode 100644 index 0000000..0569b91 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hsl-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'hsl(z, 100%, 50%)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hsl-3.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hsl-3.js new file mode 100644 index 0000000..24b21c5 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hsl-3.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'hsl(0, 0, 50%)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hsl-4.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hsl-4.js new file mode 100644 index 0000000..1a0e021 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hsl-4.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'hsl(0, 100%, 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hsl-5.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hsl-5.js new file mode 100644 index 0000000..a274be3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hsl-5.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'hsl(0, 100%, 100%, 1)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hsla-1.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hsla-1.js new file mode 100644 index 0000000..8bafae8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hsla-1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'hsla(0%, 100%, 50%, 1)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hsla-2.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hsla-2.js new file mode 100644 index 0000000..cdd0063 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.hsla-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'hsla(0, 0, 50%, 1)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.name-1.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.name-1.js new file mode 100644 index 0000000..2db78f7 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.name-1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'darkbrown'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.name-2.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.name-2.js new file mode 100644 index 0000000..16334ed --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.name-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'firebrick1'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.name-3.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.name-3.js new file mode 100644 index 0000000..01c3d71 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.name-3.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'red blue'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.rgb-1.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.rgb-1.js new file mode 100644 index 0000000..4d4ed26 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.rgb-1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgb(255.0, 0, 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.rgb-2.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.rgb-2.js new file mode 100644 index 0000000..e348f93 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.rgb-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgb(255, 0.0, 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.rgb-3.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.rgb-3.js new file mode 100644 index 0000000..64ace0b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.rgb-3.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgb(255.0, 0, 0,)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.rgb-4.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.rgb-4.js new file mode 100644 index 0000000..c56ec66 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.rgb-4.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgb(100%, 0, 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.rgb-5.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.rgb-5.js new file mode 100644 index 0000000..deccba0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.rgb-5.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgb(255 0 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.rgb-6.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.rgb-6.js new file mode 100644 index 0000000..36bba33 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.rgb-6.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgb(255, - 1, 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.rgb-7.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.rgb-7.js new file mode 100644 index 0000000..c919b73 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.rgb-7.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgb(255, 0, 0, 1)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.rgba-1.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.rgba-1.js new file mode 100644 index 0000000..f44a25e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.rgba-1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgba(255, 0, 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.rgba-2.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.rgba-2.js new file mode 100644 index 0000000..29e1c9a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.rgba-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgba(255.0, 0, 0, 1)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.rgba-3.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.rgba-3.js new file mode 100644 index 0000000..2a51261 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.rgba-3.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgba(100%, 0, 0, 1)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.rgba-4.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.rgba-4.js new file mode 100644 index 0000000..e6e9f3a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.rgba-4.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgba(255, 0, 0, 100%)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.rgba-5.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.rgba-5.js new file mode 100644 index 0000000..89ad25d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.invalid.rgba-5.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgba(255, 0, 0, 1. 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.rgb-clamp-1.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.rgb-clamp-1.js new file mode 100644 index 0000000..0647a16 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.rgb-clamp-1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgb(-1000, 1000, -1000)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.rgb-clamp-2.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.rgb-clamp-2.js new file mode 100644 index 0000000..13ecd74 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.rgb-clamp-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgb(-200%, 200%, -200%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.rgb-clamp-3.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.rgb-clamp-3.js new file mode 100644 index 0000000..ee96d11 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.rgb-clamp-3.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgb(-2147483649, 4294967298, -18446744073709551619)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.rgb-clamp-4.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.rgb-clamp-4.js new file mode 100644 index 0000000..6d59992 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.rgb-clamp-4.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgb(-1000000000000000000000000000000000000000, 1000000000000000000000000000000000000000, -1000000000000000000000000000000000000000)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.rgb-clamp-5.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.rgb-clamp-5.js new file mode 100644 index 0000000..8fcb56a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.rgb-clamp-5.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgb(-10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, -10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.rgb-num.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.rgb-num.js new file mode 100644 index 0000000..a7e459d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.rgb-num.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgb(0,255,0)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.rgb-percent.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.rgb-percent.js new file mode 100644 index 0000000..e44de2a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.rgb-percent.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgb(0% ,100% ,0%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.rgba-clamp-1.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.rgba-clamp-1.js new file mode 100644 index 0000000..a21b6e9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.rgba-clamp-1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgba(0, 255, 0, -2)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.rgba-clamp-2.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.rgba-clamp-2.js new file mode 100644 index 0000000..baf6e24 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.rgba-clamp-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgba(0, 255, 0, 2)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.rgba-num-1.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.rgba-num-1.js new file mode 100644 index 0000000..adb60fb --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.rgba-num-1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgba( 0 , 255 , 0 , .499 )'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,127, "50,25", "0,255,0,127"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.rgba-num-2.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.rgba-num-2.js new file mode 100644 index 0000000..0a9e66c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.rgba-num-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgba( 0 , 255 , 0 , 0.499 )'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,127, "50,25", "0,255,0,127"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.rgba-percent.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.rgba-percent.js new file mode 100644 index 0000000..6167e85 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.rgba-percent.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgba(0%,100%,0%,0.499)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,127, "50,25", "0,255,0,127"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.rgba-solid-1.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.rgba-solid-1.js new file mode 100644 index 0000000..a9be424 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.rgba-solid-1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgba( 0 , 255 , 0 , 1 )'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.rgba-solid-2.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.rgba-solid-2.js new file mode 100644 index 0000000..19df73e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.rgba-solid-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgba( 0 , 255 , 0 , 1.0 )'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.svg-1.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.svg-1.js new file mode 100644 index 0000000..9eba318 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.svg-1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'gray'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 128,128,128,255, "50,25", "128,128,128,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.svg-2.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.svg-2.js new file mode 100644 index 0000000..79c9612 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.svg-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'grey'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 128,128,128,255, "50,25", "128,128,128,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.system.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.system.js new file mode 100644 index 0000000..fd3d890 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.system.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'ThreeDDarkShadow'; +_assertMatch(ctx.fillStyle, /^#(?!(FF0000|ff0000|f00)$)/, "ctx.fillStyle", "/^#(?!(FF0000|ff0000|f00)$)/"); // test that it's not red + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.transparent-1.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.transparent-1.js new file mode 100644 index 0000000..c77a1bb --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.transparent-1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'transparent'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.transparent-2.js b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.transparent-2.js new file mode 100644 index 0000000..6243082 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.fillStyle.parse.transparent-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'TrAnSpArEnT'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.gradient.interpolate.alpha.js b/platforms/ios/www/test/tests-todo/2d.gradient.interpolate.alpha.js new file mode 100644 index 0000000..236ab3b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.gradient.interpolate.alpha.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#ff0'; +ctx.fillRect(0, 0, 100, 50); +var g = ctx.createLinearGradient(0, 0, 100, 0); +g.addColorStop(0, 'rgba(0,0,255, 0)'); +g.addColorStop(1, 'rgba(0,0,255, 1)'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 25,25, 191,191,63,255, "25,25", "191,191,63,255", 3); +_assertPixelApprox(canvas, 50,25, 127,127,127,255, "50,25", "127,127,127,255", 3); +_assertPixelApprox(canvas, 75,25, 63,63,191,255, "75,25", "63,63,191,255", 3); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.gradient.interpolate.colour.js b/platforms/ios/www/test/tests-todo/2d.gradient.interpolate.colour.js new file mode 100644 index 0000000..6ce808f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.gradient.interpolate.colour.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +var g = ctx.createLinearGradient(0, 0, 100, 0); +g.addColorStop(0, '#ff0'); +g.addColorStop(1, '#00f'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 25,25, 191,191,63,255, "25,25", "191,191,63,255", 3); +_assertPixelApprox(canvas, 50,25, 127,127,127,255, "50,25", "127,127,127,255", 3); +_assertPixelApprox(canvas, 75,25, 63,63,191,255, "75,25", "63,63,191,255", 3); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.gradient.interpolate.colouralpha.js b/platforms/ios/www/test/tests-todo/2d.gradient.interpolate.colouralpha.js new file mode 100644 index 0000000..f6772c4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.gradient.interpolate.colouralpha.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +var g = ctx.createLinearGradient(0, 0, 100, 0); +g.addColorStop(0, 'rgba(255,255,0, 0)'); +g.addColorStop(1, 'rgba(0,0,255, 1)'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 25,25, 191,191,63,63, "25,25", "191,191,63,63", 3); +_assertPixelApprox(canvas, 50,25, 127,127,127,127, "50,25", "127,127,127,127", 3); +_assertPixelApprox(canvas, 75,25, 63,63,191,191, "75,25", "63,63,191,191", 3); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.gradient.interpolate.multiple.js b/platforms/ios/www/test/tests-todo/2d.gradient.interpolate.multiple.js new file mode 100644 index 0000000..a2be77c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.gradient.interpolate.multiple.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 200; +var g = ctx.createLinearGradient(0, 0, 200, 0); +g.addColorStop(0, '#ff0'); +g.addColorStop(0.5, '#0ff'); +g.addColorStop(1, '#f0f'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 200, 50); +_assertPixelApprox(canvas, 50,25, 127,255,127,255, "50,25", "127,255,127,255", 3); +_assertPixelApprox(canvas, 100,25, 0,255,255,255, "100,25", "0,255,255,255", 3); +_assertPixelApprox(canvas, 150,25, 127,127,255,255, "150,25", "127,127,255,255", 3); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.gradient.interpolate.outside.js b/platforms/ios/www/test/tests-todo/2d.gradient.interpolate.outside.js new file mode 100644 index 0000000..65e5053 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.gradient.interpolate.outside.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createLinearGradient(25, 0, 75, 0); +g.addColorStop(0.4, '#0f0'); +g.addColorStop(0.6, '#0f0'); + +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 20,25, 0,255,0,255, "20,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 80,25, 0,255,0,255, "80,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.gradient.interpolate.overlap.js b/platforms/ios/www/test/tests-todo/2d.gradient.interpolate.overlap.js new file mode 100644 index 0000000..5cf8972 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.gradient.interpolate.overlap.js @@ -0,0 +1,31 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 200; +var g = ctx.createLinearGradient(0, 0, 200, 0); +g.addColorStop(0, '#f00'); +g.addColorStop(0, '#ff0'); +g.addColorStop(0.25, '#00f'); +g.addColorStop(0.25, '#0f0'); +g.addColorStop(0.25, '#0f0'); +g.addColorStop(0.25, '#0f0'); +g.addColorStop(0.25, '#ff0'); +g.addColorStop(0.5, '#00f'); +g.addColorStop(0.5, '#0f0'); +g.addColorStop(0.75, '#00f'); +g.addColorStop(0.75, '#f00'); +g.addColorStop(0.75, '#ff0'); +g.addColorStop(0.5, '#0f0'); +g.addColorStop(0.5, '#0f0'); +g.addColorStop(0.5, '#ff0'); +g.addColorStop(1, '#00f'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 200, 50); +_assertPixelApprox(canvas, 49,25, 0,0,255,255, "49,25", "0,0,255,255", 16); +_assertPixelApprox(canvas, 51,25, 255,255,0,255, "51,25", "255,255,0,255", 16); +_assertPixelApprox(canvas, 99,25, 0,0,255,255, "99,25", "0,0,255,255", 16); +_assertPixelApprox(canvas, 101,25, 255,255,0,255, "101,25", "255,255,0,255", 16); +_assertPixelApprox(canvas, 149,25, 0,0,255,255, "149,25", "0,0,255,255", 16); +_assertPixelApprox(canvas, 151,25, 255,255,0,255, "151,25", "255,255,0,255", 16); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.gradient.interpolate.overlap2.js b/platforms/ios/www/test/tests-todo/2d.gradient.interpolate.overlap2.js new file mode 100644 index 0000000..62e0880 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.gradient.interpolate.overlap2.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +var g = ctx.createLinearGradient(0, 0, 100, 0); +var ps = [ 0, 1/10, 1/4, 1/3, 1/2, 3/4, 1 ]; +for (var p = 0; p < ps.length; ++p) +{ + g.addColorStop(ps[p], '#0f0'); + for (var i = 0; i < 15; ++i) + g.addColorStop(ps[p], '#f00'); + g.addColorStop(ps[p], '#0f0'); +} +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 30,25, 0,255,0,255, "30,25", "0,255,0,255"); +_assertPixel(canvas, 40,25, 0,255,0,255, "40,25", "0,255,0,255"); +_assertPixel(canvas, 60,25, 0,255,0,255, "60,25", "0,255,0,255"); +_assertPixel(canvas, 80,25, 0,255,0,255, "80,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.gradient.interpolate.solid.js b/platforms/ios/www/test/tests-todo/2d.gradient.interpolate.solid.js new file mode 100644 index 0000000..1c73c04 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.gradient.interpolate.solid.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +var g = ctx.createLinearGradient(0, 0, 100, 0); +g.addColorStop(0, '#0f0'); +g.addColorStop(1, '#0f0'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.gradient.interpolate.zerosize.js b/platforms/ios/www/test/tests-todo/2d.gradient.interpolate.zerosize.js new file mode 100644 index 0000000..fd39054 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.gradient.interpolate.zerosize.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createLinearGradient(50, 25, 50, 25); // zero-length line (undefined direction) +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 40,20, 0,255,0,255, "40,20", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.gradient.linear.nonfinite.js b/platforms/ios/www/test/tests-todo/2d.gradient.linear.nonfinite.js new file mode 100644 index 0000000..696fe82 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.gradient.linear.nonfinite.js @@ -0,0 +1,74 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.createLinearGradient(Infinity, 0, 1, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, 0, 1, 0)"); } +try { var _thrown = false; + ctx.createLinearGradient(-Infinity, 0, 1, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(-Infinity, 0, 1, 0)"); } +try { var _thrown = false; + ctx.createLinearGradient(NaN, 0, 1, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(NaN, 0, 1, 0)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, Infinity, 1, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, Infinity, 1, 0)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, -Infinity, 1, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, -Infinity, 1, 0)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, NaN, 1, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, NaN, 1, 0)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, 0, Infinity, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, Infinity, 0)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, 0, -Infinity, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, -Infinity, 0)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, 0, NaN, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, NaN, 0)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, 0, 1, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, 1, Infinity)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, 0, 1, -Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, 1, -Infinity)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, 0, 1, NaN); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, 1, NaN)"); } +try { var _thrown = false; + ctx.createLinearGradient(Infinity, Infinity, 1, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, Infinity, 1, 0)"); } +try { var _thrown = false; + ctx.createLinearGradient(Infinity, Infinity, Infinity, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, Infinity, Infinity, 0)"); } +try { var _thrown = false; + ctx.createLinearGradient(Infinity, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.createLinearGradient(Infinity, Infinity, 1, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, Infinity, 1, Infinity)"); } +try { var _thrown = false; + ctx.createLinearGradient(Infinity, 0, Infinity, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, 0, Infinity, 0)"); } +try { var _thrown = false; + ctx.createLinearGradient(Infinity, 0, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, 0, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.createLinearGradient(Infinity, 0, 1, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, 0, 1, Infinity)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, Infinity, Infinity, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, Infinity, Infinity, 0)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, Infinity, 1, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, Infinity, 1, Infinity)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, 0, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, Infinity, Infinity)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.gradient.object.invalidcolour.js b/platforms/ios/www/test/tests-todo/2d.gradient.object.invalidcolour.js new file mode 100644 index 0000000..609b069 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.gradient.object.invalidcolour.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +var g = ctx.createLinearGradient(0, 0, 100, 0); +try { var _thrown = false; + g.addColorStop(0, ""); +} catch (e) { if (e.code != DOMException.SYNTAX_ERR) _fail("Failed assertion: expected exception of type SYNTAX_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type SYNTAX_ERR: g.addColorStop(0, \"\")"); } +try { var _thrown = false; + g.addColorStop(0, 'undefined'); +} catch (e) { if (e.code != DOMException.SYNTAX_ERR) _fail("Failed assertion: expected exception of type SYNTAX_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type SYNTAX_ERR: g.addColorStop(0, 'undefined')"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.gradient.object.invalidoffset.js b/platforms/ios/www/test/tests-todo/2d.gradient.object.invalidoffset.js new file mode 100644 index 0000000..447ba83 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.gradient.object.invalidoffset.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +var g = ctx.createLinearGradient(0, 0, 100, 0); +try { var _thrown = false; + g.addColorStop(-1, '#000'); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: g.addColorStop(-1, '#000')"); } +try { var _thrown = false; + g.addColorStop(2, '#000'); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: g.addColorStop(2, '#000')"); } +try { var _thrown = false; + g.addColorStop(Infinity, '#000'); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: g.addColorStop(Infinity, '#000')"); } +try { var _thrown = false; + g.addColorStop(-Infinity, '#000'); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: g.addColorStop(-Infinity, '#000')"); } +try { var _thrown = false; + g.addColorStop(NaN, '#000'); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: g.addColorStop(NaN, '#000')"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.gradient.object.return.js b/platforms/ios/www/test/tests-todo/2d.gradient.object.return.js new file mode 100644 index 0000000..63870c5 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.gradient.object.return.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +window.CanvasGradient.prototype.thisImplementsCanvasGradient = true; + +var g1 = ctx.createLinearGradient(0, 0, 100, 0); +_assertDifferent(g1.addColorStop, undefined, "g1.addColorStop", "undefined"); +_assertSame(g1.thisImplementsCanvasGradient, true, "g1.thisImplementsCanvasGradient", "true"); + +var g2 = ctx.createRadialGradient(0, 0, 10, 0, 0, 20); +_assertDifferent(g2.addColorStop, undefined, "g2.addColorStop", "undefined"); +_assertSame(g2.thisImplementsCanvasGradient, true, "g2.thisImplementsCanvasGradient", "true"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.gradient.object.update.js b/platforms/ios/www/test/tests-todo/2d.gradient.object.update.js new file mode 100644 index 0000000..fc3d299 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.gradient.object.update.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +var g = ctx.createLinearGradient(-100, 0, 200, 0); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +g.addColorStop(0.1, '#0f0'); +g.addColorStop(0.9, '#0f0'); +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.gradient.radial.cone.beside.js b/platforms/ios/www/test/tests-todo/2d.gradient.radial.cone.beside.js new file mode 100644 index 0000000..318df5b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.gradient.radial.cone.beside.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(0, 100, 40, 100, 100, 50); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.gradient.radial.cone.shape2.js b/platforms/ios/www/test/tests-todo/2d.gradient.radial.cone.shape2.js new file mode 100644 index 0000000..7d2f6e8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.gradient.radial.cone.shape2.js @@ -0,0 +1,32 @@ +_addTest(function(canvas, ctx) { + +var tol = 1; // tolerance to avoid antialiasing artifacts + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(30+10*5/2, 40, 10*3/2, 30+10*15/4, 40, 10*9/4); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(30-tol, 40); +ctx.lineTo(110, -20-tol); +ctx.lineTo(110, 100+tol); +ctx.fill(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.gradient.radial.equal.js b/platforms/ios/www/test/tests-todo/2d.gradient.radial.equal.js new file mode 100644 index 0000000..d30ffda --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.gradient.radial.equal.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(50, 25, 20, 50, 25, 20); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.gradient.radial.inside2.js b/platforms/ios/www/test/tests-todo/2d.gradient.radial.inside2.js new file mode 100644 index 0000000..d290618 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.gradient.radial.inside2.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(50, 25, 200, 50, 25, 100); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#0f0'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.gradient.radial.inside3.js b/platforms/ios/www/test/tests-todo/2d.gradient.radial.inside3.js new file mode 100644 index 0000000..4f2a7ba --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.gradient.radial.inside3.js @@ -0,0 +1,24 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(50, 25, 200, 50, 25, 100); +g.addColorStop(0, '#f00'); +g.addColorStop(0.993, '#f00'); +g.addColorStop(1, '#0f0'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.gradient.radial.negative.js b/platforms/ios/www/test/tests-todo/2d.gradient.radial.negative.js new file mode 100644 index 0000000..ba805b1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.gradient.radial.negative.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.createRadialGradient(0, 0, -0.1, 0, 0, 1); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.createRadialGradient(0, 0, -0.1, 0, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, 1, 0, 0, -0.1); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.createRadialGradient(0, 0, 1, 0, 0, -0.1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, -0.1, 0, 0, -0.1); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.createRadialGradient(0, 0, -0.1, 0, 0, -0.1)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.gradient.radial.outside2.js b/platforms/ios/www/test/tests-todo/2d.gradient.radial.outside2.js new file mode 100644 index 0000000..9489a94 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.gradient.radial.outside2.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(200, 25, 20, 200, 25, 10); +g.addColorStop(0, '#0f0'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.gradient.radial.outside3.js b/platforms/ios/www/test/tests-todo/2d.gradient.radial.outside3.js new file mode 100644 index 0000000..2d63b00 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.gradient.radial.outside3.js @@ -0,0 +1,24 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(200, 25, 20, 200, 25, 10); +g.addColorStop(0, '#0f0'); +g.addColorStop(0.001, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.gradient.radial.touch2.js b/platforms/ios/www/test/tests-todo/2d.gradient.radial.touch2.js new file mode 100644 index 0000000..9c507c8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.gradient.radial.touch2.js @@ -0,0 +1,25 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(-80, 25, 70, 0, 25, 150); +g.addColorStop(0, '#f00'); +g.addColorStop(0.01, '#0f0'); +g.addColorStop(0.99, '#0f0'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.create1.basic.js b/platforms/ios/www/test/tests-todo/2d.imageData.create1.basic.js new file mode 100644 index 0000000..cca632c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.create1.basic.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertDifferent(ctx.createImageData(ctx.createImageData(1, 1)), null, "ctx.createImageData(ctx.createImageData(1, 1))", "null"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.create1.initial.js b/platforms/ios/www/test/tests-todo/2d.imageData.create1.initial.js new file mode 100644 index 0000000..2c3bd2d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.create1.initial.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +var imgdata1 = ctx.getImageData(0, 0, 10, 20); +var imgdata2 = ctx.createImageData(imgdata1); +_assertEqual(imgdata2.data.length, imgdata1.data.length, "imgdata2.data.length", "imgdata1.data.length"); +_assertEqual(imgdata2.width, imgdata1.width, "imgdata2.width", "imgdata1.width"); +_assertEqual(imgdata2.height, imgdata1.height, "imgdata2.height", "imgdata1.height"); +var isTransparentBlack = true; +for (var i = 0; i < imgdata2.data.length; ++i) + if (imgdata2.data[i] !== 0) + isTransparentBlack = false; +_assert(isTransparentBlack, "isTransparentBlack"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.create1.type.js b/platforms/ios/www/test/tests-todo/2d.imageData.create1.type.js new file mode 100644 index 0000000..d2fe511 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.create1.type.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +_assertDifferent(window.ImageData, undefined, "window.ImageData", "undefined"); +_assertDifferent(window.CanvasPixelArray, undefined, "window.CanvasPixelArray", "undefined"); +window.ImageData.prototype.thisImplementsImageData = true; +window.CanvasPixelArray.prototype.thisImplementsCanvasPixelArray = true; +var imgdata = ctx.createImageData(ctx.createImageData(1, 1)); +_assert(imgdata.thisImplementsImageData, "imgdata.thisImplementsImageData"); +_assert(imgdata.data.thisImplementsCanvasPixelArray, "imgdata.data.thisImplementsCanvasPixelArray"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.create1.zero.js b/platforms/ios/www/test/tests-todo/2d.imageData.create1.zero.js new file mode 100644 index 0000000..4eb5d8f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.create1.zero.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.createImageData(null); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createImageData(null)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.create2.basic.js b/platforms/ios/www/test/tests-todo/2d.imageData.create2.basic.js new file mode 100644 index 0000000..770dd91 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.create2.basic.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertDifferent(ctx.createImageData(1, 1), null, "ctx.createImageData(1, 1)", "null"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.create2.initial.js b/platforms/ios/www/test/tests-todo/2d.imageData.create2.initial.js new file mode 100644 index 0000000..9d8645e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.create2.initial.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.createImageData(10, 20); +_assertEqual(imgdata.data.length, imgdata.width*imgdata.height*4, "imgdata.data.length", "imgdata.width*imgdata.height*4"); +_assert(imgdata.width < imgdata.height, "imgdata.width < imgdata.height"); +_assert(imgdata.width > 0, "imgdata.width > 0"); +var isTransparentBlack = true; +for (var i = 0; i < imgdata.data.length; ++i) + if (imgdata.data[i] !== 0) + isTransparentBlack = false; +_assert(isTransparentBlack, "isTransparentBlack"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.create2.large.js b/platforms/ios/www/test/tests-todo/2d.imageData.create2.large.js new file mode 100644 index 0000000..45e2294 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.create2.large.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.createImageData(1000, 2000); +_assertEqual(imgdata.data.length, imgdata.width*imgdata.height*4, "imgdata.data.length", "imgdata.width*imgdata.height*4"); +_assert(imgdata.width < imgdata.height, "imgdata.width < imgdata.height"); +_assert(imgdata.width > 0, "imgdata.width > 0"); +var isTransparentBlack = true; +for (var i = 0; i < imgdata.data.length; i += 7813) // check ~1024 points (assuming normal scaling) + if (imgdata.data[i] !== 0) + isTransparentBlack = false; +_assert(isTransparentBlack, "isTransparentBlack"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.create2.negative.js b/platforms/ios/www/test/tests-todo/2d.imageData.create2.negative.js new file mode 100644 index 0000000..4a1df28 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.create2.negative.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +var imgdata1 = ctx.createImageData(10, 20); +var imgdata2 = ctx.createImageData(-10, 20); +var imgdata3 = ctx.createImageData(10, -20); +var imgdata4 = ctx.createImageData(-10, -20); +_assertEqual(imgdata1.data.length, imgdata2.data.length, "imgdata1.data.length", "imgdata2.data.length"); +_assertEqual(imgdata2.data.length, imgdata3.data.length, "imgdata2.data.length", "imgdata3.data.length"); +_assertEqual(imgdata3.data.length, imgdata4.data.length, "imgdata3.data.length", "imgdata4.data.length"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.create2.nonfinite.js b/platforms/ios/www/test/tests-todo/2d.imageData.create2.nonfinite.js new file mode 100644 index 0000000..b0c3eae --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.create2.nonfinite.js @@ -0,0 +1,26 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.createImageData(Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createImageData(Infinity, 10)"); } +try { var _thrown = false; + ctx.createImageData(-Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createImageData(-Infinity, 10)"); } +try { var _thrown = false; + ctx.createImageData(NaN, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createImageData(NaN, 10)"); } +try { var _thrown = false; + ctx.createImageData(10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createImageData(10, Infinity)"); } +try { var _thrown = false; + ctx.createImageData(10, -Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createImageData(10, -Infinity)"); } +try { var _thrown = false; + ctx.createImageData(10, NaN); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createImageData(10, NaN)"); } +try { var _thrown = false; + ctx.createImageData(Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createImageData(Infinity, Infinity)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.create2.round.js b/platforms/ios/www/test/tests-todo/2d.imageData.create2.round.js new file mode 100644 index 0000000..5e97a65 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.create2.round.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +var imgdata1 = ctx.createImageData(10.01, 10.99); +var imgdata2 = ctx.getImageData(0, 0, 10.01, 10.99); +_assertEqual(imgdata1.width, imgdata2.width, "imgdata1.width", "imgdata2.width"); +_assertEqual(imgdata1.height, imgdata2.height, "imgdata1.height", "imgdata2.height"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.create2.tiny.js b/platforms/ios/www/test/tests-todo/2d.imageData.create2.tiny.js new file mode 100644 index 0000000..adf0c25 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.create2.tiny.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.createImageData(0.0001, 0.0001); +_assertEqual(imgdata.data.length, imgdata.width*imgdata.height*4, "imgdata.data.length", "imgdata.width*imgdata.height*4"); +_assertEqual(imgdata.width, 1, "imgdata.width", "1"); +_assertEqual(imgdata.height, 1, "imgdata.height", "1"); +var isTransparentBlack = true; +for (var i = 0; i < imgdata.data.length; ++i) + if (imgdata.data[i] !== 0) + isTransparentBlack = false; +_assert(isTransparentBlack, "isTransparentBlack"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.create2.type.js b/platforms/ios/www/test/tests-todo/2d.imageData.create2.type.js new file mode 100644 index 0000000..0c9d3d8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.create2.type.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +_assertDifferent(window.ImageData, undefined, "window.ImageData", "undefined"); +_assertDifferent(window.CanvasPixelArray, undefined, "window.CanvasPixelArray", "undefined"); +window.ImageData.prototype.thisImplementsImageData = true; +window.CanvasPixelArray.prototype.thisImplementsCanvasPixelArray = true; +var imgdata = ctx.createImageData(1, 1); +_assert(imgdata.thisImplementsImageData, "imgdata.thisImplementsImageData"); +_assert(imgdata.data.thisImplementsCanvasPixelArray, "imgdata.data.thisImplementsCanvasPixelArray"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.create2.zero.js b/platforms/ios/www/test/tests-todo/2d.imageData.create2.zero.js new file mode 100644 index 0000000..2f9f61c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.create2.zero.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.createImageData(10, 0); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.createImageData(10, 0)"); } +try { var _thrown = false; + ctx.createImageData(0, 10); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.createImageData(0, 10)"); } +try { var _thrown = false; + ctx.createImageData(0, 0); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.createImageData(0, 0)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.get.basic.js b/platforms/ios/www/test/tests-todo/2d.imageData.get.basic.js new file mode 100644 index 0000000..88070d6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.get.basic.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertDifferent(ctx.getImageData(0, 0, 100, 50), null, "ctx.getImageData(0, 0, 100, 50)", "null"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.get.clamp.js b/platforms/ios/www/test/tests-todo/2d.imageData.get.clamp.js new file mode 100644 index 0000000..05345d6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.get.clamp.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = 'rgb(-100, -200, -300)'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = 'rgb(256, 300, 400)'; +ctx.fillRect(20, 10, 60, 10); +var imgdata1 = ctx.getImageData(10, 5, 1, 1); +_assertSame(imgdata1.data[0], 0, "imgdata1.data[\""+(0)+"\"]", "0"); +_assertSame(imgdata1.data[1], 0, "imgdata1.data[\""+(1)+"\"]", "0"); +_assertSame(imgdata1.data[2], 0, "imgdata1.data[\""+(2)+"\"]", "0"); +var imgdata2 = ctx.getImageData(30, 15, 1, 1); +_assertSame(imgdata2.data[0], 255, "imgdata2.data[\""+(0)+"\"]", "255"); +_assertSame(imgdata2.data[1], 255, "imgdata2.data[\""+(1)+"\"]", "255"); +_assertSame(imgdata2.data[2], 255, "imgdata2.data[\""+(2)+"\"]", "255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.get.length.js b/platforms/ios/www/test/tests-todo/2d.imageData.get.length.js new file mode 100644 index 0000000..4ecc44e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.get.length.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.getImageData(0, 0, 10, 10); +_assertEqual(imgdata.data.length, imgdata.width*imgdata.height*4, "imgdata.data.length", "imgdata.width*imgdata.height*4"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.get.nonfinite.js b/platforms/ios/www/test/tests-todo/2d.imageData.get.nonfinite.js new file mode 100644 index 0000000..81547ae --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.get.nonfinite.js @@ -0,0 +1,74 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.getImageData(Infinity, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(Infinity, 10, 10, 10)"); } +try { var _thrown = false; + ctx.getImageData(-Infinity, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(-Infinity, 10, 10, 10)"); } +try { var _thrown = false; + ctx.getImageData(NaN, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(NaN, 10, 10, 10)"); } +try { var _thrown = false; + ctx.getImageData(10, Infinity, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, Infinity, 10, 10)"); } +try { var _thrown = false; + ctx.getImageData(10, -Infinity, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, -Infinity, 10, 10)"); } +try { var _thrown = false; + ctx.getImageData(10, NaN, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, NaN, 10, 10)"); } +try { var _thrown = false; + ctx.getImageData(10, 10, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, 10, Infinity, 10)"); } +try { var _thrown = false; + ctx.getImageData(10, 10, -Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, 10, -Infinity, 10)"); } +try { var _thrown = false; + ctx.getImageData(10, 10, NaN, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, 10, NaN, 10)"); } +try { var _thrown = false; + ctx.getImageData(10, 10, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, 10, 10, Infinity)"); } +try { var _thrown = false; + ctx.getImageData(10, 10, 10, -Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, 10, 10, -Infinity)"); } +try { var _thrown = false; + ctx.getImageData(10, 10, 10, NaN); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, 10, 10, NaN)"); } +try { var _thrown = false; + ctx.getImageData(Infinity, Infinity, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(Infinity, Infinity, 10, 10)"); } +try { var _thrown = false; + ctx.getImageData(Infinity, Infinity, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(Infinity, Infinity, Infinity, 10)"); } +try { var _thrown = false; + ctx.getImageData(Infinity, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(Infinity, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.getImageData(Infinity, Infinity, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(Infinity, Infinity, 10, Infinity)"); } +try { var _thrown = false; + ctx.getImageData(Infinity, 10, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(Infinity, 10, Infinity, 10)"); } +try { var _thrown = false; + ctx.getImageData(Infinity, 10, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(Infinity, 10, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.getImageData(Infinity, 10, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(Infinity, 10, 10, Infinity)"); } +try { var _thrown = false; + ctx.getImageData(10, Infinity, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, Infinity, Infinity, 10)"); } +try { var _thrown = false; + ctx.getImageData(10, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.getImageData(10, Infinity, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, Infinity, 10, Infinity)"); } +try { var _thrown = false; + ctx.getImageData(10, 10, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, 10, Infinity, Infinity)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.get.nonpremul.js b/platforms/ios/www/test/tests-todo/2d.imageData.get.nonpremul.js new file mode 100644 index 0000000..7fbe377 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.get.nonpremul.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = 'rgba(255, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +var imgdata = ctx.getImageData(10, 10, 10, 10); +_assert(imgdata.data[0] > 200, "imgdata.data[\""+(0)+"\"] > 200"); +_assert(imgdata.data[1] > 200, "imgdata.data[\""+(1)+"\"] > 200"); +_assert(imgdata.data[2] > 200, "imgdata.data[\""+(2)+"\"] > 200"); +_assert(imgdata.data[3] > 100, "imgdata.data[\""+(3)+"\"] > 100"); +_assert(imgdata.data[3] < 200, "imgdata.data[\""+(3)+"\"] < 200"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.get.order.alpha.js b/platforms/ios/www/test/tests-todo/2d.imageData.get.order.alpha.js new file mode 100644 index 0000000..eebf106 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.get.order.alpha.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = 'rgba(0, 0, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +var imgdata = ctx.getImageData(0, 0, 10, 10); +_assert(imgdata.data[3] < 200, "imgdata.data[\""+(3)+"\"] < 200"); +_assert(imgdata.data[3] > 100, "imgdata.data[\""+(3)+"\"] > 100"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.get.order.cols.js b/platforms/ios/www/test/tests-todo/2d.imageData.get.order.cols.js new file mode 100644 index 0000000..b911b92 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.get.order.cols.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#fff'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#000'; +ctx.fillRect(0, 0, 2, 50); +var imgdata = ctx.getImageData(0, 0, 10, 10); +_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); +_assertSame(imgdata.data[Math.round(imgdata.width/2*4)], 255, "imgdata.data[Math.round(imgdata.width/2*4)]", "255"); +_assertSame(imgdata.data[Math.round((imgdata.height/2)*imgdata.width*4)], 0, "imgdata.data[Math.round((imgdata.height/2)*imgdata.width*4)]", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.get.order.rgb.js b/platforms/ios/www/test/tests-todo/2d.imageData.get.order.rgb.js new file mode 100644 index 0000000..0a6bdd7 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.get.order.rgb.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#48c'; +ctx.fillRect(0, 0, 100, 50); +var imgdata = ctx.getImageData(0, 0, 10, 10); +_assertSame(imgdata.data[0], 0x44, "imgdata.data[\""+(0)+"\"]", "0x44"); +_assertSame(imgdata.data[1], 0x88, "imgdata.data[\""+(1)+"\"]", "0x88"); +_assertSame(imgdata.data[2], 0xCC, "imgdata.data[\""+(2)+"\"]", "0xCC"); +_assertSame(imgdata.data[3], 255, "imgdata.data[\""+(3)+"\"]", "255"); +_assertSame(imgdata.data[4], 0x44, "imgdata.data[\""+(4)+"\"]", "0x44"); +_assertSame(imgdata.data[5], 0x88, "imgdata.data[\""+(5)+"\"]", "0x88"); +_assertSame(imgdata.data[6], 0xCC, "imgdata.data[\""+(6)+"\"]", "0xCC"); +_assertSame(imgdata.data[7], 255, "imgdata.data[\""+(7)+"\"]", "255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.get.order.rows.js b/platforms/ios/www/test/tests-todo/2d.imageData.get.order.rows.js new file mode 100644 index 0000000..493395a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.get.order.rows.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#fff'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#000'; +ctx.fillRect(0, 0, 100, 2); +var imgdata = ctx.getImageData(0, 0, 10, 10); +_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); +_assertSame(imgdata.data[Math.floor(imgdata.width/2*4)], 0, "imgdata.data[Math.floor(imgdata.width/2*4)]", "0"); +_assertSame(imgdata.data[(imgdata.height/2)*imgdata.width*4], 255, "imgdata.data[(imgdata.height/2)*imgdata.width*4]", "255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.get.range.js b/platforms/ios/www/test/tests-todo/2d.imageData.get.range.js new file mode 100644 index 0000000..27614dd --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.get.range.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#000'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#fff'; +ctx.fillRect(20, 10, 60, 10); +var imgdata1 = ctx.getImageData(10, 5, 1, 1); +_assertSame(imgdata1.data[0], 0, "imgdata1.data[\""+(0)+"\"]", "0"); +var imgdata2 = ctx.getImageData(30, 15, 1, 1); +_assertSame(imgdata2.data[0], 255, "imgdata2.data[\""+(0)+"\"]", "255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.get.source.negative.js b/platforms/ios/www/test/tests-todo/2d.imageData.get.source.negative.js new file mode 100644 index 0000000..ec9b28a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.get.source.negative.js @@ -0,0 +1,25 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#000'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#fff'; +ctx.fillRect(20, 10, 60, 10); + +var imgdata1 = ctx.getImageData(85, 25, -10, -10); +_assertSame(imgdata1.data[0], 255, "imgdata1.data[\""+(0)+"\"]", "255"); +_assertSame(imgdata1.data[1], 255, "imgdata1.data[\""+(1)+"\"]", "255"); +_assertSame(imgdata1.data[2], 255, "imgdata1.data[\""+(2)+"\"]", "255"); +_assertSame(imgdata1.data[3], 255, "imgdata1.data[\""+(3)+"\"]", "255"); +_assertSame(imgdata1.data[imgdata1.data.length-4+0], 0, "imgdata1.data[imgdata1.data.length-4+0]", "0"); +_assertSame(imgdata1.data[imgdata1.data.length-4+1], 0, "imgdata1.data[imgdata1.data.length-4+1]", "0"); +_assertSame(imgdata1.data[imgdata1.data.length-4+2], 0, "imgdata1.data[imgdata1.data.length-4+2]", "0"); +_assertSame(imgdata1.data[imgdata1.data.length-4+3], 255, "imgdata1.data[imgdata1.data.length-4+3]", "255"); + +var imgdata2 = ctx.getImageData(0, 0, -1, -1); +_assertSame(imgdata2.data[0], 0, "imgdata2.data[\""+(0)+"\"]", "0"); +_assertSame(imgdata2.data[1], 0, "imgdata2.data[\""+(1)+"\"]", "0"); +_assertSame(imgdata2.data[2], 0, "imgdata2.data[\""+(2)+"\"]", "0"); +_assertSame(imgdata2.data[3], 0, "imgdata2.data[\""+(3)+"\"]", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.get.source.outside.js b/platforms/ios/www/test/tests-todo/2d.imageData.get.source.outside.js new file mode 100644 index 0000000..a915b82 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.get.source.outside.js @@ -0,0 +1,31 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#08f'; +ctx.fillRect(0, 0, 100, 50); + +var imgdata1 = ctx.getImageData(-10, 5, 1, 1); +_assertSame(imgdata1.data[0], 0, "imgdata1.data[\""+(0)+"\"]", "0"); +_assertSame(imgdata1.data[1], 0, "imgdata1.data[\""+(1)+"\"]", "0"); +_assertSame(imgdata1.data[2], 0, "imgdata1.data[\""+(2)+"\"]", "0"); +_assertSame(imgdata1.data[3], 0, "imgdata1.data[\""+(3)+"\"]", "0"); + +var imgdata2 = ctx.getImageData(10, -5, 1, 1); +_assertSame(imgdata2.data[0], 0, "imgdata2.data[\""+(0)+"\"]", "0"); +_assertSame(imgdata2.data[1], 0, "imgdata2.data[\""+(1)+"\"]", "0"); +_assertSame(imgdata2.data[2], 0, "imgdata2.data[\""+(2)+"\"]", "0"); +_assertSame(imgdata2.data[3], 0, "imgdata2.data[\""+(3)+"\"]", "0"); + +var imgdata3 = ctx.getImageData(200, 5, 1, 1); +_assertSame(imgdata3.data[0], 0, "imgdata3.data[\""+(0)+"\"]", "0"); +_assertSame(imgdata3.data[1], 0, "imgdata3.data[\""+(1)+"\"]", "0"); +_assertSame(imgdata3.data[2], 0, "imgdata3.data[\""+(2)+"\"]", "0"); +_assertSame(imgdata3.data[3], 0, "imgdata3.data[\""+(3)+"\"]", "0"); + +var imgdata4 = ctx.getImageData(10, 60, 1, 1); +_assertSame(imgdata4.data[0], 0, "imgdata4.data[\""+(0)+"\"]", "0"); +_assertSame(imgdata4.data[1], 0, "imgdata4.data[\""+(1)+"\"]", "0"); +_assertSame(imgdata4.data[2], 0, "imgdata4.data[\""+(2)+"\"]", "0"); +_assertSame(imgdata4.data[3], 0, "imgdata4.data[\""+(3)+"\"]", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.get.source.size.js b/platforms/ios/www/test/tests-todo/2d.imageData.get.source.size.js new file mode 100644 index 0000000..0d9d8cc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.get.source.size.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +var imgdata1 = ctx.getImageData(0, 0, 10, 10); +var imgdata2 = ctx.getImageData(0, 0, 20, 20); +_assert(imgdata2.width > imgdata1.width, "imgdata2.width > imgdata1.width"); +_assert(imgdata2.height > imgdata1.height, "imgdata2.height > imgdata1.height"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.get.tiny.js b/platforms/ios/www/test/tests-todo/2d.imageData.get.tiny.js new file mode 100644 index 0000000..d799357 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.get.tiny.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.getImageData(0, 0, 0.0001, 0.0001); +_assertEqual(imgdata.data.length, imgdata.width*imgdata.height*4, "imgdata.data.length", "imgdata.width*imgdata.height*4"); +_assertEqual(imgdata.width, 1, "imgdata.width", "1"); +_assertEqual(imgdata.height, 1, "imgdata.height", "1"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.get.type.js b/platforms/ios/www/test/tests-todo/2d.imageData.get.type.js new file mode 100644 index 0000000..bf65e48 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.get.type.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +_assertDifferent(window.ImageData, undefined, "window.ImageData", "undefined"); +_assertDifferent(window.CanvasPixelArray, undefined, "window.CanvasPixelArray", "undefined"); +window.ImageData.prototype.thisImplementsImageData = true; +window.CanvasPixelArray.prototype.thisImplementsCanvasPixelArray = true; +var imgdata = ctx.getImageData(0, 0, 1, 1); +_assert(imgdata.thisImplementsImageData, "imgdata.thisImplementsImageData"); +_assert(imgdata.data.thisImplementsCanvasPixelArray, "imgdata.data.thisImplementsCanvasPixelArray"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.get.unaffected.js b/platforms/ios/www/test/tests-todo/2d.imageData.get.unaffected.js new file mode 100644 index 0000000..36296a6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.get.unaffected.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 50, 50) +ctx.fillStyle = '#f00'; +ctx.fillRect(50, 0, 50, 50) +ctx.save(); +ctx.translate(50, 0); +ctx.globalAlpha = 0.1; +ctx.globalCompositeOperation = 'destination-atop'; +ctx.shadowColor = '#f00'; +ctx.rect(0, 0, 5, 5); +ctx.clip(); +var imgdata = ctx.getImageData(0, 0, 50, 50); +ctx.restore(); +ctx.putImageData(imgdata, 50, 0); +_assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.get.zero.js b/platforms/ios/www/test/tests-todo/2d.imageData.get.zero.js new file mode 100644 index 0000000..278c388 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.get.zero.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.getImageData(1, 1, 10, 0); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.getImageData(1, 1, 10, 0)"); } +try { var _thrown = false; + ctx.getImageData(1, 1, 0, 10); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.getImageData(1, 1, 0, 10)"); } +try { var _thrown = false; + ctx.getImageData(1, 1, 0, 0); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.getImageData(1, 1, 0, 0)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.object.ctor.js b/platforms/ios/www/test/tests-todo/2d.imageData.object.ctor.js new file mode 100644 index 0000000..7d761f6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.object.ctor.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +_assertDifferent(window.ImageData, undefined, "window.ImageData", "undefined"); +try { var _thrown = false; new window.ImageData(1,1); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: new window.ImageData(1,1)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.object.nan.js b/platforms/ios/www/test/tests-todo/2d.imageData.object.nan.js new file mode 100644 index 0000000..ba38464 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.object.nan.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.getImageData(0, 0, 10, 10); +imgdata.data[0] = 100; +imgdata.data[0] = NaN; +_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); +imgdata.data[0] = 100; +imgdata.data[0] = "cheese"; +_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.object.properties.js b/platforms/ios/www/test/tests-todo/2d.imageData.object.properties.js new file mode 100644 index 0000000..0aedd64 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.object.properties.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.getImageData(0, 0, 10, 10); +_assertEqual(typeof(imgdata.width), 'number', "typeof(imgdata.width)", "'number'"); +_assertEqual(typeof(imgdata.height), 'number', "typeof(imgdata.height)", "'number'"); +_assertEqual(typeof(imgdata.data), 'object', "typeof(imgdata.data)", "'object'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.object.readonly.js b/platforms/ios/www/test/tests-todo/2d.imageData.object.readonly.js new file mode 100644 index 0000000..00b3854 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.object.readonly.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.getImageData(0, 0, 10, 10); +var w = imgdata.width; +var h = imgdata.height; +var d = imgdata.data; +imgdata.width = 123; +imgdata.height = 123; +imgdata.data = [100,100,100,100]; +_assertSame(imgdata.width, w, "imgdata.width", "w"); +_assertSame(imgdata.height, h, "imgdata.height", "h"); +_assertSame(imgdata.data, d, "imgdata.data", "d"); +_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); +_assertSame(imgdata.data[1], 0, "imgdata.data[\""+(1)+"\"]", "0"); +_assertSame(imgdata.data[2], 0, "imgdata.data[\""+(2)+"\"]", "0"); +_assertSame(imgdata.data[3], 0, "imgdata.data[\""+(3)+"\"]", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.object.round.js b/platforms/ios/www/test/tests-todo/2d.imageData.object.round.js new file mode 100644 index 0000000..243171f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.object.round.js @@ -0,0 +1,34 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.getImageData(0, 0, 10, 10); +imgdata.data[0] = 0.499; +_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); +imgdata.data[0] = 0.5; +_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); +imgdata.data[0] = 0.501; +_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); +imgdata.data[0] = 1.499; +_assertSame(imgdata.data[0], 1, "imgdata.data[\""+(0)+"\"]", "1"); +imgdata.data[0] = 1.5; +_assertSame(imgdata.data[0], 1, "imgdata.data[\""+(0)+"\"]", "1"); +imgdata.data[0] = 1.501; +_assertSame(imgdata.data[0], 1, "imgdata.data[\""+(0)+"\"]", "1"); +imgdata.data[0] = 2.5; +_assertSame(imgdata.data[0], 2, "imgdata.data[\""+(0)+"\"]", "2"); +imgdata.data[0] = 3.5; +_assertSame(imgdata.data[0], 3, "imgdata.data[\""+(0)+"\"]", "3"); +imgdata.data[0] = 252.5; +_assertSame(imgdata.data[0], 252, "imgdata.data[\""+(0)+"\"]", "252"); +imgdata.data[0] = 253.5; +_assertSame(imgdata.data[0], 253, "imgdata.data[\""+(0)+"\"]", "253"); +imgdata.data[0] = 254.5; +_assertSame(imgdata.data[0], 254, "imgdata.data[\""+(0)+"\"]", "254"); +imgdata.data[0] = 256.5; +_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); +imgdata.data[0] = -0.5; +_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); +imgdata.data[0] = -1.5; +_assertSame(imgdata.data[0], 255, "imgdata.data[\""+(0)+"\"]", "255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.object.set.js b/platforms/ios/www/test/tests-todo/2d.imageData.object.set.js new file mode 100644 index 0000000..ee3cd64 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.object.set.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.getImageData(0, 0, 10, 10); +imgdata.data[0] = 100; +_assertSame(imgdata.data[0], 100, "imgdata.data[\""+(0)+"\"]", "100"); +imgdata.data[0] = 200; +_assertSame(imgdata.data[0], 200, "imgdata.data[\""+(0)+"\"]", "200"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.object.string.js b/platforms/ios/www/test/tests-todo/2d.imageData.object.string.js new file mode 100644 index 0000000..73b505a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.object.string.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.getImageData(0, 0, 10, 10); +imgdata.data[0] = 100; +imgdata.data[0] = "110"; +_assertSame(imgdata.data[0], 110, "imgdata.data[\""+(0)+"\"]", "110"); +imgdata.data[0] = 100; +imgdata.data[0] = "0x78"; +_assertSame(imgdata.data[0], 120, "imgdata.data[\""+(0)+"\"]", "120"); +imgdata.data[0] = 100; +imgdata.data[0] = " +130e0 "; +_assertSame(imgdata.data[0], 130, "imgdata.data[\""+(0)+"\"]", "130"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.object.undefined.js b/platforms/ios/www/test/tests-todo/2d.imageData.object.undefined.js new file mode 100644 index 0000000..4b89fe5 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.object.undefined.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.getImageData(0, 0, 10, 10); +imgdata.data[0] = 100; +imgdata.data[0] = undefined; +_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.object.wrap.js b/platforms/ios/www/test/tests-todo/2d.imageData.object.wrap.js new file mode 100644 index 0000000..937b359 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.object.wrap.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.getImageData(0, 0, 10, 10); + +imgdata.data[0] = 0; +_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); +imgdata.data[0] = 300; +_assertSame(imgdata.data[0], 44, "imgdata.data[\""+(0)+"\"]", "44"); +imgdata.data[0] = -100; +_assertSame(imgdata.data[0], 156, "imgdata.data[\""+(0)+"\"]", "156"); + +imgdata.data[0] = 200+Math.pow(2, 32); +_assertSame(imgdata.data[0], 200, "imgdata.data[\""+(0)+"\"]", "200"); +imgdata.data[0] = -200-Math.pow(2, 32); +_assertSame(imgdata.data[0], 56, "imgdata.data[\""+(0)+"\"]", "56"); + +imgdata.data[0] = -Infinity; +_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); +imgdata.data[0] = Infinity; +_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.put.alpha.js b/platforms/ios/www/test/tests-todo/2d.imageData.put.alpha.js new file mode 100644 index 0000000..dfad33a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.put.alpha.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = 'rgba(0, 255, 0, 0.25)'; +ctx.fillRect(0, 0, 100, 50) +var imgdata = ctx.getImageData(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50) +ctx.putImageData(imgdata, 0, 0); +_assertPixelApprox(canvas, 50,25, 0,255,0,64, "50,25", "0,255,0,64", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.put.basic.js b/platforms/ios/www/test/tests-todo/2d.imageData.put.basic.js new file mode 100644 index 0000000..ed3d93e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.put.basic.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50) +var imgdata = ctx.getImageData(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50) +ctx.putImageData(imgdata, 0, 0); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.put.clip.js b/platforms/ios/www/test/tests-todo/2d.imageData.put.clip.js new file mode 100644 index 0000000..1075d24 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.put.clip.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50) +var imgdata = ctx.getImageData(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50) +ctx.beginPath(); +ctx.rect(0, 0, 50, 50); +ctx.clip(); +ctx.putImageData(imgdata, 0, 0); +_assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.put.created.js b/platforms/ios/www/test/tests-todo/2d.imageData.put.created.js new file mode 100644 index 0000000..123f63a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.put.created.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.createImageData(100, 50); +for (var i = 0; i < imgdata.data.length; i += 4) { + imgdata.data[i] = 0; + imgdata.data[i+1] = 255; + imgdata.data[i+2] = 0; + imgdata.data[i+3] = 255; +} +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50) +ctx.putImageData(imgdata, 0, 0); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.put.cross.js b/platforms/ios/www/test/tests-todo/2d.imageData.put.cross.js new file mode 100644 index 0000000..ae1c93e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.put.cross.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = '#0f0'; +ctx2.fillRect(0, 0, 100, 50) +var imgdata = ctx2.getImageData(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50) +ctx.putImageData(imgdata, 0, 0); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.put.dirty.negative.js b/platforms/ios/www/test/tests-todo/2d.imageData.put.dirty.negative.js new file mode 100644 index 0000000..ab0d762 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.put.dirty.negative.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50) +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 20, 20) + +var imgdata = ctx.getImageData(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50) +ctx.fillStyle = '#f00'; +ctx.fillRect(40, 20, 20, 20) +ctx.putImageData(imgdata, 40, 20, 20, 20, -20, -20); + +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 35,25, 0,255,0,255, "35,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 65,25, 0,255,0,255, "65,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 50,15, 0,255,0,255, "50,15", "0,255,0,255", 2); +_assertPixelApprox(canvas, 50,45, 0,255,0,255, "50,45", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.put.dirty.outside.js b/platforms/ios/www/test/tests-todo/2d.imageData.put.dirty.outside.js new file mode 100644 index 0000000..f2a6c98 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.put.dirty.outside.js @@ -0,0 +1,25 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50) + +var imgdata = ctx.getImageData(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50) + +ctx.putImageData(imgdata, 100, 20, 20, 20, -20, -20); +ctx.putImageData(imgdata, 200, 200, 0, 0, 100, 50); +ctx.putImageData(imgdata, 40, 20, -30, -20, 30, 20); +ctx.putImageData(imgdata, -30, 20, 0, 0, 30, 20); + +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 98,15, 0,255,0,255, "98,15", "0,255,0,255", 2); +_assertPixelApprox(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 98,45, 0,255,0,255, "98,45", "0,255,0,255", 2); +_assertPixelApprox(canvas, 1,5, 0,255,0,255, "1,5", "0,255,0,255", 2); +_assertPixelApprox(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 1,45, 0,255,0,255, "1,45", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.put.dirty.rect1.js b/platforms/ios/www/test/tests-todo/2d.imageData.put.dirty.rect1.js new file mode 100644 index 0000000..ed4bb37 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.put.dirty.rect1.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50) +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 20, 20) + +var imgdata = ctx.getImageData(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50) +ctx.fillStyle = '#f00'; +ctx.fillRect(40, 20, 20, 20) +ctx.putImageData(imgdata, 40, 20, 0, 0, 20, 20); + +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 35,25, 0,255,0,255, "35,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 65,25, 0,255,0,255, "65,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 50,15, 0,255,0,255, "50,15", "0,255,0,255", 2); +_assertPixelApprox(canvas, 50,45, 0,255,0,255, "50,45", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.put.dirty.rect2.js b/platforms/ios/www/test/tests-todo/2d.imageData.put.dirty.rect2.js new file mode 100644 index 0000000..c36924f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.put.dirty.rect2.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50) +ctx.fillStyle = '#0f0'; +ctx.fillRect(60, 30, 20, 20) + +var imgdata = ctx.getImageData(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50) +ctx.fillStyle = '#f00'; +ctx.fillRect(40, 20, 20, 20) +ctx.putImageData(imgdata, -20, -10, 60, 30, 20, 20); + +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 35,25, 0,255,0,255, "35,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 65,25, 0,255,0,255, "65,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 50,15, 0,255,0,255, "50,15", "0,255,0,255", 2); +_assertPixelApprox(canvas, 50,45, 0,255,0,255, "50,45", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.put.dirty.zero.js b/platforms/ios/www/test/tests-todo/2d.imageData.put.dirty.zero.js new file mode 100644 index 0000000..a023cfb --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.put.dirty.zero.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50) +var imgdata = ctx.getImageData(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50) +ctx.putImageData(imgdata, 0, 0, 0, 0, 0, 0); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.put.modified.js b/platforms/ios/www/test/tests-todo/2d.imageData.put.modified.js new file mode 100644 index 0000000..768867e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.put.modified.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50) +ctx.fillStyle = '#f00'; +ctx.fillRect(45, 20, 10, 10) +var imgdata = ctx.getImageData(45, 20, 10, 10); +for (var i = 0, len = imgdata.width*imgdata.height*4; i < len; i += 4) +{ + imgdata.data[i] = 0; + imgdata.data[i+1] = 255; +} +ctx.putImageData(imgdata, 45, 20); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.put.nonfinite.js b/platforms/ios/www/test/tests-todo/2d.imageData.put.nonfinite.js new file mode 100644 index 0000000..773f349 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.put.nonfinite.js @@ -0,0 +1,252 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.getImageData(0, 0, 10, 10); +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, -Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, -Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, NaN, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, NaN, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, -Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, -Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, NaN); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, NaN)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, 10, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, 10, 10, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, -Infinity, 10, 10, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, -Infinity, 10, 10, 10, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, NaN, 10, 10, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, NaN, 10, 10, 10, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, 10, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, 10, 10, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, -Infinity, 10, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, -Infinity, 10, 10, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, NaN, 10, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, NaN, 10, 10, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, Infinity, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, 10, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, -Infinity, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, -Infinity, 10, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, NaN, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, NaN, 10, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, 10, Infinity, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, Infinity, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, 10, -Infinity, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, -Infinity, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, 10, NaN, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, NaN, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, 10, 10, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, 10, 10, -Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, -Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, 10, 10, NaN, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, NaN, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, 10, 10, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, 10, 10, 10, -Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, 10, -Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, 10, 10, 10, NaN); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, 10, NaN)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, 10, 10, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, 10, 10, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, 10, 10, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, 10, 10, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, 10, 10, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, 10, 10, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, 10, 10, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, 10, 10, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, 10, 10, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, 10, 10, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, 10, 10, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, 10, 10, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, Infinity, 10, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, 10, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, Infinity, 10, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, 10, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, Infinity, 10, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, 10, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, 10, Infinity, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, Infinity, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, 10, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, 10, Infinity, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, Infinity, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, 10, 10, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, Infinity, Infinity)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.put.null.js b/platforms/ios/www/test/tests-todo/2d.imageData.put.null.js new file mode 100644 index 0000000..d4a46d0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.put.null.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.putImageData(null, 0, 0); +} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail("Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TYPE_MISMATCH_ERR: ctx.putImageData(null, 0, 0)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.put.path.js b/platforms/ios/www/test/tests-todo/2d.imageData.put.path.js new file mode 100644 index 0000000..9b059de --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.put.path.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50) +ctx.rect(0, 0, 100, 50); +var imgdata = ctx.getImageData(0, 0, 100, 50); +ctx.putImageData(imgdata, 0, 0); +ctx.fillStyle = '#0f0'; +ctx.fill(); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.put.unaffected.js b/platforms/ios/www/test/tests-todo/2d.imageData.put.unaffected.js new file mode 100644 index 0000000..1118844 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.put.unaffected.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50) +var imgdata = ctx.getImageData(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50) +ctx.globalAlpha = 0.1; +ctx.globalCompositeOperation = 'destination-atop'; +ctx.shadowColor = '#f00'; +ctx.shadowBlur = 1; +ctx.translate(100, 50); +ctx.scale(0.1, 0.1); +ctx.putImageData(imgdata, 0, 0); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.put.unchanged.js b/platforms/ios/www/test/tests-todo/2d.imageData.put.unchanged.js new file mode 100644 index 0000000..5cbc72e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.put.unchanged.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +var i = 0; +for (var y = 0; y < 16; ++y) { + for (var x = 0; x < 16; ++x, ++i) { + ctx.fillStyle = 'rgba(' + i + ',' + (Math.floor(i*1.5) % 256) + ',' + (Math.floor(i*23.3) % 256) + ',' + (i/256) + ')'; + ctx.fillRect(x, y, 1, 1); + } +} +var imgdata1 = ctx.getImageData(0.1, 0.2, 15.8, 15.9); +var olddata = []; +for (var i = 0; i < imgdata1.data.length; ++i) + olddata[i] = imgdata1.data[i]; + +ctx.putImageData(imgdata1, 0.1, 0.2); + +var imgdata2 = ctx.getImageData(0.1, 0.2, 15.8, 15.9); +for (var i = 0; i < imgdata2.data.length; ++i) { + _assertSame(olddata[i], imgdata2.data[i], "olddata[\""+(i)+"\"]", "imgdata2.data[\""+(i)+"\"]"); +} + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.imageData.put.wrongtype.js b/platforms/ios/www/test/tests-todo/2d.imageData.put.wrongtype.js new file mode 100644 index 0000000..4b84fff --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.imageData.put.wrongtype.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +var imgdata = { width: 1, height: 1, data: [255, 0, 0, 255] }; +try { var _thrown = false; + ctx.putImageData(imgdata, 0, 0); +} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail("Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TYPE_MISMATCH_ERR: ctx.putImageData(imgdata, 0, 0)"); } +try { var _thrown = false; + ctx.putImageData("cheese", 0, 0); +} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail("Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TYPE_MISMATCH_ERR: ctx.putImageData(\"cheese\", 0, 0)"); } +try { var _thrown = false; + ctx.putImageData(42, 0, 0); +} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail("Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TYPE_MISMATCH_ERR: ctx.putImageData(42, 0, 0)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.line.cap.butt.js b/platforms/ios/www/test/tests-todo/2d.line.cap.butt.js new file mode 100644 index 0000000..616ad1d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.line.cap.butt.js @@ -0,0 +1,40 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineCap = 'butt'; +ctx.lineWidth = 20; + +ctx.fillStyle = '#f00'; +ctx.strokeStyle = '#0f0'; +ctx.fillRect(15, 15, 20, 20); +ctx.beginPath(); +ctx.moveTo(25, 15); +ctx.lineTo(25, 35); +ctx.stroke(); + +ctx.fillStyle = '#0f0'; +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(75, 15); +ctx.lineTo(75, 35); +ctx.stroke(); +ctx.fillRect(65, 15, 20, 20); + +_assertPixel(canvas, 25,14, 0,255,0,255, "25,14", "0,255,0,255"); +_assertPixel(canvas, 25,15, 0,255,0,255, "25,15", "0,255,0,255"); +_assertPixel(canvas, 25,16, 0,255,0,255, "25,16", "0,255,0,255"); +_assertPixel(canvas, 25,34, 0,255,0,255, "25,34", "0,255,0,255"); +_assertPixel(canvas, 25,35, 0,255,0,255, "25,35", "0,255,0,255"); +_assertPixel(canvas, 25,36, 0,255,0,255, "25,36", "0,255,0,255"); + +_assertPixel(canvas, 75,14, 0,255,0,255, "75,14", "0,255,0,255"); +_assertPixel(canvas, 75,15, 0,255,0,255, "75,15", "0,255,0,255"); +_assertPixel(canvas, 75,16, 0,255,0,255, "75,16", "0,255,0,255"); +_assertPixel(canvas, 75,34, 0,255,0,255, "75,34", "0,255,0,255"); +_assertPixel(canvas, 75,35, 0,255,0,255, "75,35", "0,255,0,255"); +_assertPixel(canvas, 75,36, 0,255,0,255, "75,36", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.line.cap.closed.js b/platforms/ios/www/test/tests-todo/2d.line.cap.closed.js new file mode 100644 index 0000000..41f4747 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.line.cap.closed.js @@ -0,0 +1,25 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.strokeStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineJoin = 'bevel'; +ctx.lineCap = 'square'; +ctx.lineWidth = 400; + +ctx.beginPath(); +ctx.moveTo(200, 200); +ctx.lineTo(200, 1000); +ctx.lineTo(1000, 1000); +ctx.lineTo(1000, 200); +ctx.closePath(); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.line.cap.invalid.js b/platforms/ios/www/test/tests-todo/2d.line.cap.invalid.js new file mode 100644 index 0000000..488567d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.line.cap.invalid.js @@ -0,0 +1,31 @@ +_addTest(function(canvas, ctx) { + +ctx.lineCap = 'butt' +_assertSame(ctx.lineCap, 'butt', "ctx.lineCap", "'butt'"); + +ctx.lineCap = 'butt'; +ctx.lineCap = 'invalid'; +_assertSame(ctx.lineCap, 'butt', "ctx.lineCap", "'butt'"); + +ctx.lineCap = 'butt'; +ctx.lineCap = 'ROUND'; +_assertSame(ctx.lineCap, 'butt', "ctx.lineCap", "'butt'"); + +ctx.lineCap = 'butt'; +ctx.lineCap = 'round\0'; +_assertSame(ctx.lineCap, 'butt', "ctx.lineCap", "'butt'"); + +ctx.lineCap = 'butt'; +ctx.lineCap = 'round '; +_assertSame(ctx.lineCap, 'butt', "ctx.lineCap", "'butt'"); + +ctx.lineCap = 'butt'; +ctx.lineCap = ""; +_assertSame(ctx.lineCap, 'butt', "ctx.lineCap", "'butt'"); + +ctx.lineCap = 'butt'; +ctx.lineCap = 'bevel'; +_assertSame(ctx.lineCap, 'butt', "ctx.lineCap", "'butt'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.line.cap.open.js b/platforms/ios/www/test/tests-todo/2d.line.cap.open.js new file mode 100644 index 0000000..fd2bf62 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.line.cap.open.js @@ -0,0 +1,25 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.strokeStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineJoin = 'bevel'; +ctx.lineCap = 'square'; +ctx.lineWidth = 400; + +ctx.beginPath(); +ctx.moveTo(200, 200); +ctx.lineTo(200, 1000); +ctx.lineTo(1000, 1000); +ctx.lineTo(1000, 200); +ctx.lineTo(200, 200); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.line.cap.round.js b/platforms/ios/www/test/tests-todo/2d.line.cap.round.js new file mode 100644 index 0000000..5e1c7de --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.line.cap.round.js @@ -0,0 +1,56 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var tol = 1; // tolerance to avoid antialiasing artifacts + +ctx.lineCap = 'round'; +ctx.lineWidth = 20; + + +ctx.fillStyle = '#f00'; +ctx.strokeStyle = '#0f0'; + +ctx.beginPath(); +ctx.moveTo(35-tol, 15); +ctx.arc(25, 15, 10-tol, 0, Math.PI, true); +ctx.arc(25, 35, 10-tol, Math.PI, 0, true); +ctx.fill(); + +ctx.beginPath(); +ctx.moveTo(25, 15); +ctx.lineTo(25, 35); +ctx.stroke(); + + +ctx.fillStyle = '#0f0'; +ctx.strokeStyle = '#f00'; + +ctx.beginPath(); +ctx.moveTo(75, 15); +ctx.lineTo(75, 35); +ctx.stroke(); + +ctx.beginPath(); +ctx.moveTo(85+tol, 15); +ctx.arc(75, 15, 10+tol, 0, Math.PI, true); +ctx.arc(75, 35, 10+tol, Math.PI, 0, true); +ctx.fill(); + +_assertPixel(canvas, 17,6, 0,255,0,255, "17,6", "0,255,0,255"); +_assertPixel(canvas, 25,6, 0,255,0,255, "25,6", "0,255,0,255"); +_assertPixel(canvas, 32,6, 0,255,0,255, "32,6", "0,255,0,255"); +_assertPixel(canvas, 17,43, 0,255,0,255, "17,43", "0,255,0,255"); +_assertPixel(canvas, 25,43, 0,255,0,255, "25,43", "0,255,0,255"); +_assertPixel(canvas, 32,43, 0,255,0,255, "32,43", "0,255,0,255"); + +_assertPixel(canvas, 67,6, 0,255,0,255, "67,6", "0,255,0,255"); +_assertPixel(canvas, 75,6, 0,255,0,255, "75,6", "0,255,0,255"); +_assertPixel(canvas, 82,6, 0,255,0,255, "82,6", "0,255,0,255"); +_assertPixel(canvas, 67,43, 0,255,0,255, "67,43", "0,255,0,255"); +_assertPixel(canvas, 75,43, 0,255,0,255, "75,43", "0,255,0,255"); +_assertPixel(canvas, 82,43, 0,255,0,255, "82,43", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.line.cap.square.js b/platforms/ios/www/test/tests-todo/2d.line.cap.square.js new file mode 100644 index 0000000..992dc5c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.line.cap.square.js @@ -0,0 +1,40 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineCap = 'square'; +ctx.lineWidth = 20; + +ctx.fillStyle = '#f00'; +ctx.strokeStyle = '#0f0'; +ctx.fillRect(15, 5, 20, 40); +ctx.beginPath(); +ctx.moveTo(25, 15); +ctx.lineTo(25, 35); +ctx.stroke(); + +ctx.fillStyle = '#0f0'; +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(75, 15); +ctx.lineTo(75, 35); +ctx.stroke(); +ctx.fillRect(65, 5, 20, 40); + +_assertPixel(canvas, 25,4, 0,255,0,255, "25,4", "0,255,0,255"); +_assertPixel(canvas, 25,5, 0,255,0,255, "25,5", "0,255,0,255"); +_assertPixel(canvas, 25,6, 0,255,0,255, "25,6", "0,255,0,255"); +_assertPixel(canvas, 25,44, 0,255,0,255, "25,44", "0,255,0,255"); +_assertPixel(canvas, 25,45, 0,255,0,255, "25,45", "0,255,0,255"); +_assertPixel(canvas, 25,46, 0,255,0,255, "25,46", "0,255,0,255"); + +_assertPixel(canvas, 75,4, 0,255,0,255, "75,4", "0,255,0,255"); +_assertPixel(canvas, 75,5, 0,255,0,255, "75,5", "0,255,0,255"); +_assertPixel(canvas, 75,6, 0,255,0,255, "75,6", "0,255,0,255"); +_assertPixel(canvas, 75,44, 0,255,0,255, "75,44", "0,255,0,255"); +_assertPixel(canvas, 75,45, 0,255,0,255, "75,45", "0,255,0,255"); +_assertPixel(canvas, 75,46, 0,255,0,255, "75,46", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.line.cap.valid.js b/platforms/ios/www/test/tests-todo/2d.line.cap.valid.js new file mode 100644 index 0000000..25a5256 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.line.cap.valid.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.lineCap = 'butt' +_assertSame(ctx.lineCap, 'butt', "ctx.lineCap", "'butt'"); + +ctx.lineCap = 'round'; +_assertSame(ctx.lineCap, 'round', "ctx.lineCap", "'round'"); + +ctx.lineCap = 'square'; +_assertSame(ctx.lineCap, 'square', "ctx.lineCap", "'square'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.line.cross.js b/platforms/ios/www/test/tests-todo/2d.line.cross.js new file mode 100644 index 0000000..baaaa6a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.line.cross.js @@ -0,0 +1,22 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineWidth = 200; +ctx.lineJoin = 'bevel'; + +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(110, 50); +ctx.lineTo(110, 60); +ctx.lineTo(100, 60); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.line.defaults.js b/platforms/ios/www/test/tests-todo/2d.line.defaults.js new file mode 100644 index 0000000..3705322 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.line.defaults.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +_assertSame(ctx.lineWidth, 1, "ctx.lineWidth", "1"); +_assertSame(ctx.lineCap, 'butt', "ctx.lineCap", "'butt'"); +_assertSame(ctx.lineJoin, 'miter', "ctx.lineJoin", "'miter'"); +_assertSame(ctx.miterLimit, 10, "ctx.miterLimit", "10"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.line.join.bevel.js b/platforms/ios/www/test/tests-todo/2d.line.join.bevel.js new file mode 100644 index 0000000..5fc241d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.line.join.bevel.js @@ -0,0 +1,59 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var tol = 1; // tolerance to avoid antialiasing artifacts + +ctx.lineJoin = 'bevel'; +ctx.lineWidth = 20; + +ctx.fillStyle = '#f00'; +ctx.strokeStyle = '#0f0'; + +ctx.fillRect(10, 10, 20, 20); +ctx.fillRect(20, 20, 20, 20); +ctx.beginPath(); +ctx.moveTo(30, 20); +ctx.lineTo(40-tol, 20); +ctx.lineTo(30, 10+tol); +ctx.fill(); + +ctx.beginPath(); +ctx.moveTo(10, 20); +ctx.lineTo(30, 20); +ctx.lineTo(30, 40); +ctx.stroke(); + + +ctx.fillStyle = '#0f0'; +ctx.strokeStyle = '#f00'; + +ctx.beginPath(); +ctx.moveTo(60, 20); +ctx.lineTo(80, 20); +ctx.lineTo(80, 40); +ctx.stroke(); + +ctx.fillRect(60, 10, 20, 20); +ctx.fillRect(70, 20, 20, 20); +ctx.beginPath(); +ctx.moveTo(80, 20); +ctx.lineTo(90+tol, 20); +ctx.lineTo(80, 10-tol); +ctx.fill(); + +_assertPixel(canvas, 34,16, 0,255,0,255, "34,16", "0,255,0,255"); +_assertPixel(canvas, 34,15, 0,255,0,255, "34,15", "0,255,0,255"); +_assertPixel(canvas, 35,15, 0,255,0,255, "35,15", "0,255,0,255"); +_assertPixel(canvas, 36,15, 0,255,0,255, "36,15", "0,255,0,255"); +_assertPixel(canvas, 36,14, 0,255,0,255, "36,14", "0,255,0,255"); + +_assertPixel(canvas, 84,16, 0,255,0,255, "84,16", "0,255,0,255"); +_assertPixel(canvas, 84,15, 0,255,0,255, "84,15", "0,255,0,255"); +_assertPixel(canvas, 85,15, 0,255,0,255, "85,15", "0,255,0,255"); +_assertPixel(canvas, 86,15, 0,255,0,255, "86,15", "0,255,0,255"); +_assertPixel(canvas, 86,14, 0,255,0,255, "86,14", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.line.join.closed.js b/platforms/ios/www/test/tests-todo/2d.line.join.closed.js new file mode 100644 index 0000000..f835bf9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.line.join.closed.js @@ -0,0 +1,24 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.strokeStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineJoin = 'miter'; +ctx.lineWidth = 200; + +ctx.beginPath(); +ctx.moveTo(100, 50); +ctx.lineTo(100, 1000); +ctx.lineTo(1000, 1000); +ctx.lineTo(1000, 50); +ctx.closePath(); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.line.join.invalid.js b/platforms/ios/www/test/tests-todo/2d.line.join.invalid.js new file mode 100644 index 0000000..c60bec8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.line.join.invalid.js @@ -0,0 +1,31 @@ +_addTest(function(canvas, ctx) { + +ctx.lineJoin = 'bevel' +_assertSame(ctx.lineJoin, 'bevel', "ctx.lineJoin", "'bevel'"); + +ctx.lineJoin = 'bevel'; +ctx.lineJoin = 'invalid'; +_assertSame(ctx.lineJoin, 'bevel', "ctx.lineJoin", "'bevel'"); + +ctx.lineJoin = 'bevel'; +ctx.lineJoin = 'ROUND'; +_assertSame(ctx.lineJoin, 'bevel', "ctx.lineJoin", "'bevel'"); + +ctx.lineJoin = 'bevel'; +ctx.lineJoin = 'round\0'; +_assertSame(ctx.lineJoin, 'bevel', "ctx.lineJoin", "'bevel'"); + +ctx.lineJoin = 'bevel'; +ctx.lineJoin = 'round '; +_assertSame(ctx.lineJoin, 'bevel', "ctx.lineJoin", "'bevel'"); + +ctx.lineJoin = 'bevel'; +ctx.lineJoin = ""; +_assertSame(ctx.lineJoin, 'bevel', "ctx.lineJoin", "'bevel'"); + +ctx.lineJoin = 'bevel'; +ctx.lineJoin = 'butt'; +_assertSame(ctx.lineJoin, 'bevel', "ctx.lineJoin", "'bevel'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.line.join.miter.js b/platforms/ios/www/test/tests-todo/2d.line.join.miter.js new file mode 100644 index 0000000..bbcb340 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.line.join.miter.js @@ -0,0 +1,50 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineJoin = 'miter'; +ctx.lineWidth = 20; + +ctx.fillStyle = '#f00'; +ctx.strokeStyle = '#0f0'; + +ctx.fillStyle = '#f00'; +ctx.strokeStyle = '#0f0'; + +ctx.fillRect(10, 10, 30, 20); +ctx.fillRect(20, 10, 20, 30); + +ctx.beginPath(); +ctx.moveTo(10, 20); +ctx.lineTo(30, 20); +ctx.lineTo(30, 40); +ctx.stroke(); + + +ctx.fillStyle = '#0f0'; +ctx.strokeStyle = '#f00'; + +ctx.beginPath(); +ctx.moveTo(60, 20); +ctx.lineTo(80, 20); +ctx.lineTo(80, 40); +ctx.stroke(); + +ctx.fillRect(60, 10, 30, 20); +ctx.fillRect(70, 10, 20, 30); + +_assertPixel(canvas, 38,12, 0,255,0,255, "38,12", "0,255,0,255"); +_assertPixel(canvas, 39,11, 0,255,0,255, "39,11", "0,255,0,255"); +_assertPixel(canvas, 40,10, 0,255,0,255, "40,10", "0,255,0,255"); +_assertPixel(canvas, 41,9, 0,255,0,255, "41,9", "0,255,0,255"); +_assertPixel(canvas, 42,8, 0,255,0,255, "42,8", "0,255,0,255"); + +_assertPixel(canvas, 88,12, 0,255,0,255, "88,12", "0,255,0,255"); +_assertPixel(canvas, 89,11, 0,255,0,255, "89,11", "0,255,0,255"); +_assertPixel(canvas, 90,10, 0,255,0,255, "90,10", "0,255,0,255"); +_assertPixel(canvas, 91,9, 0,255,0,255, "91,9", "0,255,0,255"); +_assertPixel(canvas, 92,8, 0,255,0,255, "92,8", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.line.join.open.js b/platforms/ios/www/test/tests-todo/2d.line.join.open.js new file mode 100644 index 0000000..837c8c2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.line.join.open.js @@ -0,0 +1,24 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.strokeStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineJoin = 'miter'; +ctx.lineWidth = 200; + +ctx.beginPath(); +ctx.moveTo(100, 50); +ctx.lineTo(100, 1000); +ctx.lineTo(1000, 1000); +ctx.lineTo(1000, 50); +ctx.lineTo(100, 50); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.line.join.parallel.js b/platforms/ios/www/test/tests-todo/2d.line.join.parallel.js new file mode 100644 index 0000000..c041ecb --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.line.join.parallel.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 300; +ctx.lineJoin = 'round'; +ctx.beginPath(); +ctx.moveTo(-100, 25); +ctx.lineTo(0, 25); +ctx.lineTo(-100, 25); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.line.join.round.js b/platforms/ios/www/test/tests-todo/2d.line.join.round.js new file mode 100644 index 0000000..96ce608 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.line.join.round.js @@ -0,0 +1,57 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var tol = 1; // tolerance to avoid antialiasing artifacts + +ctx.lineJoin = 'round'; +ctx.lineWidth = 20; + +ctx.fillStyle = '#f00'; +ctx.strokeStyle = '#0f0'; + +ctx.fillRect(10, 10, 20, 20); +ctx.fillRect(20, 20, 20, 20); +ctx.beginPath(); +ctx.moveTo(30, 20); +ctx.arc(30, 20, 10-tol, 0, 2*Math.PI, true); +ctx.fill(); + +ctx.beginPath(); +ctx.moveTo(10, 20); +ctx.lineTo(30, 20); +ctx.lineTo(30, 40); +ctx.stroke(); + + +ctx.fillStyle = '#0f0'; +ctx.strokeStyle = '#f00'; + +ctx.beginPath(); +ctx.moveTo(60, 20); +ctx.lineTo(80, 20); +ctx.lineTo(80, 40); +ctx.stroke(); + +ctx.fillRect(60, 10, 20, 20); +ctx.fillRect(70, 20, 20, 20); +ctx.beginPath(); +ctx.moveTo(80, 20); +ctx.arc(80, 20, 10+tol, 0, 2*Math.PI, true); +ctx.fill(); + +_assertPixel(canvas, 36,14, 0,255,0,255, "36,14", "0,255,0,255"); +_assertPixel(canvas, 36,13, 0,255,0,255, "36,13", "0,255,0,255"); +_assertPixel(canvas, 37,13, 0,255,0,255, "37,13", "0,255,0,255"); +_assertPixel(canvas, 38,13, 0,255,0,255, "38,13", "0,255,0,255"); +_assertPixel(canvas, 38,12, 0,255,0,255, "38,12", "0,255,0,255"); + +_assertPixel(canvas, 86,14, 0,255,0,255, "86,14", "0,255,0,255"); +_assertPixel(canvas, 86,13, 0,255,0,255, "86,13", "0,255,0,255"); +_assertPixel(canvas, 87,13, 0,255,0,255, "87,13", "0,255,0,255"); +_assertPixel(canvas, 88,13, 0,255,0,255, "88,13", "0,255,0,255"); +_assertPixel(canvas, 88,12, 0,255,0,255, "88,12", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.line.join.valid.js b/platforms/ios/www/test/tests-todo/2d.line.join.valid.js new file mode 100644 index 0000000..2097661 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.line.join.valid.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.lineJoin = 'bevel' +_assertSame(ctx.lineJoin, 'bevel', "ctx.lineJoin", "'bevel'"); + +ctx.lineJoin = 'round'; +_assertSame(ctx.lineJoin, 'round', "ctx.lineJoin", "'round'"); + +ctx.lineJoin = 'miter'; +_assertSame(ctx.lineJoin, 'miter', "ctx.lineJoin", "'miter'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.line.miter.acute.js b/platforms/ios/www/test/tests-todo/2d.line.miter.acute.js new file mode 100644 index 0000000..e742f87 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.line.miter.acute.js @@ -0,0 +1,31 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineWidth = 200; +ctx.lineJoin = 'miter'; + +ctx.strokeStyle = '#0f0'; +ctx.miterLimit = 2.614; +ctx.beginPath(); +ctx.moveTo(100, 1000); +ctx.lineTo(100, 100); +ctx.lineTo(1000, 1000); +ctx.stroke(); + +ctx.strokeStyle = '#f00'; +ctx.miterLimit = 2.613; +ctx.beginPath(); +ctx.moveTo(100, 1000); +ctx.lineTo(100, 100); +ctx.lineTo(1000, 1000); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.line.miter.exceeded.js b/platforms/ios/www/test/tests-todo/2d.line.miter.exceeded.js new file mode 100644 index 0000000..c86ce52 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.line.miter.exceeded.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineWidth = 400; +ctx.lineJoin = 'miter'; + +ctx.strokeStyle = '#f00'; +ctx.miterLimit = 1.414; +ctx.beginPath(); +ctx.moveTo(200, 1000); +ctx.lineTo(200, 200); +ctx.lineTo(1000, 201); // slightly non-right-angle to avoid being a special case +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.line.miter.invalid.js b/platforms/ios/www/test/tests-todo/2d.line.miter.invalid.js new file mode 100644 index 0000000..e9982e0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.line.miter.invalid.js @@ -0,0 +1,27 @@ +_addTest(function(canvas, ctx) { + +ctx.miterLimit = 1.5; +_assertSame(ctx.miterLimit, 1.5, "ctx.miterLimit", "1.5"); + +ctx.miterLimit = 1.5; +ctx.miterLimit = 0; +_assertSame(ctx.miterLimit, 1.5, "ctx.miterLimit", "1.5"); + +ctx.miterLimit = 1.5; +ctx.miterLimit = -1; +_assertSame(ctx.miterLimit, 1.5, "ctx.miterLimit", "1.5"); + +ctx.miterLimit = 1.5; +ctx.miterLimit = Infinity; +_assertSame(ctx.miterLimit, 1.5, "ctx.miterLimit", "1.5"); + +ctx.miterLimit = 1.5; +ctx.miterLimit = -Infinity; +_assertSame(ctx.miterLimit, 1.5, "ctx.miterLimit", "1.5"); + +ctx.miterLimit = 1.5; +ctx.miterLimit = NaN; +_assertSame(ctx.miterLimit, 1.5, "ctx.miterLimit", "1.5"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.line.miter.lineedge.js b/platforms/ios/www/test/tests-todo/2d.line.miter.lineedge.js new file mode 100644 index 0000000..ef5f616 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.line.miter.lineedge.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineWidth = 200; +ctx.lineJoin = 'miter'; + +ctx.strokeStyle = '#f00'; +ctx.miterLimit = 1.414; +ctx.beginPath(); +ctx.strokeRect(100, 25, 200, 0); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.line.miter.obtuse.js b/platforms/ios/www/test/tests-todo/2d.line.miter.obtuse.js new file mode 100644 index 0000000..46e4a6b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.line.miter.obtuse.js @@ -0,0 +1,31 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineWidth = 1600; +ctx.lineJoin = 'miter'; + +ctx.strokeStyle = '#0f0'; +ctx.miterLimit = 1.083; +ctx.beginPath(); +ctx.moveTo(800, 10000); +ctx.lineTo(800, 300); +ctx.lineTo(10000, -8900); +ctx.stroke(); + +ctx.strokeStyle = '#f00'; +ctx.miterLimit = 1.082; +ctx.beginPath(); +ctx.moveTo(800, 10000); +ctx.lineTo(800, 300); +ctx.lineTo(10000, -8900); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.line.miter.rightangle.js b/platforms/ios/www/test/tests-todo/2d.line.miter.rightangle.js new file mode 100644 index 0000000..150bffb --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.line.miter.rightangle.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineWidth = 400; +ctx.lineJoin = 'miter'; + +ctx.strokeStyle = '#f00'; +ctx.miterLimit = 1.414; +ctx.beginPath(); +ctx.moveTo(200, 1000); +ctx.lineTo(200, 200); +ctx.lineTo(1000, 200); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.line.miter.valid.js b/platforms/ios/www/test/tests-todo/2d.line.miter.valid.js new file mode 100644 index 0000000..26a88b3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.line.miter.valid.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.miterLimit = 1.5; +_assertSame(ctx.miterLimit, 1.5, "ctx.miterLimit", "1.5"); + +ctx.miterLimit = "1e1"; +_assertSame(ctx.miterLimit, 10, "ctx.miterLimit", "10"); + +ctx.miterLimit = 1/1024; +_assertSame(ctx.miterLimit, 1/1024, "ctx.miterLimit", "1/1024"); + +ctx.miterLimit = 1000; +_assertSame(ctx.miterLimit, 1000, "ctx.miterLimit", "1000"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.line.miter.within.js b/platforms/ios/www/test/tests-todo/2d.line.miter.within.js new file mode 100644 index 0000000..09b3eb9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.line.miter.within.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineWidth = 400; +ctx.lineJoin = 'miter'; + +ctx.strokeStyle = '#0f0'; +ctx.miterLimit = 1.416; +ctx.beginPath(); +ctx.moveTo(200, 1000); +ctx.lineTo(200, 200); +ctx.lineTo(1000, 201); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.line.union.js b/platforms/ios/www/test/tests-todo/2d.line.union.js new file mode 100644 index 0000000..d2950b0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.line.union.js @@ -0,0 +1,25 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineWidth = 100; +ctx.lineCap = 'round'; + +ctx.strokeStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(0, 24); +ctx.lineTo(100, 25); +ctx.lineTo(0, 26); +ctx.closePath(); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 25,1, 0,255,0,255, "25,1", "0,255,0,255"); +_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 25,1, 0,255,0,255, "25,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.line.width.basic.js b/platforms/ios/www/test/tests-todo/2d.line.width.basic.js new file mode 100644 index 0000000..a6d46ea --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.line.width.basic.js @@ -0,0 +1,42 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineWidth = 20; +// Draw a green line over a red box, to check the line is not too small +ctx.fillStyle = '#f00'; +ctx.strokeStyle = '#0f0'; +ctx.fillRect(15, 15, 20, 20); +ctx.beginPath(); +ctx.moveTo(25, 15); +ctx.lineTo(25, 35); +ctx.stroke(); + +// Draw a green box over a red line, to check the line is not too large +ctx.fillStyle = '#0f0'; +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(75, 15); +ctx.lineTo(75, 35); +ctx.stroke(); +ctx.fillRect(65, 15, 20, 20); + +_assertPixel(canvas, 14,25, 0,255,0,255, "14,25", "0,255,0,255"); +_assertPixel(canvas, 15,25, 0,255,0,255, "15,25", "0,255,0,255"); +_assertPixel(canvas, 16,25, 0,255,0,255, "16,25", "0,255,0,255"); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 34,25, 0,255,0,255, "34,25", "0,255,0,255"); +_assertPixel(canvas, 35,25, 0,255,0,255, "35,25", "0,255,0,255"); +_assertPixel(canvas, 36,25, 0,255,0,255, "36,25", "0,255,0,255"); + +_assertPixel(canvas, 64,25, 0,255,0,255, "64,25", "0,255,0,255"); +_assertPixel(canvas, 65,25, 0,255,0,255, "65,25", "0,255,0,255"); +_assertPixel(canvas, 66,25, 0,255,0,255, "66,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); +_assertPixel(canvas, 84,25, 0,255,0,255, "84,25", "0,255,0,255"); +_assertPixel(canvas, 85,25, 0,255,0,255, "85,25", "0,255,0,255"); +_assertPixel(canvas, 86,25, 0,255,0,255, "86,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.line.width.invalid.js b/platforms/ios/www/test/tests-todo/2d.line.width.invalid.js new file mode 100644 index 0000000..f48f0d3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.line.width.invalid.js @@ -0,0 +1,27 @@ +_addTest(function(canvas, ctx) { + +ctx.lineWidth = 1.5; +_assertSame(ctx.lineWidth, 1.5, "ctx.lineWidth", "1.5"); + +ctx.lineWidth = 1.5; +ctx.lineWidth = 0; +_assertSame(ctx.lineWidth, 1.5, "ctx.lineWidth", "1.5"); + +ctx.lineWidth = 1.5; +ctx.lineWidth = -1; +_assertSame(ctx.lineWidth, 1.5, "ctx.lineWidth", "1.5"); + +ctx.lineWidth = 1.5; +ctx.lineWidth = Infinity; +_assertSame(ctx.lineWidth, 1.5, "ctx.lineWidth", "1.5"); + +ctx.lineWidth = 1.5; +ctx.lineWidth = -Infinity; +_assertSame(ctx.lineWidth, 1.5, "ctx.lineWidth", "1.5"); + +ctx.lineWidth = 1.5; +ctx.lineWidth = NaN; +_assertSame(ctx.lineWidth, 1.5, "ctx.lineWidth", "1.5"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.line.width.scaledefault.js b/platforms/ios/www/test/tests-todo/2d.line.width.scaledefault.js new file mode 100644 index 0000000..e52773c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.line.width.scaledefault.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.scale(50, 50); +ctx.strokeStyle = '#0f0'; +ctx.moveTo(0, 0.5); +ctx.lineTo(2, 0.5); +ctx.stroke(); + +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); +_assertPixel(canvas, 50,5, 0,255,0,255, "50,5", "0,255,0,255"); +_assertPixel(canvas, 50,45, 0,255,0,255, "50,45", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.line.width.transformed.js b/platforms/ios/www/test/tests-todo/2d.line.width.transformed.js new file mode 100644 index 0000000..981e884 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.line.width.transformed.js @@ -0,0 +1,48 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineWidth = 4; +// Draw a green line over a red box, to check the line is not too small +ctx.fillStyle = '#f00'; +ctx.strokeStyle = '#0f0'; +ctx.fillRect(15, 15, 20, 20); +ctx.save(); + ctx.scale(5, 1); + ctx.beginPath(); + ctx.moveTo(5, 15); + ctx.lineTo(5, 35); + ctx.stroke(); +ctx.restore(); + +// Draw a green box over a red line, to check the line is not too large +ctx.fillStyle = '#0f0'; +ctx.strokeStyle = '#f00'; +ctx.save(); + ctx.scale(-5, 1); + ctx.beginPath(); + ctx.moveTo(-15, 15); + ctx.lineTo(-15, 35); + ctx.stroke(); +ctx.restore(); +ctx.fillRect(65, 15, 20, 20); + +_assertPixel(canvas, 14,25, 0,255,0,255, "14,25", "0,255,0,255"); +_assertPixel(canvas, 15,25, 0,255,0,255, "15,25", "0,255,0,255"); +_assertPixel(canvas, 16,25, 0,255,0,255, "16,25", "0,255,0,255"); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 34,25, 0,255,0,255, "34,25", "0,255,0,255"); +_assertPixel(canvas, 35,25, 0,255,0,255, "35,25", "0,255,0,255"); +_assertPixel(canvas, 36,25, 0,255,0,255, "36,25", "0,255,0,255"); + +_assertPixel(canvas, 64,25, 0,255,0,255, "64,25", "0,255,0,255"); +_assertPixel(canvas, 65,25, 0,255,0,255, "65,25", "0,255,0,255"); +_assertPixel(canvas, 66,25, 0,255,0,255, "66,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); +_assertPixel(canvas, 84,25, 0,255,0,255, "84,25", "0,255,0,255"); +_assertPixel(canvas, 85,25, 0,255,0,255, "85,25", "0,255,0,255"); +_assertPixel(canvas, 86,25, 0,255,0,255, "86,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.line.width.valid.js b/platforms/ios/www/test/tests-todo/2d.line.width.valid.js new file mode 100644 index 0000000..2c5e700 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.line.width.valid.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.lineWidth = 1.5; +_assertSame(ctx.lineWidth, 1.5, "ctx.lineWidth", "1.5"); + +ctx.lineWidth = "1e1"; +_assertSame(ctx.lineWidth, 10, "ctx.lineWidth", "10"); + +ctx.lineWidth = 1/1024; +_assertSame(ctx.lineWidth, 1/1024, "ctx.lineWidth", "1/1024"); + +ctx.lineWidth = 1000; +_assertSame(ctx.lineWidth, 1000, "ctx.lineWidth", "1000"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.missingargs.js b/platforms/ios/www/test/tests-todo/2d.missingargs.js new file mode 100644 index 0000000..3140fba --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.missingargs.js @@ -0,0 +1,311 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.scale(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.scale()"); } +try { var _thrown = false; + ctx.scale(1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.scale(1)"); } +try { var _thrown = false; + ctx.rotate(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.rotate()"); } +try { var _thrown = false; + ctx.translate(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.translate()"); } +try { var _thrown = false; + ctx.translate(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.translate(0)"); } +if (ctx.transform) { // (avoid spurious failures, since the aim here is not to test that all features are supported) + try { var _thrown = false; + ctx.transform(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.transform()"); } + try { var _thrown = false; + ctx.transform(1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.transform(1)"); } + try { var _thrown = false; + ctx.transform(1, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.transform(1, 0)"); } + try { var _thrown = false; + ctx.transform(1, 0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.transform(1, 0, 0)"); } + try { var _thrown = false; + ctx.transform(1, 0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.transform(1, 0, 0, 1)"); } + try { var _thrown = false; + ctx.transform(1, 0, 0, 1, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.transform(1, 0, 0, 1, 0)"); } +} +if (ctx.setTransform) { + try { var _thrown = false; + ctx.setTransform(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.setTransform()"); } + try { var _thrown = false; + ctx.setTransform(1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.setTransform(1)"); } + try { var _thrown = false; + ctx.setTransform(1, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.setTransform(1, 0)"); } + try { var _thrown = false; + ctx.setTransform(1, 0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.setTransform(1, 0, 0)"); } + try { var _thrown = false; + ctx.setTransform(1, 0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.setTransform(1, 0, 0, 1)"); } + try { var _thrown = false; + ctx.setTransform(1, 0, 0, 1, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.setTransform(1, 0, 0, 1, 0)"); } +} +try { var _thrown = false; + ctx.createLinearGradient(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient()"); } +try { var _thrown = false; + ctx.createLinearGradient(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient()"); } +try { var _thrown = false; + ctx.createRadialGradient(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, 1, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, 1, 0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, 0)"); } +try { var _thrown = false; + ctx.createPattern(canvas); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createPattern(canvas)"); } +try { var _thrown = false; + ctx.clearRect(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.clearRect()"); } +try { var _thrown = false; + ctx.clearRect(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.clearRect(0)"); } +try { var _thrown = false; + ctx.clearRect(0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.clearRect(0, 0)"); } +try { var _thrown = false; + ctx.clearRect(0, 0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.clearRect(0, 0, 0)"); } +try { var _thrown = false; + ctx.fillRect(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.fillRect()"); } +try { var _thrown = false; + ctx.fillRect(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.fillRect(0)"); } +try { var _thrown = false; + ctx.fillRect(0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.fillRect(0, 0)"); } +try { var _thrown = false; + ctx.fillRect(0, 0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.fillRect(0, 0, 0)"); } +try { var _thrown = false; + ctx.strokeRect(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.strokeRect()"); } +try { var _thrown = false; + ctx.strokeRect(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.strokeRect(0)"); } +try { var _thrown = false; + ctx.strokeRect(0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.strokeRect(0, 0)"); } +try { var _thrown = false; + ctx.strokeRect(0, 0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.strokeRect(0, 0, 0)"); } +try { var _thrown = false; + ctx.moveTo(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.moveTo()"); } +try { var _thrown = false; + ctx.moveTo(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.moveTo(0)"); } +try { var _thrown = false; + ctx.lineTo(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.lineTo()"); } +try { var _thrown = false; + ctx.lineTo(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.lineTo(0)"); } +try { var _thrown = false; + ctx.quadraticCurveTo(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.quadraticCurveTo()"); } +try { var _thrown = false; + ctx.quadraticCurveTo(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.quadraticCurveTo(0)"); } +try { var _thrown = false; + ctx.quadraticCurveTo(0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.quadraticCurveTo(0, 0)"); } +try { var _thrown = false; + ctx.quadraticCurveTo(0, 0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.quadraticCurveTo(0, 0, 0)"); } +try { var _thrown = false; + ctx.bezierCurveTo(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.bezierCurveTo()"); } +try { var _thrown = false; + ctx.bezierCurveTo(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.bezierCurveTo(0)"); } +try { var _thrown = false; + ctx.bezierCurveTo(0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.bezierCurveTo(0, 0)"); } +try { var _thrown = false; + ctx.bezierCurveTo(0, 0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.bezierCurveTo(0, 0, 0)"); } +try { var _thrown = false; + ctx.bezierCurveTo(0, 0, 0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.bezierCurveTo(0, 0, 0, 0)"); } +try { var _thrown = false; + ctx.bezierCurveTo(0, 0, 0, 0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.bezierCurveTo(0, 0, 0, 0, 0)"); } +try { var _thrown = false; + ctx.arcTo(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arcTo()"); } +try { var _thrown = false; + ctx.arcTo(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arcTo(0)"); } +try { var _thrown = false; + ctx.arcTo(0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arcTo(0, 0)"); } +try { var _thrown = false; + ctx.arcTo(0, 0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arcTo(0, 0, 0)"); } +try { var _thrown = false; + ctx.arcTo(0, 0, 0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arcTo(0, 0, 0, 0)"); } +try { var _thrown = false; + ctx.rect(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.rect()"); } +try { var _thrown = false; + ctx.rect(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.rect(0)"); } +try { var _thrown = false; + ctx.rect(0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.rect(0, 0)"); } +try { var _thrown = false; + ctx.rect(0, 0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.rect(0, 0, 0)"); } +try { var _thrown = false; + ctx.arc(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arc()"); } +try { var _thrown = false; + ctx.arc(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arc(0)"); } +try { var _thrown = false; + ctx.arc(0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arc(0, 0)"); } +try { var _thrown = false; + ctx.arc(0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arc(0, 0, 1)"); } +try { var _thrown = false; + ctx.arc(0, 0, 1, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arc(0, 0, 1, 0)"); } +try { var _thrown = false; + ctx.arc(0, 0, 1, 0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arc(0, 0, 1, 0, 0)"); } +if (ctx.isPointInPath) { + try { var _thrown = false; + ctx.isPointInPath(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.isPointInPath()"); } + try { var _thrown = false; + ctx.isPointInPath(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.isPointInPath(0)"); } +} +if (ctx.drawFocusRing) { + try { var _thrown = false; + ctx.drawFocusRing(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.drawFocusRing()"); } + try { var _thrown = false; + ctx.drawFocusRing(canvas); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.drawFocusRing(canvas)"); } + try { var _thrown = false; + ctx.drawFocusRing(canvas, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.drawFocusRing(canvas, 0)"); } +} +if (ctx.fillText) { + try { var _thrown = false; + ctx.fillText(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.fillText()"); } + try { var _thrown = false; + ctx.fillText('test'); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.fillText('test')"); } + try { var _thrown = false; + ctx.fillText('test', 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.fillText('test', 0)"); } + try { var _thrown = false; + ctx.strokeText(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.strokeText()"); } + try { var _thrown = false; + ctx.strokeText('test'); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.strokeText('test')"); } + try { var _thrown = false; + ctx.strokeText('test', 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.strokeText('test', 0)"); } + try { var _thrown = false; + ctx.measureText(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.measureText()"); } +} +try { var _thrown = false; + ctx.drawImage(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.drawImage()"); } +try { var _thrown = false; + ctx.drawImage(canvas); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.drawImage(canvas)"); } +try { var _thrown = false; + ctx.drawImage(canvas, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.drawImage(canvas, 0)"); } +// TODO: n >= 3 args on drawImage could be either a valid overload, +// or too few for another overload, or too many for another +// overload - what should happen? +if (ctx.createImageData) { + try { var _thrown = false; + ctx.createImageData(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createImageData()"); } + try { var _thrown = false; + ctx.createImageData(1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createImageData(1)"); } +} +if (ctx.getImageData) { + try { var _thrown = false; + ctx.getImageData(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData()"); } + try { var _thrown = false; + ctx.getImageData(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(0)"); } + try { var _thrown = false; + ctx.getImageData(0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(0, 0)"); } + try { var _thrown = false; + ctx.getImageData(0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(0, 0, 1)"); } +} +if (ctx.putImageData) { + var imgdata = ctx.getImageData(0, 0, 1, 1); + try { var _thrown = false; + ctx.putImageData(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData()"); } + try { var _thrown = false; + ctx.putImageData(imgdata); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata)"); } + try { var _thrown = false; + ctx.putImageData(imgdata, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 0)"); } +} +var g = ctx.createLinearGradient(0, 0, 0, 0); +try { var _thrown = false; + g.addColorStop(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: g.addColorStop()"); } +try { var _thrown = false; + g.addColorStop(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: g.addColorStop(0)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arc.angle.1.js b/platforms/ios/www/test/tests-todo/2d.path.arc.angle.1.js new file mode 100644 index 0000000..9216664 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arc.angle.1.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(100, 0); +ctx.arc(100, 0, 150, Math.PI/2, -Math.PI, true); +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arc.angle.2.js b/platforms/ios/www/test/tests-todo/2d.path.arc.angle.2.js new file mode 100644 index 0000000..f8306c0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arc.angle.2.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(100, 0); +ctx.arc(100, 0, 150, -3*Math.PI/2, -Math.PI, true); +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arc.angle.3.js b/platforms/ios/www/test/tests-todo/2d.path.arc.angle.3.js new file mode 100644 index 0000000..8b812a2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arc.angle.3.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(100, 0); +ctx.arc(100, 0, 150, (512+1/2)*Math.PI, (1024-1)*Math.PI, true); +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arc.angle.4.js b/platforms/ios/www/test/tests-todo/2d.path.arc.angle.4.js new file mode 100644 index 0000000..82b041a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arc.angle.4.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(50, 25); +ctx.arc(50, 25, 60, (512+1/2)*Math.PI, (1024-1)*Math.PI, false); +ctx.fill(); +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arc.angle.5.js b/platforms/ios/www/test/tests-todo/2d.path.arc.angle.5.js new file mode 100644 index 0000000..bbb0243 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arc.angle.5.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(100, 0); +ctx.arc(100, 0, 150, (1024-1)*Math.PI, (512+1/2)*Math.PI, false); +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arc.angle.6.js b/platforms/ios/www/test/tests-todo/2d.path.arc.angle.6.js new file mode 100644 index 0000000..be5c9ac --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arc.angle.6.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(50, 25); +ctx.arc(50, 25, 60, (1024-1)*Math.PI, (512+1/2)*Math.PI, true); +ctx.fill(); +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arc.empty.js b/platforms/ios/www/test/tests-todo/2d.path.arc.empty.js new file mode 100644 index 0000000..49e1b57 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arc.empty.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 50; +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.arc(200, 25, 5, 0, 2*Math.PI, true); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arc.end.js b/platforms/ios/www/test/tests-todo/2d.path.arc.end.js new file mode 100644 index 0000000..fec59f2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arc.end.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 50; +ctx.strokeStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(-100, 0); +ctx.arc(-100, 0, 25, -Math.PI/2, Math.PI/2, true); +ctx.lineTo(100, 25); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arc.negative.js b/platforms/ios/www/test/tests-todo/2d.path.arc.negative.js new file mode 100644 index 0000000..935a633 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arc.negative.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.arc(0, 0, -1, 0, 0, true); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.arc(0, 0, -1, 0, 0, true)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arc.nonempty.js b/platforms/ios/www/test/tests-todo/2d.path.arc.nonempty.js new file mode 100644 index 0000000..544f1a9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arc.nonempty.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 50; +ctx.strokeStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(0, 25); +ctx.arc(200, 25, 5, 0, 2*Math.PI, true); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arc.nonfinite.js b/platforms/ios/www/test/tests-todo/2d.path.arc.nonfinite.js new file mode 100644 index 0000000..2fed434 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arc.nonfinite.js @@ -0,0 +1,56 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.moveTo(0, 0); +ctx.lineTo(100, 0); +ctx.arc(Infinity, 0, 50, 0, 2*Math.PI, true); +ctx.arc(-Infinity, 0, 50, 0, 2*Math.PI, true); +ctx.arc(NaN, 0, 50, 0, 2*Math.PI, true); +ctx.arc(0, Infinity, 50, 0, 2*Math.PI, true); +ctx.arc(0, -Infinity, 50, 0, 2*Math.PI, true); +ctx.arc(0, NaN, 50, 0, 2*Math.PI, true); +ctx.arc(0, 0, Infinity, 0, 2*Math.PI, true); +ctx.arc(0, 0, -Infinity, 0, 2*Math.PI, true); +ctx.arc(0, 0, NaN, 0, 2*Math.PI, true); +ctx.arc(0, 0, 50, Infinity, 2*Math.PI, true); +ctx.arc(0, 0, 50, -Infinity, 2*Math.PI, true); +ctx.arc(0, 0, 50, NaN, 2*Math.PI, true); +ctx.arc(0, 0, 50, 0, Infinity, true); +ctx.arc(0, 0, 50, 0, -Infinity, true); +ctx.arc(0, 0, 50, 0, NaN, true); +ctx.arc(Infinity, Infinity, 50, 0, 2*Math.PI, true); +ctx.arc(Infinity, Infinity, Infinity, 0, 2*Math.PI, true); +ctx.arc(Infinity, Infinity, Infinity, Infinity, 2*Math.PI, true); +ctx.arc(Infinity, Infinity, Infinity, Infinity, Infinity, true); +ctx.arc(Infinity, Infinity, Infinity, 0, Infinity, true); +ctx.arc(Infinity, Infinity, 50, Infinity, 2*Math.PI, true); +ctx.arc(Infinity, Infinity, 50, Infinity, Infinity, true); +ctx.arc(Infinity, Infinity, 50, 0, Infinity, true); +ctx.arc(Infinity, 0, Infinity, 0, 2*Math.PI, true); +ctx.arc(Infinity, 0, Infinity, Infinity, 2*Math.PI, true); +ctx.arc(Infinity, 0, Infinity, Infinity, Infinity, true); +ctx.arc(Infinity, 0, Infinity, 0, Infinity, true); +ctx.arc(Infinity, 0, 50, Infinity, 2*Math.PI, true); +ctx.arc(Infinity, 0, 50, Infinity, Infinity, true); +ctx.arc(Infinity, 0, 50, 0, Infinity, true); +ctx.arc(0, Infinity, Infinity, 0, 2*Math.PI, true); +ctx.arc(0, Infinity, Infinity, Infinity, 2*Math.PI, true); +ctx.arc(0, Infinity, Infinity, Infinity, Infinity, true); +ctx.arc(0, Infinity, Infinity, 0, Infinity, true); +ctx.arc(0, Infinity, 50, Infinity, 2*Math.PI, true); +ctx.arc(0, Infinity, 50, Infinity, Infinity, true); +ctx.arc(0, Infinity, 50, 0, Infinity, true); +ctx.arc(0, 0, Infinity, Infinity, 2*Math.PI, true); +ctx.arc(0, 0, Infinity, Infinity, Infinity, true); +ctx.arc(0, 0, Infinity, 0, Infinity, true); +ctx.arc(0, 0, 50, Infinity, Infinity, true); +ctx.lineTo(100, 50); +ctx.lineTo(0, 50); +ctx.fillStyle = '#0f0'; +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 90,45, 0,255,0,255, "90,45", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arc.scale.1.js b/platforms/ios/www/test/tests-todo/2d.path.arc.scale.1.js new file mode 100644 index 0000000..8648fd9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arc.scale.1.js @@ -0,0 +1,33 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.scale(2, 0.5); +ctx.fillStyle = '#0f0'; +ctx.beginPath(); +ctx.arc(25, 50, 56, 0, 2*Math.PI, false); +ctx.fill(); +ctx.fillStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(-25, 50); +ctx.arc(-25, 50, 24, 0, 2*Math.PI, false); +ctx.moveTo(75, 50); +ctx.arc(75, 50, 24, 0, 2*Math.PI, false); +ctx.moveTo(25, -25); +ctx.arc(25, -25, 24, 0, 2*Math.PI, false); +ctx.moveTo(25, 125); +ctx.arc(25, 125, 24, 0, 2*Math.PI, false); +ctx.fill(); + +_assertPixel(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255"); +_assertPixel(canvas, 50,0, 0,255,0,255, "50,0", "0,255,0,255"); +_assertPixel(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255"); +_assertPixel(canvas, 0,25, 0,255,0,255, "0,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 99,25, 0,255,0,255, "99,25", "0,255,0,255"); +_assertPixel(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255"); +_assertPixel(canvas, 50,49, 0,255,0,255, "50,49", "0,255,0,255"); +_assertPixel(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arc.scale.2.js b/platforms/ios/www/test/tests-todo/2d.path.arc.scale.2.js new file mode 100644 index 0000000..e00a809 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arc.scale.2.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.scale(100, 100); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 1.2; +ctx.beginPath(); +ctx.arc(0, 0, 0.6, 0, Math.PI/2, false); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arc.selfintersect.1.js b/platforms/ios/www/test/tests-todo/2d.path.arc.selfintersect.1.js new file mode 100644 index 0000000..9a8ec74 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arc.selfintersect.1.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 200; +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.arc(100, 50, 25, 0, -Math.PI/2, true); +ctx.stroke(); +ctx.beginPath(); +ctx.arc(0, 0, 25, 0, -Math.PI/2, true); +ctx.stroke(); +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arc.selfintersect.2.js b/platforms/ios/www/test/tests-todo/2d.path.arc.selfintersect.2.js new file mode 100644 index 0000000..428f621 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arc.selfintersect.2.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 180; +ctx.strokeStyle = '#0f0'; +ctx.beginPath(); +ctx.arc(-50, 50, 25, 0, -Math.PI/2, true); +ctx.stroke(); +ctx.beginPath(); +ctx.arc(100, 0, 25, 0, -Math.PI/2, true); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 90,10, 0,255,0,255, "90,10", "0,255,0,255"); +_assertPixel(canvas, 97,1, 0,255,0,255, "97,1", "0,255,0,255"); +_assertPixel(canvas, 97,2, 0,255,0,255, "97,2", "0,255,0,255"); +_assertPixel(canvas, 97,3, 0,255,0,255, "97,3", "0,255,0,255"); +_assertPixel(canvas, 2,48, 0,255,0,255, "2,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arc.shape.1.js b/platforms/ios/www/test/tests-todo/2d.path.arc.shape.1.js new file mode 100644 index 0000000..549f509 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arc.shape.1.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 50; +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.arc(50, 50, 50, 0, Math.PI, false); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 20,48, 0,255,0,255, "20,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arc.shape.2.js b/platforms/ios/www/test/tests-todo/2d.path.arc.shape.2.js new file mode 100644 index 0000000..b852f1b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arc.shape.2.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 100; +ctx.strokeStyle = '#0f0'; +ctx.beginPath(); +ctx.arc(50, 50, 50, 0, Math.PI, true); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 20,48, 0,255,0,255, "20,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arc.shape.3.js b/platforms/ios/www/test/tests-todo/2d.path.arc.shape.3.js new file mode 100644 index 0000000..4df1161 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arc.shape.3.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 100; +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.arc(0, 50, 50, 0, -Math.PI/2, false); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arc.shape.4.js b/platforms/ios/www/test/tests-todo/2d.path.arc.shape.4.js new file mode 100644 index 0000000..7ba2bcf --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arc.shape.4.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 150; +ctx.strokeStyle = '#0f0'; +ctx.beginPath(); +ctx.arc(-50, 50, 100, 0, -Math.PI/2, true); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arc.shape.5.js b/platforms/ios/www/test/tests-todo/2d.path.arc.shape.5.js new file mode 100644 index 0000000..65e3384 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arc.shape.5.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 200; +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.arc(300, 0, 100, 0, 5*Math.PI, false); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arc.twopie.1.js b/platforms/ios/www/test/tests-todo/2d.path.arc.twopie.1.js new file mode 100644 index 0000000..a77ac0c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arc.twopie.1.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 100; +ctx.beginPath(); +ctx.arc(50, 25, 50, 0, 2*Math.PI - 1e-4, true); +ctx.stroke(); +_assertPixel(canvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arc.twopie.2.js b/platforms/ios/www/test/tests-todo/2d.path.arc.twopie.2.js new file mode 100644 index 0000000..284c167 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arc.twopie.2.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 100; +ctx.beginPath(); +ctx.arc(50, 25, 50, 0, 2*Math.PI - 1e-4, false); +ctx.stroke(); +_assertPixel(canvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arc.twopie.3.js b/platforms/ios/www/test/tests-todo/2d.path.arc.twopie.3.js new file mode 100644 index 0000000..17f86d6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arc.twopie.3.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 100; +ctx.beginPath(); +ctx.arc(50, 25, 50, 0, 2*Math.PI + 1e-4, true); +ctx.stroke(); +_assertPixel(canvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arc.twopie.4.js b/platforms/ios/www/test/tests-todo/2d.path.arc.twopie.4.js new file mode 100644 index 0000000..935f0b2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arc.twopie.4.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 100; +ctx.beginPath(); +ctx.arc(50, 25, 50, 0, 2*Math.PI + 1e-4, false); +ctx.stroke(); +_assertPixel(canvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arc.zero.1.js b/platforms/ios/www/test/tests-todo/2d.path.arc.zero.1.js new file mode 100644 index 0000000..ca1f43c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arc.zero.1.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 100; +ctx.beginPath(); +ctx.arc(50, 25, 50, 0, 0, true); +ctx.stroke(); +_assertPixel(canvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arc.zero.2.js b/platforms/ios/www/test/tests-todo/2d.path.arc.zero.2.js new file mode 100644 index 0000000..773ed0d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arc.zero.2.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 100; +ctx.beginPath(); +ctx.arc(50, 25, 50, 0, 0, false); +ctx.stroke(); +_assertPixel(canvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arc.zeroradius.js b/platforms/ios/www/test/tests-todo/2d.path.arc.zeroradius.js new file mode 100644 index 0000000..5466d13 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arc.zeroradius.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00' +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 50; +ctx.strokeStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(0, 25); +ctx.arc(200, 25, 0, 0, Math.PI, true); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arcTo.coincide.1.js b/platforms/ios/www/test/tests-todo/2d.path.arcTo.coincide.1.js new file mode 100644 index 0000000..3d53b5b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arcTo.coincide.1.js @@ -0,0 +1,25 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 50; + +ctx.strokeStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(0, 25); +ctx.arcTo(0, 25, 50, 1000, 1); +ctx.lineTo(100, 25); +ctx.stroke(); + +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(50, 25); +ctx.arcTo(50, 25, 100, 25, 1); +ctx.stroke(); + +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arcTo.coincide.2.js b/platforms/ios/www/test/tests-todo/2d.path.arcTo.coincide.2.js new file mode 100644 index 0000000..738bf08 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arcTo.coincide.2.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 50; +ctx.strokeStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(0, 25); +ctx.arcTo(100, 25, 100, 25, 1); +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arcTo.collinear.1.js b/platforms/ios/www/test/tests-todo/2d.path.arcTo.collinear.1.js new file mode 100644 index 0000000..dc0e740 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arcTo.collinear.1.js @@ -0,0 +1,22 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 50; + +ctx.strokeStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(0, 25); +ctx.arcTo(100, 25, 200, 25, 1); +ctx.stroke(); + +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(-100, 25); +ctx.arcTo(0, 25, 100, 25, 1); +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arcTo.collinear.2.js b/platforms/ios/www/test/tests-todo/2d.path.arcTo.collinear.2.js new file mode 100644 index 0000000..13579f4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arcTo.collinear.2.js @@ -0,0 +1,22 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 50; + +ctx.strokeStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(0, 25); +ctx.arcTo(100, 25, 10, 25, 1); +ctx.stroke(); + +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(100, 25); +ctx.arcTo(200, 25, 110, 25, 1); +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arcTo.collinear.3.js b/platforms/ios/www/test/tests-todo/2d.path.arcTo.collinear.3.js new file mode 100644 index 0000000..8f38117 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arcTo.collinear.3.js @@ -0,0 +1,27 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 50; + +ctx.strokeStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(0, 25); +ctx.arcTo(100, 25, -100, 25, 1); +ctx.stroke(); + +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(100, 25); +ctx.arcTo(200, 25, 0, 25, 1); +ctx.stroke(); + +ctx.beginPath(); +ctx.moveTo(-100, 25); +ctx.arcTo(0, 25, -200, 25, 1); +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arcTo.ensuresubpath.1.js b/platforms/ios/www/test/tests-todo/2d.path.arcTo.ensuresubpath.1.js new file mode 100644 index 0000000..2261e6d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arcTo.ensuresubpath.1.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 50; +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.arcTo(100, 50, 200, 50, 0.1); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arcTo.ensuresubpath.2.js b/platforms/ios/www/test/tests-todo/2d.path.arcTo.ensuresubpath.2.js new file mode 100644 index 0000000..14d2e2a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arcTo.ensuresubpath.2.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 50; +ctx.strokeStyle = '#0f0'; +ctx.beginPath(); +ctx.arcTo(0, 25, 50, 250, 0.1); // adds (x1,y1), draws nothing +ctx.lineTo(100, 25); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arcTo.negative.js b/platforms/ios/www/test/tests-todo/2d.path.arcTo.negative.js new file mode 100644 index 0000000..c57d2e3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arcTo.negative.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.arcTo(0, 0, 0, 0, -1); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.arcTo(0, 0, 0, 0, -1)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arcTo.nonfinite.js b/platforms/ios/www/test/tests-todo/2d.path.arcTo.nonfinite.js new file mode 100644 index 0000000..e580981 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arcTo.nonfinite.js @@ -0,0 +1,54 @@ +_addTest(function(canvas, ctx) { + +ctx.moveTo(0, 0); +ctx.lineTo(100, 0); +ctx.arcTo(Infinity, 50, 0, 50, 0); +ctx.arcTo(-Infinity, 50, 0, 50, 0); +ctx.arcTo(NaN, 50, 0, 50, 0); +ctx.arcTo(0, Infinity, 0, 50, 0); +ctx.arcTo(0, -Infinity, 0, 50, 0); +ctx.arcTo(0, NaN, 0, 50, 0); +ctx.arcTo(0, 50, Infinity, 50, 0); +ctx.arcTo(0, 50, -Infinity, 50, 0); +ctx.arcTo(0, 50, NaN, 50, 0); +ctx.arcTo(0, 50, 0, Infinity, 0); +ctx.arcTo(0, 50, 0, -Infinity, 0); +ctx.arcTo(0, 50, 0, NaN, 0); +ctx.arcTo(0, 50, 0, 50, Infinity); +ctx.arcTo(0, 50, 0, 50, -Infinity); +ctx.arcTo(0, 50, 0, 50, NaN); +ctx.arcTo(Infinity, Infinity, 0, 50, 0); +ctx.arcTo(Infinity, Infinity, Infinity, 50, 0); +ctx.arcTo(Infinity, Infinity, Infinity, Infinity, 0); +ctx.arcTo(Infinity, Infinity, Infinity, Infinity, Infinity); +ctx.arcTo(Infinity, Infinity, Infinity, 50, Infinity); +ctx.arcTo(Infinity, Infinity, 0, Infinity, 0); +ctx.arcTo(Infinity, Infinity, 0, Infinity, Infinity); +ctx.arcTo(Infinity, Infinity, 0, 50, Infinity); +ctx.arcTo(Infinity, 50, Infinity, 50, 0); +ctx.arcTo(Infinity, 50, Infinity, Infinity, 0); +ctx.arcTo(Infinity, 50, Infinity, Infinity, Infinity); +ctx.arcTo(Infinity, 50, Infinity, 50, Infinity); +ctx.arcTo(Infinity, 50, 0, Infinity, 0); +ctx.arcTo(Infinity, 50, 0, Infinity, Infinity); +ctx.arcTo(Infinity, 50, 0, 50, Infinity); +ctx.arcTo(0, Infinity, Infinity, 50, 0); +ctx.arcTo(0, Infinity, Infinity, Infinity, 0); +ctx.arcTo(0, Infinity, Infinity, Infinity, Infinity); +ctx.arcTo(0, Infinity, Infinity, 50, Infinity); +ctx.arcTo(0, Infinity, 0, Infinity, 0); +ctx.arcTo(0, Infinity, 0, Infinity, Infinity); +ctx.arcTo(0, Infinity, 0, 50, Infinity); +ctx.arcTo(0, 50, Infinity, Infinity, 0); +ctx.arcTo(0, 50, Infinity, Infinity, Infinity); +ctx.arcTo(0, 50, Infinity, 50, Infinity); +ctx.arcTo(0, 50, 0, Infinity, Infinity); +ctx.lineTo(100, 50); +ctx.lineTo(0, 50); +ctx.fillStyle = '#0f0'; +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 90,45, 0,255,0,255, "90,45", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arcTo.scale.js b/platforms/ios/www/test/tests-todo/2d.path.arcTo.scale.js new file mode 100644 index 0000000..48bdf0a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arcTo.scale.js @@ -0,0 +1,26 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(0, 50); +ctx.translate(100, 0); +ctx.scale(0.1, 1); +ctx.arcTo(50, 50, 50, 0, 50); +ctx.lineTo(-1000, 0); +ctx.fill(); + +_assertPixel(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255"); +_assertPixel(canvas, 50,0, 0,255,0,255, "50,0", "0,255,0,255"); +_assertPixel(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255"); +_assertPixel(canvas, 0,25, 0,255,0,255, "0,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 99,25, 0,255,0,255, "99,25", "0,255,0,255"); +_assertPixel(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255"); +_assertPixel(canvas, 50,49, 0,255,0,255, "50,49", "0,255,0,255"); +_assertPixel(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arcTo.shape.curve1.js b/platforms/ios/www/test/tests-todo/2d.path.arcTo.shape.curve1.js new file mode 100644 index 0000000..31a724a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arcTo.shape.curve1.js @@ -0,0 +1,39 @@ +_addTest(function(canvas, ctx) { + +var tol = 1.5; // tolerance to avoid antialiasing artifacts + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 10; +ctx.beginPath(); +ctx.moveTo(10, 25); +ctx.arcTo(75, 25, 75, 60, 20); +ctx.stroke(); + +ctx.fillStyle = '#0f0'; +ctx.beginPath(); +ctx.rect(10, 20, 45, 10); +ctx.moveTo(80, 45); +ctx.arc(55, 45, 25+tol, 0, -Math.PI/2, true); +ctx.arc(55, 45, 15-tol, -Math.PI/2, 0, false); +ctx.fill(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 55,19, 0,255,0,255, "55,19", "0,255,0,255"); +_assertPixel(canvas, 55,20, 0,255,0,255, "55,20", "0,255,0,255"); +_assertPixel(canvas, 55,21, 0,255,0,255, "55,21", "0,255,0,255"); +_assertPixel(canvas, 64,22, 0,255,0,255, "64,22", "0,255,0,255"); +_assertPixel(canvas, 65,21, 0,255,0,255, "65,21", "0,255,0,255"); +_assertPixel(canvas, 72,28, 0,255,0,255, "72,28", "0,255,0,255"); +_assertPixel(canvas, 73,27, 0,255,0,255, "73,27", "0,255,0,255"); +_assertPixel(canvas, 78,36, 0,255,0,255, "78,36", "0,255,0,255"); +_assertPixel(canvas, 79,35, 0,255,0,255, "79,35", "0,255,0,255"); +_assertPixel(canvas, 80,44, 0,255,0,255, "80,44", "0,255,0,255"); +_assertPixel(canvas, 80,45, 0,255,0,255, "80,45", "0,255,0,255"); +_assertPixel(canvas, 80,46, 0,255,0,255, "80,46", "0,255,0,255"); +_assertPixel(canvas, 65,45, 0,255,0,255, "65,45", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arcTo.shape.curve2.js b/platforms/ios/www/test/tests-todo/2d.path.arcTo.shape.curve2.js new file mode 100644 index 0000000..6e2e767 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arcTo.shape.curve2.js @@ -0,0 +1,38 @@ +_addTest(function(canvas, ctx) { + +var tol = 1.5; // tolerance to avoid antialiasing artifacts + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#f00'; +ctx.beginPath(); +ctx.rect(10, 20, 45, 10); +ctx.moveTo(80, 45); +ctx.arc(55, 45, 25-tol, 0, -Math.PI/2, true); +ctx.arc(55, 45, 15+tol, -Math.PI/2, 0, false); +ctx.fill(); + +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 10; +ctx.beginPath(); +ctx.moveTo(10, 25); +ctx.arcTo(75, 25, 75, 60, 20); +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 55,19, 0,255,0,255, "55,19", "0,255,0,255"); +_assertPixel(canvas, 55,20, 0,255,0,255, "55,20", "0,255,0,255"); +_assertPixel(canvas, 55,21, 0,255,0,255, "55,21", "0,255,0,255"); +_assertPixel(canvas, 64,22, 0,255,0,255, "64,22", "0,255,0,255"); +_assertPixel(canvas, 65,21, 0,255,0,255, "65,21", "0,255,0,255"); +_assertPixel(canvas, 72,28, 0,255,0,255, "72,28", "0,255,0,255"); +_assertPixel(canvas, 73,27, 0,255,0,255, "73,27", "0,255,0,255"); +_assertPixel(canvas, 78,36, 0,255,0,255, "78,36", "0,255,0,255"); +_assertPixel(canvas, 79,35, 0,255,0,255, "79,35", "0,255,0,255"); +_assertPixel(canvas, 80,44, 0,255,0,255, "80,44", "0,255,0,255"); +_assertPixel(canvas, 80,45, 0,255,0,255, "80,45", "0,255,0,255"); +_assertPixel(canvas, 80,46, 0,255,0,255, "80,46", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arcTo.shape.end.js b/platforms/ios/www/test/tests-todo/2d.path.arcTo.shape.end.js new file mode 100644 index 0000000..434fe1c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arcTo.shape.end.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 50; +ctx.beginPath(); +ctx.moveTo(-100, -100); +ctx.arcTo(-100, 25, 200, 25, 10); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arcTo.shape.start.js b/platforms/ios/www/test/tests-todo/2d.path.arcTo.shape.start.js new file mode 100644 index 0000000..d75b912 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arcTo.shape.start.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 50; +ctx.beginPath(); +ctx.moveTo(0, 25); +ctx.arcTo(200, 25, 200, 50, 10); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arcTo.transformation.js b/platforms/ios/www/test/tests-todo/2d.path.arcTo.transformation.js new file mode 100644 index 0000000..a4393b9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arcTo.transformation.js @@ -0,0 +1,25 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(0, 50); +ctx.translate(100, 0); +ctx.arcTo(50, 50, 50, 0, 50); +ctx.lineTo(-100, 0); +ctx.fill(); + +_assertPixel(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255"); +_assertPixel(canvas, 50,0, 0,255,0,255, "50,0", "0,255,0,255"); +_assertPixel(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255"); +_assertPixel(canvas, 0,25, 0,255,0,255, "0,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 99,25, 0,255,0,255, "99,25", "0,255,0,255"); +_assertPixel(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255"); +_assertPixel(canvas, 50,49, 0,255,0,255, "50,49", "0,255,0,255"); +_assertPixel(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arcTo.zero.1.js b/platforms/ios/www/test/tests-todo/2d.path.arcTo.zero.1.js new file mode 100644 index 0000000..6f9de58 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arcTo.zero.1.js @@ -0,0 +1,22 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 50; + +ctx.strokeStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(0, 25); +ctx.arcTo(100, 25, 100, 100, 0); +ctx.stroke(); + +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(0, -25); +ctx.arcTo(50, -25, 50, 50, 0); +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.arcTo.zero.2.js b/platforms/ios/www/test/tests-todo/2d.path.arcTo.zero.2.js new file mode 100644 index 0000000..5131547 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.arcTo.zero.2.js @@ -0,0 +1,22 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 50; + +ctx.strokeStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(0, 25); +ctx.arcTo(100, 25, -100, 25, 0); +ctx.stroke(); + +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(100, 25); +ctx.arcTo(200, 25, 50, 25, 0); +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.beginPath.js b/platforms/ios/www/test/tests-todo/2d.path.beginPath.js new file mode 100644 index 0000000..863d90e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.beginPath.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.rect(0, 0, 100, 50); +ctx.beginPath(); +ctx.fillStyle = '#f00'; +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.bezierCurveTo.basic.js b/platforms/ios/www/test/tests-todo/2d.path.bezierCurveTo.basic.js new file mode 100644 index 0000000..ed39006 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.bezierCurveTo.basic.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 50; +ctx.beginPath(); +ctx.moveTo(0, 25); +ctx.bezierCurveTo(100, 25, 100, 25, 100, 25); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.bezierCurveTo.ensuresubpath.1.js b/platforms/ios/www/test/tests-todo/2d.path.bezierCurveTo.ensuresubpath.1.js new file mode 100644 index 0000000..2e043d2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.bezierCurveTo.ensuresubpath.1.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 50; +ctx.beginPath(); +ctx.bezierCurveTo(100, 50, 200, 50, 200, 50); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 95,45, 0,255,0,255, "95,45", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.bezierCurveTo.ensuresubpath.2.js b/platforms/ios/www/test/tests-todo/2d.path.bezierCurveTo.ensuresubpath.2.js new file mode 100644 index 0000000..7526400 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.bezierCurveTo.ensuresubpath.2.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 50; +ctx.beginPath(); +ctx.bezierCurveTo(0, 25, 100, 25, 100, 25); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 5,45, 0,255,0,255, "5,45", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.bezierCurveTo.nonfinite.js b/platforms/ios/www/test/tests-todo/2d.path.bezierCurveTo.nonfinite.js new file mode 100644 index 0000000..95e947d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.bezierCurveTo.nonfinite.js @@ -0,0 +1,88 @@ +_addTest(function(canvas, ctx) { + +ctx.moveTo(0, 0); +ctx.lineTo(100, 0); +ctx.bezierCurveTo(Infinity, 50, 0, 50, 0, 50); +ctx.bezierCurveTo(-Infinity, 50, 0, 50, 0, 50); +ctx.bezierCurveTo(NaN, 50, 0, 50, 0, 50); +ctx.bezierCurveTo(0, Infinity, 0, 50, 0, 50); +ctx.bezierCurveTo(0, -Infinity, 0, 50, 0, 50); +ctx.bezierCurveTo(0, NaN, 0, 50, 0, 50); +ctx.bezierCurveTo(0, 50, Infinity, 50, 0, 50); +ctx.bezierCurveTo(0, 50, -Infinity, 50, 0, 50); +ctx.bezierCurveTo(0, 50, NaN, 50, 0, 50); +ctx.bezierCurveTo(0, 50, 0, Infinity, 0, 50); +ctx.bezierCurveTo(0, 50, 0, -Infinity, 0, 50); +ctx.bezierCurveTo(0, 50, 0, NaN, 0, 50); +ctx.bezierCurveTo(0, 50, 0, 50, Infinity, 50); +ctx.bezierCurveTo(0, 50, 0, 50, -Infinity, 50); +ctx.bezierCurveTo(0, 50, 0, 50, NaN, 50); +ctx.bezierCurveTo(0, 50, 0, 50, 0, Infinity); +ctx.bezierCurveTo(0, 50, 0, 50, 0, -Infinity); +ctx.bezierCurveTo(0, 50, 0, 50, 0, NaN); +ctx.bezierCurveTo(Infinity, Infinity, 0, 50, 0, 50); +ctx.bezierCurveTo(Infinity, Infinity, Infinity, 50, 0, 50); +ctx.bezierCurveTo(Infinity, Infinity, Infinity, Infinity, 0, 50); +ctx.bezierCurveTo(Infinity, Infinity, Infinity, Infinity, Infinity, 50); +ctx.bezierCurveTo(Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); +ctx.bezierCurveTo(Infinity, Infinity, Infinity, Infinity, 0, Infinity); +ctx.bezierCurveTo(Infinity, Infinity, Infinity, 50, Infinity, 50); +ctx.bezierCurveTo(Infinity, Infinity, Infinity, 50, Infinity, Infinity); +ctx.bezierCurveTo(Infinity, Infinity, Infinity, 50, 0, Infinity); +ctx.bezierCurveTo(Infinity, Infinity, 0, Infinity, 0, 50); +ctx.bezierCurveTo(Infinity, Infinity, 0, Infinity, Infinity, 50); +ctx.bezierCurveTo(Infinity, Infinity, 0, Infinity, Infinity, Infinity); +ctx.bezierCurveTo(Infinity, Infinity, 0, Infinity, 0, Infinity); +ctx.bezierCurveTo(Infinity, Infinity, 0, 50, Infinity, 50); +ctx.bezierCurveTo(Infinity, Infinity, 0, 50, Infinity, Infinity); +ctx.bezierCurveTo(Infinity, Infinity, 0, 50, 0, Infinity); +ctx.bezierCurveTo(Infinity, 50, Infinity, 50, 0, 50); +ctx.bezierCurveTo(Infinity, 50, Infinity, Infinity, 0, 50); +ctx.bezierCurveTo(Infinity, 50, Infinity, Infinity, Infinity, 50); +ctx.bezierCurveTo(Infinity, 50, Infinity, Infinity, Infinity, Infinity); +ctx.bezierCurveTo(Infinity, 50, Infinity, Infinity, 0, Infinity); +ctx.bezierCurveTo(Infinity, 50, Infinity, 50, Infinity, 50); +ctx.bezierCurveTo(Infinity, 50, Infinity, 50, Infinity, Infinity); +ctx.bezierCurveTo(Infinity, 50, Infinity, 50, 0, Infinity); +ctx.bezierCurveTo(Infinity, 50, 0, Infinity, 0, 50); +ctx.bezierCurveTo(Infinity, 50, 0, Infinity, Infinity, 50); +ctx.bezierCurveTo(Infinity, 50, 0, Infinity, Infinity, Infinity); +ctx.bezierCurveTo(Infinity, 50, 0, Infinity, 0, Infinity); +ctx.bezierCurveTo(Infinity, 50, 0, 50, Infinity, 50); +ctx.bezierCurveTo(Infinity, 50, 0, 50, Infinity, Infinity); +ctx.bezierCurveTo(Infinity, 50, 0, 50, 0, Infinity); +ctx.bezierCurveTo(0, Infinity, Infinity, 50, 0, 50); +ctx.bezierCurveTo(0, Infinity, Infinity, Infinity, 0, 50); +ctx.bezierCurveTo(0, Infinity, Infinity, Infinity, Infinity, 50); +ctx.bezierCurveTo(0, Infinity, Infinity, Infinity, Infinity, Infinity); +ctx.bezierCurveTo(0, Infinity, Infinity, Infinity, 0, Infinity); +ctx.bezierCurveTo(0, Infinity, Infinity, 50, Infinity, 50); +ctx.bezierCurveTo(0, Infinity, Infinity, 50, Infinity, Infinity); +ctx.bezierCurveTo(0, Infinity, Infinity, 50, 0, Infinity); +ctx.bezierCurveTo(0, Infinity, 0, Infinity, 0, 50); +ctx.bezierCurveTo(0, Infinity, 0, Infinity, Infinity, 50); +ctx.bezierCurveTo(0, Infinity, 0, Infinity, Infinity, Infinity); +ctx.bezierCurveTo(0, Infinity, 0, Infinity, 0, Infinity); +ctx.bezierCurveTo(0, Infinity, 0, 50, Infinity, 50); +ctx.bezierCurveTo(0, Infinity, 0, 50, Infinity, Infinity); +ctx.bezierCurveTo(0, Infinity, 0, 50, 0, Infinity); +ctx.bezierCurveTo(0, 50, Infinity, Infinity, 0, 50); +ctx.bezierCurveTo(0, 50, Infinity, Infinity, Infinity, 50); +ctx.bezierCurveTo(0, 50, Infinity, Infinity, Infinity, Infinity); +ctx.bezierCurveTo(0, 50, Infinity, Infinity, 0, Infinity); +ctx.bezierCurveTo(0, 50, Infinity, 50, Infinity, 50); +ctx.bezierCurveTo(0, 50, Infinity, 50, Infinity, Infinity); +ctx.bezierCurveTo(0, 50, Infinity, 50, 0, Infinity); +ctx.bezierCurveTo(0, 50, 0, Infinity, Infinity, 50); +ctx.bezierCurveTo(0, 50, 0, Infinity, Infinity, Infinity); +ctx.bezierCurveTo(0, 50, 0, Infinity, 0, Infinity); +ctx.bezierCurveTo(0, 50, 0, 50, Infinity, Infinity); +ctx.lineTo(100, 50); +ctx.lineTo(0, 50); +ctx.fillStyle = '#0f0'; +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 90,45, 0,255,0,255, "90,45", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.bezierCurveTo.scaled.js b/platforms/ios/www/test/tests-todo/2d.path.bezierCurveTo.scaled.js new file mode 100644 index 0000000..699d256 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.bezierCurveTo.scaled.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.scale(1000, 1000); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 0.055; +ctx.beginPath(); +ctx.moveTo(-2, 3.1); +ctx.bezierCurveTo(-2, -1, 2.1, -1, 2.1, 3.1); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.bezierCurveTo.shape.js b/platforms/ios/www/test/tests-todo/2d.path.bezierCurveTo.shape.js new file mode 100644 index 0000000..fa96b5d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.bezierCurveTo.shape.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 55; +ctx.beginPath(); +ctx.moveTo(-2000, 3100); +ctx.bezierCurveTo(-2000, -1000, 2100, -1000, 2100, 3100); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.clip.basic.1.js b/platforms/ios/www/test/tests-todo/2d.path.clip.basic.1.js new file mode 100644 index 0000000..45f643f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.clip.basic.1.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.beginPath(); +ctx.rect(0, 0, 100, 50); +ctx.clip(); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.clip.basic.2.js b/platforms/ios/www/test/tests-todo/2d.path.clip.basic.2.js new file mode 100644 index 0000000..3ce3267 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.clip.basic.2.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.beginPath(); +ctx.rect(-100, 0, 100, 50); +ctx.clip(); + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.clip.empty.js b/platforms/ios/www/test/tests-todo/2d.path.clip.empty.js new file mode 100644 index 0000000..9346e97 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.clip.empty.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.beginPath(); +ctx.clip(); + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.clip.intersect.js b/platforms/ios/www/test/tests-todo/2d.path.clip.intersect.js new file mode 100644 index 0000000..bf0fcd8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.clip.intersect.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.beginPath(); +ctx.rect(0, 0, 50, 50); +ctx.clip(); +ctx.beginPath(); +ctx.rect(50, 0, 50, 50) +ctx.clip(); + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.clip.unaffected.js b/platforms/ios/www/test/tests-todo/2d.path.clip.unaffected.js new file mode 100644 index 0000000..e13c60e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.clip.unaffected.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; + +ctx.beginPath(); +ctx.moveTo(0, 0); +ctx.lineTo(0, 50); +ctx.lineTo(100, 50); +ctx.lineTo(100, 0); +ctx.clip(); + +ctx.lineTo(0, 0); +ctx.fill(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.clip.winding.1.js b/platforms/ios/www/test/tests-todo/2d.path.clip.winding.1.js new file mode 100644 index 0000000..e1f8cbc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.clip.winding.1.js @@ -0,0 +1,24 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.beginPath(); +ctx.moveTo(-10, -10); +ctx.lineTo(110, -10); +ctx.lineTo(110, 60); +ctx.lineTo(-10, 60); +ctx.lineTo(-10, -10); +ctx.lineTo(0, 0); +ctx.lineTo(0, 50); +ctx.lineTo(100, 50); +ctx.lineTo(100, 0); +ctx.clip(); + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.clip.winding.2.js b/platforms/ios/www/test/tests-todo/2d.path.clip.winding.2.js new file mode 100644 index 0000000..57f3b99 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.clip.winding.2.js @@ -0,0 +1,28 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.beginPath(); +ctx.moveTo(-10, -10); +ctx.lineTo(110, -10); +ctx.lineTo(110, 60); +ctx.lineTo(-10, 60); +ctx.lineTo(-10, -10); +ctx.clip(); + +ctx.beginPath(); +ctx.moveTo(0, 0); +ctx.lineTo(0, 50); +ctx.lineTo(100, 50); +ctx.lineTo(100, 0); +ctx.lineTo(0, 0); +ctx.clip(); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.closePath.empty.js b/platforms/ios/www/test/tests-todo/2d.path.closePath.empty.js new file mode 100644 index 0000000..9a679db --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.closePath.empty.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.closePath(); +ctx.fillStyle = '#f00'; +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.closePath.newline.js b/platforms/ios/www/test/tests-todo/2d.path.closePath.newline.js new file mode 100644 index 0000000..8cc2aa5 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.closePath.newline.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 50; +ctx.moveTo(-100, 25); +ctx.lineTo(-100, -100); +ctx.lineTo(200, -100); +ctx.lineTo(200, 25); +ctx.closePath(); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.closePath.nextpoint.js b/platforms/ios/www/test/tests-todo/2d.path.closePath.nextpoint.js new file mode 100644 index 0000000..7d56902 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.closePath.nextpoint.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 50; +ctx.moveTo(-100, 25); +ctx.lineTo(-100, -1000); +ctx.closePath(); +ctx.lineTo(1000, 25); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.fill.closed.basic.js b/platforms/ios/www/test/tests-todo/2d.path.fill.closed.basic.js new file mode 100644 index 0000000..29c08ba --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.fill.closed.basic.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.moveTo(0, 0); +ctx.lineTo(100, 0); +ctx.lineTo(100, 50); +ctx.lineTo(0, 50); +ctx.fill(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.fill.closed.unaffected.js b/platforms/ios/www/test/tests-todo/2d.path.fill.closed.unaffected.js new file mode 100644 index 0000000..6dccb77 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.fill.closed.unaffected.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#00f'; +ctx.fillRect(0, 0, 100, 50); + +ctx.moveTo(0, 0); +ctx.lineTo(100, 0); +ctx.lineTo(100, 50); +ctx.fillStyle = '#f00'; +ctx.fill(); +ctx.lineTo(0, 50); +ctx.fillStyle = '#0f0'; +ctx.fill(); + +_assertPixel(canvas, 90,10, 0,255,0,255, "90,10", "0,255,0,255"); +_assertPixel(canvas, 10,40, 0,255,0,255, "10,40", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.fill.overlap.js b/platforms/ios/www/test/tests-todo/2d.path.fill.overlap.js new file mode 100644 index 0000000..8f0715c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.fill.overlap.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#000'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.rect(0, 0, 100, 50); +ctx.closePath(); +ctx.rect(10, 10, 80, 30); +ctx.fill(); + +_assertPixelApprox(canvas, 50,25, 0,127,0,255, "50,25", "0,127,0,255", 1); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.fill.winding.add.js b/platforms/ios/www/test/tests-todo/2d.path.fill.winding.add.js new file mode 100644 index 0000000..fb5ae74 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.fill.winding.add.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.moveTo(-10, -10); +ctx.lineTo(110, -10); +ctx.lineTo(110, 60); +ctx.lineTo(-10, 60); +ctx.lineTo(-10, -10); +ctx.lineTo(0, 0); +ctx.lineTo(100, 0); +ctx.lineTo(100, 50); +ctx.lineTo(0, 50); +ctx.fill(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.fill.winding.subtract.1.js b/platforms/ios/www/test/tests-todo/2d.path.fill.winding.subtract.1.js new file mode 100644 index 0000000..c2bec22 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.fill.winding.subtract.1.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#f00'; +ctx.moveTo(-10, -10); +ctx.lineTo(110, -10); +ctx.lineTo(110, 60); +ctx.lineTo(-10, 60); +ctx.lineTo(-10, -10); +ctx.lineTo(0, 0); +ctx.lineTo(0, 50); +ctx.lineTo(100, 50); +ctx.lineTo(100, 0); +ctx.fill(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.fill.winding.subtract.2.js b/platforms/ios/www/test/tests-todo/2d.path.fill.winding.subtract.2.js new file mode 100644 index 0000000..b7e4bbd --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.fill.winding.subtract.2.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#f00'; +ctx.moveTo(-10, -10); +ctx.lineTo(110, -10); +ctx.lineTo(110, 60); +ctx.lineTo(-10, 60); +ctx.moveTo(0, 0); +ctx.lineTo(0, 50); +ctx.lineTo(100, 50); +ctx.lineTo(100, 0); +ctx.fill(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.fill.winding.subtract.3.js b/platforms/ios/www/test/tests-todo/2d.path.fill.winding.subtract.3.js new file mode 100644 index 0000000..5b9ccda --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.fill.winding.subtract.3.js @@ -0,0 +1,26 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.moveTo(-10, -10); +ctx.lineTo(110, -10); +ctx.lineTo(110, 60); +ctx.lineTo(-10, 60); +ctx.lineTo(-10, -10); +ctx.lineTo(-20, -20); +ctx.lineTo(120, -20); +ctx.lineTo(120, 70); +ctx.lineTo(-20, 70); +ctx.lineTo(-20, -20); +ctx.lineTo(0, 0); +ctx.lineTo(0, 50); +ctx.lineTo(100, 50); +ctx.lineTo(100, 0); +ctx.fill(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.initial.js b/platforms/ios/www/test/tests-todo/2d.path.initial.js new file mode 100644 index 0000000..9a679db --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.initial.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.closePath(); +ctx.fillStyle = '#f00'; +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.arc.js b/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.arc.js new file mode 100644 index 0000000..68f1a92 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.arc.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.arc(50, 25, 10, 0, Math.PI, false); +_assertSame(ctx.isPointInPath(50, 10), false, "ctx.isPointInPath(50, 10)", "false"); +_assertSame(ctx.isPointInPath(50, 20), false, "ctx.isPointInPath(50, 20)", "false"); +_assertSame(ctx.isPointInPath(50, 30), true, "ctx.isPointInPath(50, 30)", "true"); +_assertSame(ctx.isPointInPath(50, 40), false, "ctx.isPointInPath(50, 40)", "false"); +_assertSame(ctx.isPointInPath(30, 20), false, "ctx.isPointInPath(30, 20)", "false"); +_assertSame(ctx.isPointInPath(70, 20), false, "ctx.isPointInPath(70, 20)", "false"); +_assertSame(ctx.isPointInPath(30, 30), false, "ctx.isPointInPath(30, 30)", "false"); +_assertSame(ctx.isPointInPath(70, 30), false, "ctx.isPointInPath(70, 30)", "false"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.basic.1.js b/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.basic.1.js new file mode 100644 index 0000000..2924135 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.basic.1.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +ctx.rect(0, 0, 20, 20); +_assertSame(ctx.isPointInPath(10, 10), true, "ctx.isPointInPath(10, 10)", "true"); +_assertSame(ctx.isPointInPath(30, 10), false, "ctx.isPointInPath(30, 10)", "false"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.basic.2.js b/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.basic.2.js new file mode 100644 index 0000000..98f540e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.basic.2.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +ctx.rect(20, 0, 20, 20); +_assertSame(ctx.isPointInPath(10, 10), false, "ctx.isPointInPath(10, 10)", "false"); +_assertSame(ctx.isPointInPath(30, 10), true, "ctx.isPointInPath(30, 10)", "true"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.bezier.js b/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.bezier.js new file mode 100644 index 0000000..c71fd65 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.bezier.js @@ -0,0 +1,27 @@ +_addTest(function(canvas, ctx) { + +ctx.moveTo(25, 25); +ctx.bezierCurveTo(50, -50, 50, 100, 75, 25); +_assertEqual(ctx.isPointInPath(25, 20), false, "ctx.isPointInPath(25, 20)", "false"); +_assertEqual(ctx.isPointInPath(25, 30), false, "ctx.isPointInPath(25, 30)", "false"); +_assertEqual(ctx.isPointInPath(30, 20), true, "ctx.isPointInPath(30, 20)", "true"); +_assertEqual(ctx.isPointInPath(30, 30), false, "ctx.isPointInPath(30, 30)", "false"); +_assertEqual(ctx.isPointInPath(40, 2), false, "ctx.isPointInPath(40, 2)", "false"); +_assertEqual(ctx.isPointInPath(40, 20), true, "ctx.isPointInPath(40, 20)", "true"); +_assertEqual(ctx.isPointInPath(40, 30), false, "ctx.isPointInPath(40, 30)", "false"); +_assertEqual(ctx.isPointInPath(40, 47), false, "ctx.isPointInPath(40, 47)", "false"); +_assertEqual(ctx.isPointInPath(45, 20), true, "ctx.isPointInPath(45, 20)", "true"); +_assertEqual(ctx.isPointInPath(45, 30), false, "ctx.isPointInPath(45, 30)", "false"); +_assertEqual(ctx.isPointInPath(55, 20), false, "ctx.isPointInPath(55, 20)", "false"); +_assertEqual(ctx.isPointInPath(55, 30), true, "ctx.isPointInPath(55, 30)", "true"); +_assertEqual(ctx.isPointInPath(60, 2), false, "ctx.isPointInPath(60, 2)", "false"); +_assertEqual(ctx.isPointInPath(60, 20), false, "ctx.isPointInPath(60, 20)", "false"); +_assertEqual(ctx.isPointInPath(60, 30), true, "ctx.isPointInPath(60, 30)", "true"); +_assertEqual(ctx.isPointInPath(60, 47), false, "ctx.isPointInPath(60, 47)", "false"); +_assertEqual(ctx.isPointInPath(70, 20), false, "ctx.isPointInPath(70, 20)", "false"); +_assertEqual(ctx.isPointInPath(70, 30), true, "ctx.isPointInPath(70, 30)", "true"); +_assertEqual(ctx.isPointInPath(75, 20), false, "ctx.isPointInPath(75, 20)", "false"); +_assertEqual(ctx.isPointInPath(75, 30), false, "ctx.isPointInPath(75, 30)", "false"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.bigarc.js b/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.bigarc.js new file mode 100644 index 0000000..badb306 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.bigarc.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.arc(50, 25, 10, 0, 7, false); +_assertSame(ctx.isPointInPath(50, 10), false, "ctx.isPointInPath(50, 10)", "false"); +_assertSame(ctx.isPointInPath(50, 20), true, "ctx.isPointInPath(50, 20)", "true"); +_assertSame(ctx.isPointInPath(50, 30), true, "ctx.isPointInPath(50, 30)", "true"); +_assertSame(ctx.isPointInPath(50, 40), false, "ctx.isPointInPath(50, 40)", "false"); +_assertSame(ctx.isPointInPath(30, 20), false, "ctx.isPointInPath(30, 20)", "false"); +_assertSame(ctx.isPointInPath(70, 20), false, "ctx.isPointInPath(70, 20)", "false"); +_assertSame(ctx.isPointInPath(30, 30), false, "ctx.isPointInPath(30, 30)", "false"); +_assertSame(ctx.isPointInPath(70, 30), false, "ctx.isPointInPath(70, 30)", "false"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.edge.js b/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.edge.js new file mode 100644 index 0000000..3821726 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.edge.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.rect(0, 0, 20, 20); +_assertSame(ctx.isPointInPath(0, 0), true, "ctx.isPointInPath(0, 0)", "true"); +_assertSame(ctx.isPointInPath(10, 0), true, "ctx.isPointInPath(10, 0)", "true"); +_assertSame(ctx.isPointInPath(20, 0), true, "ctx.isPointInPath(20, 0)", "true"); +_assertSame(ctx.isPointInPath(20, 10), true, "ctx.isPointInPath(20, 10)", "true"); +_assertSame(ctx.isPointInPath(20, 20), true, "ctx.isPointInPath(20, 20)", "true"); +_assertSame(ctx.isPointInPath(10, 20), true, "ctx.isPointInPath(10, 20)", "true"); +_assertSame(ctx.isPointInPath(0, 20), true, "ctx.isPointInPath(0, 20)", "true"); +_assertSame(ctx.isPointInPath(0, 10), true, "ctx.isPointInPath(0, 10)", "true"); +_assertSame(ctx.isPointInPath(10, -0.01), false, "ctx.isPointInPath(10, -0.01)", "false"); +_assertSame(ctx.isPointInPath(10, 20.01), false, "ctx.isPointInPath(10, 20.01)", "false"); +_assertSame(ctx.isPointInPath(-0.01, 10), false, "ctx.isPointInPath(-0.01, 10)", "false"); +_assertSame(ctx.isPointInPath(20.01, 10), false, "ctx.isPointInPath(20.01, 10)", "false"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.empty.js b/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.empty.js new file mode 100644 index 0000000..b55df31 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.empty.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(ctx.isPointInPath(0, 0), false, "ctx.isPointInPath(0, 0)", "false"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.nonfinite.js b/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.nonfinite.js new file mode 100644 index 0000000..e3c1719 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.nonfinite.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.rect(-100, -50, 200, 100); +_assertSame(ctx.isPointInPath(Infinity, 0), false, "ctx.isPointInPath(Infinity, 0)", "false"); +_assertSame(ctx.isPointInPath(-Infinity, 0), false, "ctx.isPointInPath(-Infinity, 0)", "false"); +_assertSame(ctx.isPointInPath(NaN, 0), false, "ctx.isPointInPath(NaN, 0)", "false"); +_assertSame(ctx.isPointInPath(0, Infinity), false, "ctx.isPointInPath(0, Infinity)", "false"); +_assertSame(ctx.isPointInPath(0, -Infinity), false, "ctx.isPointInPath(0, -Infinity)", "false"); +_assertSame(ctx.isPointInPath(0, NaN), false, "ctx.isPointInPath(0, NaN)", "false"); +_assertSame(ctx.isPointInPath(NaN, NaN), false, "ctx.isPointInPath(NaN, NaN)", "false"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.outside.js b/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.outside.js new file mode 100644 index 0000000..1afad01 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.outside.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.rect(0, -100, 20, 20); +ctx.rect(20, -10, 20, 20); +_assertSame(ctx.isPointInPath(10, -110), false, "ctx.isPointInPath(10, -110)", "false"); +_assertSame(ctx.isPointInPath(10, -90), true, "ctx.isPointInPath(10, -90)", "true"); +_assertSame(ctx.isPointInPath(10, -70), false, "ctx.isPointInPath(10, -70)", "false"); +_assertSame(ctx.isPointInPath(30, -20), false, "ctx.isPointInPath(30, -20)", "false"); +_assertSame(ctx.isPointInPath(30, 0), true, "ctx.isPointInPath(30, 0)", "true"); +_assertSame(ctx.isPointInPath(30, 20), false, "ctx.isPointInPath(30, 20)", "false"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.subpath.js b/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.subpath.js new file mode 100644 index 0000000..8a75a30 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.subpath.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.rect(0, 0, 20, 20); +ctx.beginPath(); +ctx.rect(20, 0, 20, 20); +ctx.closePath(); +ctx.rect(40, 0, 20, 20); +_assertSame(ctx.isPointInPath(10, 10), false, "ctx.isPointInPath(10, 10)", "false"); +_assertSame(ctx.isPointInPath(30, 10), true, "ctx.isPointInPath(30, 10)", "true"); +_assertSame(ctx.isPointInPath(50, 10), true, "ctx.isPointInPath(50, 10)", "true"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.transform.1.js b/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.transform.1.js new file mode 100644 index 0000000..ad91a4a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.transform.1.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.translate(50, 0); +ctx.rect(0, 0, 20, 20); +_assertSame(ctx.isPointInPath(-40, 10), false, "ctx.isPointInPath(-40, 10)", "false"); +_assertSame(ctx.isPointInPath(10, 10), false, "ctx.isPointInPath(10, 10)", "false"); +_assertSame(ctx.isPointInPath(49, 10), false, "ctx.isPointInPath(49, 10)", "false"); +_assertSame(ctx.isPointInPath(51, 10), true, "ctx.isPointInPath(51, 10)", "true"); +_assertSame(ctx.isPointInPath(69, 10), true, "ctx.isPointInPath(69, 10)", "true"); +_assertSame(ctx.isPointInPath(71, 10), false, "ctx.isPointInPath(71, 10)", "false"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.transform.2.js b/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.transform.2.js new file mode 100644 index 0000000..b82c30b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.transform.2.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.rect(50, 0, 20, 20); +ctx.translate(50, 0); +_assertSame(ctx.isPointInPath(-40, 10), false, "ctx.isPointInPath(-40, 10)", "false"); +_assertSame(ctx.isPointInPath(10, 10), false, "ctx.isPointInPath(10, 10)", "false"); +_assertSame(ctx.isPointInPath(49, 10), false, "ctx.isPointInPath(49, 10)", "false"); +_assertSame(ctx.isPointInPath(51, 10), true, "ctx.isPointInPath(51, 10)", "true"); +_assertSame(ctx.isPointInPath(69, 10), true, "ctx.isPointInPath(69, 10)", "true"); +_assertSame(ctx.isPointInPath(71, 10), false, "ctx.isPointInPath(71, 10)", "false"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.transform.3.js b/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.transform.3.js new file mode 100644 index 0000000..9513d3a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.transform.3.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.scale(-1, 1); +ctx.rect(-70, 0, 20, 20); +_assertSame(ctx.isPointInPath(-40, 10), false, "ctx.isPointInPath(-40, 10)", "false"); +_assertSame(ctx.isPointInPath(10, 10), false, "ctx.isPointInPath(10, 10)", "false"); +_assertSame(ctx.isPointInPath(49, 10), false, "ctx.isPointInPath(49, 10)", "false"); +_assertSame(ctx.isPointInPath(51, 10), true, "ctx.isPointInPath(51, 10)", "true"); +_assertSame(ctx.isPointInPath(69, 10), true, "ctx.isPointInPath(69, 10)", "true"); +_assertSame(ctx.isPointInPath(71, 10), false, "ctx.isPointInPath(71, 10)", "false"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.unclosed.js b/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.unclosed.js new file mode 100644 index 0000000..38722b1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.unclosed.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.moveTo(0, 0); +ctx.lineTo(20, 0); +ctx.lineTo(20, 20); +ctx.lineTo(0, 20); +_assertSame(ctx.isPointInPath(10, 10), true, "ctx.isPointInPath(10, 10)", "true"); +_assertSame(ctx.isPointInPath(30, 10), false, "ctx.isPointInPath(30, 10)", "false"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.winding.js b/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.winding.js new file mode 100644 index 0000000..5ca7f65 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.isPointInPath.winding.js @@ -0,0 +1,26 @@ +_addTest(function(canvas, ctx) { + +// Create a square ring, using opposite windings to make a hole in the centre +ctx.moveTo(0, 0); +ctx.lineTo(50, 0); +ctx.lineTo(50, 50); +ctx.lineTo(0, 50); +ctx.lineTo(0, 0); +ctx.lineTo(10, 10); +ctx.lineTo(10, 40); +ctx.lineTo(40, 40); +ctx.lineTo(40, 10); +ctx.lineTo(10, 10); + +_assertSame(ctx.isPointInPath(5, 5), true, "ctx.isPointInPath(5, 5)", "true"); +_assertSame(ctx.isPointInPath(25, 5), true, "ctx.isPointInPath(25, 5)", "true"); +_assertSame(ctx.isPointInPath(45, 5), true, "ctx.isPointInPath(45, 5)", "true"); +_assertSame(ctx.isPointInPath(5, 25), true, "ctx.isPointInPath(5, 25)", "true"); +_assertSame(ctx.isPointInPath(25, 25), false, "ctx.isPointInPath(25, 25)", "false"); +_assertSame(ctx.isPointInPath(45, 25), true, "ctx.isPointInPath(45, 25)", "true"); +_assertSame(ctx.isPointInPath(5, 45), true, "ctx.isPointInPath(5, 45)", "true"); +_assertSame(ctx.isPointInPath(25, 45), true, "ctx.isPointInPath(25, 45)", "true"); +_assertSame(ctx.isPointInPath(45, 45), true, "ctx.isPointInPath(45, 45)", "true"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.lineTo.basic.js b/platforms/ios/www/test/tests-todo/2d.path.lineTo.basic.js new file mode 100644 index 0000000..1967cfc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.lineTo.basic.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 50; +ctx.beginPath(); +ctx.moveTo(0, 25); +ctx.lineTo(100, 25); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.lineTo.ensuresubpath.1.js b/platforms/ios/www/test/tests-todo/2d.path.lineTo.ensuresubpath.1.js new file mode 100644 index 0000000..bb1037d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.lineTo.ensuresubpath.1.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 50; +ctx.beginPath(); +ctx.lineTo(100, 50); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.lineTo.ensuresubpath.2.js b/platforms/ios/www/test/tests-todo/2d.path.lineTo.ensuresubpath.2.js new file mode 100644 index 0000000..b15887a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.lineTo.ensuresubpath.2.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 50; +ctx.beginPath(); +ctx.lineTo(0, 25); +ctx.lineTo(100, 25); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.lineTo.nextpoint.js b/platforms/ios/www/test/tests-todo/2d.path.lineTo.nextpoint.js new file mode 100644 index 0000000..084edb0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.lineTo.nextpoint.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 50; +ctx.beginPath(); +ctx.moveTo(-100, -100); +ctx.lineTo(0, 25); +ctx.lineTo(100, 25); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.lineTo.nonfinite.js b/platforms/ios/www/test/tests-todo/2d.path.lineTo.nonfinite.js new file mode 100644 index 0000000..b25e811 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.lineTo.nonfinite.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +ctx.moveTo(0, 0); +ctx.lineTo(100, 0); +ctx.lineTo(Infinity, 50); +ctx.lineTo(-Infinity, 50); +ctx.lineTo(NaN, 50); +ctx.lineTo(0, Infinity); +ctx.lineTo(0, -Infinity); +ctx.lineTo(0, NaN); +ctx.lineTo(Infinity, Infinity); +ctx.lineTo(100, 50); +ctx.lineTo(0, 50); +ctx.fillStyle = '#0f0'; +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 90,45, 0,255,0,255, "90,45", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.moveTo.basic.js b/platforms/ios/www/test/tests-todo/2d.path.moveTo.basic.js new file mode 100644 index 0000000..8b6766e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.moveTo.basic.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.rect(0, 0, 10, 50); +ctx.moveTo(100, 0); +ctx.lineTo(10, 0); +ctx.lineTo(10, 50); +ctx.lineTo(100, 50); +ctx.fillStyle = '#0f0'; +ctx.fill(); +_assertPixel(canvas, 90,25, 0,255,0,255, "90,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.moveTo.multiple.js b/platforms/ios/www/test/tests-todo/2d.path.moveTo.multiple.js new file mode 100644 index 0000000..46082e1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.moveTo.multiple.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.moveTo(0, 25); +ctx.moveTo(100, 25); +ctx.moveTo(0, 25); +ctx.lineTo(100, 25); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 50; +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.moveTo.newsubpath.js b/platforms/ios/www/test/tests-todo/2d.path.moveTo.newsubpath.js new file mode 100644 index 0000000..5216d3d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.moveTo.newsubpath.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.beginPath(); +ctx.moveTo(0, 0); +ctx.moveTo(100, 0); +ctx.moveTo(100, 50); +ctx.moveTo(0, 50); +ctx.fillStyle = '#f00'; +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.moveTo.nonfinite.js b/platforms/ios/www/test/tests-todo/2d.path.moveTo.nonfinite.js new file mode 100644 index 0000000..1925721 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.moveTo.nonfinite.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.moveTo(0, 0); +ctx.lineTo(100, 0); +ctx.moveTo(Infinity, 50); +ctx.moveTo(-Infinity, 50); +ctx.moveTo(NaN, 50); +ctx.moveTo(0, Infinity); +ctx.moveTo(0, -Infinity); +ctx.moveTo(0, NaN); +ctx.moveTo(Infinity, Infinity); +ctx.lineTo(100, 50); +ctx.lineTo(0, 50); +ctx.fillStyle = '#0f0'; +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.quadraticCurveTo.basic.js b/platforms/ios/www/test/tests-todo/2d.path.quadraticCurveTo.basic.js new file mode 100644 index 0000000..bd962f2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.quadraticCurveTo.basic.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 50; +ctx.beginPath(); +ctx.moveTo(0, 25); +ctx.quadraticCurveTo(100, 25, 100, 25); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.quadraticCurveTo.ensuresubpath.1.js b/platforms/ios/www/test/tests-todo/2d.path.quadraticCurveTo.ensuresubpath.1.js new file mode 100644 index 0000000..ac66e98 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.quadraticCurveTo.ensuresubpath.1.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 50; +ctx.beginPath(); +ctx.quadraticCurveTo(100, 50, 200, 50); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 95,45, 0,255,0,255, "95,45", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.quadraticCurveTo.ensuresubpath.2.js b/platforms/ios/www/test/tests-todo/2d.path.quadraticCurveTo.ensuresubpath.2.js new file mode 100644 index 0000000..f9c0536 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.quadraticCurveTo.ensuresubpath.2.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 50; +ctx.beginPath(); +ctx.quadraticCurveTo(0, 25, 100, 25); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 5,45, 0,255,0,255, "5,45", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.quadraticCurveTo.nonfinite.js b/platforms/ios/www/test/tests-todo/2d.path.quadraticCurveTo.nonfinite.js new file mode 100644 index 0000000..668cee8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.quadraticCurveTo.nonfinite.js @@ -0,0 +1,36 @@ +_addTest(function(canvas, ctx) { + +ctx.moveTo(0, 0); +ctx.lineTo(100, 0); +ctx.quadraticCurveTo(Infinity, 50, 0, 50); +ctx.quadraticCurveTo(-Infinity, 50, 0, 50); +ctx.quadraticCurveTo(NaN, 50, 0, 50); +ctx.quadraticCurveTo(0, Infinity, 0, 50); +ctx.quadraticCurveTo(0, -Infinity, 0, 50); +ctx.quadraticCurveTo(0, NaN, 0, 50); +ctx.quadraticCurveTo(0, 50, Infinity, 50); +ctx.quadraticCurveTo(0, 50, -Infinity, 50); +ctx.quadraticCurveTo(0, 50, NaN, 50); +ctx.quadraticCurveTo(0, 50, 0, Infinity); +ctx.quadraticCurveTo(0, 50, 0, -Infinity); +ctx.quadraticCurveTo(0, 50, 0, NaN); +ctx.quadraticCurveTo(Infinity, Infinity, 0, 50); +ctx.quadraticCurveTo(Infinity, Infinity, Infinity, 50); +ctx.quadraticCurveTo(Infinity, Infinity, Infinity, Infinity); +ctx.quadraticCurveTo(Infinity, Infinity, 0, Infinity); +ctx.quadraticCurveTo(Infinity, 50, Infinity, 50); +ctx.quadraticCurveTo(Infinity, 50, Infinity, Infinity); +ctx.quadraticCurveTo(Infinity, 50, 0, Infinity); +ctx.quadraticCurveTo(0, Infinity, Infinity, 50); +ctx.quadraticCurveTo(0, Infinity, Infinity, Infinity); +ctx.quadraticCurveTo(0, Infinity, 0, Infinity); +ctx.quadraticCurveTo(0, 50, Infinity, Infinity); +ctx.lineTo(100, 50); +ctx.lineTo(0, 50); +ctx.fillStyle = '#0f0'; +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 90,45, 0,255,0,255, "90,45", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.quadraticCurveTo.scaled.js b/platforms/ios/www/test/tests-todo/2d.path.quadraticCurveTo.scaled.js new file mode 100644 index 0000000..4ba2c00 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.quadraticCurveTo.scaled.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.scale(1000, 1000); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 0.055; +ctx.beginPath(); +ctx.moveTo(-1, 1.05); +ctx.quadraticCurveTo(0, -1, 1.2, 1.05); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.quadraticCurveTo.shape.js b/platforms/ios/www/test/tests-todo/2d.path.quadraticCurveTo.shape.js new file mode 100644 index 0000000..214f05a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.quadraticCurveTo.shape.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 55; +ctx.beginPath(); +ctx.moveTo(-1000, 1050); +ctx.quadraticCurveTo(0, -1000, 1200, 1050); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.rect.basic.js b/platforms/ios/www/test/tests-todo/2d.path.rect.basic.js new file mode 100644 index 0000000..ff8909d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.rect.basic.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.rect(0, 0, 100, 50); +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.rect.closed.js b/platforms/ios/www/test/tests-todo/2d.path.rect.closed.js new file mode 100644 index 0000000..a045caa --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.rect.closed.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 200; +ctx.lineJoin = 'miter'; +ctx.rect(100, 50, 100, 100); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.rect.end.1.js b/platforms/ios/www/test/tests-todo/2d.path.rect.end.1.js new file mode 100644 index 0000000..933861b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.rect.end.1.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 100; +ctx.rect(200, 100, 400, 1000); +ctx.lineTo(-2000, -1000); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.rect.end.2.js b/platforms/ios/www/test/tests-todo/2d.path.rect.end.2.js new file mode 100644 index 0000000..6f01fc9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.rect.end.2.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 450; +ctx.lineCap = 'round'; +ctx.lineJoin = 'bevel'; +ctx.rect(150, 150, 2000, 2000); +ctx.lineTo(160, 160); +ctx.stroke(); +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.rect.negative.js b/platforms/ios/www/test/tests-todo/2d.path.rect.negative.js new file mode 100644 index 0000000..daf8eae --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.rect.negative.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.beginPath(); +ctx.fillStyle = '#0f0'; +ctx.rect(0, 0, 50, 25); +ctx.rect(100, 0, -50, 25); +ctx.rect(0, 50, 50, -25); +ctx.rect(100, 50, -50, -25); +ctx.fill(); +_assertPixel(canvas, 25,12, 0,255,0,255, "25,12", "0,255,0,255"); +_assertPixel(canvas, 75,12, 0,255,0,255, "75,12", "0,255,0,255"); +_assertPixel(canvas, 25,37, 0,255,0,255, "25,37", "0,255,0,255"); +_assertPixel(canvas, 75,37, 0,255,0,255, "75,37", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.rect.newsubpath.js b/platforms/ios/www/test/tests-todo/2d.path.rect.newsubpath.js new file mode 100644 index 0000000..edec4c6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.rect.newsubpath.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.beginPath(); +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 50; +ctx.moveTo(-100, 25); +ctx.lineTo(-50, 25); +ctx.rect(200, 25, 1, 1); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.rect.nonfinite.js b/platforms/ios/www/test/tests-todo/2d.path.rect.nonfinite.js new file mode 100644 index 0000000..f256cd2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.rect.nonfinite.js @@ -0,0 +1,36 @@ +_addTest(function(canvas, ctx) { + +ctx.moveTo(0, 0); +ctx.lineTo(100, 0); +ctx.rect(Infinity, 50, 1, 1); +ctx.rect(-Infinity, 50, 1, 1); +ctx.rect(NaN, 50, 1, 1); +ctx.rect(0, Infinity, 1, 1); +ctx.rect(0, -Infinity, 1, 1); +ctx.rect(0, NaN, 1, 1); +ctx.rect(0, 50, Infinity, 1); +ctx.rect(0, 50, -Infinity, 1); +ctx.rect(0, 50, NaN, 1); +ctx.rect(0, 50, 1, Infinity); +ctx.rect(0, 50, 1, -Infinity); +ctx.rect(0, 50, 1, NaN); +ctx.rect(Infinity, Infinity, 1, 1); +ctx.rect(Infinity, Infinity, Infinity, 1); +ctx.rect(Infinity, Infinity, Infinity, Infinity); +ctx.rect(Infinity, Infinity, 1, Infinity); +ctx.rect(Infinity, 50, Infinity, 1); +ctx.rect(Infinity, 50, Infinity, Infinity); +ctx.rect(Infinity, 50, 1, Infinity); +ctx.rect(0, Infinity, Infinity, 1); +ctx.rect(0, Infinity, Infinity, Infinity); +ctx.rect(0, Infinity, 1, Infinity); +ctx.rect(0, 50, Infinity, Infinity); +ctx.lineTo(100, 50); +ctx.lineTo(0, 50); +ctx.fillStyle = '#0f0'; +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 90,45, 0,255,0,255, "90,45", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.rect.selfintersect.js b/platforms/ios/www/test/tests-todo/2d.path.rect.selfintersect.js new file mode 100644 index 0000000..175749a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.rect.selfintersect.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 90; +ctx.beginPath(); +ctx.rect(45, 20, 10, 10); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.rect.winding.js b/platforms/ios/www/test/tests-todo/2d.path.rect.winding.js new file mode 100644 index 0000000..965bce2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.rect.winding.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.beginPath(); +ctx.fillStyle = '#f00'; +ctx.rect(0, 0, 50, 50); +ctx.rect(100, 50, -50, -50); +ctx.rect(0, 25, 100, -25); +ctx.rect(100, 25, -100, 25); +ctx.fill(); +_assertPixel(canvas, 25,12, 0,255,0,255, "25,12", "0,255,0,255"); +_assertPixel(canvas, 75,12, 0,255,0,255, "75,12", "0,255,0,255"); +_assertPixel(canvas, 25,37, 0,255,0,255, "25,37", "0,255,0,255"); +_assertPixel(canvas, 75,37, 0,255,0,255, "75,37", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.rect.zero.1.js b/platforms/ios/www/test/tests-todo/2d.path.rect.zero.1.js new file mode 100644 index 0000000..9bee74f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.rect.zero.1.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 100; +ctx.beginPath(); +ctx.rect(0, 50, 100, 0); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.rect.zero.2.js b/platforms/ios/www/test/tests-todo/2d.path.rect.zero.2.js new file mode 100644 index 0000000..eefaa2c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.rect.zero.2.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 100; +ctx.beginPath(); +ctx.rect(50, -100, 0, 250); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.rect.zero.3.js b/platforms/ios/www/test/tests-todo/2d.path.rect.zero.3.js new file mode 100644 index 0000000..720f299 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.rect.zero.3.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 100; +ctx.beginPath(); +ctx.rect(50, 25, 0, 0); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.rect.zero.4.js b/platforms/ios/www/test/tests-todo/2d.path.rect.zero.4.js new file mode 100644 index 0000000..bae9388 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.rect.zero.4.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 50; +ctx.rect(100, 25, 0, 0); +ctx.lineTo(0, 25); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.rect.zero.5.js b/platforms/ios/www/test/tests-todo/2d.path.rect.zero.5.js new file mode 100644 index 0000000..55c35cc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.rect.zero.5.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 50; +ctx.moveTo(0, 0); +ctx.rect(100, 25, 0, 0); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.rect.zero.6.js b/platforms/ios/www/test/tests-todo/2d.path.rect.zero.6.js new file mode 100644 index 0000000..a5f7d54 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.rect.zero.6.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.lineJoin = 'miter'; +ctx.miterLimit = 1.5; +ctx.lineWidth = 200; +ctx.beginPath(); +ctx.rect(100, 25, 1000, 0); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.stroke.empty.js b/platforms/ios/www/test/tests-todo/2d.path.stroke.empty.js new file mode 100644 index 0000000..4be7dbf --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.stroke.empty.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 100; +ctx.lineCap = 'round'; +ctx.lineJoin = 'round'; + +ctx.beginPath(); +ctx.moveTo(40, 25); +ctx.moveTo(60, 25); +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.stroke.overlap.js b/platforms/ios/www/test/tests-todo/2d.path.stroke.overlap.js new file mode 100644 index 0000000..ba1dfee --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.stroke.overlap.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#000'; +ctx.fillRect(0, 0, 100, 50); + +ctx.strokeStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.lineWidth = 50; +ctx.moveTo(0, 20); +ctx.lineTo(100, 20); +ctx.moveTo(0, 30); +ctx.lineTo(100, 30); +ctx.stroke(); + +_assertPixelApprox(canvas, 50,25, 0,127,0,255, "50,25", "0,127,0,255", 1); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.stroke.prune.arc.js b/platforms/ios/www/test/tests-todo/2d.path.stroke.prune.arc.js new file mode 100644 index 0000000..5b0d46c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.stroke.prune.arc.js @@ -0,0 +1,24 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 100; +ctx.lineCap = 'round'; +ctx.lineJoin = 'round'; + +ctx.beginPath(); +ctx.moveTo(50, 25); +ctx.arcTo(50, 25, 150, 25, 10); +ctx.stroke(); + +ctx.beginPath(); +ctx.moveTo(50, 25); +ctx.arc(50, 25, 10, 0, 0, false); +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.stroke.prune.closed.js b/platforms/ios/www/test/tests-todo/2d.path.stroke.prune.closed.js new file mode 100644 index 0000000..b90942c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.stroke.prune.closed.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 100; +ctx.lineCap = 'round'; +ctx.lineJoin = 'round'; + +ctx.beginPath(); +ctx.moveTo(50, 25); +ctx.lineTo(50, 25); +ctx.closePath(); +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.stroke.prune.corner.js b/platforms/ios/www/test/tests-todo/2d.path.stroke.prune.corner.js new file mode 100644 index 0000000..53278d3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.stroke.prune.corner.js @@ -0,0 +1,22 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 400; +ctx.lineJoin = 'miter'; +ctx.miterLimit = 1.4; + +ctx.beginPath(); +ctx.moveTo(-1000, 200, 0, 0); +ctx.lineTo(-100, 200); +ctx.lineTo(-100, 200); +ctx.lineTo(-100, 200); +ctx.lineTo(-100, 1000); +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.stroke.prune.curve.js b/platforms/ios/www/test/tests-todo/2d.path.stroke.prune.curve.js new file mode 100644 index 0000000..1638bb1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.stroke.prune.curve.js @@ -0,0 +1,24 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 100; +ctx.lineCap = 'round'; +ctx.lineJoin = 'round'; + +ctx.beginPath(); +ctx.moveTo(50, 25); +ctx.quadraticCurveTo(50, 25, 50, 25); +ctx.stroke(); + +ctx.beginPath(); +ctx.moveTo(50, 25); +ctx.bezierCurveTo(50, 25, 50, 25, 50, 25); +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.stroke.prune.line.js b/platforms/ios/www/test/tests-todo/2d.path.stroke.prune.line.js new file mode 100644 index 0000000..08b92f4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.stroke.prune.line.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 100; +ctx.lineCap = 'round'; +ctx.lineJoin = 'round'; + +ctx.beginPath(); +ctx.moveTo(50, 25); +ctx.lineTo(50, 25); +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.stroke.prune.rect.js b/platforms/ios/www/test/tests-todo/2d.path.stroke.prune.rect.js new file mode 100644 index 0000000..ba98361 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.stroke.prune.rect.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 100; +ctx.lineCap = 'round'; +ctx.lineJoin = 'round'; + +ctx.beginPath(); +ctx.rect(50, 25, 0, 0); +ctx.stroke(); + +ctx.strokeRect(50, 25, 0, 0); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.stroke.scale1.js b/platforms/ios/www/test/tests-todo/2d.path.stroke.scale1.js new file mode 100644 index 0000000..87b2f2c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.stroke.scale1.js @@ -0,0 +1,33 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.beginPath(); +ctx.rect(25, 12.5, 50, 25); +ctx.save(); +ctx.scale(50, 25); +ctx.strokeStyle = '#0f0'; +ctx.stroke(); +ctx.restore(); + +ctx.beginPath(); +ctx.rect(-25, -12.5, 150, 75); +ctx.save(); +ctx.scale(50, 25); +ctx.strokeStyle = '#f00'; +ctx.stroke(); +ctx.restore(); + +_assertPixel(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255"); +_assertPixel(canvas, 50,0, 0,255,0,255, "50,0", "0,255,0,255"); +_assertPixel(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255"); +_assertPixel(canvas, 0,25, 0,255,0,255, "0,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 99,25, 0,255,0,255, "99,25", "0,255,0,255"); +_assertPixel(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255"); +_assertPixel(canvas, 50,49, 0,255,0,255, "50,49", "0,255,0,255"); +_assertPixel(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.stroke.scale2.js b/platforms/ios/www/test/tests-todo/2d.path.stroke.scale2.js new file mode 100644 index 0000000..3a0f188 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.stroke.scale2.js @@ -0,0 +1,35 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.beginPath(); +ctx.rect(25, 12.5, 50, 25); +ctx.save(); +ctx.rotate(Math.PI/2); +ctx.scale(25, 50); +ctx.strokeStyle = '#0f0'; +ctx.stroke(); +ctx.restore(); + +ctx.beginPath(); +ctx.rect(-25, -12.5, 150, 75); +ctx.save(); +ctx.rotate(Math.PI/2); +ctx.scale(25, 50); +ctx.strokeStyle = '#f00'; +ctx.stroke(); +ctx.restore(); + +_assertPixel(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255"); +_assertPixel(canvas, 50,0, 0,255,0,255, "50,0", "0,255,0,255"); +_assertPixel(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255"); +_assertPixel(canvas, 0,25, 0,255,0,255, "0,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 99,25, 0,255,0,255, "99,25", "0,255,0,255"); +_assertPixel(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255"); +_assertPixel(canvas, 50,49, 0,255,0,255, "50,49", "0,255,0,255"); +_assertPixel(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.stroke.skew.js b/platforms/ios/www/test/tests-todo/2d.path.stroke.skew.js new file mode 100644 index 0000000..acb4888 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.stroke.skew.js @@ -0,0 +1,49 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.save(); +ctx.beginPath(); +ctx.moveTo(49, -50); +ctx.lineTo(201, -50); +ctx.rotate(Math.PI/4); +ctx.scale(1, 283); +ctx.strokeStyle = '#0f0'; +ctx.stroke(); +ctx.restore(); + +ctx.save(); +ctx.beginPath(); +ctx.translate(-150, 0); +ctx.moveTo(49, -50); +ctx.lineTo(199, -50); +ctx.rotate(Math.PI/4); +ctx.scale(1, 142); +ctx.strokeStyle = '#f00'; +ctx.stroke(); +ctx.restore(); + +ctx.save(); +ctx.beginPath(); +ctx.translate(-150, 0); +ctx.moveTo(49, -50); +ctx.lineTo(199, -50); +ctx.rotate(Math.PI/4); +ctx.scale(1, 142); +ctx.strokeStyle = '#f00'; +ctx.stroke(); +ctx.restore(); + +_assertPixel(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255"); +_assertPixel(canvas, 50,0, 0,255,0,255, "50,0", "0,255,0,255"); +_assertPixel(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255"); +_assertPixel(canvas, 0,25, 0,255,0,255, "0,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 99,25, 0,255,0,255, "99,25", "0,255,0,255"); +_assertPixel(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255"); +_assertPixel(canvas, 50,49, 0,255,0,255, "50,49", "0,255,0,255"); +_assertPixel(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.stroke.unaffected.js b/platforms/ios/www/test/tests-todo/2d.path.stroke.unaffected.js new file mode 100644 index 0000000..087c5a7 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.stroke.unaffected.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineWidth = 50; +ctx.moveTo(-100, 25); +ctx.lineTo(-100, -100); +ctx.lineTo(200, -100); +ctx.lineTo(200, 25); +ctx.strokeStyle = '#f00'; +ctx.stroke(); + +ctx.closePath(); +ctx.strokeStyle = '#0f0'; +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.stroke.union.js b/platforms/ios/www/test/tests-todo/2d.path.stroke.union.js new file mode 100644 index 0000000..47fa81c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.stroke.union.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 40; +ctx.moveTo(0, 10); +ctx.lineTo(100, 10); +ctx.moveTo(100, 40); +ctx.lineTo(0, 40); +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.transformation.basic.js b/platforms/ios/www/test/tests-todo/2d.path.transformation.basic.js new file mode 100644 index 0000000..faf5348 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.transformation.basic.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.translate(-100, 0); +ctx.rect(100, 0, 100, 50); +ctx.translate(0, -100); +ctx.fillStyle = '#0f0'; +ctx.fill(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.transformation.changing.js b/platforms/ios/www/test/tests-todo/2d.path.transformation.changing.js new file mode 100644 index 0000000..4fe7bf4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.transformation.changing.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.moveTo(0, 0); +ctx.translate(100, 0); +ctx.lineTo(0, 0); +ctx.translate(0, 50); +ctx.lineTo(0, 0); +ctx.translate(-100, 0); +ctx.lineTo(0, 0); +ctx.translate(1000, 1000); +ctx.rotate(Math.PI/2); +ctx.scale(0.1, 0.1); +ctx.fill(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.path.transformation.multiple.js b/platforms/ios/www/test/tests-todo/2d.path.transformation.multiple.js new file mode 100644 index 0000000..601d25d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.path.transformation.multiple.js @@ -0,0 +1,26 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#f00'; +ctx.translate(-100, 0); +ctx.rect(0, 0, 100, 50); +ctx.fill(); +ctx.translate(100, 0); +ctx.fill(); + +ctx.beginPath(); +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 50; +ctx.translate(0, -50); +ctx.moveTo(0, 25); +ctx.lineTo(100, 25); +ctx.stroke(); +ctx.translate(0, 50); +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.pattern.animated.gif.js b/platforms/ios/www/test/tests-todo/2d.pattern.animated.gif.js new file mode 100644 index 0000000..03c155f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.pattern.animated.gif.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +deferTest(); +setTimeout(function () { + var pattern = ctx.createPattern(document.getElementById('anim-gr.gif'), 'repeat'); + ctx.fillStyle = pattern; + ctx.fillRect(0, 0, 50, 50); + setTimeout(wrapFunction(function () { + ctx.fillRect(50, 0, 50, 50); + _assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2); + _assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2); + }), 250); +}, 250); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.pattern.basic.canvas.js b/platforms/ios/www/test/tests-todo/2d.pattern.basic.canvas.js new file mode 100644 index 0000000..c19b8fc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.pattern.basic.canvas.js @@ -0,0 +1,28 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = '#0f0'; +ctx2.fillRect(0, 0, 100, 50); + +var pattern = ctx.createPattern(canvas2, 'no-repeat'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.pattern.basic.image.js b/platforms/ios/www/test/tests-todo/2d.pattern.basic.image.js new file mode 100644 index 0000000..1049cb8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.pattern.basic.image.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +var img = document.getElementById('green.png'); +var pattern = ctx.createPattern(img, 'no-repeat'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.pattern.basic.nocontext.js b/platforms/ios/www/test/tests-todo/2d.pattern.basic.nocontext.js new file mode 100644 index 0000000..f4eba65 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.pattern.basic.nocontext.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var pattern = ctx.createPattern(canvas2, 'no-repeat'); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.pattern.basic.type.js b/platforms/ios/www/test/tests-todo/2d.pattern.basic.type.js new file mode 100644 index 0000000..4273479 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.pattern.basic.type.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +_assertDifferent(window.CanvasPattern, undefined, "window.CanvasPattern", "undefined"); + +window.CanvasPattern.prototype.thisImplementsCanvasPattern = true; + +var img = document.getElementById('green.png'); +var pattern = ctx.createPattern(img, 'no-repeat'); +_assert(pattern.thisImplementsCanvasPattern, "pattern.thisImplementsCanvasPattern"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.pattern.basic.zerocanvas.js b/platforms/ios/www/test/tests-todo/2d.pattern.basic.zerocanvas.js new file mode 100644 index 0000000..e70aba7 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.pattern.basic.zerocanvas.js @@ -0,0 +1,28 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 0; +canvas.height = 10; +_assertSame(canvas.width, 0, "canvas.width", "0"); +_assertSame(canvas.height, 10, "canvas.height", "10"); +try { var _thrown = false; + ctx.createPattern(canvas, 'repeat'); +} catch (e) { if (e.code != DOMException.INVALID_STATE_ERR) _fail("Failed assertion: expected exception of type INVALID_STATE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INVALID_STATE_ERR: ctx.createPattern(canvas, 'repeat')"); } + +canvas.width = 10; +canvas.height = 0; +_assertSame(canvas.width, 10, "canvas.width", "10"); +_assertSame(canvas.height, 0, "canvas.height", "0"); +try { var _thrown = false; + ctx.createPattern(canvas, 'repeat'); +} catch (e) { if (e.code != DOMException.INVALID_STATE_ERR) _fail("Failed assertion: expected exception of type INVALID_STATE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INVALID_STATE_ERR: ctx.createPattern(canvas, 'repeat')"); } + +canvas.width = 0; +canvas.height = 0; +_assertSame(canvas.width, 0, "canvas.width", "0"); +_assertSame(canvas.height, 0, "canvas.height", "0"); +try { var _thrown = false; + ctx.createPattern(canvas, 'repeat'); +} catch (e) { if (e.code != DOMException.INVALID_STATE_ERR) _fail("Failed assertion: expected exception of type INVALID_STATE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INVALID_STATE_ERR: ctx.createPattern(canvas, 'repeat')"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.pattern.crosscanvas.js b/platforms/ios/www/test/tests-todo/2d.pattern.crosscanvas.js new file mode 100644 index 0000000..c4251d3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.pattern.crosscanvas.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +var img = document.getElementById('green.png'); + +var pattern = document.createElement('canvas').getContext('2d').createPattern(img, 'no-repeat'); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.pattern.image.broken.js b/platforms/ios/www/test/tests-todo/2d.pattern.image.broken.js new file mode 100644 index 0000000..422048a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.pattern.image.broken.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +var img = document.getElementById('broken.png'); +_assertSame(img.complete, false, "img.complete", "false"); +_assertSame(ctx.createPattern(img, 'repeat'), null, "ctx.createPattern(img, 'repeat')", "null"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.pattern.image.incomplete.js b/platforms/ios/www/test/tests-todo/2d.pattern.image.incomplete.js new file mode 100644 index 0000000..3764e83 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.pattern.image.incomplete.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +var img = new Image(); +_assertSame(img.complete, false, "img.complete", "false"); +_assertSame(ctx.createPattern(img, 'repeat'), null, "ctx.createPattern(img, 'repeat')", "null"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.pattern.image.null.js b/platforms/ios/www/test/tests-todo/2d.pattern.image.null.js new file mode 100644 index 0000000..75e4549 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.pattern.image.null.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.createPattern(null, 'repeat'); +} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail("Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TYPE_MISMATCH_ERR: ctx.createPattern(null, 'repeat')"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.pattern.image.string.js b/platforms/ios/www/test/tests-todo/2d.pattern.image.string.js new file mode 100644 index 0000000..3f1d4a0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.pattern.image.string.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.createPattern('../images/red.png', 'repeat'); +} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail("Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TYPE_MISMATCH_ERR: ctx.createPattern('../images/red.png', 'repeat')"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.pattern.image.undefined.js b/platforms/ios/www/test/tests-todo/2d.pattern.image.undefined.js new file mode 100644 index 0000000..052b250 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.pattern.image.undefined.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.createPattern(undefined, 'repeat'); +} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail("Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TYPE_MISMATCH_ERR: ctx.createPattern(undefined, 'repeat')"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.pattern.modify.canvas1.js b/platforms/ios/www/test/tests-todo/2d.pattern.modify.canvas1.js new file mode 100644 index 0000000..2500755 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.pattern.modify.canvas1.js @@ -0,0 +1,24 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = '#0f0'; +ctx2.fillRect(0, 0, 100, 50); + +var pattern = ctx.createPattern(canvas2, 'no-repeat'); + +ctx2.fillStyle = '#f00'; +ctx2.fillRect(0, 0, 100, 50); + +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.pattern.modify.canvas2.js b/platforms/ios/www/test/tests-todo/2d.pattern.modify.canvas2.js new file mode 100644 index 0000000..d6f8a67 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.pattern.modify.canvas2.js @@ -0,0 +1,28 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = '#0f0'; +ctx2.fillRect(0, 0, 100, 50); + +var pattern = ctx.createPattern(canvas2, 'no-repeat'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx2.fillStyle = '#f00'; +ctx2.fillRect(0, 0, 100, 50); + +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.pattern.modify.image1.js b/platforms/ios/www/test/tests-todo/2d.pattern.modify.image1.js new file mode 100644 index 0000000..32fcb86 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.pattern.modify.image1.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +var img = document.getElementById('green.png'); +var pattern = ctx.createPattern(img, 'no-repeat'); +deferTest(); +img.onload = wrapFunction(function () +{ + ctx.fillStyle = pattern; + ctx.fillRect(0, 0, 100, 50); + + _assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); + _assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); + _assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + _assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); +}); +img.src = '../images/red.png'; + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.pattern.modify.image2.js b/platforms/ios/www/test/tests-todo/2d.pattern.modify.image2.js new file mode 100644 index 0000000..26b5aa1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.pattern.modify.image2.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +var img = document.getElementById('green.png'); +var pattern = ctx.createPattern(img, 'no-repeat'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#00f'; +ctx.fillRect(0, 0, 100, 50); +deferTest(); +img.onload = wrapFunction(function () +{ + ctx.fillStyle = pattern; + ctx.fillRect(0, 0, 100, 50); + + _assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); + _assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); + _assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + _assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); +}); +img.src = '../images/red.png'; + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.pattern.paint.norepeat.basic.js b/platforms/ios/www/test/tests-todo/2d.pattern.paint.norepeat.basic.js new file mode 100644 index 0000000..37d5310 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.pattern.paint.norepeat.basic.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('green.png'); +var pattern = ctx.createPattern(img, 'no-repeat'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.pattern.paint.norepeat.coord1.js b/platforms/ios/www/test/tests-todo/2d.pattern.paint.norepeat.coord1.js new file mode 100644 index 0000000..8e66bcd --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.pattern.paint.norepeat.coord1.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 50, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(50, 0, 50, 50); + +var img = document.getElementById('green.png'); +var pattern = ctx.createPattern(img, 'no-repeat'); +ctx.fillStyle = pattern; +ctx.translate(50, 0); +ctx.fillRect(-50, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.pattern.paint.norepeat.coord2.js b/platforms/ios/www/test/tests-todo/2d.pattern.paint.norepeat.coord2.js new file mode 100644 index 0000000..d09b6ed --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.pattern.paint.norepeat.coord2.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +var img = document.getElementById('green.png'); +var pattern = ctx.createPattern(img, 'no-repeat'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 50, 50); + +ctx.fillStyle = '#f00'; +ctx.fillRect(50, 0, 50, 50); + +ctx.fillStyle = pattern; +ctx.translate(50, 0); +ctx.fillRect(-50, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.pattern.paint.norepeat.coord3.js b/platforms/ios/www/test/tests-todo/2d.pattern.paint.norepeat.coord3.js new file mode 100644 index 0000000..b4b0cc8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.pattern.paint.norepeat.coord3.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('red.png'); +var pattern = ctx.createPattern(img, 'no-repeat'); +ctx.fillStyle = pattern; +ctx.translate(50, 25); +ctx.fillRect(-50, -25, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 50, 25); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.pattern.paint.norepeat.outside.js b/platforms/ios/www/test/tests-todo/2d.pattern.paint.norepeat.outside.js new file mode 100644 index 0000000..8dddb46 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.pattern.paint.norepeat.outside.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('red.png'); +var pattern = ctx.createPattern(img, 'no-repeat'); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = pattern; +ctx.fillRect(0, -50, 100, 50); +ctx.fillRect(-100, 0, 100, 50); +ctx.fillRect(0, 50, 100, 50); +ctx.fillRect(100, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.pattern.paint.orientation.canvas.js b/platforms/ios/www/test/tests-todo/2d.pattern.paint.orientation.canvas.js new file mode 100644 index 0000000..4492b71 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.pattern.paint.orientation.canvas.js @@ -0,0 +1,27 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = '#f00'; +ctx2.fillRect(0, 0, 100, 25); +ctx2.fillStyle = '#0f0'; +ctx2.fillRect(0, 25, 100, 25); + +var pattern = ctx.createPattern(canvas2, 'no-repeat'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 25); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.pattern.paint.orientation.image.js b/platforms/ios/www/test/tests-todo/2d.pattern.paint.orientation.image.js new file mode 100644 index 0000000..1f0f031 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.pattern.paint.orientation.image.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('rrgg-256x256.png'); +var pattern = ctx.createPattern(img, 'no-repeat'); +ctx.fillStyle = pattern; +ctx.save(); +ctx.translate(0, -103); +ctx.fillRect(0, 103, 100, 50); +ctx.restore(); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 25); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.pattern.paint.repeat.basic.js b/platforms/ios/www/test/tests-todo/2d.pattern.paint.repeat.basic.js new file mode 100644 index 0000000..ee19c77 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.pattern.paint.repeat.basic.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('green-16x16.png'); +var pattern = ctx.createPattern(img, 'repeat'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.pattern.paint.repeat.coord1.js b/platforms/ios/www/test/tests-todo/2d.pattern.paint.repeat.coord1.js new file mode 100644 index 0000000..d3c9c4d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.pattern.paint.repeat.coord1.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('rgrg-256x256.png'); +var pattern = ctx.createPattern(img, 'repeat'); +ctx.fillStyle = pattern; +ctx.translate(-128, -78); +ctx.fillRect(128, 78, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.pattern.paint.repeat.coord2.js b/platforms/ios/www/test/tests-todo/2d.pattern.paint.repeat.coord2.js new file mode 100644 index 0000000..2939568 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.pattern.paint.repeat.coord2.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +var img = document.getElementById('ggrr-256x256.png'); +var pattern = ctx.createPattern(img, 'repeat'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.pattern.paint.repeat.coord3.js b/platforms/ios/www/test/tests-todo/2d.pattern.paint.repeat.coord3.js new file mode 100644 index 0000000..0879ca3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.pattern.paint.repeat.coord3.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +var img = document.getElementById('rgrg-256x256.png'); +var pattern = ctx.createPattern(img, 'repeat'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +ctx.translate(-128, -78); +ctx.fillRect(128, 78, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.pattern.paint.repeat.outside.js b/platforms/ios/www/test/tests-todo/2d.pattern.paint.repeat.outside.js new file mode 100644 index 0000000..9727f0b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.pattern.paint.repeat.outside.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('green-16x16.png'); +var pattern = ctx.createPattern(img, 'repeat'); +ctx.fillStyle = pattern; +ctx.translate(50, 25); +ctx.fillRect(-50, -25, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.pattern.paint.repeatx.basic.js b/platforms/ios/www/test/tests-todo/2d.pattern.paint.repeatx.basic.js new file mode 100644 index 0000000..e113835 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.pattern.paint.repeatx.basic.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 16); + +var img = document.getElementById('green-16x16.png'); +var pattern = ctx.createPattern(img, 'repeat-x'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.pattern.paint.repeatx.coord1.js b/platforms/ios/www/test/tests-todo/2d.pattern.paint.repeatx.coord1.js new file mode 100644 index 0000000..b151153 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.pattern.paint.repeatx.coord1.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('red-16x16.png'); +var pattern = ctx.createPattern(img, 'repeat-x'); +ctx.fillStyle = pattern; +ctx.translate(0, 16); +ctx.fillRect(0, -16, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 16); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.pattern.paint.repeatx.outside.js b/platforms/ios/www/test/tests-todo/2d.pattern.paint.repeatx.outside.js new file mode 100644 index 0000000..d2ef7eb --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.pattern.paint.repeatx.outside.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('red-16x16.png'); +var pattern = ctx.createPattern(img, 'repeat-x'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 16); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.pattern.paint.repeaty.basic.js b/platforms/ios/www/test/tests-todo/2d.pattern.paint.repeaty.basic.js new file mode 100644 index 0000000..1b7feda --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.pattern.paint.repeaty.basic.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 16, 50); + +var img = document.getElementById('green-16x16.png'); +var pattern = ctx.createPattern(img, 'repeat-y'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.pattern.paint.repeaty.coord1.js b/platforms/ios/www/test/tests-todo/2d.pattern.paint.repeaty.coord1.js new file mode 100644 index 0000000..2d5eb80 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.pattern.paint.repeaty.coord1.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('red-16x16.png'); +var pattern = ctx.createPattern(img, 'repeat-y'); +ctx.fillStyle = pattern; +ctx.translate(48, 0); +ctx.fillRect(-48, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 16, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.pattern.paint.repeaty.outside.js b/platforms/ios/www/test/tests-todo/2d.pattern.paint.repeaty.outside.js new file mode 100644 index 0000000..8125837 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.pattern.paint.repeaty.outside.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('red-16x16.png'); +var pattern = ctx.createPattern(img, 'repeat-y'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 16, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.pattern.repeat.case.js b/platforms/ios/www/test/tests-todo/2d.pattern.repeat.case.js new file mode 100644 index 0000000..ad45bed --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.pattern.repeat.case.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.createPattern(canvas, "Repeat"); +} catch (e) { if (e.code != DOMException.SYNTAX_ERR) _fail("Failed assertion: expected exception of type SYNTAX_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type SYNTAX_ERR: ctx.createPattern(canvas, \"Repeat\")"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.pattern.repeat.empty.js b/platforms/ios/www/test/tests-todo/2d.pattern.repeat.empty.js new file mode 100644 index 0000000..f251ed4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.pattern.repeat.empty.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +var img = document.getElementById('green-1x1.png'); +var pattern = ctx.createPattern(img, ""); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 200, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.pattern.repeat.null.js b/platforms/ios/www/test/tests-todo/2d.pattern.repeat.null.js new file mode 100644 index 0000000..6a13765 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.pattern.repeat.null.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +var img = document.getElementById('green-1x1.png'); +var pattern = ctx.createPattern(img, null); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.pattern.repeat.nullsuffix.js b/platforms/ios/www/test/tests-todo/2d.pattern.repeat.nullsuffix.js new file mode 100644 index 0000000..adf6eae --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.pattern.repeat.nullsuffix.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.createPattern(canvas, "repeat\0"); +} catch (e) { if (e.code != DOMException.SYNTAX_ERR) _fail("Failed assertion: expected exception of type SYNTAX_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type SYNTAX_ERR: ctx.createPattern(canvas, \"repeat\\0\")"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.pattern.repeat.undefined.js b/platforms/ios/www/test/tests-todo/2d.pattern.repeat.undefined.js new file mode 100644 index 0000000..661cd0d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.pattern.repeat.undefined.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.createPattern(canvas, undefined); +} catch (e) { if (e.code != DOMException.SYNTAX_ERR) _fail("Failed assertion: expected exception of type SYNTAX_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type SYNTAX_ERR: ctx.createPattern(canvas, undefined)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.pattern.repeat.unrecognised.js b/platforms/ios/www/test/tests-todo/2d.pattern.repeat.unrecognised.js new file mode 100644 index 0000000..d24500b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.pattern.repeat.unrecognised.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.createPattern(canvas, "invalid"); +} catch (e) { if (e.code != DOMException.SYNTAX_ERR) _fail("Failed assertion: expected exception of type SYNTAX_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type SYNTAX_ERR: ctx.createPattern(canvas, \"invalid\")"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.scaled.js b/platforms/ios/www/test/tests-todo/2d.scaled.js new file mode 100644 index 0000000..3ed3b0e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.scaled.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#00f'; +ctx.fillRect(0, 0, 50, 25); +ctx.fillStyle = '#0ff'; +ctx.fillRect(0, 0, 25, 10); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.alpha.1.js b/platforms/ios/www/test/tests-todo/2d.shadow.alpha.1.js new file mode 100644 index 0000000..1aac375 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.alpha.1.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = 'rgba(255, 0, 0, 0.01)'; +ctx.shadowOffsetY = 50; +ctx.fillRect(0, -50, 100, 50); + +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 4); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.alpha.2.js b/platforms/ios/www/test/tests-todo/2d.shadow.alpha.2.js new file mode 100644 index 0000000..536144b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.alpha.2.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = 'rgba(0, 0, 255, 0.5)'; +ctx.shadowOffsetY = 50; +ctx.fillRect(0, -50, 100, 50); + +_assertPixelApprox(canvas, 50,25, 127,0,127,255, "50,25", "127,0,127,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.alpha.3.js b/platforms/ios/www/test/tests-todo/2d.shadow.alpha.3.js new file mode 100644 index 0000000..2b89a2b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.alpha.3.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; // (work around broken Firefox globalAlpha caching) +ctx.shadowColor = '#00f'; +ctx.shadowOffsetY = 50; +ctx.globalAlpha = 0.5; +ctx.fillRect(0, -50, 100, 50); + +_assertPixelApprox(canvas, 50,25, 127,0,127,255, "50,25", "127,0,127,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.alpha.4.js b/platforms/ios/www/test/tests-todo/2d.shadow.alpha.4.js new file mode 100644 index 0000000..9b7ac01 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.alpha.4.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; // (work around broken Firefox globalAlpha caching) +ctx.shadowColor = 'rgba(0, 0, 255, 0.707)'; +ctx.shadowOffsetY = 50; +ctx.globalAlpha = 0.707; +ctx.fillRect(0, -50, 100, 50); + +_assertPixelApprox(canvas, 50,25, 127,0,127,255, "50,25", "127,0,127,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.alpha.5.js b/platforms/ios/www/test/tests-todo/2d.shadow.alpha.5.js new file mode 100644 index 0000000..71c396f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.alpha.5.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = 'rgba(64, 0, 0, 0.5)'; +ctx.shadowColor = '#00f'; +ctx.shadowOffsetY = 50; +ctx.fillRect(0, -50, 100, 50); + +_assertPixelApprox(canvas, 50,25, 127,0,127,255, "50,25", "127,0,127,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.attributes.shadowBlur.initial.js b/platforms/ios/www/test/tests-todo/2d.shadow.attributes.shadowBlur.initial.js new file mode 100644 index 0000000..6410228 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.attributes.shadowBlur.initial.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(ctx.shadowBlur, 0, "ctx.shadowBlur", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.attributes.shadowBlur.invalid.js b/platforms/ios/www/test/tests-todo/2d.shadow.attributes.shadowBlur.invalid.js new file mode 100644 index 0000000..a0a823a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.attributes.shadowBlur.invalid.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +ctx.shadowBlur = 1; +ctx.shadowBlur = -2; +_assertSame(ctx.shadowBlur, 1, "ctx.shadowBlur", "1"); + +ctx.shadowBlur = 1; +ctx.shadowBlur = Infinity; +_assertSame(ctx.shadowBlur, 1, "ctx.shadowBlur", "1"); + +ctx.shadowBlur = 1; +ctx.shadowBlur = -Infinity; +_assertSame(ctx.shadowBlur, 1, "ctx.shadowBlur", "1"); + +ctx.shadowBlur = 1; +ctx.shadowBlur = NaN; +_assertSame(ctx.shadowBlur, 1, "ctx.shadowBlur", "1"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.attributes.shadowBlur.valid.js b/platforms/ios/www/test/tests-todo/2d.shadow.attributes.shadowBlur.valid.js new file mode 100644 index 0000000..0a02f2e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.attributes.shadowBlur.valid.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.shadowBlur = 1; +_assertSame(ctx.shadowBlur, 1, "ctx.shadowBlur", "1"); + +ctx.shadowBlur = 0.5; +_assertSame(ctx.shadowBlur, 0.5, "ctx.shadowBlur", "0.5"); + +ctx.shadowBlur = 1e6; +_assertSame(ctx.shadowBlur, 1e6, "ctx.shadowBlur", "1e6"); + +ctx.shadowBlur = 0; +_assertSame(ctx.shadowBlur, 0, "ctx.shadowBlur", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.attributes.shadowColor.initial.js b/platforms/ios/www/test/tests-todo/2d.shadow.attributes.shadowColor.initial.js new file mode 100644 index 0000000..1d8539b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.attributes.shadowColor.initial.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(ctx.shadowColor, 'rgba(0, 0, 0, 0.0)', "ctx.shadowColor", "'rgba(0, 0, 0, 0.0)'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.attributes.shadowColor.invalid.js b/platforms/ios/www/test/tests-todo/2d.shadow.attributes.shadowColor.invalid.js new file mode 100644 index 0000000..f287f30 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.attributes.shadowColor.invalid.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +ctx.shadowColor = '#00ff00'; +ctx.shadowColor = 'bogus'; +_assertSame(ctx.shadowColor, '#00ff00', "ctx.shadowColor", "'#00ff00'"); + +ctx.shadowColor = '#00ff00'; +ctx.shadowColor = 'red bogus'; +_assertSame(ctx.shadowColor, '#00ff00', "ctx.shadowColor", "'#00ff00'"); + +ctx.shadowColor = '#00ff00'; +ctx.shadowColor = ctx; +_assertSame(ctx.shadowColor, '#00ff00', "ctx.shadowColor", "'#00ff00'"); + +ctx.shadowColor = '#00ff00'; +ctx.shadowColor = undefined; +_assertSame(ctx.shadowColor, '#00ff00', "ctx.shadowColor", "'#00ff00'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.attributes.shadowColor.valid.js b/platforms/ios/www/test/tests-todo/2d.shadow.attributes.shadowColor.valid.js new file mode 100644 index 0000000..02a5f5c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.attributes.shadowColor.valid.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.shadowColor = 'lime'; +_assertSame(ctx.shadowColor, '#00ff00', "ctx.shadowColor", "'#00ff00'"); + +ctx.shadowColor = 'RGBA(0,255, 0,0)'; +_assertSame(ctx.shadowColor, 'rgba(0, 255, 0, 0.0)', "ctx.shadowColor", "'rgba(0, 255, 0, 0.0)'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.attributes.shadowOffset.initial.js b/platforms/ios/www/test/tests-todo/2d.shadow.attributes.shadowOffset.initial.js new file mode 100644 index 0000000..48cf0ca --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.attributes.shadowOffset.initial.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +_assertSame(ctx.shadowOffsetX, 0, "ctx.shadowOffsetX", "0"); +_assertSame(ctx.shadowOffsetY, 0, "ctx.shadowOffsetY", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.attributes.shadowOffset.invalid.js b/platforms/ios/www/test/tests-todo/2d.shadow.attributes.shadowOffset.invalid.js new file mode 100644 index 0000000..4b9c04e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.attributes.shadowOffset.invalid.js @@ -0,0 +1,25 @@ +_addTest(function(canvas, ctx) { + +ctx.shadowOffsetX = 1; +ctx.shadowOffsetY = 2; +ctx.shadowOffsetX = Infinity; +ctx.shadowOffsetY = Infinity; +_assertSame(ctx.shadowOffsetX, 1, "ctx.shadowOffsetX", "1"); +_assertSame(ctx.shadowOffsetY, 2, "ctx.shadowOffsetY", "2"); + +ctx.shadowOffsetX = 1; +ctx.shadowOffsetY = 2; +ctx.shadowOffsetX = -Infinity; +ctx.shadowOffsetY = -Infinity; +_assertSame(ctx.shadowOffsetX, 1, "ctx.shadowOffsetX", "1"); +_assertSame(ctx.shadowOffsetY, 2, "ctx.shadowOffsetY", "2"); + +ctx.shadowOffsetX = 1; +ctx.shadowOffsetY = 2; +ctx.shadowOffsetX = NaN; +ctx.shadowOffsetY = NaN; +_assertSame(ctx.shadowOffsetX, 1, "ctx.shadowOffsetX", "1"); +_assertSame(ctx.shadowOffsetY, 2, "ctx.shadowOffsetY", "2"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.attributes.shadowOffset.valid.js b/platforms/ios/www/test/tests-todo/2d.shadow.attributes.shadowOffset.valid.js new file mode 100644 index 0000000..75937f0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.attributes.shadowOffset.valid.js @@ -0,0 +1,29 @@ +_addTest(function(canvas, ctx) { + +ctx.shadowOffsetX = 1; +ctx.shadowOffsetY = 2; +_assertSame(ctx.shadowOffsetX, 1, "ctx.shadowOffsetX", "1"); +_assertSame(ctx.shadowOffsetY, 2, "ctx.shadowOffsetY", "2"); + +ctx.shadowOffsetX = 0.5; +ctx.shadowOffsetY = 0.25; +_assertSame(ctx.shadowOffsetX, 0.5, "ctx.shadowOffsetX", "0.5"); +_assertSame(ctx.shadowOffsetY, 0.25, "ctx.shadowOffsetY", "0.25"); + +ctx.shadowOffsetX = -0.5; +ctx.shadowOffsetY = -0.25; +_assertSame(ctx.shadowOffsetX, -0.5, "ctx.shadowOffsetX", "-0.5"); +_assertSame(ctx.shadowOffsetY, -0.25, "ctx.shadowOffsetY", "-0.25"); + +ctx.shadowOffsetX = 0; +ctx.shadowOffsetY = 0; +_assertSame(ctx.shadowOffsetX, 0, "ctx.shadowOffsetX", "0"); +_assertSame(ctx.shadowOffsetY, 0, "ctx.shadowOffsetY", "0"); + +ctx.shadowOffsetX = 1e6; +ctx.shadowOffsetY = 1e6; +_assertSame(ctx.shadowOffsetX, 1e6, "ctx.shadowOffsetX", "1e6"); +_assertSame(ctx.shadowOffsetY, 1e6, "ctx.shadowOffsetY", "1e6"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.blur.high.js b/platforms/ios/www/test/tests-todo/2d.shadow.blur.high.js new file mode 100644 index 0000000..b3c9e4f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.blur.high.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#ff0'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = '#00f'; +ctx.shadowOffsetY = 0; +ctx.shadowBlur = 555.6; +ctx.fillRect(-200, -200, 200, 400); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.blur.low.js b/platforms/ios/www/test/tests-todo/2d.shadow.blur.low.js new file mode 100644 index 0000000..9703121 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.blur.low.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#ff0'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = '#00f'; +ctx.shadowOffsetY = 25; +for (var x = 0; x < 100; ++x) { + ctx.save(); + ctx.beginPath(); + ctx.rect(x, 0, 1, 50); + ctx.clip(); + ctx.shadowBlur = x; + ctx.fillRect(-200, -200, 500, 200); + ctx.restore(); +} + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.canvas.alpha.js b/platforms/ios/www/test/tests-todo/2d.shadow.canvas.alpha.js new file mode 100644 index 0000000..7f9af4e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.canvas.alpha.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = 'rgba(255, 0, 0, 0.5)'; +ctx2.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowOffsetY = 50; +ctx.shadowColor = '#00f'; +ctx.drawImage(canvas2, 0, -50); + +_assertPixelApprox(canvas, 50,25, 127,0,127,255, "50,25", "127,0,127,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.canvas.basic.js b/platforms/ios/www/test/tests-todo/2d.shadow.canvas.basic.js new file mode 100644 index 0000000..0b9b795 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.canvas.basic.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = '#f00'; +ctx2.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetY = 50; +ctx.drawImage(canvas2, 0, -50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.canvas.transparent.1.js b/platforms/ios/www/test/tests-todo/2d.shadow.canvas.transparent.1.js new file mode 100644 index 0000000..00bf2c7 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.canvas.transparent.1.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = '#f00'; +ctx.shadowOffsetY = 50; +ctx.drawImage(canvas2, 0, -50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.canvas.transparent.2.js b/platforms/ios/www/test/tests-todo/2d.shadow.canvas.transparent.2.js new file mode 100644 index 0000000..6e5f276 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.canvas.transparent.2.js @@ -0,0 +1,25 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = '#f00'; +ctx2.fillRect(0, 0, 50, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 50, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(50, 0, 50, 50); +ctx.shadowOffsetY = 50; +ctx.shadowColor = '#0f0'; +ctx.drawImage(canvas2, 50, -50); +ctx.shadowColor = '#f00'; +ctx.drawImage(canvas2, -50, -50); + +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.clip.1.js b/platforms/ios/www/test/tests-todo/2d.shadow.clip.1.js new file mode 100644 index 0000000..d23e68c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.clip.1.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 50, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(50, 0, 50, 50); + +ctx.save(); +ctx.beginPath(); +ctx.rect(50, 0, 50, 50); +ctx.clip(); +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetX = 50; +ctx.fillRect(0, 0, 50, 50); +ctx.restore(); + +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.clip.2.js b/platforms/ios/www/test/tests-todo/2d.shadow.clip.2.js new file mode 100644 index 0000000..7142fd0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.clip.2.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +ctx.fillStyle = '#0f0'; +ctx.fillRect(50, 0, 50, 50); + +ctx.save(); +ctx.beginPath(); +ctx.rect(0, 0, 50, 50); +ctx.clip(); +ctx.shadowColor = '#f00'; +ctx.shadowOffsetX = 50; +ctx.fillRect(0, 0, 50, 50); +ctx.restore(); + +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.clip.3.js b/platforms/ios/www/test/tests-todo/2d.shadow.clip.3.js new file mode 100644 index 0000000..bfa775f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.clip.3.js @@ -0,0 +1,22 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +ctx.fillStyle = '#0f0'; +ctx.fillRect(50, 0, 50, 50); + +ctx.save(); +ctx.beginPath(); +ctx.rect(0, 0, 50, 50); +ctx.clip(); +ctx.fillStyle = '#f00'; +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetX = 50; +ctx.fillRect(-50, 0, 50, 50); +ctx.restore(); + +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.composite.1.js b/platforms/ios/www/test/tests-todo/2d.shadow.composite.1.js new file mode 100644 index 0000000..855bca0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.composite.1.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'xor'; +ctx.shadowColor = '#f00'; +ctx.shadowOffsetX = 100; +ctx.fillStyle = '#0f0'; +ctx.fillRect(-100, 0, 200, 50); + +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.composite.2.js b/platforms/ios/www/test/tests-todo/2d.shadow.composite.2.js new file mode 100644 index 0000000..da3b03f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.composite.2.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'xor'; +ctx.shadowColor = '#f00'; +ctx.shadowBlur = 1; +ctx.fillStyle = '#0f0'; +ctx.fillRect(-10, -10, 120, 70); + +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.composite.3.js b/platforms/ios/www/test/tests-todo/2d.shadow.composite.3.js new file mode 100644 index 0000000..3a77b71 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.composite.3.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-out'; +ctx.shadowColor = '#f00'; +ctx.shadowBlur = 10; +ctx.fillStyle = '#f00'; +ctx.fillRect(200, 0, 100, 50); + +_assertPixelApprox(canvas, 5,5, 0,255,0,255, "5,5", "0,255,0,255", 2); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.enable.blur.js b/platforms/ios/www/test/tests-todo/2d.shadow.enable.blur.js new file mode 100644 index 0000000..2f1127e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.enable.blur.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.globalCompositeOperation = 'destination-atop'; +ctx.shadowColor = '#0f0'; +ctx.shadowBlur = 0.1; +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.enable.off.1.js b/platforms/ios/www/test/tests-todo/2d.shadow.enable.off.1.js new file mode 100644 index 0000000..9bb20b8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.enable.off.1.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +ctx.shadowColor = '#f00'; +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.enable.off.2.js b/platforms/ios/www/test/tests-todo/2d.shadow.enable.off.2.js new file mode 100644 index 0000000..800c731 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.enable.off.2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.globalCompositeOperation = 'destination-atop'; +ctx.shadowColor = '#f00'; +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.enable.x.js b/platforms/ios/www/test/tests-todo/2d.shadow.enable.x.js new file mode 100644 index 0000000..bf80da6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.enable.x.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.globalCompositeOperation = 'destination-atop'; +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetX = 0.1; +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.enable.y.js b/platforms/ios/www/test/tests-todo/2d.shadow.enable.y.js new file mode 100644 index 0000000..eda5f53 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.enable.y.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.globalCompositeOperation = 'destination-atop'; +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetY = 0.1; +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.gradient.alpha.js b/platforms/ios/www/test/tests-todo/2d.shadow.gradient.alpha.js new file mode 100644 index 0000000..6174354 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.gradient.alpha.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +var gradient = ctx.createLinearGradient(0, 0, 100, 0); +gradient.addColorStop(0, 'rgba(255,0,0,0.5)'); +gradient.addColorStop(1, 'rgba(255,0,0,0.5)'); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowOffsetY = 50; +ctx.shadowColor = '#00f'; +ctx.fillStyle = gradient; +ctx.fillRect(0, -50, 100, 50); + +_assertPixelApprox(canvas, 50,25, 127,0,127,255, "50,25", "127,0,127,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.gradient.basic.js b/platforms/ios/www/test/tests-todo/2d.shadow.gradient.basic.js new file mode 100644 index 0000000..ddb028a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.gradient.basic.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +var gradient = ctx.createLinearGradient(0, 0, 100, 0); +gradient.addColorStop(0, '#f00'); +gradient.addColorStop(1, '#f00'); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetY = 50; +ctx.fillStyle = gradient; +ctx.fillRect(0, -50, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.gradient.transparent.1.js b/platforms/ios/www/test/tests-todo/2d.shadow.gradient.transparent.1.js new file mode 100644 index 0000000..9627019 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.gradient.transparent.1.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +var gradient = ctx.createLinearGradient(0, 0, 100, 0); +gradient.addColorStop(0, 'rgba(0,0,0,0)'); +gradient.addColorStop(1, 'rgba(0,0,0,0)'); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = '#f00'; +ctx.shadowOffsetY = 50; +ctx.fillStyle = gradient; +ctx.fillRect(0, -50, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.gradient.transparent.2.js b/platforms/ios/www/test/tests-todo/2d.shadow.gradient.transparent.2.js new file mode 100644 index 0000000..f13ba5d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.gradient.transparent.2.js @@ -0,0 +1,22 @@ +_addTest(function(canvas, ctx) { + +var gradient = ctx.createLinearGradient(0, 0, 100, 0); +gradient.addColorStop(0, '#f00'); +gradient.addColorStop(0.499, '#f00'); +gradient.addColorStop(0.5, 'rgba(0,0,0,0)'); +gradient.addColorStop(1, 'rgba(0,0,0,0)'); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +ctx.fillStyle = '#0f0'; +ctx.fillRect(50, 0, 50, 50); +ctx.shadowOffsetY = 50; +ctx.shadowColor = '#0f0'; +ctx.fillStyle = gradient; +ctx.fillRect(0, -50, 100, 50); + +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.image.alpha.js b/platforms/ios/www/test/tests-todo/2d.shadow.image.alpha.js new file mode 100644 index 0000000..67b935c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.image.alpha.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowOffsetY = 50; +ctx.shadowColor = '#00f'; +ctx.drawImage(document.getElementById('transparent50.png'), 0, -50); + +_assertPixelApprox(canvas, 50,25, 127,0,127,255, "50,25", "127,0,127,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.image.basic.js b/platforms/ios/www/test/tests-todo/2d.shadow.image.basic.js new file mode 100644 index 0000000..46accfa --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.image.basic.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetY = 50; +ctx.drawImage(document.getElementById('red.png'), 0, -50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.image.scale.js b/platforms/ios/www/test/tests-todo/2d.shadow.image.scale.js new file mode 100644 index 0000000..34ef1ea --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.image.scale.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowOffsetY = 50; +ctx.shadowColor = '#0f0'; +ctx.drawImage(document.getElementById('redtransparent.png'), 0, 0, 100, 50, -10, -50, 240, 50); + +_assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.image.section.js b/platforms/ios/www/test/tests-todo/2d.shadow.image.section.js new file mode 100644 index 0000000..0da6055 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.image.section.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowOffsetY = 50; +ctx.shadowColor = '#f00'; +ctx.drawImage(document.getElementById('redtransparent.png'), 50, 0, 50, 50, 0, -50, 50, 50); + +_assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.image.transparent.1.js b/platforms/ios/www/test/tests-todo/2d.shadow.image.transparent.1.js new file mode 100644 index 0000000..9397db6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.image.transparent.1.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = '#f00'; +ctx.shadowOffsetY = 50; +ctx.drawImage(document.getElementById('transparent.png'), 0, -50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.image.transparent.2.js b/platforms/ios/www/test/tests-todo/2d.shadow.image.transparent.2.js new file mode 100644 index 0000000..7a5e570 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.image.transparent.2.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 50, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(50, 0, 50, 50); +ctx.shadowOffsetY = 50; +ctx.shadowColor = '#0f0'; +ctx.drawImage(document.getElementById('redtransparent.png'), 50, -50); +ctx.shadowColor = '#f00'; +ctx.drawImage(document.getElementById('redtransparent.png'), -50, -50); + +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.offset.negativeX.js b/platforms/ios/www/test/tests-todo/2d.shadow.offset.negativeX.js new file mode 100644 index 0000000..fd0a4a0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.offset.negativeX.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetX = -50; +ctx.fillRect(50, 0, 50, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.offset.negativeY.js b/platforms/ios/www/test/tests-todo/2d.shadow.offset.negativeY.js new file mode 100644 index 0000000..29054cc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.offset.negativeY.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetY = -25; +ctx.fillRect(0, 25, 100, 25); +_assertPixel(canvas, 50,12, 0,255,0,255, "50,12", "0,255,0,255"); +_assertPixel(canvas, 50,37, 0,255,0,255, "50,37", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.offset.positiveX.js b/platforms/ios/www/test/tests-todo/2d.shadow.offset.positiveX.js new file mode 100644 index 0000000..c07b951 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.offset.positiveX.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetX = 50; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.offset.positiveY.js b/platforms/ios/www/test/tests-todo/2d.shadow.offset.positiveY.js new file mode 100644 index 0000000..907c5ce --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.offset.positiveY.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetY = 25; +ctx.fillRect(0, 0, 100, 25); +_assertPixel(canvas, 50,12, 0,255,0,255, "50,12", "0,255,0,255"); +_assertPixel(canvas, 50,37, 0,255,0,255, "50,37", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.outside.js b/platforms/ios/www/test/tests-todo/2d.shadow.outside.js new file mode 100644 index 0000000..b87a9c6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.outside.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetX = 100; +ctx.fillRect(-100, 0, 25, 50); +ctx.shadowOffsetX = -100; +ctx.fillRect(175, 0, 25, 50); +ctx.shadowOffsetX = 0; +ctx.shadowOffsetY = 100; +ctx.fillRect(25, -100, 50, 25); +ctx.shadowOffsetY = -100; +ctx.fillRect(25, 125, 50, 25); +_assertPixel(canvas, 12,25, 0,255,0,255, "12,25", "0,255,0,255"); +_assertPixel(canvas, 87,25, 0,255,0,255, "87,25", "0,255,0,255"); +_assertPixel(canvas, 50,12, 0,255,0,255, "50,12", "0,255,0,255"); +_assertPixel(canvas, 50,37, 0,255,0,255, "50,37", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.pattern.alpha.js b/platforms/ios/www/test/tests-todo/2d.shadow.pattern.alpha.js new file mode 100644 index 0000000..b362073 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.pattern.alpha.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +var pattern = ctx.createPattern(document.getElementById('transparent50.png'), 'repeat'); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowOffsetY = 50; +ctx.shadowColor = '#00f'; +ctx.fillStyle = pattern; +ctx.fillRect(0, -50, 100, 50); + +_assertPixelApprox(canvas, 50,25, 127,0,127,255, "50,25", "127,0,127,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.pattern.basic.js b/platforms/ios/www/test/tests-todo/2d.shadow.pattern.basic.js new file mode 100644 index 0000000..5c15887 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.pattern.basic.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +var pattern = ctx.createPattern(document.getElementById('red.png'), 'repeat'); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetY = 50; +ctx.fillStyle = pattern; +ctx.fillRect(0, -50, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.pattern.transparent.1.js b/platforms/ios/www/test/tests-todo/2d.shadow.pattern.transparent.1.js new file mode 100644 index 0000000..721f77f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.pattern.transparent.1.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +var pattern = ctx.createPattern(document.getElementById('transparent.png'), 'repeat'); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = '#f00'; +ctx.shadowOffsetY = 50; +ctx.fillStyle = pattern; +ctx.fillRect(0, -50, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.pattern.transparent.2.js b/platforms/ios/www/test/tests-todo/2d.shadow.pattern.transparent.2.js new file mode 100644 index 0000000..acca923 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.pattern.transparent.2.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +var pattern = ctx.createPattern(document.getElementById('redtransparent.png'), 'repeat'); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +ctx.fillStyle = '#0f0'; +ctx.fillRect(50, 0, 50, 50); +ctx.shadowOffsetY = 50; +ctx.shadowColor = '#0f0'; +ctx.fillStyle = pattern; +ctx.fillRect(0, -50, 100, 50); + +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.stroke.basic.js b/platforms/ios/www/test/tests-todo/2d.shadow.stroke.basic.js new file mode 100644 index 0000000..7f5b18b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.stroke.basic.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetY = 50; +ctx.beginPath(); +ctx.lineWidth = 50; +ctx.moveTo(0, -25); +ctx.lineTo(100, -25); +ctx.stroke(); + +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.stroke.cap.1.js b/platforms/ios/www/test/tests-todo/2d.shadow.stroke.cap.1.js new file mode 100644 index 0000000..236e300 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.stroke.cap.1.js @@ -0,0 +1,22 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.shadowColor = '#f00'; +ctx.shadowOffsetY = 50; +ctx.beginPath(); +ctx.lineWidth = 50; +ctx.lineCap = 'butt'; +ctx.moveTo(-50, -25); +ctx.lineTo(0, -25); +ctx.moveTo(100, -25); +ctx.lineTo(150, -25); +ctx.stroke(); + +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.stroke.cap.2.js b/platforms/ios/www/test/tests-todo/2d.shadow.stroke.cap.2.js new file mode 100644 index 0000000..175d0fb --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.stroke.cap.2.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetY = 50; +ctx.beginPath(); +ctx.lineWidth = 50; +ctx.lineCap = 'square'; +ctx.moveTo(25, -25); +ctx.lineTo(75, -25); +ctx.stroke(); + +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.stroke.join.1.js b/platforms/ios/www/test/tests-todo/2d.shadow.stroke.join.1.js new file mode 100644 index 0000000..f719a77 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.stroke.join.1.js @@ -0,0 +1,22 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.shadowColor = '#f00'; +ctx.shadowOffsetX = 100; +ctx.lineWidth = 200; +ctx.lineJoin = 'bevel'; +ctx.beginPath(); +ctx.moveTo(-200, -50); +ctx.lineTo(-150, -50); +ctx.lineTo(-151, -100); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.stroke.join.2.js b/platforms/ios/www/test/tests-todo/2d.shadow.stroke.join.2.js new file mode 100644 index 0000000..4c27ff3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.stroke.join.2.js @@ -0,0 +1,24 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +ctx.fillStyle = '#0f0'; +ctx.fillRect(50, 0, 50, 50); +ctx.strokeStyle = '#f00'; +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetX = 100; +ctx.lineWidth = 200; +ctx.lineJoin = 'miter'; +ctx.beginPath(); +ctx.moveTo(-200, -50); +ctx.lineTo(-150, -50); +ctx.lineTo(-151, -100); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.stroke.join.3.js b/platforms/ios/www/test/tests-todo/2d.shadow.stroke.join.3.js new file mode 100644 index 0000000..304775b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.stroke.join.3.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.shadowColor = '#f00'; +ctx.shadowOffsetX = 100; +ctx.lineWidth = 200; +ctx.lineJoin = 'miter'; +ctx.miterLimit = 0.1; +ctx.beginPath(); +ctx.moveTo(-200, -50); +ctx.lineTo(-150, -50); +ctx.lineTo(-151, -100); // (not an exact right angle, to avoid some other bug in Firefox 3) +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.transform.1.js b/platforms/ios/www/test/tests-todo/2d.shadow.transform.1.js new file mode 100644 index 0000000..55b51ec --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.transform.1.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowOffsetY = 50; +ctx.shadowColor = '#0f0'; +ctx.translate(100, 100); +ctx.fillRect(-100, -150, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.shadow.transform.2.js b/platforms/ios/www/test/tests-todo/2d.shadow.transform.2.js new file mode 100644 index 0000000..fb3eece --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.shadow.transform.2.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowOffsetY = 50; +ctx.shadowColor = '#0f0'; +ctx.rotate(Math.PI) +ctx.fillRect(-100, 0, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.state.saverestore.bitmap.js b/platforms/ios/www/test/tests-todo/2d.state.saverestore.bitmap.js new file mode 100644 index 0000000..8f6f459 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.state.saverestore.bitmap.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.save(); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.restore(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.state.saverestore.clip.js b/platforms/ios/www/test/tests-todo/2d.state.saverestore.clip.js new file mode 100644 index 0000000..4375086 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.state.saverestore.clip.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.save(); +ctx.rect(0, 0, 1, 1); +ctx.clip(); +ctx.restore(); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.state.saverestore.fillStyle.js b/platforms/ios/www/test/tests-todo/2d.state.saverestore.fillStyle.js new file mode 100644 index 0000000..0e5d128 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.state.saverestore.fillStyle.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.fillStyle; +ctx.save(); +ctx.fillStyle = "#ff0000"; +ctx.restore(); +_assertSame(ctx.fillStyle, old, "ctx.fillStyle", "old"); + +// Also test that save() doesn't modify the values +ctx.fillStyle = "#ff0000"; +old = ctx.fillStyle; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against "#ff0000" +ctx.save(); +_assertSame(ctx.fillStyle, old, "ctx.fillStyle", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.state.saverestore.font.js b/platforms/ios/www/test/tests-todo/2d.state.saverestore.font.js new file mode 100644 index 0000000..c0d4e3a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.state.saverestore.font.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.font; +ctx.save(); +ctx.font = "25px serif"; +ctx.restore(); +_assertSame(ctx.font, old, "ctx.font", "old"); + +// Also test that save() doesn't modify the values +ctx.font = "25px serif"; +old = ctx.font; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against "25px serif" +ctx.save(); +_assertSame(ctx.font, old, "ctx.font", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.state.saverestore.globalAlpha.js b/platforms/ios/www/test/tests-todo/2d.state.saverestore.globalAlpha.js new file mode 100644 index 0000000..f3d6363 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.state.saverestore.globalAlpha.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.globalAlpha; +ctx.save(); +ctx.globalAlpha = 0.5; +ctx.restore(); +_assertSame(ctx.globalAlpha, old, "ctx.globalAlpha", "old"); + +// Also test that save() doesn't modify the values +ctx.globalAlpha = 0.5; +old = ctx.globalAlpha; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against 0.5 +ctx.save(); +_assertSame(ctx.globalAlpha, old, "ctx.globalAlpha", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.state.saverestore.globalCompositeOperation.js b/platforms/ios/www/test/tests-todo/2d.state.saverestore.globalCompositeOperation.js new file mode 100644 index 0000000..070093b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.state.saverestore.globalCompositeOperation.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.globalCompositeOperation; +ctx.save(); +ctx.globalCompositeOperation = "copy"; +ctx.restore(); +_assertSame(ctx.globalCompositeOperation, old, "ctx.globalCompositeOperation", "old"); + +// Also test that save() doesn't modify the values +ctx.globalCompositeOperation = "copy"; +old = ctx.globalCompositeOperation; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against "copy" +ctx.save(); +_assertSame(ctx.globalCompositeOperation, old, "ctx.globalCompositeOperation", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.state.saverestore.lineCap.js b/platforms/ios/www/test/tests-todo/2d.state.saverestore.lineCap.js new file mode 100644 index 0000000..c8c2cbd --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.state.saverestore.lineCap.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.lineCap; +ctx.save(); +ctx.lineCap = "round"; +ctx.restore(); +_assertSame(ctx.lineCap, old, "ctx.lineCap", "old"); + +// Also test that save() doesn't modify the values +ctx.lineCap = "round"; +old = ctx.lineCap; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against "round" +ctx.save(); +_assertSame(ctx.lineCap, old, "ctx.lineCap", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.state.saverestore.lineJoin.js b/platforms/ios/www/test/tests-todo/2d.state.saverestore.lineJoin.js new file mode 100644 index 0000000..fc1a51a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.state.saverestore.lineJoin.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.lineJoin; +ctx.save(); +ctx.lineJoin = "round"; +ctx.restore(); +_assertSame(ctx.lineJoin, old, "ctx.lineJoin", "old"); + +// Also test that save() doesn't modify the values +ctx.lineJoin = "round"; +old = ctx.lineJoin; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against "round" +ctx.save(); +_assertSame(ctx.lineJoin, old, "ctx.lineJoin", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.state.saverestore.lineWidth.js b/platforms/ios/www/test/tests-todo/2d.state.saverestore.lineWidth.js new file mode 100644 index 0000000..849a201 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.state.saverestore.lineWidth.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.lineWidth; +ctx.save(); +ctx.lineWidth = 0.5; +ctx.restore(); +_assertSame(ctx.lineWidth, old, "ctx.lineWidth", "old"); + +// Also test that save() doesn't modify the values +ctx.lineWidth = 0.5; +old = ctx.lineWidth; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against 0.5 +ctx.save(); +_assertSame(ctx.lineWidth, old, "ctx.lineWidth", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.state.saverestore.miterLimit.js b/platforms/ios/www/test/tests-todo/2d.state.saverestore.miterLimit.js new file mode 100644 index 0000000..9e27575 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.state.saverestore.miterLimit.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.miterLimit; +ctx.save(); +ctx.miterLimit = 0.5; +ctx.restore(); +_assertSame(ctx.miterLimit, old, "ctx.miterLimit", "old"); + +// Also test that save() doesn't modify the values +ctx.miterLimit = 0.5; +old = ctx.miterLimit; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against 0.5 +ctx.save(); +_assertSame(ctx.miterLimit, old, "ctx.miterLimit", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.state.saverestore.path.js b/platforms/ios/www/test/tests-todo/2d.state.saverestore.path.js new file mode 100644 index 0000000..cc7234b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.state.saverestore.path.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.save(); +ctx.rect(0, 0, 100, 50); +ctx.restore(); +ctx.fillStyle = '#0f0'; +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.state.saverestore.shadowBlur.js b/platforms/ios/www/test/tests-todo/2d.state.saverestore.shadowBlur.js new file mode 100644 index 0000000..e6b6345 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.state.saverestore.shadowBlur.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.shadowBlur; +ctx.save(); +ctx.shadowBlur = 5; +ctx.restore(); +_assertSame(ctx.shadowBlur, old, "ctx.shadowBlur", "old"); + +// Also test that save() doesn't modify the values +ctx.shadowBlur = 5; +old = ctx.shadowBlur; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against 5 +ctx.save(); +_assertSame(ctx.shadowBlur, old, "ctx.shadowBlur", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.state.saverestore.shadowColor.js b/platforms/ios/www/test/tests-todo/2d.state.saverestore.shadowColor.js new file mode 100644 index 0000000..ded4349 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.state.saverestore.shadowColor.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.shadowColor; +ctx.save(); +ctx.shadowColor = "#ff0000"; +ctx.restore(); +_assertSame(ctx.shadowColor, old, "ctx.shadowColor", "old"); + +// Also test that save() doesn't modify the values +ctx.shadowColor = "#ff0000"; +old = ctx.shadowColor; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against "#ff0000" +ctx.save(); +_assertSame(ctx.shadowColor, old, "ctx.shadowColor", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.state.saverestore.shadowOffsetX.js b/platforms/ios/www/test/tests-todo/2d.state.saverestore.shadowOffsetX.js new file mode 100644 index 0000000..e4eaf54 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.state.saverestore.shadowOffsetX.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.shadowOffsetX; +ctx.save(); +ctx.shadowOffsetX = 5; +ctx.restore(); +_assertSame(ctx.shadowOffsetX, old, "ctx.shadowOffsetX", "old"); + +// Also test that save() doesn't modify the values +ctx.shadowOffsetX = 5; +old = ctx.shadowOffsetX; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against 5 +ctx.save(); +_assertSame(ctx.shadowOffsetX, old, "ctx.shadowOffsetX", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.state.saverestore.shadowOffsetY.js b/platforms/ios/www/test/tests-todo/2d.state.saverestore.shadowOffsetY.js new file mode 100644 index 0000000..57066b8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.state.saverestore.shadowOffsetY.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.shadowOffsetY; +ctx.save(); +ctx.shadowOffsetY = 5; +ctx.restore(); +_assertSame(ctx.shadowOffsetY, old, "ctx.shadowOffsetY", "old"); + +// Also test that save() doesn't modify the values +ctx.shadowOffsetY = 5; +old = ctx.shadowOffsetY; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against 5 +ctx.save(); +_assertSame(ctx.shadowOffsetY, old, "ctx.shadowOffsetY", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.state.saverestore.stack.js b/platforms/ios/www/test/tests-todo/2d.state.saverestore.stack.js new file mode 100644 index 0000000..8847aa6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.state.saverestore.stack.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.lineWidth = 1; +ctx.save(); +ctx.lineWidth = 2; +ctx.save(); +ctx.lineWidth = 3; +_assertEqual(ctx.lineWidth, 3, "ctx.lineWidth", "3"); +ctx.restore(); +_assertEqual(ctx.lineWidth, 2, "ctx.lineWidth", "2"); +ctx.restore(); +_assertEqual(ctx.lineWidth, 1, "ctx.lineWidth", "1"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.state.saverestore.stackdepth.js b/platforms/ios/www/test/tests-todo/2d.state.saverestore.stackdepth.js new file mode 100644 index 0000000..5b38313 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.state.saverestore.stackdepth.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +var limit = 512; +for (var i = 1; i < limit; ++i) +{ + ctx.save(); + ctx.lineWidth = i; +} +for (var i = limit-1; i > 0; --i) +{ + _assertEqual(ctx.lineWidth, i, "ctx.lineWidth", "i"); + ctx.restore(); +} + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.state.saverestore.strokeStyle.js b/platforms/ios/www/test/tests-todo/2d.state.saverestore.strokeStyle.js new file mode 100644 index 0000000..22391e8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.state.saverestore.strokeStyle.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.strokeStyle; +ctx.save(); +ctx.strokeStyle = "#ff0000"; +ctx.restore(); +_assertSame(ctx.strokeStyle, old, "ctx.strokeStyle", "old"); + +// Also test that save() doesn't modify the values +ctx.strokeStyle = "#ff0000"; +old = ctx.strokeStyle; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against "#ff0000" +ctx.save(); +_assertSame(ctx.strokeStyle, old, "ctx.strokeStyle", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.state.saverestore.textAlign.js b/platforms/ios/www/test/tests-todo/2d.state.saverestore.textAlign.js new file mode 100644 index 0000000..9c88e00 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.state.saverestore.textAlign.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.textAlign; +ctx.save(); +ctx.textAlign = "center"; +ctx.restore(); +_assertSame(ctx.textAlign, old, "ctx.textAlign", "old"); + +// Also test that save() doesn't modify the values +ctx.textAlign = "center"; +old = ctx.textAlign; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against "center" +ctx.save(); +_assertSame(ctx.textAlign, old, "ctx.textAlign", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.state.saverestore.textBaseline.js b/platforms/ios/www/test/tests-todo/2d.state.saverestore.textBaseline.js new file mode 100644 index 0000000..0e2e64e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.state.saverestore.textBaseline.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.textBaseline; +ctx.save(); +ctx.textBaseline = "bottom"; +ctx.restore(); +_assertSame(ctx.textBaseline, old, "ctx.textBaseline", "old"); + +// Also test that save() doesn't modify the values +ctx.textBaseline = "bottom"; +old = ctx.textBaseline; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against "bottom" +ctx.save(); +_assertSame(ctx.textBaseline, old, "ctx.textBaseline", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.state.saverestore.transformation.js b/platforms/ios/www/test/tests-todo/2d.state.saverestore.transformation.js new file mode 100644 index 0000000..4050b9b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.state.saverestore.transformation.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.save(); +ctx.translate(200, 0); +ctx.restore(); +ctx.fillStyle = '#f00'; +ctx.fillRect(-200, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.state.saverestore.underflow.js b/platforms/ios/www/test/tests-todo/2d.state.saverestore.underflow.js new file mode 100644 index 0000000..64aff9c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.state.saverestore.underflow.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +for (var i = 0; i < 16; ++i) + ctx.restore(); +ctx.lineWidth = 0.5; +ctx.restore(); +_assertEqual(ctx.lineWidth, 0.5, "ctx.lineWidth", "0.5"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.strokeRect.basic.js b/platforms/ios/www/test/tests-todo/2d.strokeRect.basic.js new file mode 100644 index 0000000..e64fb73 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.strokeRect.basic.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 50; +ctx.strokeRect(25, 24, 50, 2); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.strokeRect.clip.js b/platforms/ios/www/test/tests-todo/2d.strokeRect.clip.js new file mode 100644 index 0000000..9315308 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.strokeRect.clip.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.beginPath(); +ctx.rect(0, 0, 16, 16); +ctx.clip(); + +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 50; +ctx.strokeRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 16, 16); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.strokeRect.globalalpha.js b/platforms/ios/www/test/tests-todo/2d.strokeRect.globalalpha.js new file mode 100644 index 0000000..faed405 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.strokeRect.globalalpha.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.globalAlpha = 0; +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 50; +ctx.strokeRect(25, 24, 50, 2); +_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.strokeRect.globalcomposite.js b/platforms/ios/www/test/tests-todo/2d.strokeRect.globalcomposite.js new file mode 100644 index 0000000..8c2f596 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.strokeRect.globalcomposite.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.globalCompositeOperation = 'source-in'; +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 50; +ctx.strokeRect(25, 24, 50, 2); +_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.strokeRect.negative.js b/platforms/ios/www/test/tests-todo/2d.strokeRect.negative.js new file mode 100644 index 0000000..337dbb3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.strokeRect.negative.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 25; +ctx.strokeRect(12, 12, 26, 1); +ctx.strokeRect(88, 12, -26, 1); +ctx.strokeRect(12, 38, 26, -1); +ctx.strokeRect(88, 38, -26, -1); +_assertPixel(canvas, 25,12, 0,255,0,255, "25,12", "0,255,0,255"); +_assertPixel(canvas, 75,12, 0,255,0,255, "75,12", "0,255,0,255"); +_assertPixel(canvas, 25,37, 0,255,0,255, "25,37", "0,255,0,255"); +_assertPixel(canvas, 75,37, 0,255,0,255, "75,37", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.strokeRect.nonfinite.js b/platforms/ios/www/test/tests-todo/2d.strokeRect.nonfinite.js new file mode 100644 index 0000000..334e9f6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.strokeRect.nonfinite.js @@ -0,0 +1,35 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 150; +ctx.strokeRect(Infinity, 0, 100, 50); +ctx.strokeRect(-Infinity, 0, 100, 50); +ctx.strokeRect(NaN, 0, 100, 50); +ctx.strokeRect(0, Infinity, 100, 50); +ctx.strokeRect(0, -Infinity, 100, 50); +ctx.strokeRect(0, NaN, 100, 50); +ctx.strokeRect(0, 0, Infinity, 50); +ctx.strokeRect(0, 0, -Infinity, 50); +ctx.strokeRect(0, 0, NaN, 50); +ctx.strokeRect(0, 0, 100, Infinity); +ctx.strokeRect(0, 0, 100, -Infinity); +ctx.strokeRect(0, 0, 100, NaN); +ctx.strokeRect(Infinity, Infinity, 100, 50); +ctx.strokeRect(Infinity, Infinity, Infinity, 50); +ctx.strokeRect(Infinity, Infinity, Infinity, Infinity); +ctx.strokeRect(Infinity, Infinity, 100, Infinity); +ctx.strokeRect(Infinity, 0, Infinity, 50); +ctx.strokeRect(Infinity, 0, Infinity, Infinity); +ctx.strokeRect(Infinity, 0, 100, Infinity); +ctx.strokeRect(0, Infinity, Infinity, 50); +ctx.strokeRect(0, Infinity, Infinity, Infinity); +ctx.strokeRect(0, Infinity, 100, Infinity); +ctx.strokeRect(0, 0, Infinity, Infinity); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.strokeRect.path.js b/platforms/ios/www/test/tests-todo/2d.strokeRect.path.js new file mode 100644 index 0000000..3ed7a86 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.strokeRect.path.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.beginPath(); +ctx.rect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 5; +ctx.strokeRect(0, 0, 16, 16); +ctx.fillStyle = '#0f0'; +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.strokeRect.shadow.js b/platforms/ios/www/test/tests-todo/2d.strokeRect.shadow.js new file mode 100644 index 0000000..6e10988 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.strokeRect.shadow.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.shadowColor = '#0f0'; +ctx.shadowBlur = 0; +ctx.shadowOffsetX = 0; +ctx.shadowOffsetY = 50; +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 50; +ctx.strokeRect(0, -75, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.strokeRect.transform.js b/platforms/ios/www/test/tests-todo/2d.strokeRect.transform.js new file mode 100644 index 0000000..9835d7c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.strokeRect.transform.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.scale(10, 10); +ctx.translate(0, 5); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 5; +ctx.strokeRect(2.5, -2.6, 5, 0.2); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.strokeRect.zero.1.js b/platforms/ios/www/test/tests-todo/2d.strokeRect.zero.1.js new file mode 100644 index 0000000..6ef2399 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.strokeRect.zero.1.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 250; +ctx.strokeRect(50, 25, 0, 0); +_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.strokeRect.zero.2.js b/platforms/ios/www/test/tests-todo/2d.strokeRect.zero.2.js new file mode 100644 index 0000000..14315e1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.strokeRect.zero.2.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 250; +ctx.lineCap = 'round'; +ctx.lineJoin = 'round'; +ctx.strokeRect(50, 25, 0, 0); +_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.strokeRect.zero.3.js b/platforms/ios/www/test/tests-todo/2d.strokeRect.zero.3.js new file mode 100644 index 0000000..759224f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.strokeRect.zero.3.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 50; +ctx.strokeRect(0, 25, 100, 0); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.strokeRect.zero.4.js b/platforms/ios/www/test/tests-todo/2d.strokeRect.zero.4.js new file mode 100644 index 0000000..11461dc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.strokeRect.zero.4.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 250; +ctx.lineCap = 'round'; +ctx.strokeRect(100, 25, 100, 0); +_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.strokeRect.zero.5.js b/platforms/ios/www/test/tests-todo/2d.strokeRect.zero.5.js new file mode 100644 index 0000000..5fb410d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.strokeRect.zero.5.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 250; +ctx.lineJoin = 'round'; +ctx.strokeRect(100, 25, 100, 0); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.strokeStyle.default.js b/platforms/ios/www/test/tests-todo/2d.strokeStyle.default.js new file mode 100644 index 0000000..7f80eb8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.strokeStyle.default.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertEqual(ctx.strokeStyle, '#000000', "ctx.strokeStyle", "'#000000'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.align.default.js b/platforms/ios/www/test/tests-todo/2d.text.align.default.js new file mode 100644 index 0000000..172f8cb --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.align.default.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(ctx.textAlign, 'start', "ctx.textAlign", "'start'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.align.invalid.js b/platforms/ios/www/test/tests-todo/2d.text.align.invalid.js new file mode 100644 index 0000000..95f9e13 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.align.invalid.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +ctx.textAlign = 'start'; +ctx.textAlign = 'bogus'; +_assertSame(ctx.textAlign, 'start', "ctx.textAlign", "'start'"); + +ctx.textAlign = 'start'; +ctx.textAlign = 'END'; +_assertSame(ctx.textAlign, 'start', "ctx.textAlign", "'start'"); + +ctx.textAlign = 'start'; +ctx.textAlign = 'end '; +_assertSame(ctx.textAlign, 'start', "ctx.textAlign", "'start'"); + +ctx.textAlign = 'start'; +ctx.textAlign = 'end\0'; +_assertSame(ctx.textAlign, 'start', "ctx.textAlign", "'start'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.align.valid.js b/platforms/ios/www/test/tests-todo/2d.text.align.valid.js new file mode 100644 index 0000000..c59a065 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.align.valid.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.textAlign = 'start'; +_assertSame(ctx.textAlign, 'start', "ctx.textAlign", "'start'"); + +ctx.textAlign = 'end'; +_assertSame(ctx.textAlign, 'end', "ctx.textAlign", "'end'"); + +ctx.textAlign = 'left'; +_assertSame(ctx.textAlign, 'left', "ctx.textAlign", "'left'"); + +ctx.textAlign = 'right'; +_assertSame(ctx.textAlign, 'right', "ctx.textAlign", "'right'"); + +ctx.textAlign = 'center'; +_assertSame(ctx.textAlign, 'center', "ctx.textAlign", "'center'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.baseline.default.js b/platforms/ios/www/test/tests-todo/2d.text.baseline.default.js new file mode 100644 index 0000000..c6b84c9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.baseline.default.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(ctx.textBaseline, 'alphabetic', "ctx.textBaseline", "'alphabetic'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.baseline.invalid.js b/platforms/ios/www/test/tests-todo/2d.text.baseline.invalid.js new file mode 100644 index 0000000..3002e28 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.baseline.invalid.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +ctx.textBaseline = 'top'; +ctx.textBaseline = 'bogus'; +_assertSame(ctx.textBaseline, 'top', "ctx.textBaseline", "'top'"); + +ctx.textBaseline = 'top'; +ctx.textBaseline = 'MIDDLE'; +_assertSame(ctx.textBaseline, 'top', "ctx.textBaseline", "'top'"); + +ctx.textBaseline = 'top'; +ctx.textBaseline = 'middle '; +_assertSame(ctx.textBaseline, 'top', "ctx.textBaseline", "'top'"); + +ctx.textBaseline = 'top'; +ctx.textBaseline = 'middle\0'; +_assertSame(ctx.textBaseline, 'top', "ctx.textBaseline", "'top'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.baseline.valid.js b/platforms/ios/www/test/tests-todo/2d.text.baseline.valid.js new file mode 100644 index 0000000..406d664 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.baseline.valid.js @@ -0,0 +1,22 @@ +_addTest(function(canvas, ctx) { + +ctx.textBaseline = 'top'; +_assertSame(ctx.textBaseline, 'top', "ctx.textBaseline", "'top'"); + +ctx.textBaseline = 'hanging'; +_assertSame(ctx.textBaseline, 'hanging', "ctx.textBaseline", "'hanging'"); + +ctx.textBaseline = 'middle'; +_assertSame(ctx.textBaseline, 'middle', "ctx.textBaseline", "'middle'"); + +ctx.textBaseline = 'alphabetic'; +_assertSame(ctx.textBaseline, 'alphabetic', "ctx.textBaseline", "'alphabetic'"); + +ctx.textBaseline = 'ideographic'; +_assertSame(ctx.textBaseline, 'ideographic', "ctx.textBaseline", "'ideographic'"); + +ctx.textBaseline = 'bottom'; +_assertSame(ctx.textBaseline, 'bottom', "ctx.textBaseline", "'bottom'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.draw.align.center.js b/platforms/ios/www/test/tests-todo/2d.text.draw.align.center.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.draw.align.center.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.draw.align.end.ltr.js b/platforms/ios/www/test/tests-todo/2d.text.draw.align.end.ltr.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.draw.align.end.ltr.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.draw.align.end.rtl.js b/platforms/ios/www/test/tests-todo/2d.text.draw.align.end.rtl.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.draw.align.end.rtl.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.draw.align.left.js b/platforms/ios/www/test/tests-todo/2d.text.draw.align.left.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.draw.align.left.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.draw.align.right.js b/platforms/ios/www/test/tests-todo/2d.text.draw.align.right.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.draw.align.right.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.draw.align.start.ltr.js b/platforms/ios/www/test/tests-todo/2d.text.draw.align.start.ltr.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.draw.align.start.ltr.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.draw.align.start.rtl.js b/platforms/ios/www/test/tests-todo/2d.text.draw.align.start.rtl.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.draw.align.start.rtl.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.draw.baseline.alphabetic.js b/platforms/ios/www/test/tests-todo/2d.text.draw.baseline.alphabetic.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.draw.baseline.alphabetic.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.draw.baseline.bottom.js b/platforms/ios/www/test/tests-todo/2d.text.draw.baseline.bottom.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.draw.baseline.bottom.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.draw.baseline.hanging.js b/platforms/ios/www/test/tests-todo/2d.text.draw.baseline.hanging.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.draw.baseline.hanging.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.draw.baseline.ideographic.js b/platforms/ios/www/test/tests-todo/2d.text.draw.baseline.ideographic.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.draw.baseline.ideographic.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.draw.baseline.middle.js b/platforms/ios/www/test/tests-todo/2d.text.draw.baseline.middle.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.draw.baseline.middle.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.draw.baseline.top.js b/platforms/ios/www/test/tests-todo/2d.text.draw.baseline.top.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.draw.baseline.top.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.draw.fill.basic.js b/platforms/ios/www/test/tests-todo/2d.text.draw.fill.basic.js new file mode 100644 index 0000000..0319659 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.draw.fill.basic.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#000'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.strokeStyle = '#f00'; +ctx.font = '35px Arial, sans-serif'; +ctx.fillText('PASS', 5, 35); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.draw.fill.maxWidth.bound.js b/platforms/ios/www/test/tests-todo/2d.text.draw.fill.maxWidth.bound.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.draw.fill.maxWidth.bound.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.draw.fill.maxWidth.fontface.js b/platforms/ios/www/test/tests-todo/2d.text.draw.fill.maxWidth.fontface.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.draw.fill.maxWidth.fontface.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.draw.fill.maxWidth.large.js b/platforms/ios/www/test/tests-todo/2d.text.draw.fill.maxWidth.large.js new file mode 100644 index 0000000..e168e3e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.draw.fill.maxWidth.large.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#000'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.font = '35px Arial, sans-serif'; +ctx.fillText('PASS', 5, 35, 200); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.draw.fill.maxWidth.small.js b/platforms/ios/www/test/tests-todo/2d.text.draw.fill.maxWidth.small.js new file mode 100644 index 0000000..3d8cd0b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.draw.fill.maxWidth.small.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.font = '35px Arial, sans-serif'; +ctx.fillText('fail fail fail fail fail', -100, 35, 90); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.draw.fill.maxWidth.zero.js b/platforms/ios/www/test/tests-todo/2d.text.draw.fill.maxWidth.zero.js new file mode 100644 index 0000000..26c430d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.draw.fill.maxWidth.zero.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.font = '35px Arial, sans-serif'; +ctx.fillText('fail fail fail fail fail', 5, 35, 0); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.draw.fill.rtl.js b/platforms/ios/www/test/tests-todo/2d.text.draw.fill.rtl.js new file mode 100644 index 0000000..da865fb --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.draw.fill.rtl.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#000'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.strokeStyle = '#f00'; +ctx.font = '35px Arial, sans-serif'; +ctx.fillText('\u202eFAIL \xa0 \xa0 SSAP', 5, 35); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.draw.fill.unaffected.js b/platforms/ios/www/test/tests-todo/2d.text.draw.fill.unaffected.js new file mode 100644 index 0000000..10b63bd --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.draw.fill.unaffected.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.moveTo(0, 0); +ctx.lineTo(100, 0); + +ctx.font = '35px Arial, sans-serif'; +ctx.fillText('FAIL', 5, 35); + +ctx.lineTo(100, 50); +ctx.lineTo(0, 50); +ctx.fillStyle = '#0f0'; +ctx.fill(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 5,45, 0,255,0,255, "5,45", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.draw.fontface.js b/platforms/ios/www/test/tests-todo/2d.text.draw.fontface.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.draw.fontface.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.draw.fontface.notinpage.js b/platforms/ios/www/test/tests-todo/2d.text.draw.fontface.notinpage.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.draw.fontface.notinpage.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.draw.fontface.repeat.js b/platforms/ios/www/test/tests-todo/2d.text.draw.fontface.repeat.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.draw.fontface.repeat.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.draw.kern.consistent.js b/platforms/ios/www/test/tests-todo/2d.text.draw.kern.consistent.js new file mode 100644 index 0000000..678ad31 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.draw.kern.consistent.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 3; +ctx.font = '20px Arial, sans-serif'; +ctx.fillText('VAVAVAVAVAVAVA', -50, 25); +ctx.fillText('ToToToToToToTo', -50, 45); +ctx.strokeText('VAVAVAVAVAVAVA', -50, 25); +ctx.strokeText('ToToToToToToTo', -50, 45); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.draw.space.basic.js b/platforms/ios/www/test/tests-todo/2d.text.draw.space.basic.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.draw.space.basic.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.draw.space.collapse.end.js b/platforms/ios/www/test/tests-todo/2d.text.draw.space.collapse.end.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.draw.space.collapse.end.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.draw.space.collapse.nonspace.js b/platforms/ios/www/test/tests-todo/2d.text.draw.space.collapse.nonspace.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.draw.space.collapse.nonspace.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.draw.space.collapse.other.js b/platforms/ios/www/test/tests-todo/2d.text.draw.space.collapse.other.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.draw.space.collapse.other.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.draw.space.collapse.space.js b/platforms/ios/www/test/tests-todo/2d.text.draw.space.collapse.space.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.draw.space.collapse.space.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.draw.space.collapse.start.js b/platforms/ios/www/test/tests-todo/2d.text.draw.space.collapse.start.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.draw.space.collapse.start.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.draw.stroke.basic.js b/platforms/ios/www/test/tests-todo/2d.text.draw.stroke.basic.js new file mode 100644 index 0000000..e876dba --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.draw.stroke.basic.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#000'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.fillStyle = '#f00'; +ctx.lineWidth = 1; +ctx.font = '35px Arial, sans-serif'; +ctx.strokeText('PASS', 5, 35); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.draw.stroke.unaffected.js b/platforms/ios/www/test/tests-todo/2d.text.draw.stroke.unaffected.js new file mode 100644 index 0000000..ae555d6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.draw.stroke.unaffected.js @@ -0,0 +1,22 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.moveTo(0, 0); +ctx.lineTo(100, 0); + +ctx.font = '35px Arial, sans-serif'; +ctx.strokeStyle = '#f00'; +ctx.strokeText('FAIL', 5, 35); + +ctx.lineTo(100, 50); +ctx.lineTo(0, 50); +ctx.fillStyle = '#0f0'; +ctx.fill(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 5,45, 0,255,0,255, "5,45", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.font.default.js b/platforms/ios/www/test/tests-todo/2d.text.font.default.js new file mode 100644 index 0000000..80821d0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.font.default.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(ctx.font, '10px sans-serif', "ctx.font", "'10px sans-serif'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.font.parse.basic.js b/platforms/ios/www/test/tests-todo/2d.text.font.parse.basic.js new file mode 100644 index 0000000..24d505a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.font.parse.basic.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.font = '20px serif'; +_assertSame(ctx.font, '20px serif', "ctx.font", "'20px serif'"); + +ctx.font = '20PX SERIF'; +_assertSame(ctx.font, '20px serif', "ctx.font", "'20px serif'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.font.parse.complex.js b/platforms/ios/www/test/tests-todo/2d.text.font.parse.complex.js new file mode 100644 index 0000000..0d4449b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.font.parse.complex.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +ctx.font = 'small-caps italic 400 12px/2 Unknown Font, sans-serif'; +_assertSame(ctx.font, 'italic small-caps 12px "Unknown Font", sans-serif', "ctx.font", "'italic small-caps 12px \"Unknown Font\", sans-serif'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.font.parse.invalid.js b/platforms/ios/www/test/tests-todo/2d.text.font.parse.invalid.js new file mode 100644 index 0000000..6e8a8c2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.font.parse.invalid.js @@ -0,0 +1,31 @@ +_addTest(function(canvas, ctx) { + +ctx.font = '20px serif'; +_assertSame(ctx.font, '20px serif', "ctx.font", "'20px serif'"); + +ctx.font = '20px serif'; +ctx.font = 'bogus'; +_assertSame(ctx.font, '20px serif', "ctx.font", "'20px serif'"); + +ctx.font = '20px serif'; +ctx.font = 'inherit'; +_assertSame(ctx.font, '20px serif', "ctx.font", "'20px serif'"); + +ctx.font = '20px serif'; +ctx.font = '10px {bogus}'; +_assertSame(ctx.font, '20px serif', "ctx.font", "'20px serif'"); + +ctx.font = '20px serif'; +ctx.font = '10px initial'; +_assertSame(ctx.font, '20px serif', "ctx.font", "'20px serif'"); + +ctx.font = '20px serif'; +ctx.font = '10px default'; +_assertSame(ctx.font, '20px serif', "ctx.font", "'20px serif'"); + +ctx.font = '20px serif'; +ctx.font = '10px inherit'; +_assertSame(ctx.font, '20px serif', "ctx.font", "'20px serif'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.font.parse.size.percentage.default.js b/platforms/ios/www/test/tests-todo/2d.text.font.parse.size.percentage.default.js new file mode 100644 index 0000000..fcf9e9f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.font.parse.size.percentage.default.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +var ctx2 = canvas2.getContext('2d'); +ctx.font = '1000% serif'; +_assertSame(ctx.font, '100px serif', "ctx.font", "'100px serif'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.font.parse.size.percentage.js b/platforms/ios/www/test/tests-todo/2d.text.font.parse.size.percentage.js new file mode 100644 index 0000000..9baeb5f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.font.parse.size.percentage.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +ctx.font = '50% serif'; +_assertSame(ctx.font, '72px serif', "ctx.font", "'72px serif'"); +canvas.setAttribute('style', 'font-size: 100px'); +_assertSame(ctx.font, '72px serif', "ctx.font", "'72px serif'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.font.parse.system.js b/platforms/ios/www/test/tests-todo/2d.text.font.parse.system.js new file mode 100644 index 0000000..844742e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.font.parse.system.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +ctx.font = 'message-box'; +_assertDifferent(ctx.font, 'message-box', "ctx.font", "'message-box'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.measure.width.basic.js b/platforms/ios/www/test/tests-todo/2d.text.measure.width.basic.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.measure.width.basic.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.measure.width.empty.js b/platforms/ios/www/test/tests-todo/2d.text.measure.width.empty.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.measure.width.empty.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.text.measure.width.space.js b/platforms/ios/www/test/tests-todo/2d.text.measure.width.space.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.text.measure.width.space.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.transformation.order.js b/platforms/ios/www/test/tests-todo/2d.transformation.order.js new file mode 100644 index 0000000..0bc0790 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.transformation.order.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.scale(2, 1); +ctx.rotate(Math.PI / 2); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, -50, 50, 50); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.transformation.rotate.direction.js b/platforms/ios/www/test/tests-todo/2d.transformation.rotate.direction.js new file mode 100644 index 0000000..e5e31aa --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.transformation.rotate.direction.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.rotate(Math.PI / 2); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, -100, 50, 100); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.transformation.rotate.nonfinite.js b/platforms/ios/www/test/tests-todo/2d.transformation.rotate.nonfinite.js new file mode 100644 index 0000000..20ecf87 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.transformation.rotate.nonfinite.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.translate(100, 10); +ctx.rotate(Infinity); +ctx.rotate(-Infinity); +ctx.rotate(NaN); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(-100, -10, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.transformation.rotate.radians.js b/platforms/ios/www/test/tests-todo/2d.transformation.rotate.radians.js new file mode 100644 index 0000000..6fe1650 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.transformation.rotate.radians.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.rotate(Math.PI); // should fail obviously if this is 3.1 degrees +ctx.fillStyle = '#0f0'; +ctx.fillRect(-100, -50, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.transformation.rotate.wrap.js b/platforms/ios/www/test/tests-todo/2d.transformation.rotate.wrap.js new file mode 100644 index 0000000..a079b58 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.transformation.rotate.wrap.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.rotate(Math.PI * (1 + 4096)); // == pi (mod 2*pi) +// We need about pi +/- 0.001 in order to get correct-looking results +// 32-bit floats can store pi*4097 with precision 2^-10, so that should +// be safe enough on reasonable implementations +ctx.fillStyle = '#0f0'; +ctx.fillRect(-100, -50, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,2, 0,255,0,255, "98,2", "0,255,0,255"); +_assertPixel(canvas, 98,47, 0,255,0,255, "98,47", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.transformation.rotate.wrapnegative.js b/platforms/ios/www/test/tests-todo/2d.transformation.rotate.wrapnegative.js new file mode 100644 index 0000000..58a6015 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.transformation.rotate.wrapnegative.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.rotate(-Math.PI * (1 + 4096)); +ctx.fillStyle = '#0f0'; +ctx.fillRect(-100, -50, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,2, 0,255,0,255, "98,2", "0,255,0,255"); +_assertPixel(canvas, 98,47, 0,255,0,255, "98,47", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.transformation.rotate.zero.js b/platforms/ios/www/test/tests-todo/2d.transformation.rotate.zero.js new file mode 100644 index 0000000..d752131 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.transformation.rotate.zero.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.rotate(0); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.transformation.scale.basic.js b/platforms/ios/www/test/tests-todo/2d.transformation.scale.basic.js new file mode 100644 index 0000000..7e7ef5b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.transformation.scale.basic.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.scale(2, 4); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 50, 12.5); +_assertPixel(canvas, 90,40, 0,255,0,255, "90,40", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.transformation.scale.large.js b/platforms/ios/www/test/tests-todo/2d.transformation.scale.large.js new file mode 100644 index 0000000..8cdc2b3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.transformation.scale.large.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.scale(1e5, 1e5); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 1, 1); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.transformation.scale.multiple.js b/platforms/ios/www/test/tests-todo/2d.transformation.scale.multiple.js new file mode 100644 index 0000000..4f2345f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.transformation.scale.multiple.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.scale(Math.sqrt(2), Math.sqrt(2)); +ctx.scale(Math.sqrt(2), Math.sqrt(2)); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 50, 25); +_assertPixel(canvas, 90,40, 0,255,0,255, "90,40", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.transformation.scale.negative.js b/platforms/ios/www/test/tests-todo/2d.transformation.scale.negative.js new file mode 100644 index 0000000..c25972b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.transformation.scale.negative.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.save(); +ctx.scale(-1, 1); +ctx.fillStyle = '#0f0'; +ctx.fillRect(-50, 0, 50, 50); +ctx.restore(); + +ctx.save(); +ctx.scale(1, -1); +ctx.fillStyle = '#0f0'; +ctx.fillRect(50, -50, 50, 50); +ctx.restore(); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.transformation.scale.nonfinite.js b/platforms/ios/www/test/tests-todo/2d.transformation.scale.nonfinite.js new file mode 100644 index 0000000..7cdc79f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.transformation.scale.nonfinite.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.translate(100, 10); +ctx.scale(Infinity, 0.1); +ctx.scale(-Infinity, 0.1); +ctx.scale(NaN, 0.1); +ctx.scale(0.1, Infinity); +ctx.scale(0.1, -Infinity); +ctx.scale(0.1, NaN); +ctx.scale(Infinity, Infinity); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(-100, -10, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.transformation.scale.zero.js b/platforms/ios/www/test/tests-todo/2d.transformation.scale.zero.js new file mode 100644 index 0000000..2d7daf1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.transformation.scale.zero.js @@ -0,0 +1,26 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.save(); +ctx.translate(50, 0); +ctx.scale(0, 1); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.restore(); + +ctx.save(); +ctx.translate(0, 25); +ctx.scale(1, 0); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.restore(); + +// Firefox has a bug where it renders the canvas as empty and toDataURL throws an exception +canvas.toDataURL(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.transformation.setTransform.multiple.js b/platforms/ios/www/test/tests-todo/2d.transformation.setTransform.multiple.js new file mode 100644 index 0000000..28baaaf --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.transformation.setTransform.multiple.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.setTransform(1/2,0, 0,1/2, 0,0); +ctx.setTransform(2,0, 0,2, 0,0); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 50, 25); +_assertPixel(canvas, 75,35, 0,255,0,255, "75,35", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.transformation.setTransform.nonfinite.js b/platforms/ios/www/test/tests-todo/2d.transformation.setTransform.nonfinite.js new file mode 100644 index 0000000..381afd7 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.transformation.setTransform.nonfinite.js @@ -0,0 +1,89 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.translate(100, 10); +ctx.setTransform(Infinity, 0, 0, 0, 0, 0); +ctx.setTransform(-Infinity, 0, 0, 0, 0, 0); +ctx.setTransform(NaN, 0, 0, 0, 0, 0); +ctx.setTransform(0, Infinity, 0, 0, 0, 0); +ctx.setTransform(0, -Infinity, 0, 0, 0, 0); +ctx.setTransform(0, NaN, 0, 0, 0, 0); +ctx.setTransform(0, 0, Infinity, 0, 0, 0); +ctx.setTransform(0, 0, -Infinity, 0, 0, 0); +ctx.setTransform(0, 0, NaN, 0, 0, 0); +ctx.setTransform(0, 0, 0, Infinity, 0, 0); +ctx.setTransform(0, 0, 0, -Infinity, 0, 0); +ctx.setTransform(0, 0, 0, NaN, 0, 0); +ctx.setTransform(0, 0, 0, 0, Infinity, 0); +ctx.setTransform(0, 0, 0, 0, -Infinity, 0); +ctx.setTransform(0, 0, 0, 0, NaN, 0); +ctx.setTransform(0, 0, 0, 0, 0, Infinity); +ctx.setTransform(0, 0, 0, 0, 0, -Infinity); +ctx.setTransform(0, 0, 0, 0, 0, NaN); +ctx.setTransform(Infinity, Infinity, 0, 0, 0, 0); +ctx.setTransform(Infinity, Infinity, Infinity, 0, 0, 0); +ctx.setTransform(Infinity, Infinity, Infinity, Infinity, 0, 0); +ctx.setTransform(Infinity, Infinity, Infinity, Infinity, Infinity, 0); +ctx.setTransform(Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); +ctx.setTransform(Infinity, Infinity, Infinity, Infinity, 0, Infinity); +ctx.setTransform(Infinity, Infinity, Infinity, 0, Infinity, 0); +ctx.setTransform(Infinity, Infinity, Infinity, 0, Infinity, Infinity); +ctx.setTransform(Infinity, Infinity, Infinity, 0, 0, Infinity); +ctx.setTransform(Infinity, Infinity, 0, Infinity, 0, 0); +ctx.setTransform(Infinity, Infinity, 0, Infinity, Infinity, 0); +ctx.setTransform(Infinity, Infinity, 0, Infinity, Infinity, Infinity); +ctx.setTransform(Infinity, Infinity, 0, Infinity, 0, Infinity); +ctx.setTransform(Infinity, Infinity, 0, 0, Infinity, 0); +ctx.setTransform(Infinity, Infinity, 0, 0, Infinity, Infinity); +ctx.setTransform(Infinity, Infinity, 0, 0, 0, Infinity); +ctx.setTransform(Infinity, 0, Infinity, 0, 0, 0); +ctx.setTransform(Infinity, 0, Infinity, Infinity, 0, 0); +ctx.setTransform(Infinity, 0, Infinity, Infinity, Infinity, 0); +ctx.setTransform(Infinity, 0, Infinity, Infinity, Infinity, Infinity); +ctx.setTransform(Infinity, 0, Infinity, Infinity, 0, Infinity); +ctx.setTransform(Infinity, 0, Infinity, 0, Infinity, 0); +ctx.setTransform(Infinity, 0, Infinity, 0, Infinity, Infinity); +ctx.setTransform(Infinity, 0, Infinity, 0, 0, Infinity); +ctx.setTransform(Infinity, 0, 0, Infinity, 0, 0); +ctx.setTransform(Infinity, 0, 0, Infinity, Infinity, 0); +ctx.setTransform(Infinity, 0, 0, Infinity, Infinity, Infinity); +ctx.setTransform(Infinity, 0, 0, Infinity, 0, Infinity); +ctx.setTransform(Infinity, 0, 0, 0, Infinity, 0); +ctx.setTransform(Infinity, 0, 0, 0, Infinity, Infinity); +ctx.setTransform(Infinity, 0, 0, 0, 0, Infinity); +ctx.setTransform(0, Infinity, Infinity, 0, 0, 0); +ctx.setTransform(0, Infinity, Infinity, Infinity, 0, 0); +ctx.setTransform(0, Infinity, Infinity, Infinity, Infinity, 0); +ctx.setTransform(0, Infinity, Infinity, Infinity, Infinity, Infinity); +ctx.setTransform(0, Infinity, Infinity, Infinity, 0, Infinity); +ctx.setTransform(0, Infinity, Infinity, 0, Infinity, 0); +ctx.setTransform(0, Infinity, Infinity, 0, Infinity, Infinity); +ctx.setTransform(0, Infinity, Infinity, 0, 0, Infinity); +ctx.setTransform(0, Infinity, 0, Infinity, 0, 0); +ctx.setTransform(0, Infinity, 0, Infinity, Infinity, 0); +ctx.setTransform(0, Infinity, 0, Infinity, Infinity, Infinity); +ctx.setTransform(0, Infinity, 0, Infinity, 0, Infinity); +ctx.setTransform(0, Infinity, 0, 0, Infinity, 0); +ctx.setTransform(0, Infinity, 0, 0, Infinity, Infinity); +ctx.setTransform(0, Infinity, 0, 0, 0, Infinity); +ctx.setTransform(0, 0, Infinity, Infinity, 0, 0); +ctx.setTransform(0, 0, Infinity, Infinity, Infinity, 0); +ctx.setTransform(0, 0, Infinity, Infinity, Infinity, Infinity); +ctx.setTransform(0, 0, Infinity, Infinity, 0, Infinity); +ctx.setTransform(0, 0, Infinity, 0, Infinity, 0); +ctx.setTransform(0, 0, Infinity, 0, Infinity, Infinity); +ctx.setTransform(0, 0, Infinity, 0, 0, Infinity); +ctx.setTransform(0, 0, 0, Infinity, Infinity, 0); +ctx.setTransform(0, 0, 0, Infinity, Infinity, Infinity); +ctx.setTransform(0, 0, 0, Infinity, 0, Infinity); +ctx.setTransform(0, 0, 0, 0, Infinity, Infinity); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(-100, -10, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.transformation.setTransform.skewed.js b/platforms/ios/www/test/tests-todo/2d.transformation.setTransform.skewed.js new file mode 100644 index 0000000..325b5c6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.transformation.setTransform.skewed.js @@ -0,0 +1,34 @@ +_addTest(function(canvas, ctx) { + +// Create green with a red square ring inside it +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(20, 10, 60, 30); +ctx.fillStyle = '#0f0'; +ctx.fillRect(40, 20, 20, 10); + +// Draw a skewed shape to fill that gap, to make sure it is aligned correctly +ctx.setTransform(1,4, 2,3, 5,6); +// Post-transform coordinates: +// [[20,10],[80,10],[80,40],[20,40],[20,10],[40,20],[40,30],[60,30],[60,20],[40,20],[20,10]]; +// Hence pre-transform coordinates: +var pts=[[-7.4,11.2],[-43.4,59.2],[-31.4,53.2],[4.6,5.2],[-7.4,11.2], + [-15.4,25.2],[-11.4,23.2],[-23.4,39.2],[-27.4,41.2],[-15.4,25.2], + [-7.4,11.2]]; +ctx.beginPath(); +ctx.moveTo(pts[0][0], pts[0][1]); +for (var i = 0; i < pts.length; ++i) + ctx.lineTo(pts[i][0], pts[i][1]); +ctx.fill(); +_assertPixel(canvas, 21,11, 0,255,0,255, "21,11", "0,255,0,255"); +_assertPixel(canvas, 79,11, 0,255,0,255, "79,11", "0,255,0,255"); +_assertPixel(canvas, 21,39, 0,255,0,255, "21,39", "0,255,0,255"); +_assertPixel(canvas, 79,39, 0,255,0,255, "79,39", "0,255,0,255"); +_assertPixel(canvas, 39,19, 0,255,0,255, "39,19", "0,255,0,255"); +_assertPixel(canvas, 61,19, 0,255,0,255, "61,19", "0,255,0,255"); +_assertPixel(canvas, 39,31, 0,255,0,255, "39,31", "0,255,0,255"); +_assertPixel(canvas, 61,31, 0,255,0,255, "61,31", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.transformation.transform.identity.js b/platforms/ios/www/test/tests-todo/2d.transformation.transform.identity.js new file mode 100644 index 0000000..2b8e39f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.transformation.transform.identity.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.transform(1,0, 0,1, 0,0); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.transformation.transform.multiply.js b/platforms/ios/www/test/tests-todo/2d.transformation.transform.multiply.js new file mode 100644 index 0000000..f91ed59 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.transformation.transform.multiply.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.transform(1,2, 3,4, 5,6); +ctx.transform(-2,1, 3/2,-1/2, 1,-2); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.transformation.transform.nonfinite.js b/platforms/ios/www/test/tests-todo/2d.transformation.transform.nonfinite.js new file mode 100644 index 0000000..e8eaec2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.transformation.transform.nonfinite.js @@ -0,0 +1,89 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.translate(100, 10); +ctx.transform(Infinity, 0, 0, 0, 0, 0); +ctx.transform(-Infinity, 0, 0, 0, 0, 0); +ctx.transform(NaN, 0, 0, 0, 0, 0); +ctx.transform(0, Infinity, 0, 0, 0, 0); +ctx.transform(0, -Infinity, 0, 0, 0, 0); +ctx.transform(0, NaN, 0, 0, 0, 0); +ctx.transform(0, 0, Infinity, 0, 0, 0); +ctx.transform(0, 0, -Infinity, 0, 0, 0); +ctx.transform(0, 0, NaN, 0, 0, 0); +ctx.transform(0, 0, 0, Infinity, 0, 0); +ctx.transform(0, 0, 0, -Infinity, 0, 0); +ctx.transform(0, 0, 0, NaN, 0, 0); +ctx.transform(0, 0, 0, 0, Infinity, 0); +ctx.transform(0, 0, 0, 0, -Infinity, 0); +ctx.transform(0, 0, 0, 0, NaN, 0); +ctx.transform(0, 0, 0, 0, 0, Infinity); +ctx.transform(0, 0, 0, 0, 0, -Infinity); +ctx.transform(0, 0, 0, 0, 0, NaN); +ctx.transform(Infinity, Infinity, 0, 0, 0, 0); +ctx.transform(Infinity, Infinity, Infinity, 0, 0, 0); +ctx.transform(Infinity, Infinity, Infinity, Infinity, 0, 0); +ctx.transform(Infinity, Infinity, Infinity, Infinity, Infinity, 0); +ctx.transform(Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); +ctx.transform(Infinity, Infinity, Infinity, Infinity, 0, Infinity); +ctx.transform(Infinity, Infinity, Infinity, 0, Infinity, 0); +ctx.transform(Infinity, Infinity, Infinity, 0, Infinity, Infinity); +ctx.transform(Infinity, Infinity, Infinity, 0, 0, Infinity); +ctx.transform(Infinity, Infinity, 0, Infinity, 0, 0); +ctx.transform(Infinity, Infinity, 0, Infinity, Infinity, 0); +ctx.transform(Infinity, Infinity, 0, Infinity, Infinity, Infinity); +ctx.transform(Infinity, Infinity, 0, Infinity, 0, Infinity); +ctx.transform(Infinity, Infinity, 0, 0, Infinity, 0); +ctx.transform(Infinity, Infinity, 0, 0, Infinity, Infinity); +ctx.transform(Infinity, Infinity, 0, 0, 0, Infinity); +ctx.transform(Infinity, 0, Infinity, 0, 0, 0); +ctx.transform(Infinity, 0, Infinity, Infinity, 0, 0); +ctx.transform(Infinity, 0, Infinity, Infinity, Infinity, 0); +ctx.transform(Infinity, 0, Infinity, Infinity, Infinity, Infinity); +ctx.transform(Infinity, 0, Infinity, Infinity, 0, Infinity); +ctx.transform(Infinity, 0, Infinity, 0, Infinity, 0); +ctx.transform(Infinity, 0, Infinity, 0, Infinity, Infinity); +ctx.transform(Infinity, 0, Infinity, 0, 0, Infinity); +ctx.transform(Infinity, 0, 0, Infinity, 0, 0); +ctx.transform(Infinity, 0, 0, Infinity, Infinity, 0); +ctx.transform(Infinity, 0, 0, Infinity, Infinity, Infinity); +ctx.transform(Infinity, 0, 0, Infinity, 0, Infinity); +ctx.transform(Infinity, 0, 0, 0, Infinity, 0); +ctx.transform(Infinity, 0, 0, 0, Infinity, Infinity); +ctx.transform(Infinity, 0, 0, 0, 0, Infinity); +ctx.transform(0, Infinity, Infinity, 0, 0, 0); +ctx.transform(0, Infinity, Infinity, Infinity, 0, 0); +ctx.transform(0, Infinity, Infinity, Infinity, Infinity, 0); +ctx.transform(0, Infinity, Infinity, Infinity, Infinity, Infinity); +ctx.transform(0, Infinity, Infinity, Infinity, 0, Infinity); +ctx.transform(0, Infinity, Infinity, 0, Infinity, 0); +ctx.transform(0, Infinity, Infinity, 0, Infinity, Infinity); +ctx.transform(0, Infinity, Infinity, 0, 0, Infinity); +ctx.transform(0, Infinity, 0, Infinity, 0, 0); +ctx.transform(0, Infinity, 0, Infinity, Infinity, 0); +ctx.transform(0, Infinity, 0, Infinity, Infinity, Infinity); +ctx.transform(0, Infinity, 0, Infinity, 0, Infinity); +ctx.transform(0, Infinity, 0, 0, Infinity, 0); +ctx.transform(0, Infinity, 0, 0, Infinity, Infinity); +ctx.transform(0, Infinity, 0, 0, 0, Infinity); +ctx.transform(0, 0, Infinity, Infinity, 0, 0); +ctx.transform(0, 0, Infinity, Infinity, Infinity, 0); +ctx.transform(0, 0, Infinity, Infinity, Infinity, Infinity); +ctx.transform(0, 0, Infinity, Infinity, 0, Infinity); +ctx.transform(0, 0, Infinity, 0, Infinity, 0); +ctx.transform(0, 0, Infinity, 0, Infinity, Infinity); +ctx.transform(0, 0, Infinity, 0, 0, Infinity); +ctx.transform(0, 0, 0, Infinity, Infinity, 0); +ctx.transform(0, 0, 0, Infinity, Infinity, Infinity); +ctx.transform(0, 0, 0, Infinity, 0, Infinity); +ctx.transform(0, 0, 0, 0, Infinity, Infinity); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(-100, -10, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.transformation.transform.skewed.js b/platforms/ios/www/test/tests-todo/2d.transformation.transform.skewed.js new file mode 100644 index 0000000..b1d8424 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.transformation.transform.skewed.js @@ -0,0 +1,34 @@ +_addTest(function(canvas, ctx) { + +// Create green with a red square ring inside it +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(20, 10, 60, 30); +ctx.fillStyle = '#0f0'; +ctx.fillRect(40, 20, 20, 10); + +// Draw a skewed shape to fill that gap, to make sure it is aligned correctly +ctx.transform(1,4, 2,3, 5,6); +// Post-transform coordinates: +// [[20,10],[80,10],[80,40],[20,40],[20,10],[40,20],[40,30],[60,30],[60,20],[40,20],[20,10]]; +// Hence pre-transform coordinates: +var pts=[[-7.4,11.2],[-43.4,59.2],[-31.4,53.2],[4.6,5.2],[-7.4,11.2], + [-15.4,25.2],[-11.4,23.2],[-23.4,39.2],[-27.4,41.2],[-15.4,25.2], + [-7.4,11.2]]; +ctx.beginPath(); +ctx.moveTo(pts[0][0], pts[0][1]); +for (var i = 0; i < pts.length; ++i) + ctx.lineTo(pts[i][0], pts[i][1]); +ctx.fill(); +_assertPixel(canvas, 21,11, 0,255,0,255, "21,11", "0,255,0,255"); +_assertPixel(canvas, 79,11, 0,255,0,255, "79,11", "0,255,0,255"); +_assertPixel(canvas, 21,39, 0,255,0,255, "21,39", "0,255,0,255"); +_assertPixel(canvas, 79,39, 0,255,0,255, "79,39", "0,255,0,255"); +_assertPixel(canvas, 39,19, 0,255,0,255, "39,19", "0,255,0,255"); +_assertPixel(canvas, 61,19, 0,255,0,255, "61,19", "0,255,0,255"); +_assertPixel(canvas, 39,31, 0,255,0,255, "39,31", "0,255,0,255"); +_assertPixel(canvas, 61,31, 0,255,0,255, "61,31", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.transformation.translate.basic.js b/platforms/ios/www/test/tests-todo/2d.transformation.translate.basic.js new file mode 100644 index 0000000..5ab55cc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.transformation.translate.basic.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.translate(100, 50); +ctx.fillStyle = '#0f0'; +ctx.fillRect(-100, -50, 100, 50); +_assertPixel(canvas, 90,40, 0,255,0,255, "90,40", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.transformation.translate.nonfinite.js b/platforms/ios/www/test/tests-todo/2d.transformation.translate.nonfinite.js new file mode 100644 index 0000000..616d328 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.transformation.translate.nonfinite.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.translate(100, 10); +ctx.translate(Infinity, 0.1); +ctx.translate(-Infinity, 0.1); +ctx.translate(NaN, 0.1); +ctx.translate(0.1, Infinity); +ctx.translate(0.1, -Infinity); +ctx.translate(0.1, NaN); +ctx.translate(Infinity, Infinity); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(-100, -10, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/2d.voidreturn.js b/platforms/ios/www/test/tests-todo/2d.voidreturn.js new file mode 100644 index 0000000..b419b77 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/2d.voidreturn.js @@ -0,0 +1,41 @@ +_addTest(function(canvas, ctx) { + +_assertSame(ctx.save(), undefined, "ctx.save()", "undefined"); +_assertSame(ctx.restore(), undefined, "ctx.restore()", "undefined"); +_assertSame(ctx.scale(1, 1), undefined, "ctx.scale(1, 1)", "undefined"); +_assertSame(ctx.rotate(0), undefined, "ctx.rotate(0)", "undefined"); +_assertSame(ctx.translate(0, 0), undefined, "ctx.translate(0, 0)", "undefined"); +if (ctx.transform) { // (avoid spurious failures, since the aim here is not to test that all features are supported) + _assertSame(ctx.transform(1, 0, 0, 1, 0, 0), undefined, "ctx.transform(1, 0, 0, 1, 0, 0)", "undefined"); +} +if (ctx.setTransform) { + _assertSame(ctx.setTransform(1, 0, 0, 1, 0, 0), undefined, "ctx.setTransform(1, 0, 0, 1, 0, 0)", "undefined"); +} +_assertSame(ctx.clearRect(0, 0, 0, 0), undefined, "ctx.clearRect(0, 0, 0, 0)", "undefined"); +_assertSame(ctx.fillRect(0, 0, 0, 0), undefined, "ctx.fillRect(0, 0, 0, 0)", "undefined"); +_assertSame(ctx.strokeRect(0, 0, 0, 0), undefined, "ctx.strokeRect(0, 0, 0, 0)", "undefined"); +_assertSame(ctx.beginPath(), undefined, "ctx.beginPath()", "undefined"); +_assertSame(ctx.closePath(), undefined, "ctx.closePath()", "undefined"); +_assertSame(ctx.moveTo(0, 0), undefined, "ctx.moveTo(0, 0)", "undefined"); +_assertSame(ctx.lineTo(0, 0), undefined, "ctx.lineTo(0, 0)", "undefined"); +_assertSame(ctx.quadraticCurveTo(0, 0, 0, 0), undefined, "ctx.quadraticCurveTo(0, 0, 0, 0)", "undefined"); +_assertSame(ctx.bezierCurveTo(0, 0, 0, 0, 0, 0), undefined, "ctx.bezierCurveTo(0, 0, 0, 0, 0, 0)", "undefined"); +_assertSame(ctx.arcTo(0, 0, 0, 0, 1), undefined, "ctx.arcTo(0, 0, 0, 0, 1)", "undefined"); +_assertSame(ctx.rect(0, 0, 0, 0), undefined, "ctx.rect(0, 0, 0, 0)", "undefined"); +_assertSame(ctx.arc(0, 0, 1, 0, 0, true), undefined, "ctx.arc(0, 0, 1, 0, 0, true)", "undefined"); +_assertSame(ctx.fill(), undefined, "ctx.fill()", "undefined"); +_assertSame(ctx.stroke(), undefined, "ctx.stroke()", "undefined"); +_assertSame(ctx.clip(), undefined, "ctx.clip()", "undefined"); +if (ctx.fillText) { + _assertSame(ctx.fillText('test', 0, 0), undefined, "ctx.fillText('test', 0, 0)", "undefined"); + _assertSame(ctx.strokeText('test', 0, 0), undefined, "ctx.strokeText('test', 0, 0)", "undefined"); +} +if (ctx.putImageData) { + _assertSame(ctx.putImageData(ctx.getImageData(0, 0, 1, 1), 0, 0), undefined, "ctx.putImageData(ctx.getImageData(0, 0, 1, 1), 0, 0)", "undefined"); +} +_assertSame(ctx.drawImage(document.getElementById('yellow.png'), 0, 0, 1, 1, 0, 0, 0, 0), undefined, "ctx.drawImage(document.getElementById('yellow.png'), 0, 0, 1, 1, 0, 0, 0, 0)", "undefined"); +_assertSame(ctx.drawImage(canvas, 0, 0, 1, 1, 0, 0, 0, 0), undefined, "ctx.drawImage(canvas, 0, 0, 1, 1, 0, 0, 0, 0)", "undefined"); +_assertSame(ctx.createLinearGradient(0, 0, 0, 0).addColorStop(0, 'white'), undefined, "ctx.createLinearGradient(0, 0, 0, 0).addColorStop(0, 'white')", "undefined"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/context.casesensitive.js b/platforms/ios/www/test/tests-todo/context.casesensitive.js new file mode 100644 index 0000000..8ab0ef8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/context.casesensitive.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.getContext('2D'), null, "canvas.getContext('2D')", "null"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/context.emptystring.js b/platforms/ios/www/test/tests-todo/context.emptystring.js new file mode 100644 index 0000000..742a111 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/context.emptystring.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.getContext(""), null, "canvas.getContext(\"\")", "null"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/context.unrecognised.badname.js b/platforms/ios/www/test/tests-todo/context.unrecognised.badname.js new file mode 100644 index 0000000..941a0b8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/context.unrecognised.badname.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.getContext('This is not an implemented context in any real browser'), null, "canvas.getContext('This is not an implemented context in any real browser')", "null"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/context.unrecognised.badsuffix.js b/platforms/ios/www/test/tests-todo/context.unrecognised.badsuffix.js new file mode 100644 index 0000000..c56623c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/context.unrecognised.badsuffix.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.getContext("2d#"), null, "canvas.getContext(\"2d#\")", "null"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/context.unrecognised.nullsuffix.js b/platforms/ios/www/test/tests-todo/context.unrecognised.nullsuffix.js new file mode 100644 index 0000000..121a5ca --- /dev/null +++ b/platforms/ios/www/test/tests-todo/context.unrecognised.nullsuffix.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.getContext("2d\0"), null, "canvas.getContext(\"2d\\0\")", "null"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/context.unrecognised.unicode.js b/platforms/ios/www/test/tests-todo/context.unrecognised.unicode.js new file mode 100644 index 0000000..1bf51ef --- /dev/null +++ b/platforms/ios/www/test/tests-todo/context.unrecognised.unicode.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.getContext("2\uFF44"), null, "canvas.getContext(\"2\\uFF44\")", "null"); // Fullwidth Latin Small Letter D + + +}); diff --git a/platforms/ios/www/test/tests-todo/fallback.basic.js b/platforms/ios/www/test/tests-todo/fallback.basic.js new file mode 100644 index 0000000..9753080 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/fallback.basic.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertEqual(canvas.childNodes.length, 1, "canvas.childNodes.length", "1"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/fallback.multiple.js b/platforms/ios/www/test/tests-todo/fallback.multiple.js new file mode 100644 index 0000000..6eddbe1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/fallback.multiple.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertEqual(canvas.childNodes.length, 2, "canvas.childNodes.length", "2"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/fallback.nested.js b/platforms/ios/www/test/tests-todo/fallback.nested.js new file mode 100644 index 0000000..6eddbe1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/fallback.nested.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertEqual(canvas.childNodes.length, 2, "canvas.childNodes.length", "2"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.canvas.readonly.js b/platforms/ios/www/test/tests-todo/framed.2d.canvas.readonly.js new file mode 100644 index 0000000..3d67615 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.canvas.readonly.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +var c = document.createElement('canvas'); +var d = ctx.canvas; +_assertDifferent(c, d, "c", "d"); +try { ctx.canvas = c; } catch (e) {} // TODO: not sure whether this should throw or not... +_assertSame(ctx.canvas, d, "ctx.canvas", "d"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.canvas.reference.js b/platforms/ios/www/test/tests-todo/framed.2d.canvas.reference.js new file mode 100644 index 0000000..23d3429 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.canvas.reference.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(ctx.canvas, canvas, "ctx.canvas", "canvas"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.clearRect.basic.js b/platforms/ios/www/test/tests-todo/framed.2d.clearRect.basic.js new file mode 100644 index 0000000..57341a3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.clearRect.basic.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.clearRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.clearRect.clip.js b/platforms/ios/www/test/tests-todo/framed.2d.clearRect.clip.js new file mode 100644 index 0000000..057de6f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.clearRect.clip.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.beginPath(); +ctx.rect(0, 0, 16, 16); +ctx.clip(); + +ctx.clearRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 16, 16); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.clearRect.globalalpha.js b/platforms/ios/www/test/tests-todo/framed.2d.clearRect.globalalpha.js new file mode 100644 index 0000000..4525615 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.clearRect.globalalpha.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalAlpha = 0.1; +ctx.clearRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.clearRect.globalcomposite.js b/platforms/ios/www/test/tests-todo/framed.2d.clearRect.globalcomposite.js new file mode 100644 index 0000000..8285119 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.clearRect.globalcomposite.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-atop'; +ctx.clearRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.clearRect.negative.js b/platforms/ios/www/test/tests-todo/framed.2d.clearRect.negative.js new file mode 100644 index 0000000..a3574f3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.clearRect.negative.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.clearRect(0, 0, 50, 25); +ctx.clearRect(100, 0, -50, 25); +ctx.clearRect(0, 50, 50, -25); +ctx.clearRect(100, 50, -50, -25); +_assertPixel(canvas, 25,12, 0,0,0,0, "25,12", "0,0,0,0"); +_assertPixel(canvas, 75,12, 0,0,0,0, "75,12", "0,0,0,0"); +_assertPixel(canvas, 25,37, 0,0,0,0, "25,37", "0,0,0,0"); +_assertPixel(canvas, 75,37, 0,0,0,0, "75,37", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.clearRect.nonfinite.js b/platforms/ios/www/test/tests-todo/framed.2d.clearRect.nonfinite.js new file mode 100644 index 0000000..5347945 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.clearRect.nonfinite.js @@ -0,0 +1,33 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.clearRect(Infinity, 0, 100, 50); +ctx.clearRect(-Infinity, 0, 100, 50); +ctx.clearRect(NaN, 0, 100, 50); +ctx.clearRect(0, Infinity, 100, 50); +ctx.clearRect(0, -Infinity, 100, 50); +ctx.clearRect(0, NaN, 100, 50); +ctx.clearRect(0, 0, Infinity, 50); +ctx.clearRect(0, 0, -Infinity, 50); +ctx.clearRect(0, 0, NaN, 50); +ctx.clearRect(0, 0, 100, Infinity); +ctx.clearRect(0, 0, 100, -Infinity); +ctx.clearRect(0, 0, 100, NaN); +ctx.clearRect(Infinity, Infinity, 100, 50); +ctx.clearRect(Infinity, Infinity, Infinity, 50); +ctx.clearRect(Infinity, Infinity, Infinity, Infinity); +ctx.clearRect(Infinity, Infinity, 100, Infinity); +ctx.clearRect(Infinity, 0, Infinity, 50); +ctx.clearRect(Infinity, 0, Infinity, Infinity); +ctx.clearRect(Infinity, 0, 100, Infinity); +ctx.clearRect(0, Infinity, Infinity, 50); +ctx.clearRect(0, Infinity, Infinity, Infinity); +ctx.clearRect(0, Infinity, 100, Infinity); +ctx.clearRect(0, 0, Infinity, Infinity); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.clearRect.path.js b/platforms/ios/www/test/tests-todo/framed.2d.clearRect.path.js new file mode 100644 index 0000000..360372a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.clearRect.path.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.beginPath(); +ctx.rect(0, 0, 100, 50); +ctx.clearRect(0, 0, 16, 16); +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.clearRect.shadow.js b/platforms/ios/www/test/tests-todo/framed.2d.clearRect.shadow.js new file mode 100644 index 0000000..152d3dd --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.clearRect.shadow.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = '#f00'; +ctx.shadowBlur = 0; +ctx.shadowOffsetX = 0; +ctx.shadowOffsetY = 50; +ctx.clearRect(0, -50, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.clearRect.transform.js b/platforms/ios/www/test/tests-todo/framed.2d.clearRect.transform.js new file mode 100644 index 0000000..6b407f4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.clearRect.transform.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.scale(10, 10); +ctx.translate(0, 5); +ctx.clearRect(0, -5, 10, 5); +_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.clearRect.zero.js b/platforms/ios/www/test/tests-todo/framed.2d.clearRect.zero.js new file mode 100644 index 0000000..efdde6b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.clearRect.zero.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.clearRect(0, 0, 100, 0); +ctx.clearRect(0, 0, 0, 50); +ctx.clearRect(0, 0, 0, 0); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.canvas.copy.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.canvas.copy.js new file mode 100644 index 0000000..01e90bf --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.canvas.copy.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + + +var canvas2 = document.createElement('canvas'); +canvas2.width = canvas.width; +canvas2.height = canvas.height; +var ctx2 = canvas2.getContext('2d'); +ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0); +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'copy'; +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 255,255,0,191, "50,25", "255,255,0,191", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.canvas.destination-atop.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.canvas.destination-atop.js new file mode 100644 index 0000000..c4b9d04 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.canvas.destination-atop.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + + +var canvas2 = document.createElement('canvas'); +canvas2.width = canvas.width; +canvas2.height = canvas.height; +var ctx2 = canvas2.getContext('2d'); +ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0); +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-atop'; +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 127,255,127,191, "50,25", "127,255,127,191", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.canvas.destination-in.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.canvas.destination-in.js new file mode 100644 index 0000000..61f0166 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.canvas.destination-in.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + + +var canvas2 = document.createElement('canvas'); +canvas2.width = canvas.width; +canvas2.height = canvas.height; +var ctx2 = canvas2.getContext('2d'); +ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0); +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-in'; +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 0,255,255,95, "50,25", "0,255,255,95", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.canvas.destination-out.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.canvas.destination-out.js new file mode 100644 index 0000000..55e32d8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.canvas.destination-out.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + + +var canvas2 = document.createElement('canvas'); +canvas2.width = canvas.width; +canvas2.height = canvas.height; +var ctx2 = canvas2.getContext('2d'); +ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0); +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-out'; +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 0,255,255,31, "50,25", "0,255,255,31", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.canvas.destination-over.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.canvas.destination-over.js new file mode 100644 index 0000000..0ae2682 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.canvas.destination-over.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + + +var canvas2 = document.createElement('canvas'); +canvas2.width = canvas.width; +canvas2.height = canvas.height; +var ctx2 = canvas2.getContext('2d'); +ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0); +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-over'; +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 109,255,145,223, "50,25", "109,255,145,223", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.canvas.lighter.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.canvas.lighter.js new file mode 100644 index 0000000..fbb860d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.canvas.lighter.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + + +var canvas2 = document.createElement('canvas'); +canvas2.width = canvas.width; +canvas2.height = canvas.height; +var ctx2 = canvas2.getContext('2d'); +ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0); +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'lighter'; +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 191,255,127,255, "50,25", "191,255,127,255", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.canvas.source-atop.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.canvas.source-atop.js new file mode 100644 index 0000000..92c4999 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.canvas.source-atop.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + + +var canvas2 = document.createElement('canvas'); +canvas2.width = canvas.width; +canvas2.height = canvas.height; +var ctx2 = canvas2.getContext('2d'); +ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0); +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-atop'; +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 191,255,63,127, "50,25", "191,255,63,127", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.canvas.source-in.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.canvas.source-in.js new file mode 100644 index 0000000..1aa5c4c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.canvas.source-in.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + + +var canvas2 = document.createElement('canvas'); +canvas2.width = canvas.width; +canvas2.height = canvas.height; +var ctx2 = canvas2.getContext('2d'); +ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0); +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-in'; +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 255,255,0,95, "50,25", "255,255,0,95", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.canvas.source-out.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.canvas.source-out.js new file mode 100644 index 0000000..d182826 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.canvas.source-out.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + + +var canvas2 = document.createElement('canvas'); +canvas2.width = canvas.width; +canvas2.height = canvas.height; +var ctx2 = canvas2.getContext('2d'); +ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0); +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-out'; +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 255,255,0,95, "50,25", "255,255,0,95", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.canvas.source-over.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.canvas.source-over.js new file mode 100644 index 0000000..9a050b6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.canvas.source-over.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + + +var canvas2 = document.createElement('canvas'); +canvas2.width = canvas.width; +canvas2.height = canvas.height; +var ctx2 = canvas2.getContext('2d'); +ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0); +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-over'; +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 218,255,36,223, "50,25", "218,255,36,223", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.canvas.xor.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.canvas.xor.js new file mode 100644 index 0000000..3a9df1c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.canvas.xor.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + + +var canvas2 = document.createElement('canvas'); +canvas2.width = canvas.width; +canvas2.height = canvas.height; +var ctx2 = canvas2.getContext('2d'); +ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0); +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'xor'; +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 191,255,63,127, "50,25", "191,255,63,127", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.clip.copy.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.clip.copy.js new file mode 100644 index 0000000..f3dfba4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.clip.copy.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'copy'; +ctx.rect(-20, -20, 10, 10); +ctx.clip(); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.clip.destination-atop.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.clip.destination-atop.js new file mode 100644 index 0000000..70645dc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.clip.destination-atop.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-atop'; +ctx.rect(-20, -20, 10, 10); +ctx.clip(); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.clip.destination-in.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.clip.destination-in.js new file mode 100644 index 0000000..f6f0e76 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.clip.destination-in.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-in'; +ctx.rect(-20, -20, 10, 10); +ctx.clip(); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.clip.destination-out.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.clip.destination-out.js new file mode 100644 index 0000000..b21df0b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.clip.destination-out.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-out'; +ctx.rect(-20, -20, 10, 10); +ctx.clip(); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.clip.destination-over.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.clip.destination-over.js new file mode 100644 index 0000000..1877ee6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.clip.destination-over.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-over'; +ctx.rect(-20, -20, 10, 10); +ctx.clip(); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.clip.lighter.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.clip.lighter.js new file mode 100644 index 0000000..a8f2b0e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.clip.lighter.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'lighter'; +ctx.rect(-20, -20, 10, 10); +ctx.clip(); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.clip.source-atop.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.clip.source-atop.js new file mode 100644 index 0000000..d086776 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.clip.source-atop.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-atop'; +ctx.rect(-20, -20, 10, 10); +ctx.clip(); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.clip.source-in.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.clip.source-in.js new file mode 100644 index 0000000..34fe397 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.clip.source-in.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-in'; +ctx.rect(-20, -20, 10, 10); +ctx.clip(); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.clip.source-out.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.clip.source-out.js new file mode 100644 index 0000000..977a39c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.clip.source-out.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-out'; +ctx.rect(-20, -20, 10, 10); +ctx.clip(); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.clip.source-over.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.clip.source-over.js new file mode 100644 index 0000000..8d49d2e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.clip.source-over.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-over'; +ctx.rect(-20, -20, 10, 10); +ctx.clip(); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.clip.xor.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.clip.xor.js new file mode 100644 index 0000000..4b3e980 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.clip.xor.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'xor'; +ctx.rect(-20, -20, 10, 10); +ctx.clip(); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.globalAlpha.canvas.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.globalAlpha.canvas.js new file mode 100644 index 0000000..e11ab64 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.globalAlpha.canvas.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = '#f00'; +ctx2.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalAlpha = 0.01; // avoid any potential alpha=0 optimisations +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 2,253,0,255, "50,25", "2,253,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.globalAlpha.canvaspattern.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.globalAlpha.canvaspattern.js new file mode 100644 index 0000000..d3eb366 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.globalAlpha.canvaspattern.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = '#f00'; +ctx2.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = ctx.createPattern(canvas2, 'no-repeat'); +ctx.globalAlpha = 0.01; // avoid any potential alpha=0 optimisations +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 2,253,0,255, "50,25", "2,253,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.globalAlpha.default.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.globalAlpha.default.js new file mode 100644 index 0000000..af46748 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.globalAlpha.default.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(ctx.globalAlpha, 1.0, "ctx.globalAlpha", "1.0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.globalAlpha.fill.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.globalAlpha.fill.js new file mode 100644 index 0000000..c310590 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.globalAlpha.fill.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalAlpha = 0.01; // avoid any potential alpha=0 optimisations +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 2,253,0,255, "50,25", "2,253,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.globalAlpha.image.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.globalAlpha.image.js new file mode 100644 index 0000000..479dedd --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.globalAlpha.image.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalAlpha = 0.01; // avoid any potential alpha=0 optimisations +ctx.drawImage(document.getElementById('red.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 2,253,0,255, "50,25", "2,253,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.globalAlpha.imagepattern.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.globalAlpha.imagepattern.js new file mode 100644 index 0000000..d269796 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.globalAlpha.imagepattern.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = ctx.createPattern(document.getElementById('red.png'), 'no-repeat'); +ctx.globalAlpha = 0.01; // avoid any potential alpha=0 optimisations +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 2,253,0,255, "50,25", "2,253,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.globalAlpha.invalid.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.globalAlpha.invalid.js new file mode 100644 index 0000000..e53a289 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.globalAlpha.invalid.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.globalAlpha = 0.5; +var a = ctx.globalAlpha; // might not be exactly 0.5, if it is rounded/quantised, so remember for future comparisons +ctx.globalAlpha = Infinity; +_assertEqual(ctx.globalAlpha, a, "ctx.globalAlpha", "a"); +ctx.globalAlpha = -Infinity; +_assertEqual(ctx.globalAlpha, a, "ctx.globalAlpha", "a"); +ctx.globalAlpha = NaN; +_assertEqual(ctx.globalAlpha, a, "ctx.globalAlpha", "a"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.globalAlpha.range.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.globalAlpha.range.js new file mode 100644 index 0000000..60c8901 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.globalAlpha.range.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.globalAlpha = 0.5; +var a = ctx.globalAlpha; // might not be exactly 0.5, if it is rounded/quantised, so remember for future comparisons +ctx.globalAlpha = 1.1; +_assertEqual(ctx.globalAlpha, a, "ctx.globalAlpha", "a"); +ctx.globalAlpha = -0.1; +_assertEqual(ctx.globalAlpha, a, "ctx.globalAlpha", "a"); +ctx.globalAlpha = 0; +_assertEqual(ctx.globalAlpha, 0, "ctx.globalAlpha", "0"); +ctx.globalAlpha = 1; +_assertEqual(ctx.globalAlpha, 1, "ctx.globalAlpha", "1"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.image.copy.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.image.copy.js new file mode 100644 index 0000000..92d325f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.image.copy.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'copy'; +ctx.drawImage(document.getElementById('yellow75.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 255,255,0,191, "50,25", "255,255,0,191", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.image.destination-atop.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.image.destination-atop.js new file mode 100644 index 0000000..18836f6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.image.destination-atop.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-atop'; +ctx.drawImage(document.getElementById('yellow75.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 127,255,127,191, "50,25", "127,255,127,191", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.image.destination-in.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.image.destination-in.js new file mode 100644 index 0000000..6b424df --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.image.destination-in.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-in'; +ctx.drawImage(document.getElementById('yellow75.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 0,255,255,95, "50,25", "0,255,255,95", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.image.destination-out.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.image.destination-out.js new file mode 100644 index 0000000..d78d191 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.image.destination-out.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-out'; +ctx.drawImage(document.getElementById('yellow75.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 0,255,255,31, "50,25", "0,255,255,31", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.image.destination-over.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.image.destination-over.js new file mode 100644 index 0000000..9bdbd52 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.image.destination-over.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-over'; +ctx.drawImage(document.getElementById('yellow75.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 109,255,145,223, "50,25", "109,255,145,223", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.image.lighter.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.image.lighter.js new file mode 100644 index 0000000..5b3fdcf --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.image.lighter.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'lighter'; +ctx.drawImage(document.getElementById('yellow75.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 191,255,127,255, "50,25", "191,255,127,255", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.image.source-atop.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.image.source-atop.js new file mode 100644 index 0000000..90157da --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.image.source-atop.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-atop'; +ctx.drawImage(document.getElementById('yellow75.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 191,255,63,127, "50,25", "191,255,63,127", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.image.source-in.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.image.source-in.js new file mode 100644 index 0000000..76a2bf5 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.image.source-in.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-in'; +ctx.drawImage(document.getElementById('yellow75.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 255,255,0,95, "50,25", "255,255,0,95", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.image.source-out.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.image.source-out.js new file mode 100644 index 0000000..2b09cd8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.image.source-out.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-out'; +ctx.drawImage(document.getElementById('yellow75.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 255,255,0,95, "50,25", "255,255,0,95", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.image.source-over.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.image.source-over.js new file mode 100644 index 0000000..dcd3291 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.image.source-over.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-over'; +ctx.drawImage(document.getElementById('yellow75.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 218,255,36,223, "50,25", "218,255,36,223", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.image.xor.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.image.xor.js new file mode 100644 index 0000000..2ae1fa5 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.image.xor.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'xor'; +ctx.drawImage(document.getElementById('yellow75.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 191,255,63,127, "50,25", "191,255,63,127", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.operation.casesensitive.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.operation.casesensitive.js new file mode 100644 index 0000000..bc185fc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.operation.casesensitive.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +ctx.globalCompositeOperation = 'xor'; +ctx.globalCompositeOperation = 'Source-over'; +_assertEqual(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.operation.clear.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.operation.clear.js new file mode 100644 index 0000000..b44825e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.operation.clear.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +ctx.globalCompositeOperation = 'xor'; +ctx.globalCompositeOperation = 'clear'; +_assertEqual(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.operation.darker.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.operation.darker.js new file mode 100644 index 0000000..c93ed3b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.operation.darker.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +ctx.globalCompositeOperation = 'xor'; +ctx.globalCompositeOperation = 'darker'; +_assertEqual(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.operation.default.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.operation.default.js new file mode 100644 index 0000000..cc02047 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.operation.default.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertEqual(ctx.globalCompositeOperation, 'source-over', "ctx.globalCompositeOperation", "'source-over'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.operation.get.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.operation.get.js new file mode 100644 index 0000000..faa06dc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.operation.get.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +var modes = ['source-atop', 'source-in', 'source-out', 'source-over', + 'destination-atop', 'destination-in', 'destination-out', 'destination-over', + 'lighter', 'copy', 'xor']; +for (var i = 0; i < modes.length; ++i) +{ + ctx.globalCompositeOperation = modes[i]; + _assertEqual(ctx.globalCompositeOperation, modes[i], "ctx.globalCompositeOperation", "modes[\""+(i)+"\"]"); +} + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.operation.highlight.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.operation.highlight.js new file mode 100644 index 0000000..33f45c8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.operation.highlight.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +ctx.globalCompositeOperation = 'xor'; +ctx.globalCompositeOperation = 'highlight'; +_assertEqual(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.operation.nullsuffix.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.operation.nullsuffix.js new file mode 100644 index 0000000..62e8c42 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.operation.nullsuffix.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +ctx.globalCompositeOperation = 'xor'; +ctx.globalCompositeOperation = 'source-over\0'; +_assertEqual(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.operation.over.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.operation.over.js new file mode 100644 index 0000000..464c3c9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.operation.over.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +ctx.globalCompositeOperation = 'xor'; +ctx.globalCompositeOperation = 'over'; +_assertEqual(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.operation.unrecognised.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.operation.unrecognised.js new file mode 100644 index 0000000..00c853b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.operation.unrecognised.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +ctx.globalCompositeOperation = 'xor'; +ctx.globalCompositeOperation = 'nonexistent'; +_assertEqual(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.solid.copy.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.solid.copy.js new file mode 100644 index 0000000..0c143dc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.solid.copy.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'copy'; +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 255,255,0,255, "50,25", "255,255,0,255", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.solid.destination-atop.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.solid.destination-atop.js new file mode 100644 index 0000000..d5e7f62 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.solid.destination-atop.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-atop'; +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,255,255,255, "50,25", "0,255,255,255", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.solid.destination-in.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.solid.destination-in.js new file mode 100644 index 0000000..2d7733a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.solid.destination-in.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-in'; +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,255,255,255, "50,25", "0,255,255,255", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.solid.destination-out.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.solid.destination-out.js new file mode 100644 index 0000000..cbfded4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.solid.destination-out.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-out'; +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.solid.destination-over.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.solid.destination-over.js new file mode 100644 index 0000000..3d94ca4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.solid.destination-over.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-over'; +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,255,255,255, "50,25", "0,255,255,255", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.solid.lighter.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.solid.lighter.js new file mode 100644 index 0000000..ee3fe61 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.solid.lighter.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'lighter'; +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 255,255,255,255, "50,25", "255,255,255,255", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.solid.source-atop.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.solid.source-atop.js new file mode 100644 index 0000000..41d0df3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.solid.source-atop.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-atop'; +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 255,255,0,255, "50,25", "255,255,0,255", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.solid.source-in.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.solid.source-in.js new file mode 100644 index 0000000..71b94de --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.solid.source-in.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-in'; +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 255,255,0,255, "50,25", "255,255,0,255", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.solid.source-out.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.solid.source-out.js new file mode 100644 index 0000000..cd1c484 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.solid.source-out.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-out'; +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.solid.source-over.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.solid.source-over.js new file mode 100644 index 0000000..969f474 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.solid.source-over.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-over'; +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 255,255,0,255, "50,25", "255,255,0,255", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.solid.xor.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.solid.xor.js new file mode 100644 index 0000000..6f15f72 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.solid.xor.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'xor'; +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.transparent.copy.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.transparent.copy.js new file mode 100644 index 0000000..dec49c9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.transparent.copy.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'copy'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,255,191, "50,25", "0,0,255,191", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.transparent.destination-atop.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.transparent.destination-atop.js new file mode 100644 index 0000000..502dce5 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.transparent.destination-atop.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-atop'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,127,127,191, "50,25", "0,127,127,191", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.transparent.destination-in.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.transparent.destination-in.js new file mode 100644 index 0000000..11c86d8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.transparent.destination-in.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-in'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,255,0,95, "50,25", "0,255,0,95", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.transparent.destination-out.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.transparent.destination-out.js new file mode 100644 index 0000000..c350691 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.transparent.destination-out.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-out'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,255,0,31, "50,25", "0,255,0,31", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.transparent.destination-over.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.transparent.destination-over.js new file mode 100644 index 0000000..01bd9e2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.transparent.destination-over.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-over'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,145,109,223, "50,25", "0,145,109,223", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.transparent.lighter.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.transparent.lighter.js new file mode 100644 index 0000000..fac6a7d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.transparent.lighter.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'lighter'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,127,191,255, "50,25", "0,127,191,255", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.transparent.source-atop.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.transparent.source-atop.js new file mode 100644 index 0000000..c878090 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.transparent.source-atop.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-atop'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,63,191,127, "50,25", "0,63,191,127", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.transparent.source-in.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.transparent.source-in.js new file mode 100644 index 0000000..5855881 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.transparent.source-in.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-in'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,255,95, "50,25", "0,0,255,95", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.transparent.source-out.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.transparent.source-out.js new file mode 100644 index 0000000..bca551e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.transparent.source-out.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-out'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,255,95, "50,25", "0,0,255,95", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.transparent.source-over.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.transparent.source-over.js new file mode 100644 index 0000000..cc36cb9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.transparent.source-over.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-over'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,36,218,223, "50,25", "0,36,218,223", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.transparent.xor.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.transparent.xor.js new file mode 100644 index 0000000..d3e4a0a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.transparent.xor.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'xor'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,63,191,127, "50,25", "0,63,191,127", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.fill.copy.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.fill.copy.js new file mode 100644 index 0000000..b1ca3a2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.fill.copy.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'copy'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.translate(0, 25); +ctx.fillRect(0, 50, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.fill.destination-atop.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.fill.destination-atop.js new file mode 100644 index 0000000..f76e616 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.fill.destination-atop.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-atop'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.translate(0, 25); +ctx.fillRect(0, 50, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.fill.destination-in.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.fill.destination-in.js new file mode 100644 index 0000000..2613ed3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.fill.destination-in.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-in'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.translate(0, 25); +ctx.fillRect(0, 50, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.fill.source-in.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.fill.source-in.js new file mode 100644 index 0000000..15d10f3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.fill.source-in.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-in'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.translate(0, 25); +ctx.fillRect(0, 50, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.fill.source-out.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.fill.source-out.js new file mode 100644 index 0000000..653121b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.fill.source-out.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-out'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.translate(0, 25); +ctx.fillRect(0, 50, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.image.copy.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.image.copy.js new file mode 100644 index 0000000..624786c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.image.copy.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'copy'; +ctx.drawImage(document.getElementById('yellow.png'), 40, 40, 10, 10, 40, 50, 10, 10); +_assertPixelApprox(canvas, 15,15, 0,0,0,0, "15,15", "0,0,0,0", 5); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.image.destination-atop.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.image.destination-atop.js new file mode 100644 index 0000000..509aff6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.image.destination-atop.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-atop'; +ctx.drawImage(document.getElementById('yellow.png'), 40, 40, 10, 10, 40, 50, 10, 10); +_assertPixelApprox(canvas, 15,15, 0,0,0,0, "15,15", "0,0,0,0", 5); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.image.destination-in.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.image.destination-in.js new file mode 100644 index 0000000..451a51b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.image.destination-in.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-in'; +ctx.drawImage(document.getElementById('yellow.png'), 40, 40, 10, 10, 40, 50, 10, 10); +_assertPixelApprox(canvas, 15,15, 0,0,0,0, "15,15", "0,0,0,0", 5); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.image.source-in.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.image.source-in.js new file mode 100644 index 0000000..7b81106 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.image.source-in.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-in'; +ctx.drawImage(document.getElementById('yellow.png'), 40, 40, 10, 10, 40, 50, 10, 10); +_assertPixelApprox(canvas, 15,15, 0,0,0,0, "15,15", "0,0,0,0", 5); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.image.source-out.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.image.source-out.js new file mode 100644 index 0000000..44df955 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.image.source-out.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-out'; +ctx.drawImage(document.getElementById('yellow.png'), 40, 40, 10, 10, 40, 50, 10, 10); +_assertPixelApprox(canvas, 15,15, 0,0,0,0, "15,15", "0,0,0,0", 5); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.nocontext.copy.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.nocontext.copy.js new file mode 100644 index 0000000..339105c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.nocontext.copy.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'copy'; +var canvas2 = document.createElement('canvas'); +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.nocontext.destination-atop.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.nocontext.destination-atop.js new file mode 100644 index 0000000..91a09c9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.nocontext.destination-atop.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-atop'; +var canvas2 = document.createElement('canvas'); +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.nocontext.destination-in.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.nocontext.destination-in.js new file mode 100644 index 0000000..5c2d617 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.nocontext.destination-in.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-in'; +var canvas2 = document.createElement('canvas'); +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.nocontext.source-in.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.nocontext.source-in.js new file mode 100644 index 0000000..1de64cb --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.nocontext.source-in.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-in'; +var canvas2 = document.createElement('canvas'); +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.nocontext.source-out.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.nocontext.source-out.js new file mode 100644 index 0000000..bfc1901 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.nocontext.source-out.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-out'; +var canvas2 = document.createElement('canvas'); +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.pattern.copy.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.pattern.copy.js new file mode 100644 index 0000000..cdb9d7a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.pattern.copy.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'copy'; +ctx.fillStyle = ctx.createPattern(document.getElementById('yellow.png'), 'no-repeat'); +ctx.fillRect(0, 50, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.pattern.destination-atop.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.pattern.destination-atop.js new file mode 100644 index 0000000..c1c63a8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.pattern.destination-atop.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-atop'; +ctx.fillStyle = ctx.createPattern(document.getElementById('yellow.png'), 'no-repeat'); +ctx.fillRect(0, 50, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.pattern.destination-in.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.pattern.destination-in.js new file mode 100644 index 0000000..e69936f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.pattern.destination-in.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-in'; +ctx.fillStyle = ctx.createPattern(document.getElementById('yellow.png'), 'no-repeat'); +ctx.fillRect(0, 50, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.pattern.source-in.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.pattern.source-in.js new file mode 100644 index 0000000..b211541 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.pattern.source-in.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-in'; +ctx.fillStyle = ctx.createPattern(document.getElementById('yellow.png'), 'no-repeat'); +ctx.fillRect(0, 50, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.pattern.source-out.js b/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.pattern.source-out.js new file mode 100644 index 0000000..e84e1f0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.composite.uncovered.pattern.source-out.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-out'; +ctx.fillStyle = ctx.createPattern(document.getElementById('yellow.png'), 'no-repeat'); +ctx.fillRect(0, 50, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.coordinatespace.js b/platforms/ios/www/test/tests-todo/framed.2d.coordinatespace.js new file mode 100644 index 0000000..8220b08 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.coordinatespace.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#00f'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0ff'; +ctx.fillRect(0, 0, 50, 25); +_assertPixel(canvas, 25,12, 0,255,255,255, "25,12", "0,255,255,255"); +_assertPixel(canvas, 75,12, 0,0,255,255, "75,12", "0,0,255,255"); +_assertPixel(canvas, 25,37, 0,0,255,255, "25,37", "0,0,255,255"); +_assertPixel(canvas, 75,37, 0,0,255,255, "75,37", "0,0,255,255"); +_requireManualCheck(); // because we can't tell that getPixelData isn't using the wrong coordinate space too + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.drawImage.3arg.js b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.3arg.js new file mode 100644 index 0000000..a0c66bf --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.3arg.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.drawImage(document.getElementById('green.png'), 0, 0); +ctx.drawImage(document.getElementById('red.png'), -100, 0); +ctx.drawImage(document.getElementById('red.png'), 100, 0); +ctx.drawImage(document.getElementById('red.png'), 0, -50); +ctx.drawImage(document.getElementById('red.png'), 0, 50); + +_assertPixelApprox(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2); +_assertPixelApprox(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2); +_assertPixelApprox(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2); +_assertPixelApprox(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.drawImage.5arg.js b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.5arg.js new file mode 100644 index 0000000..ca0667e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.5arg.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.drawImage(document.getElementById('green.png'), 50, 0, 50, 50); +ctx.drawImage(document.getElementById('red.png'), 0, 0, 50, 50); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 50, 50); + +_assertPixelApprox(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2); +_assertPixelApprox(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2); +_assertPixelApprox(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2); +_assertPixelApprox(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.drawImage.9arg.basic.js b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.9arg.basic.js new file mode 100644 index 0000000..19bb506 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.9arg.basic.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.drawImage(document.getElementById('green.png'), 0, 0, 100, 50, 0, 0, 100, 50); +_assertPixelApprox(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2); +_assertPixelApprox(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2); +_assertPixelApprox(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2); +_assertPixelApprox(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.drawImage.9arg.destpos.js b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.9arg.destpos.js new file mode 100644 index 0000000..4ac7a26 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.9arg.destpos.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.drawImage(document.getElementById('green.png'), 0, 0, 100, 50, 0, 0, 100, 50); +ctx.drawImage(document.getElementById('red.png'), 0, 0, 100, 50, -100, 0, 100, 50); +ctx.drawImage(document.getElementById('red.png'), 0, 0, 100, 50, 100, 0, 100, 50); +ctx.drawImage(document.getElementById('red.png'), 0, 0, 100, 50, 0, -50, 100, 50); +ctx.drawImage(document.getElementById('red.png'), 0, 0, 100, 50, 0, 50, 100, 50); +_assertPixelApprox(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2); +_assertPixelApprox(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2); +_assertPixelApprox(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2); +_assertPixelApprox(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.drawImage.9arg.destsize.js b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.9arg.destsize.js new file mode 100644 index 0000000..2c7381b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.9arg.destsize.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.drawImage(document.getElementById('green.png'), 1, 1, 1, 1, 0, 0, 100, 50); +ctx.drawImage(document.getElementById('red.png'), 0, 0, 100, 50, -50, 0, 50, 50); +ctx.drawImage(document.getElementById('red.png'), 0, 0, 100, 50, 100, 0, 50, 50); +ctx.drawImage(document.getElementById('red.png'), 0, 0, 100, 50, 0, -25, 100, 25); +ctx.drawImage(document.getElementById('red.png'), 0, 0, 100, 50, 0, 50, 100, 25); +_assertPixelApprox(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2); +_assertPixelApprox(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2); +_assertPixelApprox(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2); +_assertPixelApprox(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.drawImage.9arg.sourcepos.js b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.9arg.sourcepos.js new file mode 100644 index 0000000..6139b64 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.9arg.sourcepos.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.drawImage(document.getElementById('rgrg-256x256.png'), 140, 20, 100, 50, 0, 0, 100, 50); +_assertPixelApprox(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2); +_assertPixelApprox(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2); +_assertPixelApprox(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2); +_assertPixelApprox(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.drawImage.9arg.sourcesize.js b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.9arg.sourcesize.js new file mode 100644 index 0000000..5081fc1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.9arg.sourcesize.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.drawImage(document.getElementById('rgrg-256x256.png'), 0, 0, 256, 256, 0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 51, 26); +ctx.fillRect(49, 24, 51, 26); +_assertPixelApprox(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2); +_assertPixelApprox(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2); +_assertPixelApprox(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2); +_assertPixelApprox(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2); +_assertPixelApprox(canvas, 20,20, 0,255,0,255, "20,20", "0,255,0,255", 2); +_assertPixelApprox(canvas, 80,20, 0,255,0,255, "80,20", "0,255,0,255", 2); +_assertPixelApprox(canvas, 20,30, 0,255,0,255, "20,30", "0,255,0,255", 2); +_assertPixelApprox(canvas, 80,30, 0,255,0,255, "80,30", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.drawImage.alpha.js b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.alpha.js new file mode 100644 index 0000000..09b4776 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.alpha.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalAlpha = 0; +ctx.drawImage(document.getElementById('red.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.drawImage.animated.apng.js b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.animated.apng.js new file mode 100644 index 0000000..7cbffd1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.animated.apng.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +deferTest(); +setTimeout(wrapFunction(function () { + ctx.drawImage(document.getElementById('anim-gr.png'), 0, 0); + _assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.drawImage.animated.gif.js b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.animated.gif.js new file mode 100644 index 0000000..4e5a3ce --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.animated.gif.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +deferTest(); +setTimeout(wrapFunction(function () { + ctx.drawImage(document.getElementById('anim-gr.gif'), 0, 0); + _assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.drawImage.animated.poster.js b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.animated.poster.js new file mode 100644 index 0000000..180bb47 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.animated.poster.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +ctx.drawImage(document.getElementById('anim-poster-gr.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.drawImage.broken.js b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.broken.js new file mode 100644 index 0000000..bdd7c31 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.broken.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +var img = document.getElementById('broken.png'); +_assertSame(img.complete, false, "img.complete", "false"); +ctx.drawImage(img, 0, 0); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.drawImage.canvas.js b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.canvas.js new file mode 100644 index 0000000..b4a881d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.canvas.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = '#0f0'; +ctx2.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#f00'; +ctx.drawImage(canvas2, 0, 0); + +_assertPixelApprox(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2); +_assertPixelApprox(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2); +_assertPixelApprox(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2); +_assertPixelApprox(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.drawImage.clip.js b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.clip.js new file mode 100644 index 0000000..45b5600 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.clip.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.rect(-10, -10, 1, 1); +ctx.clip(); +ctx.drawImage(document.getElementById('red.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.drawImage.composite.js b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.composite.js new file mode 100644 index 0000000..ebd95e6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.composite.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-over'; +ctx.drawImage(document.getElementById('red.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.drawImage.floatsource.js b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.floatsource.js new file mode 100644 index 0000000..632308a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.floatsource.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +ctx.drawImage(document.getElementById('green.png'), 10.1, 10.1, 0.1, 0.1, 0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.drawImage.incomplete.js b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.incomplete.js new file mode 100644 index 0000000..b27df0c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.incomplete.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +var img = new Image(); +_assertSame(img.complete, false, "img.complete", "false"); +ctx.drawImage(img, 0, 0); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.drawImage.negativedest.js b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.negativedest.js new file mode 100644 index 0000000..51a7120 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.negativedest.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.drawImage(document.getElementById('ggrr-256x256.png'), 100, 78, 50, 50, 0, 50, 50, -50); +ctx.drawImage(document.getElementById('ggrr-256x256.png'), 100, 128, 50, -50, 100, 50, -50, -50); +_assertPixelApprox(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255", 2); +_assertPixelApprox(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255", 2); +_assertPixelApprox(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255", 2); +_assertPixelApprox(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255", 2); +_assertPixelApprox(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255", 2); +_assertPixelApprox(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255", 2); +_assertPixelApprox(canvas, 51,1, 0,255,0,255, "51,1", "0,255,0,255", 2); +_assertPixelApprox(canvas, 51,48, 0,255,0,255, "51,48", "0,255,0,255", 2); +_assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.drawImage.negativedir.js b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.negativedir.js new file mode 100644 index 0000000..dbca7a5 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.negativedir.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.drawImage(document.getElementById('ggrr-256x256.png'), 0, 178, 50, -100, 0, 0, 50, 100); +ctx.drawImage(document.getElementById('ggrr-256x256.png'), 0, 78, 50, 100, 50, 100, 50, -100); +_assertPixelApprox(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255", 2); +_assertPixelApprox(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255", 2); +_assertPixelApprox(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255", 2); +_assertPixelApprox(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255", 2); +_assertPixelApprox(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255", 2); +_assertPixelApprox(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255", 2); +_assertPixelApprox(canvas, 51,1, 0,255,0,255, "51,1", "0,255,0,255", 2); +_assertPixelApprox(canvas, 51,48, 0,255,0,255, "51,48", "0,255,0,255", 2); +_assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.drawImage.negativesource.js b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.negativesource.js new file mode 100644 index 0000000..dfe7bc0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.negativesource.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.drawImage(document.getElementById('ggrr-256x256.png'), 100, 78, -100, 50, 0, 0, 50, 50); +ctx.drawImage(document.getElementById('ggrr-256x256.png'), 100, 128, -100, -50, 50, 0, 50, 50); +_assertPixelApprox(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255", 2); +_assertPixelApprox(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255", 2); +_assertPixelApprox(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255", 2); +_assertPixelApprox(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255", 2); +_assertPixelApprox(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255", 2); +_assertPixelApprox(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255", 2); +_assertPixelApprox(canvas, 51,1, 0,255,0,255, "51,1", "0,255,0,255", 2); +_assertPixelApprox(canvas, 51,48, 0,255,0,255, "51,48", "0,255,0,255", 2); +_assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.drawImage.nonfinite.js b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.nonfinite.js new file mode 100644 index 0000000..10971d3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.nonfinite.js @@ -0,0 +1,310 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +var red = document.getElementById('red.png'); +ctx.drawImage(red, Infinity, 0); +ctx.drawImage(red, -Infinity, 0); +ctx.drawImage(red, NaN, 0); +ctx.drawImage(red, 0, Infinity); +ctx.drawImage(red, 0, -Infinity); +ctx.drawImage(red, 0, NaN); +ctx.drawImage(red, Infinity, Infinity); +ctx.drawImage(red, Infinity, 0, 100, 50); +ctx.drawImage(red, -Infinity, 0, 100, 50); +ctx.drawImage(red, NaN, 0, 100, 50); +ctx.drawImage(red, 0, Infinity, 100, 50); +ctx.drawImage(red, 0, -Infinity, 100, 50); +ctx.drawImage(red, 0, NaN, 100, 50); +ctx.drawImage(red, 0, 0, Infinity, 50); +ctx.drawImage(red, 0, 0, -Infinity, 50); +ctx.drawImage(red, 0, 0, NaN, 50); +ctx.drawImage(red, 0, 0, 100, Infinity); +ctx.drawImage(red, 0, 0, 100, -Infinity); +ctx.drawImage(red, 0, 0, 100, NaN); +ctx.drawImage(red, Infinity, Infinity, 100, 50); +ctx.drawImage(red, Infinity, Infinity, Infinity, 50); +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity); +ctx.drawImage(red, Infinity, Infinity, 100, Infinity); +ctx.drawImage(red, Infinity, 0, Infinity, 50); +ctx.drawImage(red, Infinity, 0, Infinity, Infinity); +ctx.drawImage(red, Infinity, 0, 100, Infinity); +ctx.drawImage(red, 0, Infinity, Infinity, 50); +ctx.drawImage(red, 0, Infinity, Infinity, Infinity); +ctx.drawImage(red, 0, Infinity, 100, Infinity); +ctx.drawImage(red, 0, 0, Infinity, Infinity); +ctx.drawImage(red, Infinity, 0, 100, 50, 0, 0, 100, 50); +ctx.drawImage(red, -Infinity, 0, 100, 50, 0, 0, 100, 50); +ctx.drawImage(red, NaN, 0, 100, 50, 0, 0, 100, 50); +ctx.drawImage(red, 0, Infinity, 100, 50, 0, 0, 100, 50); +ctx.drawImage(red, 0, -Infinity, 100, 50, 0, 0, 100, 50); +ctx.drawImage(red, 0, NaN, 100, 50, 0, 0, 100, 50); +ctx.drawImage(red, 0, 0, Infinity, 50, 0, 0, 100, 50); +ctx.drawImage(red, 0, 0, -Infinity, 50, 0, 0, 100, 50); +ctx.drawImage(red, 0, 0, NaN, 50, 0, 0, 100, 50); +ctx.drawImage(red, 0, 0, 100, Infinity, 0, 0, 100, 50); +ctx.drawImage(red, 0, 0, 100, -Infinity, 0, 0, 100, 50); +ctx.drawImage(red, 0, 0, 100, NaN, 0, 0, 100, 50); +ctx.drawImage(red, 0, 0, 100, 50, Infinity, 0, 100, 50); +ctx.drawImage(red, 0, 0, 100, 50, -Infinity, 0, 100, 50); +ctx.drawImage(red, 0, 0, 100, 50, NaN, 0, 100, 50); +ctx.drawImage(red, 0, 0, 100, 50, 0, Infinity, 100, 50); +ctx.drawImage(red, 0, 0, 100, 50, 0, -Infinity, 100, 50); +ctx.drawImage(red, 0, 0, 100, 50, 0, NaN, 100, 50); +ctx.drawImage(red, 0, 0, 100, 50, 0, 0, Infinity, 50); +ctx.drawImage(red, 0, 0, 100, 50, 0, 0, -Infinity, 50); +ctx.drawImage(red, 0, 0, 100, 50, 0, 0, NaN, 50); +ctx.drawImage(red, 0, 0, 100, 50, 0, 0, 100, Infinity); +ctx.drawImage(red, 0, 0, 100, 50, 0, 0, 100, -Infinity); +ctx.drawImage(red, 0, 0, 100, 50, 0, 0, 100, NaN); +ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, 0, 100, 50); +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, 0, 100, 50); +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, 0, 100, 50); +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, 0, 100, 50); +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, 100, 50); +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, 50); +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, 100, Infinity); +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, 0, Infinity, 50); +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, 0, Infinity, Infinity); +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, 0, 100, Infinity); +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, Infinity, 100, 50); +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, Infinity, Infinity, 50); +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, Infinity, Infinity, Infinity); +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, Infinity, 100, Infinity); +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, 0, Infinity, 50); +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, 0, Infinity, Infinity); +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, 0, 100, Infinity); +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, 0, 100, 50); +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, Infinity, 100, 50); +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, Infinity, Infinity, 50); +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, Infinity, Infinity, Infinity); +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, Infinity, 100, Infinity); +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, 0, Infinity, 50); +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, 0, Infinity, Infinity); +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, 0, 100, Infinity); +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, Infinity, 100, 50); +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, Infinity, Infinity, 50); +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, Infinity, Infinity, Infinity); +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, Infinity, 100, Infinity); +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, 0, Infinity, 50); +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, 0, Infinity, Infinity); +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, 0, 100, Infinity); +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, 0, 100, 50); +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, 0, 100, 50); +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, Infinity, 100, 50); +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, Infinity, Infinity, 50); +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, Infinity, Infinity, Infinity); +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, Infinity, 100, Infinity); +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, 0, Infinity, 50); +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, 0, Infinity, Infinity); +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, 0, 100, Infinity); +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, Infinity, 100, 50); +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, Infinity, Infinity, 50); +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, Infinity, Infinity, Infinity); +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, Infinity, 100, Infinity); +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, 0, Infinity, 50); +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, 0, Infinity, Infinity); +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, 0, 100, Infinity); +ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, 0, 100, 50); +ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, Infinity, 100, 50); +ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, Infinity, Infinity, 50); +ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, Infinity, Infinity, Infinity); +ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, Infinity, 100, Infinity); +ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, 0, Infinity, 50); +ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, 0, Infinity, Infinity); +ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, 0, 100, Infinity); +ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, Infinity, 100, 50); +ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, Infinity, Infinity, 50); +ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, Infinity, Infinity, Infinity); +ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, Infinity, 100, Infinity); +ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, 0, Infinity, 50); +ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, 0, Infinity, Infinity); +ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, 0, 100, Infinity); +ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, 0, 100, 50); +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, 0, 100, 50); +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, 0, 100, 50); +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, Infinity, 100, 50); +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, Infinity, Infinity, 50); +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, Infinity, 100, Infinity); +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, 0, Infinity, 50); +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, 0, Infinity, Infinity); +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, 0, 100, Infinity); +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, Infinity, 100, 50); +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, Infinity, Infinity, 50); +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, Infinity, Infinity, Infinity); +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, Infinity, 100, Infinity); +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, 0, Infinity, 50); +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, 0, Infinity, Infinity); +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, 0, 100, Infinity); +ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, 0, 100, 50); +ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, Infinity, 100, 50); +ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, Infinity, Infinity, 50); +ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, Infinity, Infinity, Infinity); +ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, Infinity, 100, Infinity); +ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, 0, Infinity, 50); +ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, 0, Infinity, Infinity); +ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, 0, 100, Infinity); +ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, Infinity, 100, 50); +ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, Infinity, Infinity, 50); +ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, Infinity, Infinity, Infinity); +ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, Infinity, 100, Infinity); +ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, 0, Infinity, 50); +ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, 0, Infinity, Infinity); +ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, 0, 100, Infinity); +ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, 0, 100, 50); +ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, 0, 100, 50); +ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, Infinity, 100, 50); +ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, Infinity, Infinity, 50); +ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, Infinity, Infinity, Infinity); +ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, Infinity, 100, Infinity); +ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, 0, Infinity, 50); +ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, 0, Infinity, Infinity); +ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, 0, 100, Infinity); +ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, Infinity, 100, 50); +ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, Infinity, Infinity, 50); +ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, Infinity, Infinity, Infinity); +ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, Infinity, 100, Infinity); +ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, 0, Infinity, 50); +ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, 0, Infinity, Infinity); +ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, 0, 100, Infinity); +ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, 0, 100, 50); +ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, Infinity, 100, 50); +ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, Infinity, Infinity, 50); +ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, Infinity, Infinity, Infinity); +ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, Infinity, 100, Infinity); +ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, 0, Infinity, 50); +ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, 0, Infinity, Infinity); +ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, 0, 100, Infinity); +ctx.drawImage(red, Infinity, 0, 100, 50, 0, Infinity, 100, 50); +ctx.drawImage(red, Infinity, 0, 100, 50, 0, Infinity, Infinity, 50); +ctx.drawImage(red, Infinity, 0, 100, 50, 0, Infinity, Infinity, Infinity); +ctx.drawImage(red, Infinity, 0, 100, 50, 0, Infinity, 100, Infinity); +ctx.drawImage(red, Infinity, 0, 100, 50, 0, 0, Infinity, 50); +ctx.drawImage(red, Infinity, 0, 100, 50, 0, 0, Infinity, Infinity); +ctx.drawImage(red, Infinity, 0, 100, 50, 0, 0, 100, Infinity); +ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, 0, 100, 50); +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, 0, 100, 50); +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, 0, 100, 50); +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, Infinity, 100, 50); +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, 50); +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, Infinity, 100, Infinity); +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, 0, Infinity, 50); +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, 0, Infinity, Infinity); +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, 0, 100, Infinity); +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, Infinity, 100, 50); +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, Infinity, Infinity, 50); +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, Infinity, Infinity, Infinity); +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, Infinity, 100, Infinity); +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, 0, Infinity, 50); +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, 0, Infinity, Infinity); +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, 0, 100, Infinity); +ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, 0, 100, 50); +ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, Infinity, 100, 50); +ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, Infinity, Infinity, 50); +ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, Infinity, Infinity, Infinity); +ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, Infinity, 100, Infinity); +ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, 0, Infinity, 50); +ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, 0, Infinity, Infinity); +ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, 0, 100, Infinity); +ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, Infinity, 100, 50); +ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, Infinity, Infinity, 50); +ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, Infinity, Infinity, Infinity); +ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, Infinity, 100, Infinity); +ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, 0, Infinity, 50); +ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, 0, Infinity, Infinity); +ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, 0, 100, Infinity); +ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, 0, 100, 50); +ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, 0, 100, 50); +ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, Infinity, 100, 50); +ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, Infinity, Infinity, 50); +ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, Infinity, Infinity, Infinity); +ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, Infinity, 100, Infinity); +ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, 0, Infinity, 50); +ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, 0, Infinity, Infinity); +ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, 0, 100, Infinity); +ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, Infinity, 100, 50); +ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, Infinity, Infinity, 50); +ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, Infinity, Infinity, Infinity); +ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, Infinity, 100, Infinity); +ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, 0, Infinity, 50); +ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, 0, Infinity, Infinity); +ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, 0, 100, Infinity); +ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, 0, 100, 50); +ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, Infinity, 100, 50); +ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, Infinity, Infinity, 50); +ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, Infinity, Infinity, Infinity); +ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, Infinity, 100, Infinity); +ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, 0, Infinity, 50); +ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, 0, Infinity, Infinity); +ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, 0, 100, Infinity); +ctx.drawImage(red, 0, Infinity, 100, 50, 0, Infinity, 100, 50); +ctx.drawImage(red, 0, Infinity, 100, 50, 0, Infinity, Infinity, 50); +ctx.drawImage(red, 0, Infinity, 100, 50, 0, Infinity, Infinity, Infinity); +ctx.drawImage(red, 0, Infinity, 100, 50, 0, Infinity, 100, Infinity); +ctx.drawImage(red, 0, Infinity, 100, 50, 0, 0, Infinity, 50); +ctx.drawImage(red, 0, Infinity, 100, 50, 0, 0, Infinity, Infinity); +ctx.drawImage(red, 0, Infinity, 100, 50, 0, 0, 100, Infinity); +ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, 0, 100, 50); +ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, 0, 100, 50); +ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, Infinity, 100, 50); +ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, Infinity, Infinity, 50); +ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); +ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, Infinity, 100, Infinity); +ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, 0, Infinity, 50); +ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, 0, Infinity, Infinity); +ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, 0, 100, Infinity); +ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, Infinity, 100, 50); +ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, Infinity, Infinity, 50); +ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, Infinity, Infinity, Infinity); +ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, Infinity, 100, Infinity); +ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, 0, Infinity, 50); +ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, 0, Infinity, Infinity); +ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, 0, 100, Infinity); +ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, 0, 100, 50); +ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, Infinity, 100, 50); +ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, Infinity, Infinity, 50); +ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, Infinity, Infinity, Infinity); +ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, Infinity, 100, Infinity); +ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, 0, Infinity, 50); +ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, 0, Infinity, Infinity); +ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, 0, 100, Infinity); +ctx.drawImage(red, 0, 0, Infinity, 50, 0, Infinity, 100, 50); +ctx.drawImage(red, 0, 0, Infinity, 50, 0, Infinity, Infinity, 50); +ctx.drawImage(red, 0, 0, Infinity, 50, 0, Infinity, Infinity, Infinity); +ctx.drawImage(red, 0, 0, Infinity, 50, 0, Infinity, 100, Infinity); +ctx.drawImage(red, 0, 0, Infinity, 50, 0, 0, Infinity, 50); +ctx.drawImage(red, 0, 0, Infinity, 50, 0, 0, Infinity, Infinity); +ctx.drawImage(red, 0, 0, Infinity, 50, 0, 0, 100, Infinity); +ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, 0, 100, 50); +ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, Infinity, 100, 50); +ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, Infinity, Infinity, 50); +ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, Infinity, Infinity, Infinity); +ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, Infinity, 100, Infinity); +ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, 0, Infinity, 50); +ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, 0, Infinity, Infinity); +ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, 0, 100, Infinity); +ctx.drawImage(red, 0, 0, 100, Infinity, 0, Infinity, 100, 50); +ctx.drawImage(red, 0, 0, 100, Infinity, 0, Infinity, Infinity, 50); +ctx.drawImage(red, 0, 0, 100, Infinity, 0, Infinity, Infinity, Infinity); +ctx.drawImage(red, 0, 0, 100, Infinity, 0, Infinity, 100, Infinity); +ctx.drawImage(red, 0, 0, 100, Infinity, 0, 0, Infinity, 50); +ctx.drawImage(red, 0, 0, 100, Infinity, 0, 0, Infinity, Infinity); +ctx.drawImage(red, 0, 0, 100, Infinity, 0, 0, 100, Infinity); +ctx.drawImage(red, 0, 0, 100, 50, Infinity, Infinity, 100, 50); +ctx.drawImage(red, 0, 0, 100, 50, Infinity, Infinity, Infinity, 50); +ctx.drawImage(red, 0, 0, 100, 50, Infinity, Infinity, Infinity, Infinity); +ctx.drawImage(red, 0, 0, 100, 50, Infinity, Infinity, 100, Infinity); +ctx.drawImage(red, 0, 0, 100, 50, Infinity, 0, Infinity, 50); +ctx.drawImage(red, 0, 0, 100, 50, Infinity, 0, Infinity, Infinity); +ctx.drawImage(red, 0, 0, 100, 50, Infinity, 0, 100, Infinity); +ctx.drawImage(red, 0, 0, 100, 50, 0, Infinity, Infinity, 50); +ctx.drawImage(red, 0, 0, 100, 50, 0, Infinity, Infinity, Infinity); +ctx.drawImage(red, 0, 0, 100, 50, 0, Infinity, 100, Infinity); +ctx.drawImage(red, 0, 0, 100, 50, 0, 0, Infinity, Infinity); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.drawImage.nowrap.js b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.nowrap.js new file mode 100644 index 0000000..44a38e0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.nowrap.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.drawImage(document.getElementById('redtransparent.png'), -1950, 0, 2000, 50); +_assertPixelApprox(canvas, 45,25, 0,255,0,255, "45,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 55,25, 0,255,0,255, "55,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.drawImage.null.js b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.null.js new file mode 100644 index 0000000..34de2e4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.null.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.drawImage(null, 0, 0); +} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail("Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TYPE_MISMATCH_ERR: ctx.drawImage(null, 0, 0)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.drawImage.outsidesource.js b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.outsidesource.js new file mode 100644 index 0000000..266460f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.outsidesource.js @@ -0,0 +1,33 @@ +_addTest(function(canvas, ctx) { + +ctx.drawImage(document.getElementById('green.png'), 10.5, 10.5, 89.5, 39.5, 0, 0, 100, 50); +ctx.drawImage(document.getElementById('green.png'), 5.5, 5.5, -5.5, -5.5, 0, 0, 100, 50); +ctx.drawImage(document.getElementById('green.png'), 100, 50, -5, -5, 0, 0, 100, 50); +try { var _thrown = false; + ctx.drawImage(document.getElementById('red.png'), -0.001, 0, 100, 50, 0, 0, 100, 50); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), -0.001, 0, 100, 50, 0, 0, 100, 50)"); } +try { var _thrown = false; + ctx.drawImage(document.getElementById('red.png'), 0, -0.001, 100, 50, 0, 0, 100, 50); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 0, -0.001, 100, 50, 0, 0, 100, 50)"); } +try { var _thrown = false; + ctx.drawImage(document.getElementById('red.png'), 0, 0, 100.001, 50, 0, 0, 100, 50); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 0, 0, 100.001, 50, 0, 0, 100, 50)"); } +try { var _thrown = false; + ctx.drawImage(document.getElementById('red.png'), 0, 0, 100, 50.001, 0, 0, 100, 50); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 0, 0, 100, 50.001, 0, 0, 100, 50)"); } +try { var _thrown = false; + ctx.drawImage(document.getElementById('red.png'), 50, 0, 50.001, 50, 0, 0, 100, 50); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 50, 0, 50.001, 50, 0, 0, 100, 50)"); } +try { var _thrown = false; + ctx.drawImage(document.getElementById('red.png'), 0, 0, -5, 5, 0, 0, 100, 50); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 0, 0, -5, 5, 0, 0, 100, 50)"); } +try { var _thrown = false; + ctx.drawImage(document.getElementById('red.png'), 0, 0, 5, -5, 0, 0, 100, 50); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 0, 0, 5, -5, 0, 0, 100, 50)"); } +try { var _thrown = false; + ctx.drawImage(document.getElementById('red.png'), 110, 60, -20, -20, 0, 0, 100, 50); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 110, 60, -20, -20, 0, 0, 100, 50)"); } +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.drawImage.path.js b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.path.js new file mode 100644 index 0000000..b3236a1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.path.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.rect(0, 0, 100, 50); +ctx.drawImage(document.getElementById('red.png'), 0, 0); +ctx.fill(); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.drawImage.self.1.js b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.self.1.js new file mode 100644 index 0000000..3032061 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.self.1.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 50, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(50, 0, 50, 50); +ctx.drawImage(canvas, 50, 0); + +_assertPixelApprox(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2); +_assertPixelApprox(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2); +_assertPixelApprox(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2); +_assertPixelApprox(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.drawImage.self.2.js b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.self.2.js new file mode 100644 index 0000000..0cc507d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.self.2.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 1, 100, 49); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 1); +ctx.drawImage(canvas, 0, 1); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 2); + +_assertPixelApprox(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2); +_assertPixelApprox(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2); +_assertPixelApprox(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2); +_assertPixelApprox(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.drawImage.transform.js b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.transform.js new file mode 100644 index 0000000..0817a8e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.transform.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.translate(100, 0); +ctx.drawImage(document.getElementById('red.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.drawImage.wrongtype.js b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.wrongtype.js new file mode 100644 index 0000000..64fb6e4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.wrongtype.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.drawImage(undefined, 0, 0); +} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail("Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TYPE_MISMATCH_ERR: ctx.drawImage(undefined, 0, 0)"); } +try { var _thrown = false; + ctx.drawImage(0, 0, 0); +} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail("Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TYPE_MISMATCH_ERR: ctx.drawImage(0, 0, 0)"); } +try { var _thrown = false; + ctx.drawImage("", 0, 0); +} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail("Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TYPE_MISMATCH_ERR: ctx.drawImage(\"\", 0, 0)"); } +try { var _thrown = false; + ctx.drawImage(document.createElement('p'), 0, 0); +} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail("Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TYPE_MISMATCH_ERR: ctx.drawImage(document.createElement('p'), 0, 0)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.drawImage.zerocanvas.js b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.zerocanvas.js new file mode 100644 index 0000000..2282f8e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.zerocanvas.js @@ -0,0 +1,28 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var canvas2 = document.createElement('canvas'); +canvas2.width = 0; +canvas2.height = 10; +try { var _thrown = false; + ctx.drawImage(canvas2, 0, 0); +} catch (e) { if (e.code != DOMException.INVALID_STATE_ERR) _fail("Failed assertion: expected exception of type INVALID_STATE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INVALID_STATE_ERR: ctx.drawImage(canvas2, 0, 0)"); } + +canvas2.width = 10; +canvas2.height = 0; +try { var _thrown = false; + ctx.drawImage(canvas2, 0, 0); +} catch (e) { if (e.code != DOMException.INVALID_STATE_ERR) _fail("Failed assertion: expected exception of type INVALID_STATE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INVALID_STATE_ERR: ctx.drawImage(canvas2, 0, 0)"); } + +canvas2.width = 0; +canvas2.height = 0; +try { var _thrown = false; + ctx.drawImage(canvas2, 0, 0); +} catch (e) { if (e.code != DOMException.INVALID_STATE_ERR) _fail("Failed assertion: expected exception of type INVALID_STATE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INVALID_STATE_ERR: ctx.drawImage(canvas2, 0, 0)"); } + +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.drawImage.zerosource.js b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.zerosource.js new file mode 100644 index 0000000..6873b86 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.drawImage.zerosource.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +try { var _thrown = false; + ctx.drawImage(document.getElementById('red.png'), 10, 10, 0, 1, 0, 0, 100, 50); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 10, 10, 0, 1, 0, 0, 100, 50)"); } +try { var _thrown = false; + ctx.drawImage(document.getElementById('red.png'), 10, 10, 1, 0, 0, 0, 100, 50); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 10, 10, 1, 0, 0, 0, 100, 50)"); } +try { var _thrown = false; + ctx.drawImage(document.getElementById('red.png'), 10, 10, 0, 0, 0, 0, 100, 50); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 10, 10, 0, 0, 0, 0, 100, 50)"); } +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillRect.basic.js b/platforms/ios/www/test/tests-todo/framed.2d.fillRect.basic.js new file mode 100644 index 0000000..d7e98b3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillRect.basic.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillRect.clip.js b/platforms/ios/www/test/tests-todo/framed.2d.fillRect.clip.js new file mode 100644 index 0000000..1259f13 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillRect.clip.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.beginPath(); +ctx.rect(0, 0, 16, 16); +ctx.clip(); + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 16, 16); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillRect.negative.js b/platforms/ios/www/test/tests-todo/framed.2d.fillRect.negative.js new file mode 100644 index 0000000..b582917 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillRect.negative.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 50, 25); +ctx.fillRect(100, 0, -50, 25); +ctx.fillRect(0, 50, 50, -25); +ctx.fillRect(100, 50, -50, -25); +_assertPixel(canvas, 25,12, 0,255,0,255, "25,12", "0,255,0,255"); +_assertPixel(canvas, 75,12, 0,255,0,255, "75,12", "0,255,0,255"); +_assertPixel(canvas, 25,37, 0,255,0,255, "25,37", "0,255,0,255"); +_assertPixel(canvas, 75,37, 0,255,0,255, "75,37", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillRect.nonfinite.js b/platforms/ios/www/test/tests-todo/framed.2d.fillRect.nonfinite.js new file mode 100644 index 0000000..c224f49 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillRect.nonfinite.js @@ -0,0 +1,34 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#f00'; +ctx.fillRect(Infinity, 0, 100, 50); +ctx.fillRect(-Infinity, 0, 100, 50); +ctx.fillRect(NaN, 0, 100, 50); +ctx.fillRect(0, Infinity, 100, 50); +ctx.fillRect(0, -Infinity, 100, 50); +ctx.fillRect(0, NaN, 100, 50); +ctx.fillRect(0, 0, Infinity, 50); +ctx.fillRect(0, 0, -Infinity, 50); +ctx.fillRect(0, 0, NaN, 50); +ctx.fillRect(0, 0, 100, Infinity); +ctx.fillRect(0, 0, 100, -Infinity); +ctx.fillRect(0, 0, 100, NaN); +ctx.fillRect(Infinity, Infinity, 100, 50); +ctx.fillRect(Infinity, Infinity, Infinity, 50); +ctx.fillRect(Infinity, Infinity, Infinity, Infinity); +ctx.fillRect(Infinity, Infinity, 100, Infinity); +ctx.fillRect(Infinity, 0, Infinity, 50); +ctx.fillRect(Infinity, 0, Infinity, Infinity); +ctx.fillRect(Infinity, 0, 100, Infinity); +ctx.fillRect(0, Infinity, Infinity, 50); +ctx.fillRect(0, Infinity, Infinity, Infinity); +ctx.fillRect(0, Infinity, 100, Infinity); +ctx.fillRect(0, 0, Infinity, Infinity); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillRect.path.js b/platforms/ios/www/test/tests-todo/framed.2d.fillRect.path.js new file mode 100644 index 0000000..6d5fec5 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillRect.path.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.beginPath(); +ctx.rect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 16, 16); +ctx.fillStyle = '#0f0'; +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillRect.shadow.js b/platforms/ios/www/test/tests-todo/framed.2d.fillRect.shadow.js new file mode 100644 index 0000000..8847506 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillRect.shadow.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = '#0f0'; +ctx.shadowBlur = 0; +ctx.shadowOffsetX = 0; +ctx.shadowOffsetY = 50; +ctx.fillRect(0, -50, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillRect.transform.js b/platforms/ios/www/test/tests-todo/framed.2d.fillRect.transform.js new file mode 100644 index 0000000..d80df06 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillRect.transform.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.scale(10, 10); +ctx.translate(0, 5); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, -5, 10, 5); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillRect.zero.js b/platforms/ios/www/test/tests-todo/framed.2d.fillRect.zero.js new file mode 100644 index 0000000..f600d5e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillRect.zero.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 0); +ctx.fillRect(0, 0, 0, 50); +ctx.fillRect(0, 0, 0, 0); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.default.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.default.js new file mode 100644 index 0000000..8256830 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.default.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertEqual(ctx.fillStyle, '#000000', "ctx.fillStyle", "'#000000'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.get.semitransparent.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.get.semitransparent.js new file mode 100644 index 0000000..ae13c6e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.get.semitransparent.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = 'rgba(255,255,255,0.45)'; +_assertMatch(ctx.fillStyle, /^rgba\(255, 255, 255, 0\.4\d+\)$/, "ctx.fillStyle", "/^rgba\\(255, 255, 255, 0\\.4\\d+\\)$/"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.get.solid.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.get.solid.js new file mode 100644 index 0000000..b466c83 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.get.solid.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#fa0'; +_assertSame(ctx.fillStyle, '#ffaa00', "ctx.fillStyle", "'#ffaa00'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.get.transparent.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.get.transparent.js new file mode 100644 index 0000000..ce98d44 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.get.transparent.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = 'rgba(0,0,0,0)'; +_assertEqual(ctx.fillStyle, 'rgba(0, 0, 0, 0.0)', "ctx.fillStyle", "'rgba(0, 0, 0, 0.0)'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.invalidstring.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.invalidstring.js new file mode 100644 index 0000000..45031cc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.invalidstring.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.fillStyle = 'invalid'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.invalidtype.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.invalidtype.js new file mode 100644 index 0000000..3d098f4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.invalidtype.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.fillStyle = null; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.current.basic.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.current.basic.js new file mode 100644 index 0000000..c4e3ef8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.current.basic.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('style', 'color: #0f0'); +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'currentColor'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.current.changed.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.current.changed.js new file mode 100644 index 0000000..aecd2e7 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.current.changed.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('style', 'color: #0f0'); +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'currentColor'; +canvas.setAttribute('style', 'color: #f00'); +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.current.removed.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.current.removed.js new file mode 100644 index 0000000..9c4cb3b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.current.removed.js @@ -0,0 +1,22 @@ +_addTest(function(canvas, ctx) { + +// Try not to let it undetectably incorrectly pick up opaque-black +// from other parts of the document: +document.body.parentNode.setAttribute('style', 'color: #f00'); +document.body.setAttribute('style', 'color: #f00'); +canvas.setAttribute('style', 'color: #f00'); + +var canvas2 = document.createElement('canvas'); +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = '#f00'; +ctx2.fillStyle = 'currentColor'; +ctx2.fillRect(0, 0, 100, 50); +ctx.drawImage(canvas2, 0, 0); + +document.body.parentNode.removeAttribute('style'); +document.body.removeAttribute('style'); + +_assertPixel(canvas, 50,25, 0,0,0,255, "50,25", "0,0,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hex3.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hex3.js new file mode 100644 index 0000000..74b4b25 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hex3.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hex6.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hex6.js new file mode 100644 index 0000000..e076f53 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hex6.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = '#00fF00'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsl-1.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsl-1.js new file mode 100644 index 0000000..0b48479 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsl-1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(120, 100%, 50%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsl-2.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsl-2.js new file mode 100644 index 0000000..1210c7f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsl-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl( -240 , 100% , 50% )'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsl-3.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsl-3.js new file mode 100644 index 0000000..5fbfea0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsl-3.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(360120, 100%, 50%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsl-4.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsl-4.js new file mode 100644 index 0000000..f2b086a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsl-4.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(-360240, 100%, 50%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsl-5.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsl-5.js new file mode 100644 index 0000000..d8c7c27 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsl-5.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(120.0, 100.0%, 50.0%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsl-clamp-1.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsl-clamp-1.js new file mode 100644 index 0000000..375c1f2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsl-clamp-1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(120, 200%, 50%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsl-clamp-2.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsl-clamp-2.js new file mode 100644 index 0000000..c0a6b5b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsl-clamp-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(120, -200%, 49.9%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 127,127,127,255, "50,25", "127,127,127,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsl-clamp-3.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsl-clamp-3.js new file mode 100644 index 0000000..6bb9a8d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsl-clamp-3.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(120, 100%, 200%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 255,255,255,255, "50,25", "255,255,255,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsl-clamp-4.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsl-clamp-4.js new file mode 100644 index 0000000..091eb3c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsl-clamp-4.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(120, 100%, -200%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,0,0,255, "50,25", "0,0,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsla-1.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsla-1.js new file mode 100644 index 0000000..da51825 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsla-1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsla(120, 100%, 50%, 0.499)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,127, "50,25", "0,255,0,127"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsla-2.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsla-2.js new file mode 100644 index 0000000..b746602 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsla-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsla( 120.0 , 100.0% , 50.0% , 1 )'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsla-clamp-1.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsla-clamp-1.js new file mode 100644 index 0000000..97f9eec --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsla-clamp-1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsla(120, 200%, 50%, 1)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsla-clamp-2.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsla-clamp-2.js new file mode 100644 index 0000000..a479c09 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsla-clamp-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsla(120, -200%, 49.9%, 1)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 127,127,127,255, "50,25", "127,127,127,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsla-clamp-3.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsla-clamp-3.js new file mode 100644 index 0000000..69af398 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsla-clamp-3.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsla(120, 100%, 200%, 1)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 255,255,255,255, "50,25", "255,255,255,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsla-clamp-4.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsla-clamp-4.js new file mode 100644 index 0000000..bca6ff3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsla-clamp-4.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsla(120, 100%, -200%, 1)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,0,0,255, "50,25", "0,0,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsla-clamp-5.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsla-clamp-5.js new file mode 100644 index 0000000..9d1a095 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsla-clamp-5.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsla(120, 100%, 50%, 2)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsla-clamp-6.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsla-clamp-6.js new file mode 100644 index 0000000..488477a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.hsla-clamp-6.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsla(120, 100%, 0%, -2)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.html4.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.html4.js new file mode 100644 index 0000000..945cc00 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.html4.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'limE'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hex1.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hex1.js new file mode 100644 index 0000000..85949a0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hex1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = '#f'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hex2.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hex2.js new file mode 100644 index 0000000..d028340 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hex2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = '#f0'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hex3.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hex3.js new file mode 100644 index 0000000..17fa794 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hex3.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = '#g00'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hex4.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hex4.js new file mode 100644 index 0000000..1abcd75 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hex4.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = '#ff00'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hex5.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hex5.js new file mode 100644 index 0000000..8a59b56 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hex5.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = '#ff000'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hex6.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hex6.js new file mode 100644 index 0000000..a296b00 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hex6.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = '#fg0000'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hex7.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hex7.js new file mode 100644 index 0000000..6ef24b8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hex7.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = '#ff0000f'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hex8.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hex8.js new file mode 100644 index 0000000..cca73d9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hex8.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = '#ff0000ff'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hsl-1.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hsl-1.js new file mode 100644 index 0000000..1722e76 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hsl-1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'hsl(0%, 100%, 50%)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hsl-2.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hsl-2.js new file mode 100644 index 0000000..0569b91 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hsl-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'hsl(z, 100%, 50%)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hsl-3.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hsl-3.js new file mode 100644 index 0000000..24b21c5 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hsl-3.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'hsl(0, 0, 50%)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hsl-4.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hsl-4.js new file mode 100644 index 0000000..1a0e021 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hsl-4.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'hsl(0, 100%, 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hsl-5.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hsl-5.js new file mode 100644 index 0000000..a274be3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hsl-5.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'hsl(0, 100%, 100%, 1)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hsla-1.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hsla-1.js new file mode 100644 index 0000000..8bafae8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hsla-1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'hsla(0%, 100%, 50%, 1)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hsla-2.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hsla-2.js new file mode 100644 index 0000000..cdd0063 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.hsla-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'hsla(0, 0, 50%, 1)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.name-1.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.name-1.js new file mode 100644 index 0000000..2db78f7 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.name-1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'darkbrown'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.name-2.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.name-2.js new file mode 100644 index 0000000..16334ed --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.name-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'firebrick1'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.name-3.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.name-3.js new file mode 100644 index 0000000..01c3d71 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.name-3.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'red blue'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.rgb-1.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.rgb-1.js new file mode 100644 index 0000000..4d4ed26 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.rgb-1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgb(255.0, 0, 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.rgb-2.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.rgb-2.js new file mode 100644 index 0000000..e348f93 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.rgb-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgb(255, 0.0, 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.rgb-3.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.rgb-3.js new file mode 100644 index 0000000..64ace0b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.rgb-3.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgb(255.0, 0, 0,)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.rgb-4.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.rgb-4.js new file mode 100644 index 0000000..c56ec66 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.rgb-4.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgb(100%, 0, 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.rgb-5.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.rgb-5.js new file mode 100644 index 0000000..deccba0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.rgb-5.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgb(255 0 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.rgb-6.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.rgb-6.js new file mode 100644 index 0000000..36bba33 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.rgb-6.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgb(255, - 1, 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.rgb-7.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.rgb-7.js new file mode 100644 index 0000000..c919b73 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.rgb-7.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgb(255, 0, 0, 1)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.rgba-1.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.rgba-1.js new file mode 100644 index 0000000..f44a25e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.rgba-1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgba(255, 0, 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.rgba-2.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.rgba-2.js new file mode 100644 index 0000000..29e1c9a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.rgba-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgba(255.0, 0, 0, 1)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.rgba-3.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.rgba-3.js new file mode 100644 index 0000000..2a51261 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.rgba-3.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgba(100%, 0, 0, 1)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.rgba-4.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.rgba-4.js new file mode 100644 index 0000000..e6e9f3a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.rgba-4.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgba(255, 0, 0, 100%)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.rgba-5.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.rgba-5.js new file mode 100644 index 0000000..89ad25d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.invalid.rgba-5.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgba(255, 0, 0, 1. 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.rgb-clamp-1.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.rgb-clamp-1.js new file mode 100644 index 0000000..0647a16 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.rgb-clamp-1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgb(-1000, 1000, -1000)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.rgb-clamp-2.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.rgb-clamp-2.js new file mode 100644 index 0000000..13ecd74 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.rgb-clamp-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgb(-200%, 200%, -200%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.rgb-clamp-3.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.rgb-clamp-3.js new file mode 100644 index 0000000..ee96d11 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.rgb-clamp-3.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgb(-2147483649, 4294967298, -18446744073709551619)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.rgb-clamp-4.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.rgb-clamp-4.js new file mode 100644 index 0000000..6d59992 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.rgb-clamp-4.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgb(-1000000000000000000000000000000000000000, 1000000000000000000000000000000000000000, -1000000000000000000000000000000000000000)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.rgb-clamp-5.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.rgb-clamp-5.js new file mode 100644 index 0000000..8fcb56a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.rgb-clamp-5.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgb(-10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, -10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.rgb-num.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.rgb-num.js new file mode 100644 index 0000000..a7e459d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.rgb-num.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgb(0,255,0)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.rgb-percent.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.rgb-percent.js new file mode 100644 index 0000000..e44de2a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.rgb-percent.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgb(0% ,100% ,0%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.rgba-clamp-1.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.rgba-clamp-1.js new file mode 100644 index 0000000..a21b6e9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.rgba-clamp-1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgba(0, 255, 0, -2)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.rgba-clamp-2.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.rgba-clamp-2.js new file mode 100644 index 0000000..baf6e24 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.rgba-clamp-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgba(0, 255, 0, 2)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.rgba-num-1.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.rgba-num-1.js new file mode 100644 index 0000000..adb60fb --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.rgba-num-1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgba( 0 , 255 , 0 , .499 )'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,127, "50,25", "0,255,0,127"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.rgba-num-2.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.rgba-num-2.js new file mode 100644 index 0000000..0a9e66c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.rgba-num-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgba( 0 , 255 , 0 , 0.499 )'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,127, "50,25", "0,255,0,127"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.rgba-percent.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.rgba-percent.js new file mode 100644 index 0000000..6167e85 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.rgba-percent.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgba(0%,100%,0%,0.499)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,127, "50,25", "0,255,0,127"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.rgba-solid-1.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.rgba-solid-1.js new file mode 100644 index 0000000..a9be424 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.rgba-solid-1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgba( 0 , 255 , 0 , 1 )'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.rgba-solid-2.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.rgba-solid-2.js new file mode 100644 index 0000000..19df73e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.rgba-solid-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgba( 0 , 255 , 0 , 1.0 )'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.svg-1.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.svg-1.js new file mode 100644 index 0000000..9eba318 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.svg-1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'gray'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 128,128,128,255, "50,25", "128,128,128,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.svg-2.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.svg-2.js new file mode 100644 index 0000000..79c9612 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.svg-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'grey'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 128,128,128,255, "50,25", "128,128,128,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.system.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.system.js new file mode 100644 index 0000000..fd3d890 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.system.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'ThreeDDarkShadow'; +_assertMatch(ctx.fillStyle, /^#(?!(FF0000|ff0000|f00)$)/, "ctx.fillStyle", "/^#(?!(FF0000|ff0000|f00)$)/"); // test that it's not red + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.transparent-1.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.transparent-1.js new file mode 100644 index 0000000..c77a1bb --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.transparent-1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'transparent'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.transparent-2.js b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.transparent-2.js new file mode 100644 index 0000000..6243082 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.fillStyle.parse.transparent-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'TrAnSpArEnT'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.getcontext.exists.js b/platforms/ios/www/test/tests-todo/framed.2d.getcontext.exists.js new file mode 100644 index 0000000..1576a66 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.getcontext.exists.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertDifferent(canvas.getContext('2d'), null, "canvas.getContext('2d')", "null"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.getcontext.shared.js b/platforms/ios/www/test/tests-todo/framed.2d.getcontext.shared.js new file mode 100644 index 0000000..a18ef07 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.getcontext.shared.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +var ctx2 = canvas.getContext('2d'); +ctx.fillStyle = '#f00'; +ctx2.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.getcontext.unique.js b/platforms/ios/www/test/tests-todo/framed.2d.getcontext.unique.js new file mode 100644 index 0000000..1d34c7a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.getcontext.unique.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.getContext('2d'), canvas.getContext('2d'), "canvas.getContext('2d')", "canvas.getContext('2d')"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.empty.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.empty.js new file mode 100644 index 0000000..f204d2b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.empty.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +var g = ctx.createLinearGradient(0, 0, 0, 50); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.interpolate.alpha.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.interpolate.alpha.js new file mode 100644 index 0000000..236ab3b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.interpolate.alpha.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#ff0'; +ctx.fillRect(0, 0, 100, 50); +var g = ctx.createLinearGradient(0, 0, 100, 0); +g.addColorStop(0, 'rgba(0,0,255, 0)'); +g.addColorStop(1, 'rgba(0,0,255, 1)'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 25,25, 191,191,63,255, "25,25", "191,191,63,255", 3); +_assertPixelApprox(canvas, 50,25, 127,127,127,255, "50,25", "127,127,127,255", 3); +_assertPixelApprox(canvas, 75,25, 63,63,191,255, "75,25", "63,63,191,255", 3); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.interpolate.colour.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.interpolate.colour.js new file mode 100644 index 0000000..6ce808f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.interpolate.colour.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +var g = ctx.createLinearGradient(0, 0, 100, 0); +g.addColorStop(0, '#ff0'); +g.addColorStop(1, '#00f'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 25,25, 191,191,63,255, "25,25", "191,191,63,255", 3); +_assertPixelApprox(canvas, 50,25, 127,127,127,255, "50,25", "127,127,127,255", 3); +_assertPixelApprox(canvas, 75,25, 63,63,191,255, "75,25", "63,63,191,255", 3); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.interpolate.colouralpha.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.interpolate.colouralpha.js new file mode 100644 index 0000000..f6772c4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.interpolate.colouralpha.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +var g = ctx.createLinearGradient(0, 0, 100, 0); +g.addColorStop(0, 'rgba(255,255,0, 0)'); +g.addColorStop(1, 'rgba(0,0,255, 1)'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 25,25, 191,191,63,63, "25,25", "191,191,63,63", 3); +_assertPixelApprox(canvas, 50,25, 127,127,127,127, "50,25", "127,127,127,127", 3); +_assertPixelApprox(canvas, 75,25, 63,63,191,191, "75,25", "63,63,191,191", 3); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.interpolate.multiple.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.interpolate.multiple.js new file mode 100644 index 0000000..a2be77c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.interpolate.multiple.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 200; +var g = ctx.createLinearGradient(0, 0, 200, 0); +g.addColorStop(0, '#ff0'); +g.addColorStop(0.5, '#0ff'); +g.addColorStop(1, '#f0f'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 200, 50); +_assertPixelApprox(canvas, 50,25, 127,255,127,255, "50,25", "127,255,127,255", 3); +_assertPixelApprox(canvas, 100,25, 0,255,255,255, "100,25", "0,255,255,255", 3); +_assertPixelApprox(canvas, 150,25, 127,127,255,255, "150,25", "127,127,255,255", 3); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.interpolate.outside.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.interpolate.outside.js new file mode 100644 index 0000000..65e5053 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.interpolate.outside.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createLinearGradient(25, 0, 75, 0); +g.addColorStop(0.4, '#0f0'); +g.addColorStop(0.6, '#0f0'); + +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 20,25, 0,255,0,255, "20,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 80,25, 0,255,0,255, "80,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.interpolate.overlap.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.interpolate.overlap.js new file mode 100644 index 0000000..5cf8972 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.interpolate.overlap.js @@ -0,0 +1,31 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 200; +var g = ctx.createLinearGradient(0, 0, 200, 0); +g.addColorStop(0, '#f00'); +g.addColorStop(0, '#ff0'); +g.addColorStop(0.25, '#00f'); +g.addColorStop(0.25, '#0f0'); +g.addColorStop(0.25, '#0f0'); +g.addColorStop(0.25, '#0f0'); +g.addColorStop(0.25, '#ff0'); +g.addColorStop(0.5, '#00f'); +g.addColorStop(0.5, '#0f0'); +g.addColorStop(0.75, '#00f'); +g.addColorStop(0.75, '#f00'); +g.addColorStop(0.75, '#ff0'); +g.addColorStop(0.5, '#0f0'); +g.addColorStop(0.5, '#0f0'); +g.addColorStop(0.5, '#ff0'); +g.addColorStop(1, '#00f'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 200, 50); +_assertPixelApprox(canvas, 49,25, 0,0,255,255, "49,25", "0,0,255,255", 16); +_assertPixelApprox(canvas, 51,25, 255,255,0,255, "51,25", "255,255,0,255", 16); +_assertPixelApprox(canvas, 99,25, 0,0,255,255, "99,25", "0,0,255,255", 16); +_assertPixelApprox(canvas, 101,25, 255,255,0,255, "101,25", "255,255,0,255", 16); +_assertPixelApprox(canvas, 149,25, 0,0,255,255, "149,25", "0,0,255,255", 16); +_assertPixelApprox(canvas, 151,25, 255,255,0,255, "151,25", "255,255,0,255", 16); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.interpolate.overlap2.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.interpolate.overlap2.js new file mode 100644 index 0000000..62e0880 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.interpolate.overlap2.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +var g = ctx.createLinearGradient(0, 0, 100, 0); +var ps = [ 0, 1/10, 1/4, 1/3, 1/2, 3/4, 1 ]; +for (var p = 0; p < ps.length; ++p) +{ + g.addColorStop(ps[p], '#0f0'); + for (var i = 0; i < 15; ++i) + g.addColorStop(ps[p], '#f00'); + g.addColorStop(ps[p], '#0f0'); +} +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 30,25, 0,255,0,255, "30,25", "0,255,0,255"); +_assertPixel(canvas, 40,25, 0,255,0,255, "40,25", "0,255,0,255"); +_assertPixel(canvas, 60,25, 0,255,0,255, "60,25", "0,255,0,255"); +_assertPixel(canvas, 80,25, 0,255,0,255, "80,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.interpolate.solid.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.interpolate.solid.js new file mode 100644 index 0000000..1c73c04 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.interpolate.solid.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +var g = ctx.createLinearGradient(0, 0, 100, 0); +g.addColorStop(0, '#0f0'); +g.addColorStop(1, '#0f0'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.interpolate.vertical.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.interpolate.vertical.js new file mode 100644 index 0000000..30bdf8d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.interpolate.vertical.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +var g = ctx.createLinearGradient(0, 0, 0, 50); +g.addColorStop(0, '#ff0'); +g.addColorStop(1, '#00f'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,12, 191,191,63,255, "50,12", "191,191,63,255", 10); +_assertPixelApprox(canvas, 50,25, 127,127,127,255, "50,25", "127,127,127,255", 5); +_assertPixelApprox(canvas, 50,37, 63,63,191,255, "50,37", "63,63,191,255", 10); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.interpolate.zerosize.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.interpolate.zerosize.js new file mode 100644 index 0000000..fd39054 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.interpolate.zerosize.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createLinearGradient(50, 25, 50, 25); // zero-length line (undefined direction) +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 40,20, 0,255,0,255, "40,20", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.linear.nonfinite.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.linear.nonfinite.js new file mode 100644 index 0000000..696fe82 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.linear.nonfinite.js @@ -0,0 +1,74 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.createLinearGradient(Infinity, 0, 1, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, 0, 1, 0)"); } +try { var _thrown = false; + ctx.createLinearGradient(-Infinity, 0, 1, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(-Infinity, 0, 1, 0)"); } +try { var _thrown = false; + ctx.createLinearGradient(NaN, 0, 1, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(NaN, 0, 1, 0)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, Infinity, 1, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, Infinity, 1, 0)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, -Infinity, 1, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, -Infinity, 1, 0)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, NaN, 1, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, NaN, 1, 0)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, 0, Infinity, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, Infinity, 0)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, 0, -Infinity, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, -Infinity, 0)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, 0, NaN, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, NaN, 0)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, 0, 1, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, 1, Infinity)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, 0, 1, -Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, 1, -Infinity)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, 0, 1, NaN); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, 1, NaN)"); } +try { var _thrown = false; + ctx.createLinearGradient(Infinity, Infinity, 1, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, Infinity, 1, 0)"); } +try { var _thrown = false; + ctx.createLinearGradient(Infinity, Infinity, Infinity, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, Infinity, Infinity, 0)"); } +try { var _thrown = false; + ctx.createLinearGradient(Infinity, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.createLinearGradient(Infinity, Infinity, 1, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, Infinity, 1, Infinity)"); } +try { var _thrown = false; + ctx.createLinearGradient(Infinity, 0, Infinity, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, 0, Infinity, 0)"); } +try { var _thrown = false; + ctx.createLinearGradient(Infinity, 0, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, 0, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.createLinearGradient(Infinity, 0, 1, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, 0, 1, Infinity)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, Infinity, Infinity, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, Infinity, Infinity, 0)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, Infinity, 1, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, Infinity, 1, Infinity)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, 0, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, Infinity, Infinity)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.linear.transform.1.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.linear.transform.1.js new file mode 100644 index 0000000..297fdc5 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.linear.transform.1.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +var g = ctx.createLinearGradient(0, 0, 200, 0); +g.addColorStop(0, '#f00'); +g.addColorStop(0.25, '#0f0'); +g.addColorStop(0.75, '#0f0'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.translate(-50, 0); +ctx.fillRect(50, 0, 100, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.linear.transform.2.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.linear.transform.2.js new file mode 100644 index 0000000..d461074 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.linear.transform.2.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.translate(100, 0); +var g = ctx.createLinearGradient(0, 0, 200, 0); +g.addColorStop(0, '#f00'); +g.addColorStop(0.25, '#0f0'); +g.addColorStop(0.75, '#0f0'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.translate(-150, 0); +ctx.fillRect(50, 0, 100, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.linear.transform.3.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.linear.transform.3.js new file mode 100644 index 0000000..152ce92 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.linear.transform.3.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +var g = ctx.createLinearGradient(0, 0, 200, 0); +g.addColorStop(0, '#f00'); +g.addColorStop(0.25, '#0f0'); +g.addColorStop(0.75, '#0f0'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +ctx.translate(-50, 0); +ctx.fillRect(50, 0, 100, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.object.compare.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.object.compare.js new file mode 100644 index 0000000..d143b9c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.object.compare.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +var g1 = ctx.createLinearGradient(0, 0, 100, 0); +var g2 = ctx.createLinearGradient(0, 0, 100, 0); +_assertDifferent(g1, g2, "g1", "g2"); +ctx.fillStyle = g1; +_assertSame(ctx.fillStyle, g1, "ctx.fillStyle", "g1"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.object.crosscanvas.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.object.crosscanvas.js new file mode 100644 index 0000000..9a97619 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.object.crosscanvas.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +var g = document.createElement('canvas').getContext('2d').createLinearGradient(0, 0, 100, 0); +g.addColorStop(0, '#0f0'); +g.addColorStop(1, '#0f0'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.object.invalidcolour.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.object.invalidcolour.js new file mode 100644 index 0000000..609b069 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.object.invalidcolour.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +var g = ctx.createLinearGradient(0, 0, 100, 0); +try { var _thrown = false; + g.addColorStop(0, ""); +} catch (e) { if (e.code != DOMException.SYNTAX_ERR) _fail("Failed assertion: expected exception of type SYNTAX_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type SYNTAX_ERR: g.addColorStop(0, \"\")"); } +try { var _thrown = false; + g.addColorStop(0, 'undefined'); +} catch (e) { if (e.code != DOMException.SYNTAX_ERR) _fail("Failed assertion: expected exception of type SYNTAX_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type SYNTAX_ERR: g.addColorStop(0, 'undefined')"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.object.invalidoffset.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.object.invalidoffset.js new file mode 100644 index 0000000..447ba83 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.object.invalidoffset.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +var g = ctx.createLinearGradient(0, 0, 100, 0); +try { var _thrown = false; + g.addColorStop(-1, '#000'); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: g.addColorStop(-1, '#000')"); } +try { var _thrown = false; + g.addColorStop(2, '#000'); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: g.addColorStop(2, '#000')"); } +try { var _thrown = false; + g.addColorStop(Infinity, '#000'); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: g.addColorStop(Infinity, '#000')"); } +try { var _thrown = false; + g.addColorStop(-Infinity, '#000'); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: g.addColorStop(-Infinity, '#000')"); } +try { var _thrown = false; + g.addColorStop(NaN, '#000'); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: g.addColorStop(NaN, '#000')"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.object.return.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.object.return.js new file mode 100644 index 0000000..63870c5 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.object.return.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +window.CanvasGradient.prototype.thisImplementsCanvasGradient = true; + +var g1 = ctx.createLinearGradient(0, 0, 100, 0); +_assertDifferent(g1.addColorStop, undefined, "g1.addColorStop", "undefined"); +_assertSame(g1.thisImplementsCanvasGradient, true, "g1.thisImplementsCanvasGradient", "true"); + +var g2 = ctx.createRadialGradient(0, 0, 10, 0, 0, 20); +_assertDifferent(g2.addColorStop, undefined, "g2.addColorStop", "undefined"); +_assertSame(g2.thisImplementsCanvasGradient, true, "g2.thisImplementsCanvasGradient", "true"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.object.update.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.object.update.js new file mode 100644 index 0000000..fc3d299 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.object.update.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +var g = ctx.createLinearGradient(-100, 0, 200, 0); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +g.addColorStop(0.1, '#0f0'); +g.addColorStop(0.9, '#0f0'); +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.cone.behind.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.cone.behind.js new file mode 100644 index 0000000..6699a5c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.cone.behind.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(120, 25, 10, 211, 25, 100); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.cone.beside.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.cone.beside.js new file mode 100644 index 0000000..318df5b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.cone.beside.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(0, 100, 40, 100, 100, 50); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.cone.bottom.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.cone.bottom.js new file mode 100644 index 0000000..d4f3e09 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.cone.bottom.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(210, 25, 100, 230, 25, 101); +g.addColorStop(0, '#0f0'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.cone.cylinder.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.cone.cylinder.js new file mode 100644 index 0000000..5455012 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.cone.cylinder.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(210, 25, 100, 230, 25, 100); +g.addColorStop(0, '#0f0'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.cone.front.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.cone.front.js new file mode 100644 index 0000000..54bdcda --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.cone.front.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(311, 25, 10, 210, 25, 100); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#0f0'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.cone.shape1.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.cone.shape1.js new file mode 100644 index 0000000..065fd1a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.cone.shape1.js @@ -0,0 +1,32 @@ +_addTest(function(canvas, ctx) { + +var tol = 1; // tolerance to avoid antialiasing artifacts + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(30+tol, 40); +ctx.lineTo(110, -20+tol); +ctx.lineTo(110, 100-tol); +ctx.fill(); + +var g = ctx.createRadialGradient(30+10*5/2, 40, 10*3/2, 30+10*15/4, 40, 10*9/4); +g.addColorStop(0, '#0f0'); +g.addColorStop(1, '#0f0'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.cone.shape2.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.cone.shape2.js new file mode 100644 index 0000000..7d2f6e8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.cone.shape2.js @@ -0,0 +1,32 @@ +_addTest(function(canvas, ctx) { + +var tol = 1; // tolerance to avoid antialiasing artifacts + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(30+10*5/2, 40, 10*3/2, 30+10*15/4, 40, 10*9/4); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(30-tol, 40); +ctx.lineTo(110, -20-tol); +ctx.lineTo(110, 100+tol); +ctx.fill(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.cone.top.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.cone.top.js new file mode 100644 index 0000000..c1b4cd2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.cone.top.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(230, 25, 100, 100, 25, 101); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#0f0'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.equal.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.equal.js new file mode 100644 index 0000000..d30ffda --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.equal.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(50, 25, 20, 50, 25, 20); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.inside1.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.inside1.js new file mode 100644 index 0000000..40747e8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.inside1.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(50, 25, 100, 50, 25, 200); +g.addColorStop(0, '#0f0'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.inside2.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.inside2.js new file mode 100644 index 0000000..d290618 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.inside2.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(50, 25, 200, 50, 25, 100); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#0f0'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.inside3.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.inside3.js new file mode 100644 index 0000000..4f2a7ba --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.inside3.js @@ -0,0 +1,24 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(50, 25, 200, 50, 25, 100); +g.addColorStop(0, '#f00'); +g.addColorStop(0.993, '#f00'); +g.addColorStop(1, '#0f0'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.negative.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.negative.js new file mode 100644 index 0000000..ba805b1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.negative.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.createRadialGradient(0, 0, -0.1, 0, 0, 1); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.createRadialGradient(0, 0, -0.1, 0, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, 1, 0, 0, -0.1); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.createRadialGradient(0, 0, 1, 0, 0, -0.1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, -0.1, 0, 0, -0.1); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.createRadialGradient(0, 0, -0.1, 0, 0, -0.1)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.nonfinite.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.nonfinite.js new file mode 100644 index 0000000..6d1a1ab --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.nonfinite.js @@ -0,0 +1,230 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.createRadialGradient(Infinity, 0, 1, 0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, 0, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(-Infinity, 0, 1, 0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(-Infinity, 0, 1, 0, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(NaN, 0, 1, 0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(NaN, 0, 1, 0, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, Infinity, 1, 0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, 0, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, -Infinity, 1, 0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, -Infinity, 1, 0, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, NaN, 1, 0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, NaN, 1, 0, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, Infinity, 0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, 0, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, -Infinity, 0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, -Infinity, 0, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, NaN, 0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, NaN, 0, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, 1, Infinity, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, Infinity, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, 1, -Infinity, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, -Infinity, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, 1, NaN, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, NaN, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, 1, 0, Infinity, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, Infinity, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, 1, 0, -Infinity, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, -Infinity, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, 1, 0, NaN, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, NaN, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, 1, 0, 0, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, 0, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, 1, 0, 0, -Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, 0, -Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, 1, 0, 0, NaN); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, 0, NaN)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, Infinity, 1, 0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, 0, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, Infinity, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, Infinity, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, 0, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, 0, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, Infinity, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, Infinity, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, 0, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, 0, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, Infinity, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, Infinity, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, 0, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, 0, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, Infinity, 1, 0, Infinity, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, 0, Infinity, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, Infinity, 1, 0, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, 0, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, Infinity, 1, 0, 0, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, 0, 0, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, 0, Infinity, 0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, 0, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, Infinity, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, Infinity, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, 0, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, 0, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, 0, Infinity, 0, Infinity, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, 0, Infinity, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, 0, Infinity, 0, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, 0, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, 0, Infinity, 0, 0, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, 0, 0, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, 0, 1, Infinity, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, Infinity, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, 0, 1, Infinity, Infinity, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, Infinity, Infinity, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, 0, 1, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, 0, 1, Infinity, 0, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, Infinity, 0, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, 0, 1, 0, Infinity, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, 0, Infinity, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, 0, 1, 0, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, 0, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, 0, 1, 0, 0, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, 0, 0, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, Infinity, Infinity, 0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, 0, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, Infinity, Infinity, Infinity, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, Infinity, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, Infinity, Infinity, Infinity, Infinity, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, Infinity, Infinity, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, Infinity, Infinity, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, Infinity, Infinity, Infinity, 0, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, Infinity, 0, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, Infinity, Infinity, 0, Infinity, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, 0, Infinity, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, Infinity, Infinity, 0, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, 0, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, Infinity, Infinity, 0, 0, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, 0, 0, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, Infinity, 1, Infinity, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, Infinity, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, Infinity, 1, Infinity, Infinity, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, Infinity, Infinity, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, Infinity, 1, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, Infinity, 1, Infinity, 0, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, Infinity, 0, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, Infinity, 1, 0, Infinity, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, 0, Infinity, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, Infinity, 1, 0, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, 0, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, Infinity, 1, 0, 0, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, 0, 0, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, Infinity, Infinity, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, Infinity, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, Infinity, Infinity, Infinity, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, Infinity, Infinity, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, Infinity, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, Infinity, Infinity, 0, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, Infinity, 0, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, Infinity, 0, Infinity, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, 0, Infinity, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, Infinity, 0, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, 0, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, Infinity, 0, 0, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, 0, 0, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, 1, Infinity, Infinity, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, Infinity, Infinity, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, 1, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, 1, Infinity, 0, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, Infinity, 0, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, 1, 0, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, Infinity, Infinity)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.outside1.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.outside1.js new file mode 100644 index 0000000..365d957 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.outside1.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(200, 25, 10, 200, 25, 20); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#0f0'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.outside2.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.outside2.js new file mode 100644 index 0000000..9489a94 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.outside2.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(200, 25, 20, 200, 25, 10); +g.addColorStop(0, '#0f0'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.outside3.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.outside3.js new file mode 100644 index 0000000..2d63b00 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.outside3.js @@ -0,0 +1,24 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(200, 25, 20, 200, 25, 10); +g.addColorStop(0, '#0f0'); +g.addColorStop(0.001, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.touch1.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.touch1.js new file mode 100644 index 0000000..2761093 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.touch1.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(150, 25, 50, 200, 25, 100); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.touch2.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.touch2.js new file mode 100644 index 0000000..9c507c8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.touch2.js @@ -0,0 +1,25 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(-80, 25, 70, 0, 25, 150); +g.addColorStop(0, '#f00'); +g.addColorStop(0.01, '#0f0'); +g.addColorStop(0.99, '#0f0'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.touch3.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.touch3.js new file mode 100644 index 0000000..3c8a546 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.touch3.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(120, -15, 25, 140, -30, 50); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.transform.1.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.transform.1.js new file mode 100644 index 0000000..bfc0ebc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.transform.1.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +var g = ctx.createRadialGradient(0, 0, 0, 0, 0, 11.2); +g.addColorStop(0, '#0f0'); +g.addColorStop(0.5, '#0f0'); +g.addColorStop(0.51, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.translate(50, 25); +ctx.scale(10, 10); +ctx.fillRect(-5, -2.5, 10, 5); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.transform.2.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.transform.2.js new file mode 100644 index 0000000..1603b0b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.transform.2.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.translate(100, 0); +var g = ctx.createRadialGradient(0, 0, 0, 0, 0, 11.2); +g.addColorStop(0, '#0f0'); +g.addColorStop(0.5, '#0f0'); +g.addColorStop(0.51, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.translate(-50, 25); +ctx.scale(10, 10); +ctx.fillRect(-5, -2.5, 10, 5); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.transform.3.js b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.transform.3.js new file mode 100644 index 0000000..33acdd4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.gradient.radial.transform.3.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +var g = ctx.createRadialGradient(0, 0, 0, 0, 0, 11.2); +g.addColorStop(0, '#0f0'); +g.addColorStop(0.5, '#0f0'); +g.addColorStop(0.51, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +ctx.translate(50, 25); +ctx.scale(10, 10); +ctx.fillRect(-5, -2.5, 10, 5); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.create1.basic.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.create1.basic.js new file mode 100644 index 0000000..cca632c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.create1.basic.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertDifferent(ctx.createImageData(ctx.createImageData(1, 1)), null, "ctx.createImageData(ctx.createImageData(1, 1))", "null"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.create1.initial.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.create1.initial.js new file mode 100644 index 0000000..2c3bd2d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.create1.initial.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +var imgdata1 = ctx.getImageData(0, 0, 10, 20); +var imgdata2 = ctx.createImageData(imgdata1); +_assertEqual(imgdata2.data.length, imgdata1.data.length, "imgdata2.data.length", "imgdata1.data.length"); +_assertEqual(imgdata2.width, imgdata1.width, "imgdata2.width", "imgdata1.width"); +_assertEqual(imgdata2.height, imgdata1.height, "imgdata2.height", "imgdata1.height"); +var isTransparentBlack = true; +for (var i = 0; i < imgdata2.data.length; ++i) + if (imgdata2.data[i] !== 0) + isTransparentBlack = false; +_assert(isTransparentBlack, "isTransparentBlack"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.create1.type.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.create1.type.js new file mode 100644 index 0000000..d2fe511 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.create1.type.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +_assertDifferent(window.ImageData, undefined, "window.ImageData", "undefined"); +_assertDifferent(window.CanvasPixelArray, undefined, "window.CanvasPixelArray", "undefined"); +window.ImageData.prototype.thisImplementsImageData = true; +window.CanvasPixelArray.prototype.thisImplementsCanvasPixelArray = true; +var imgdata = ctx.createImageData(ctx.createImageData(1, 1)); +_assert(imgdata.thisImplementsImageData, "imgdata.thisImplementsImageData"); +_assert(imgdata.data.thisImplementsCanvasPixelArray, "imgdata.data.thisImplementsCanvasPixelArray"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.create1.zero.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.create1.zero.js new file mode 100644 index 0000000..4eb5d8f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.create1.zero.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.createImageData(null); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createImageData(null)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.create2.basic.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.create2.basic.js new file mode 100644 index 0000000..770dd91 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.create2.basic.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertDifferent(ctx.createImageData(1, 1), null, "ctx.createImageData(1, 1)", "null"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.create2.initial.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.create2.initial.js new file mode 100644 index 0000000..9d8645e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.create2.initial.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.createImageData(10, 20); +_assertEqual(imgdata.data.length, imgdata.width*imgdata.height*4, "imgdata.data.length", "imgdata.width*imgdata.height*4"); +_assert(imgdata.width < imgdata.height, "imgdata.width < imgdata.height"); +_assert(imgdata.width > 0, "imgdata.width > 0"); +var isTransparentBlack = true; +for (var i = 0; i < imgdata.data.length; ++i) + if (imgdata.data[i] !== 0) + isTransparentBlack = false; +_assert(isTransparentBlack, "isTransparentBlack"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.create2.large.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.create2.large.js new file mode 100644 index 0000000..45e2294 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.create2.large.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.createImageData(1000, 2000); +_assertEqual(imgdata.data.length, imgdata.width*imgdata.height*4, "imgdata.data.length", "imgdata.width*imgdata.height*4"); +_assert(imgdata.width < imgdata.height, "imgdata.width < imgdata.height"); +_assert(imgdata.width > 0, "imgdata.width > 0"); +var isTransparentBlack = true; +for (var i = 0; i < imgdata.data.length; i += 7813) // check ~1024 points (assuming normal scaling) + if (imgdata.data[i] !== 0) + isTransparentBlack = false; +_assert(isTransparentBlack, "isTransparentBlack"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.create2.negative.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.create2.negative.js new file mode 100644 index 0000000..4a1df28 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.create2.negative.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +var imgdata1 = ctx.createImageData(10, 20); +var imgdata2 = ctx.createImageData(-10, 20); +var imgdata3 = ctx.createImageData(10, -20); +var imgdata4 = ctx.createImageData(-10, -20); +_assertEqual(imgdata1.data.length, imgdata2.data.length, "imgdata1.data.length", "imgdata2.data.length"); +_assertEqual(imgdata2.data.length, imgdata3.data.length, "imgdata2.data.length", "imgdata3.data.length"); +_assertEqual(imgdata3.data.length, imgdata4.data.length, "imgdata3.data.length", "imgdata4.data.length"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.create2.nonfinite.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.create2.nonfinite.js new file mode 100644 index 0000000..b0c3eae --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.create2.nonfinite.js @@ -0,0 +1,26 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.createImageData(Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createImageData(Infinity, 10)"); } +try { var _thrown = false; + ctx.createImageData(-Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createImageData(-Infinity, 10)"); } +try { var _thrown = false; + ctx.createImageData(NaN, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createImageData(NaN, 10)"); } +try { var _thrown = false; + ctx.createImageData(10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createImageData(10, Infinity)"); } +try { var _thrown = false; + ctx.createImageData(10, -Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createImageData(10, -Infinity)"); } +try { var _thrown = false; + ctx.createImageData(10, NaN); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createImageData(10, NaN)"); } +try { var _thrown = false; + ctx.createImageData(Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createImageData(Infinity, Infinity)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.create2.round.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.create2.round.js new file mode 100644 index 0000000..5e97a65 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.create2.round.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +var imgdata1 = ctx.createImageData(10.01, 10.99); +var imgdata2 = ctx.getImageData(0, 0, 10.01, 10.99); +_assertEqual(imgdata1.width, imgdata2.width, "imgdata1.width", "imgdata2.width"); +_assertEqual(imgdata1.height, imgdata2.height, "imgdata1.height", "imgdata2.height"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.create2.tiny.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.create2.tiny.js new file mode 100644 index 0000000..adf0c25 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.create2.tiny.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.createImageData(0.0001, 0.0001); +_assertEqual(imgdata.data.length, imgdata.width*imgdata.height*4, "imgdata.data.length", "imgdata.width*imgdata.height*4"); +_assertEqual(imgdata.width, 1, "imgdata.width", "1"); +_assertEqual(imgdata.height, 1, "imgdata.height", "1"); +var isTransparentBlack = true; +for (var i = 0; i < imgdata.data.length; ++i) + if (imgdata.data[i] !== 0) + isTransparentBlack = false; +_assert(isTransparentBlack, "isTransparentBlack"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.create2.type.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.create2.type.js new file mode 100644 index 0000000..0c9d3d8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.create2.type.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +_assertDifferent(window.ImageData, undefined, "window.ImageData", "undefined"); +_assertDifferent(window.CanvasPixelArray, undefined, "window.CanvasPixelArray", "undefined"); +window.ImageData.prototype.thisImplementsImageData = true; +window.CanvasPixelArray.prototype.thisImplementsCanvasPixelArray = true; +var imgdata = ctx.createImageData(1, 1); +_assert(imgdata.thisImplementsImageData, "imgdata.thisImplementsImageData"); +_assert(imgdata.data.thisImplementsCanvasPixelArray, "imgdata.data.thisImplementsCanvasPixelArray"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.create2.zero.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.create2.zero.js new file mode 100644 index 0000000..2f9f61c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.create2.zero.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.createImageData(10, 0); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.createImageData(10, 0)"); } +try { var _thrown = false; + ctx.createImageData(0, 10); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.createImageData(0, 10)"); } +try { var _thrown = false; + ctx.createImageData(0, 0); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.createImageData(0, 0)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.basic.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.basic.js new file mode 100644 index 0000000..88070d6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.basic.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertDifferent(ctx.getImageData(0, 0, 100, 50), null, "ctx.getImageData(0, 0, 100, 50)", "null"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.clamp.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.clamp.js new file mode 100644 index 0000000..05345d6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.clamp.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = 'rgb(-100, -200, -300)'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = 'rgb(256, 300, 400)'; +ctx.fillRect(20, 10, 60, 10); +var imgdata1 = ctx.getImageData(10, 5, 1, 1); +_assertSame(imgdata1.data[0], 0, "imgdata1.data[\""+(0)+"\"]", "0"); +_assertSame(imgdata1.data[1], 0, "imgdata1.data[\""+(1)+"\"]", "0"); +_assertSame(imgdata1.data[2], 0, "imgdata1.data[\""+(2)+"\"]", "0"); +var imgdata2 = ctx.getImageData(30, 15, 1, 1); +_assertSame(imgdata2.data[0], 255, "imgdata2.data[\""+(0)+"\"]", "255"); +_assertSame(imgdata2.data[1], 255, "imgdata2.data[\""+(1)+"\"]", "255"); +_assertSame(imgdata2.data[2], 255, "imgdata2.data[\""+(2)+"\"]", "255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.length.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.length.js new file mode 100644 index 0000000..4ecc44e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.length.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.getImageData(0, 0, 10, 10); +_assertEqual(imgdata.data.length, imgdata.width*imgdata.height*4, "imgdata.data.length", "imgdata.width*imgdata.height*4"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.nonfinite.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.nonfinite.js new file mode 100644 index 0000000..81547ae --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.nonfinite.js @@ -0,0 +1,74 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.getImageData(Infinity, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(Infinity, 10, 10, 10)"); } +try { var _thrown = false; + ctx.getImageData(-Infinity, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(-Infinity, 10, 10, 10)"); } +try { var _thrown = false; + ctx.getImageData(NaN, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(NaN, 10, 10, 10)"); } +try { var _thrown = false; + ctx.getImageData(10, Infinity, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, Infinity, 10, 10)"); } +try { var _thrown = false; + ctx.getImageData(10, -Infinity, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, -Infinity, 10, 10)"); } +try { var _thrown = false; + ctx.getImageData(10, NaN, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, NaN, 10, 10)"); } +try { var _thrown = false; + ctx.getImageData(10, 10, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, 10, Infinity, 10)"); } +try { var _thrown = false; + ctx.getImageData(10, 10, -Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, 10, -Infinity, 10)"); } +try { var _thrown = false; + ctx.getImageData(10, 10, NaN, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, 10, NaN, 10)"); } +try { var _thrown = false; + ctx.getImageData(10, 10, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, 10, 10, Infinity)"); } +try { var _thrown = false; + ctx.getImageData(10, 10, 10, -Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, 10, 10, -Infinity)"); } +try { var _thrown = false; + ctx.getImageData(10, 10, 10, NaN); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, 10, 10, NaN)"); } +try { var _thrown = false; + ctx.getImageData(Infinity, Infinity, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(Infinity, Infinity, 10, 10)"); } +try { var _thrown = false; + ctx.getImageData(Infinity, Infinity, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(Infinity, Infinity, Infinity, 10)"); } +try { var _thrown = false; + ctx.getImageData(Infinity, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(Infinity, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.getImageData(Infinity, Infinity, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(Infinity, Infinity, 10, Infinity)"); } +try { var _thrown = false; + ctx.getImageData(Infinity, 10, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(Infinity, 10, Infinity, 10)"); } +try { var _thrown = false; + ctx.getImageData(Infinity, 10, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(Infinity, 10, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.getImageData(Infinity, 10, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(Infinity, 10, 10, Infinity)"); } +try { var _thrown = false; + ctx.getImageData(10, Infinity, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, Infinity, Infinity, 10)"); } +try { var _thrown = false; + ctx.getImageData(10, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.getImageData(10, Infinity, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, Infinity, 10, Infinity)"); } +try { var _thrown = false; + ctx.getImageData(10, 10, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, 10, Infinity, Infinity)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.nonpremul.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.nonpremul.js new file mode 100644 index 0000000..7fbe377 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.nonpremul.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = 'rgba(255, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +var imgdata = ctx.getImageData(10, 10, 10, 10); +_assert(imgdata.data[0] > 200, "imgdata.data[\""+(0)+"\"] > 200"); +_assert(imgdata.data[1] > 200, "imgdata.data[\""+(1)+"\"] > 200"); +_assert(imgdata.data[2] > 200, "imgdata.data[\""+(2)+"\"] > 200"); +_assert(imgdata.data[3] > 100, "imgdata.data[\""+(3)+"\"] > 100"); +_assert(imgdata.data[3] < 200, "imgdata.data[\""+(3)+"\"] < 200"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.order.alpha.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.order.alpha.js new file mode 100644 index 0000000..eebf106 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.order.alpha.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = 'rgba(0, 0, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +var imgdata = ctx.getImageData(0, 0, 10, 10); +_assert(imgdata.data[3] < 200, "imgdata.data[\""+(3)+"\"] < 200"); +_assert(imgdata.data[3] > 100, "imgdata.data[\""+(3)+"\"] > 100"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.order.cols.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.order.cols.js new file mode 100644 index 0000000..b911b92 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.order.cols.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#fff'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#000'; +ctx.fillRect(0, 0, 2, 50); +var imgdata = ctx.getImageData(0, 0, 10, 10); +_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); +_assertSame(imgdata.data[Math.round(imgdata.width/2*4)], 255, "imgdata.data[Math.round(imgdata.width/2*4)]", "255"); +_assertSame(imgdata.data[Math.round((imgdata.height/2)*imgdata.width*4)], 0, "imgdata.data[Math.round((imgdata.height/2)*imgdata.width*4)]", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.order.rgb.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.order.rgb.js new file mode 100644 index 0000000..0a6bdd7 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.order.rgb.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#48c'; +ctx.fillRect(0, 0, 100, 50); +var imgdata = ctx.getImageData(0, 0, 10, 10); +_assertSame(imgdata.data[0], 0x44, "imgdata.data[\""+(0)+"\"]", "0x44"); +_assertSame(imgdata.data[1], 0x88, "imgdata.data[\""+(1)+"\"]", "0x88"); +_assertSame(imgdata.data[2], 0xCC, "imgdata.data[\""+(2)+"\"]", "0xCC"); +_assertSame(imgdata.data[3], 255, "imgdata.data[\""+(3)+"\"]", "255"); +_assertSame(imgdata.data[4], 0x44, "imgdata.data[\""+(4)+"\"]", "0x44"); +_assertSame(imgdata.data[5], 0x88, "imgdata.data[\""+(5)+"\"]", "0x88"); +_assertSame(imgdata.data[6], 0xCC, "imgdata.data[\""+(6)+"\"]", "0xCC"); +_assertSame(imgdata.data[7], 255, "imgdata.data[\""+(7)+"\"]", "255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.order.rows.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.order.rows.js new file mode 100644 index 0000000..493395a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.order.rows.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#fff'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#000'; +ctx.fillRect(0, 0, 100, 2); +var imgdata = ctx.getImageData(0, 0, 10, 10); +_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); +_assertSame(imgdata.data[Math.floor(imgdata.width/2*4)], 0, "imgdata.data[Math.floor(imgdata.width/2*4)]", "0"); +_assertSame(imgdata.data[(imgdata.height/2)*imgdata.width*4], 255, "imgdata.data[(imgdata.height/2)*imgdata.width*4]", "255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.range.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.range.js new file mode 100644 index 0000000..27614dd --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.range.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#000'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#fff'; +ctx.fillRect(20, 10, 60, 10); +var imgdata1 = ctx.getImageData(10, 5, 1, 1); +_assertSame(imgdata1.data[0], 0, "imgdata1.data[\""+(0)+"\"]", "0"); +var imgdata2 = ctx.getImageData(30, 15, 1, 1); +_assertSame(imgdata2.data[0], 255, "imgdata2.data[\""+(0)+"\"]", "255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.source.negative.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.source.negative.js new file mode 100644 index 0000000..ec9b28a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.source.negative.js @@ -0,0 +1,25 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#000'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#fff'; +ctx.fillRect(20, 10, 60, 10); + +var imgdata1 = ctx.getImageData(85, 25, -10, -10); +_assertSame(imgdata1.data[0], 255, "imgdata1.data[\""+(0)+"\"]", "255"); +_assertSame(imgdata1.data[1], 255, "imgdata1.data[\""+(1)+"\"]", "255"); +_assertSame(imgdata1.data[2], 255, "imgdata1.data[\""+(2)+"\"]", "255"); +_assertSame(imgdata1.data[3], 255, "imgdata1.data[\""+(3)+"\"]", "255"); +_assertSame(imgdata1.data[imgdata1.data.length-4+0], 0, "imgdata1.data[imgdata1.data.length-4+0]", "0"); +_assertSame(imgdata1.data[imgdata1.data.length-4+1], 0, "imgdata1.data[imgdata1.data.length-4+1]", "0"); +_assertSame(imgdata1.data[imgdata1.data.length-4+2], 0, "imgdata1.data[imgdata1.data.length-4+2]", "0"); +_assertSame(imgdata1.data[imgdata1.data.length-4+3], 255, "imgdata1.data[imgdata1.data.length-4+3]", "255"); + +var imgdata2 = ctx.getImageData(0, 0, -1, -1); +_assertSame(imgdata2.data[0], 0, "imgdata2.data[\""+(0)+"\"]", "0"); +_assertSame(imgdata2.data[1], 0, "imgdata2.data[\""+(1)+"\"]", "0"); +_assertSame(imgdata2.data[2], 0, "imgdata2.data[\""+(2)+"\"]", "0"); +_assertSame(imgdata2.data[3], 0, "imgdata2.data[\""+(3)+"\"]", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.source.outside.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.source.outside.js new file mode 100644 index 0000000..a915b82 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.source.outside.js @@ -0,0 +1,31 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#08f'; +ctx.fillRect(0, 0, 100, 50); + +var imgdata1 = ctx.getImageData(-10, 5, 1, 1); +_assertSame(imgdata1.data[0], 0, "imgdata1.data[\""+(0)+"\"]", "0"); +_assertSame(imgdata1.data[1], 0, "imgdata1.data[\""+(1)+"\"]", "0"); +_assertSame(imgdata1.data[2], 0, "imgdata1.data[\""+(2)+"\"]", "0"); +_assertSame(imgdata1.data[3], 0, "imgdata1.data[\""+(3)+"\"]", "0"); + +var imgdata2 = ctx.getImageData(10, -5, 1, 1); +_assertSame(imgdata2.data[0], 0, "imgdata2.data[\""+(0)+"\"]", "0"); +_assertSame(imgdata2.data[1], 0, "imgdata2.data[\""+(1)+"\"]", "0"); +_assertSame(imgdata2.data[2], 0, "imgdata2.data[\""+(2)+"\"]", "0"); +_assertSame(imgdata2.data[3], 0, "imgdata2.data[\""+(3)+"\"]", "0"); + +var imgdata3 = ctx.getImageData(200, 5, 1, 1); +_assertSame(imgdata3.data[0], 0, "imgdata3.data[\""+(0)+"\"]", "0"); +_assertSame(imgdata3.data[1], 0, "imgdata3.data[\""+(1)+"\"]", "0"); +_assertSame(imgdata3.data[2], 0, "imgdata3.data[\""+(2)+"\"]", "0"); +_assertSame(imgdata3.data[3], 0, "imgdata3.data[\""+(3)+"\"]", "0"); + +var imgdata4 = ctx.getImageData(10, 60, 1, 1); +_assertSame(imgdata4.data[0], 0, "imgdata4.data[\""+(0)+"\"]", "0"); +_assertSame(imgdata4.data[1], 0, "imgdata4.data[\""+(1)+"\"]", "0"); +_assertSame(imgdata4.data[2], 0, "imgdata4.data[\""+(2)+"\"]", "0"); +_assertSame(imgdata4.data[3], 0, "imgdata4.data[\""+(3)+"\"]", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.source.size.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.source.size.js new file mode 100644 index 0000000..0d9d8cc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.source.size.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +var imgdata1 = ctx.getImageData(0, 0, 10, 10); +var imgdata2 = ctx.getImageData(0, 0, 20, 20); +_assert(imgdata2.width > imgdata1.width, "imgdata2.width > imgdata1.width"); +_assert(imgdata2.height > imgdata1.height, "imgdata2.height > imgdata1.height"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.tiny.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.tiny.js new file mode 100644 index 0000000..d799357 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.tiny.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.getImageData(0, 0, 0.0001, 0.0001); +_assertEqual(imgdata.data.length, imgdata.width*imgdata.height*4, "imgdata.data.length", "imgdata.width*imgdata.height*4"); +_assertEqual(imgdata.width, 1, "imgdata.width", "1"); +_assertEqual(imgdata.height, 1, "imgdata.height", "1"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.type.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.type.js new file mode 100644 index 0000000..bf65e48 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.type.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +_assertDifferent(window.ImageData, undefined, "window.ImageData", "undefined"); +_assertDifferent(window.CanvasPixelArray, undefined, "window.CanvasPixelArray", "undefined"); +window.ImageData.prototype.thisImplementsImageData = true; +window.CanvasPixelArray.prototype.thisImplementsCanvasPixelArray = true; +var imgdata = ctx.getImageData(0, 0, 1, 1); +_assert(imgdata.thisImplementsImageData, "imgdata.thisImplementsImageData"); +_assert(imgdata.data.thisImplementsCanvasPixelArray, "imgdata.data.thisImplementsCanvasPixelArray"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.unaffected.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.unaffected.js new file mode 100644 index 0000000..36296a6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.unaffected.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 50, 50) +ctx.fillStyle = '#f00'; +ctx.fillRect(50, 0, 50, 50) +ctx.save(); +ctx.translate(50, 0); +ctx.globalAlpha = 0.1; +ctx.globalCompositeOperation = 'destination-atop'; +ctx.shadowColor = '#f00'; +ctx.rect(0, 0, 5, 5); +ctx.clip(); +var imgdata = ctx.getImageData(0, 0, 50, 50); +ctx.restore(); +ctx.putImageData(imgdata, 50, 0); +_assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.zero.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.zero.js new file mode 100644 index 0000000..278c388 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.get.zero.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.getImageData(1, 1, 10, 0); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.getImageData(1, 1, 10, 0)"); } +try { var _thrown = false; + ctx.getImageData(1, 1, 0, 10); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.getImageData(1, 1, 0, 10)"); } +try { var _thrown = false; + ctx.getImageData(1, 1, 0, 0); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.getImageData(1, 1, 0, 0)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.object.ctor.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.object.ctor.js new file mode 100644 index 0000000..7d761f6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.object.ctor.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +_assertDifferent(window.ImageData, undefined, "window.ImageData", "undefined"); +try { var _thrown = false; new window.ImageData(1,1); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: new window.ImageData(1,1)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.object.nan.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.object.nan.js new file mode 100644 index 0000000..ba38464 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.object.nan.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.getImageData(0, 0, 10, 10); +imgdata.data[0] = 100; +imgdata.data[0] = NaN; +_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); +imgdata.data[0] = 100; +imgdata.data[0] = "cheese"; +_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.object.properties.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.object.properties.js new file mode 100644 index 0000000..0aedd64 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.object.properties.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.getImageData(0, 0, 10, 10); +_assertEqual(typeof(imgdata.width), 'number', "typeof(imgdata.width)", "'number'"); +_assertEqual(typeof(imgdata.height), 'number', "typeof(imgdata.height)", "'number'"); +_assertEqual(typeof(imgdata.data), 'object', "typeof(imgdata.data)", "'object'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.object.readonly.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.object.readonly.js new file mode 100644 index 0000000..00b3854 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.object.readonly.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.getImageData(0, 0, 10, 10); +var w = imgdata.width; +var h = imgdata.height; +var d = imgdata.data; +imgdata.width = 123; +imgdata.height = 123; +imgdata.data = [100,100,100,100]; +_assertSame(imgdata.width, w, "imgdata.width", "w"); +_assertSame(imgdata.height, h, "imgdata.height", "h"); +_assertSame(imgdata.data, d, "imgdata.data", "d"); +_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); +_assertSame(imgdata.data[1], 0, "imgdata.data[\""+(1)+"\"]", "0"); +_assertSame(imgdata.data[2], 0, "imgdata.data[\""+(2)+"\"]", "0"); +_assertSame(imgdata.data[3], 0, "imgdata.data[\""+(3)+"\"]", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.object.round.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.object.round.js new file mode 100644 index 0000000..243171f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.object.round.js @@ -0,0 +1,34 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.getImageData(0, 0, 10, 10); +imgdata.data[0] = 0.499; +_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); +imgdata.data[0] = 0.5; +_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); +imgdata.data[0] = 0.501; +_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); +imgdata.data[0] = 1.499; +_assertSame(imgdata.data[0], 1, "imgdata.data[\""+(0)+"\"]", "1"); +imgdata.data[0] = 1.5; +_assertSame(imgdata.data[0], 1, "imgdata.data[\""+(0)+"\"]", "1"); +imgdata.data[0] = 1.501; +_assertSame(imgdata.data[0], 1, "imgdata.data[\""+(0)+"\"]", "1"); +imgdata.data[0] = 2.5; +_assertSame(imgdata.data[0], 2, "imgdata.data[\""+(0)+"\"]", "2"); +imgdata.data[0] = 3.5; +_assertSame(imgdata.data[0], 3, "imgdata.data[\""+(0)+"\"]", "3"); +imgdata.data[0] = 252.5; +_assertSame(imgdata.data[0], 252, "imgdata.data[\""+(0)+"\"]", "252"); +imgdata.data[0] = 253.5; +_assertSame(imgdata.data[0], 253, "imgdata.data[\""+(0)+"\"]", "253"); +imgdata.data[0] = 254.5; +_assertSame(imgdata.data[0], 254, "imgdata.data[\""+(0)+"\"]", "254"); +imgdata.data[0] = 256.5; +_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); +imgdata.data[0] = -0.5; +_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); +imgdata.data[0] = -1.5; +_assertSame(imgdata.data[0], 255, "imgdata.data[\""+(0)+"\"]", "255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.object.set.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.object.set.js new file mode 100644 index 0000000..ee3cd64 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.object.set.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.getImageData(0, 0, 10, 10); +imgdata.data[0] = 100; +_assertSame(imgdata.data[0], 100, "imgdata.data[\""+(0)+"\"]", "100"); +imgdata.data[0] = 200; +_assertSame(imgdata.data[0], 200, "imgdata.data[\""+(0)+"\"]", "200"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.object.string.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.object.string.js new file mode 100644 index 0000000..73b505a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.object.string.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.getImageData(0, 0, 10, 10); +imgdata.data[0] = 100; +imgdata.data[0] = "110"; +_assertSame(imgdata.data[0], 110, "imgdata.data[\""+(0)+"\"]", "110"); +imgdata.data[0] = 100; +imgdata.data[0] = "0x78"; +_assertSame(imgdata.data[0], 120, "imgdata.data[\""+(0)+"\"]", "120"); +imgdata.data[0] = 100; +imgdata.data[0] = " +130e0 "; +_assertSame(imgdata.data[0], 130, "imgdata.data[\""+(0)+"\"]", "130"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.object.undefined.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.object.undefined.js new file mode 100644 index 0000000..4b89fe5 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.object.undefined.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.getImageData(0, 0, 10, 10); +imgdata.data[0] = 100; +imgdata.data[0] = undefined; +_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.object.wrap.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.object.wrap.js new file mode 100644 index 0000000..937b359 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.object.wrap.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.getImageData(0, 0, 10, 10); + +imgdata.data[0] = 0; +_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); +imgdata.data[0] = 300; +_assertSame(imgdata.data[0], 44, "imgdata.data[\""+(0)+"\"]", "44"); +imgdata.data[0] = -100; +_assertSame(imgdata.data[0], 156, "imgdata.data[\""+(0)+"\"]", "156"); + +imgdata.data[0] = 200+Math.pow(2, 32); +_assertSame(imgdata.data[0], 200, "imgdata.data[\""+(0)+"\"]", "200"); +imgdata.data[0] = -200-Math.pow(2, 32); +_assertSame(imgdata.data[0], 56, "imgdata.data[\""+(0)+"\"]", "56"); + +imgdata.data[0] = -Infinity; +_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); +imgdata.data[0] = Infinity; +_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.alpha.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.alpha.js new file mode 100644 index 0000000..dfad33a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.alpha.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = 'rgba(0, 255, 0, 0.25)'; +ctx.fillRect(0, 0, 100, 50) +var imgdata = ctx.getImageData(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50) +ctx.putImageData(imgdata, 0, 0); +_assertPixelApprox(canvas, 50,25, 0,255,0,64, "50,25", "0,255,0,64", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.basic.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.basic.js new file mode 100644 index 0000000..ed3d93e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.basic.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50) +var imgdata = ctx.getImageData(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50) +ctx.putImageData(imgdata, 0, 0); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.clip.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.clip.js new file mode 100644 index 0000000..1075d24 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.clip.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50) +var imgdata = ctx.getImageData(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50) +ctx.beginPath(); +ctx.rect(0, 0, 50, 50); +ctx.clip(); +ctx.putImageData(imgdata, 0, 0); +_assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.created.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.created.js new file mode 100644 index 0000000..123f63a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.created.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.createImageData(100, 50); +for (var i = 0; i < imgdata.data.length; i += 4) { + imgdata.data[i] = 0; + imgdata.data[i+1] = 255; + imgdata.data[i+2] = 0; + imgdata.data[i+3] = 255; +} +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50) +ctx.putImageData(imgdata, 0, 0); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.cross.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.cross.js new file mode 100644 index 0000000..ae1c93e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.cross.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = '#0f0'; +ctx2.fillRect(0, 0, 100, 50) +var imgdata = ctx2.getImageData(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50) +ctx.putImageData(imgdata, 0, 0); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.dirty.negative.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.dirty.negative.js new file mode 100644 index 0000000..ab0d762 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.dirty.negative.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50) +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 20, 20) + +var imgdata = ctx.getImageData(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50) +ctx.fillStyle = '#f00'; +ctx.fillRect(40, 20, 20, 20) +ctx.putImageData(imgdata, 40, 20, 20, 20, -20, -20); + +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 35,25, 0,255,0,255, "35,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 65,25, 0,255,0,255, "65,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 50,15, 0,255,0,255, "50,15", "0,255,0,255", 2); +_assertPixelApprox(canvas, 50,45, 0,255,0,255, "50,45", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.dirty.outside.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.dirty.outside.js new file mode 100644 index 0000000..f2a6c98 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.dirty.outside.js @@ -0,0 +1,25 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50) + +var imgdata = ctx.getImageData(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50) + +ctx.putImageData(imgdata, 100, 20, 20, 20, -20, -20); +ctx.putImageData(imgdata, 200, 200, 0, 0, 100, 50); +ctx.putImageData(imgdata, 40, 20, -30, -20, 30, 20); +ctx.putImageData(imgdata, -30, 20, 0, 0, 30, 20); + +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 98,15, 0,255,0,255, "98,15", "0,255,0,255", 2); +_assertPixelApprox(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 98,45, 0,255,0,255, "98,45", "0,255,0,255", 2); +_assertPixelApprox(canvas, 1,5, 0,255,0,255, "1,5", "0,255,0,255", 2); +_assertPixelApprox(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 1,45, 0,255,0,255, "1,45", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.dirty.rect1.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.dirty.rect1.js new file mode 100644 index 0000000..ed4bb37 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.dirty.rect1.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50) +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 20, 20) + +var imgdata = ctx.getImageData(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50) +ctx.fillStyle = '#f00'; +ctx.fillRect(40, 20, 20, 20) +ctx.putImageData(imgdata, 40, 20, 0, 0, 20, 20); + +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 35,25, 0,255,0,255, "35,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 65,25, 0,255,0,255, "65,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 50,15, 0,255,0,255, "50,15", "0,255,0,255", 2); +_assertPixelApprox(canvas, 50,45, 0,255,0,255, "50,45", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.dirty.rect2.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.dirty.rect2.js new file mode 100644 index 0000000..c36924f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.dirty.rect2.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50) +ctx.fillStyle = '#0f0'; +ctx.fillRect(60, 30, 20, 20) + +var imgdata = ctx.getImageData(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50) +ctx.fillStyle = '#f00'; +ctx.fillRect(40, 20, 20, 20) +ctx.putImageData(imgdata, -20, -10, 60, 30, 20, 20); + +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 35,25, 0,255,0,255, "35,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 65,25, 0,255,0,255, "65,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 50,15, 0,255,0,255, "50,15", "0,255,0,255", 2); +_assertPixelApprox(canvas, 50,45, 0,255,0,255, "50,45", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.dirty.zero.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.dirty.zero.js new file mode 100644 index 0000000..a023cfb --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.dirty.zero.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50) +var imgdata = ctx.getImageData(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50) +ctx.putImageData(imgdata, 0, 0, 0, 0, 0, 0); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.modified.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.modified.js new file mode 100644 index 0000000..768867e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.modified.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50) +ctx.fillStyle = '#f00'; +ctx.fillRect(45, 20, 10, 10) +var imgdata = ctx.getImageData(45, 20, 10, 10); +for (var i = 0, len = imgdata.width*imgdata.height*4; i < len; i += 4) +{ + imgdata.data[i] = 0; + imgdata.data[i+1] = 255; +} +ctx.putImageData(imgdata, 45, 20); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.nonfinite.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.nonfinite.js new file mode 100644 index 0000000..773f349 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.nonfinite.js @@ -0,0 +1,252 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.getImageData(0, 0, 10, 10); +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, -Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, -Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, NaN, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, NaN, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, -Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, -Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, NaN); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, NaN)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, 10, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, 10, 10, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, -Infinity, 10, 10, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, -Infinity, 10, 10, 10, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, NaN, 10, 10, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, NaN, 10, 10, 10, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, 10, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, 10, 10, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, -Infinity, 10, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, -Infinity, 10, 10, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, NaN, 10, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, NaN, 10, 10, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, Infinity, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, 10, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, -Infinity, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, -Infinity, 10, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, NaN, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, NaN, 10, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, 10, Infinity, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, Infinity, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, 10, -Infinity, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, -Infinity, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, 10, NaN, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, NaN, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, 10, 10, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, 10, 10, -Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, -Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, 10, 10, NaN, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, NaN, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, 10, 10, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, 10, 10, 10, -Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, 10, -Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, 10, 10, 10, NaN); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, 10, NaN)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, 10, 10, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, 10, 10, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, 10, 10, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, 10, 10, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, 10, 10, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, 10, 10, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, 10, 10, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, 10, 10, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, 10, 10, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, 10, 10, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, 10, 10, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, 10, 10, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, Infinity, 10, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, 10, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, Infinity, 10, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, 10, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, Infinity, 10, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, 10, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, 10, Infinity, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, Infinity, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, 10, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, 10, Infinity, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, Infinity, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, 10, 10, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, Infinity, Infinity)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.null.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.null.js new file mode 100644 index 0000000..d4a46d0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.null.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.putImageData(null, 0, 0); +} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail("Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TYPE_MISMATCH_ERR: ctx.putImageData(null, 0, 0)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.path.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.path.js new file mode 100644 index 0000000..9b059de --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.path.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50) +ctx.rect(0, 0, 100, 50); +var imgdata = ctx.getImageData(0, 0, 100, 50); +ctx.putImageData(imgdata, 0, 0); +ctx.fillStyle = '#0f0'; +ctx.fill(); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.unaffected.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.unaffected.js new file mode 100644 index 0000000..1118844 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.unaffected.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50) +var imgdata = ctx.getImageData(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50) +ctx.globalAlpha = 0.1; +ctx.globalCompositeOperation = 'destination-atop'; +ctx.shadowColor = '#f00'; +ctx.shadowBlur = 1; +ctx.translate(100, 50); +ctx.scale(0.1, 0.1); +ctx.putImageData(imgdata, 0, 0); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.unchanged.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.unchanged.js new file mode 100644 index 0000000..5cbc72e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.unchanged.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +var i = 0; +for (var y = 0; y < 16; ++y) { + for (var x = 0; x < 16; ++x, ++i) { + ctx.fillStyle = 'rgba(' + i + ',' + (Math.floor(i*1.5) % 256) + ',' + (Math.floor(i*23.3) % 256) + ',' + (i/256) + ')'; + ctx.fillRect(x, y, 1, 1); + } +} +var imgdata1 = ctx.getImageData(0.1, 0.2, 15.8, 15.9); +var olddata = []; +for (var i = 0; i < imgdata1.data.length; ++i) + olddata[i] = imgdata1.data[i]; + +ctx.putImageData(imgdata1, 0.1, 0.2); + +var imgdata2 = ctx.getImageData(0.1, 0.2, 15.8, 15.9); +for (var i = 0; i < imgdata2.data.length; ++i) { + _assertSame(olddata[i], imgdata2.data[i], "olddata[\""+(i)+"\"]", "imgdata2.data[\""+(i)+"\"]"); +} + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.wrongtype.js b/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.wrongtype.js new file mode 100644 index 0000000..4b84fff --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.imageData.put.wrongtype.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +var imgdata = { width: 1, height: 1, data: [255, 0, 0, 255] }; +try { var _thrown = false; + ctx.putImageData(imgdata, 0, 0); +} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail("Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TYPE_MISMATCH_ERR: ctx.putImageData(imgdata, 0, 0)"); } +try { var _thrown = false; + ctx.putImageData("cheese", 0, 0); +} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail("Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TYPE_MISMATCH_ERR: ctx.putImageData(\"cheese\", 0, 0)"); } +try { var _thrown = false; + ctx.putImageData(42, 0, 0); +} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail("Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TYPE_MISMATCH_ERR: ctx.putImageData(42, 0, 0)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.line.cap.butt.js b/platforms/ios/www/test/tests-todo/framed.2d.line.cap.butt.js new file mode 100644 index 0000000..616ad1d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.line.cap.butt.js @@ -0,0 +1,40 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineCap = 'butt'; +ctx.lineWidth = 20; + +ctx.fillStyle = '#f00'; +ctx.strokeStyle = '#0f0'; +ctx.fillRect(15, 15, 20, 20); +ctx.beginPath(); +ctx.moveTo(25, 15); +ctx.lineTo(25, 35); +ctx.stroke(); + +ctx.fillStyle = '#0f0'; +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(75, 15); +ctx.lineTo(75, 35); +ctx.stroke(); +ctx.fillRect(65, 15, 20, 20); + +_assertPixel(canvas, 25,14, 0,255,0,255, "25,14", "0,255,0,255"); +_assertPixel(canvas, 25,15, 0,255,0,255, "25,15", "0,255,0,255"); +_assertPixel(canvas, 25,16, 0,255,0,255, "25,16", "0,255,0,255"); +_assertPixel(canvas, 25,34, 0,255,0,255, "25,34", "0,255,0,255"); +_assertPixel(canvas, 25,35, 0,255,0,255, "25,35", "0,255,0,255"); +_assertPixel(canvas, 25,36, 0,255,0,255, "25,36", "0,255,0,255"); + +_assertPixel(canvas, 75,14, 0,255,0,255, "75,14", "0,255,0,255"); +_assertPixel(canvas, 75,15, 0,255,0,255, "75,15", "0,255,0,255"); +_assertPixel(canvas, 75,16, 0,255,0,255, "75,16", "0,255,0,255"); +_assertPixel(canvas, 75,34, 0,255,0,255, "75,34", "0,255,0,255"); +_assertPixel(canvas, 75,35, 0,255,0,255, "75,35", "0,255,0,255"); +_assertPixel(canvas, 75,36, 0,255,0,255, "75,36", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.line.cap.closed.js b/platforms/ios/www/test/tests-todo/framed.2d.line.cap.closed.js new file mode 100644 index 0000000..41f4747 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.line.cap.closed.js @@ -0,0 +1,25 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.strokeStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineJoin = 'bevel'; +ctx.lineCap = 'square'; +ctx.lineWidth = 400; + +ctx.beginPath(); +ctx.moveTo(200, 200); +ctx.lineTo(200, 1000); +ctx.lineTo(1000, 1000); +ctx.lineTo(1000, 200); +ctx.closePath(); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.line.cap.invalid.js b/platforms/ios/www/test/tests-todo/framed.2d.line.cap.invalid.js new file mode 100644 index 0000000..488567d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.line.cap.invalid.js @@ -0,0 +1,31 @@ +_addTest(function(canvas, ctx) { + +ctx.lineCap = 'butt' +_assertSame(ctx.lineCap, 'butt', "ctx.lineCap", "'butt'"); + +ctx.lineCap = 'butt'; +ctx.lineCap = 'invalid'; +_assertSame(ctx.lineCap, 'butt', "ctx.lineCap", "'butt'"); + +ctx.lineCap = 'butt'; +ctx.lineCap = 'ROUND'; +_assertSame(ctx.lineCap, 'butt', "ctx.lineCap", "'butt'"); + +ctx.lineCap = 'butt'; +ctx.lineCap = 'round\0'; +_assertSame(ctx.lineCap, 'butt', "ctx.lineCap", "'butt'"); + +ctx.lineCap = 'butt'; +ctx.lineCap = 'round '; +_assertSame(ctx.lineCap, 'butt', "ctx.lineCap", "'butt'"); + +ctx.lineCap = 'butt'; +ctx.lineCap = ""; +_assertSame(ctx.lineCap, 'butt', "ctx.lineCap", "'butt'"); + +ctx.lineCap = 'butt'; +ctx.lineCap = 'bevel'; +_assertSame(ctx.lineCap, 'butt', "ctx.lineCap", "'butt'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.line.cap.open.js b/platforms/ios/www/test/tests-todo/framed.2d.line.cap.open.js new file mode 100644 index 0000000..fd2bf62 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.line.cap.open.js @@ -0,0 +1,25 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.strokeStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineJoin = 'bevel'; +ctx.lineCap = 'square'; +ctx.lineWidth = 400; + +ctx.beginPath(); +ctx.moveTo(200, 200); +ctx.lineTo(200, 1000); +ctx.lineTo(1000, 1000); +ctx.lineTo(1000, 200); +ctx.lineTo(200, 200); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.line.cap.round.js b/platforms/ios/www/test/tests-todo/framed.2d.line.cap.round.js new file mode 100644 index 0000000..5e1c7de --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.line.cap.round.js @@ -0,0 +1,56 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var tol = 1; // tolerance to avoid antialiasing artifacts + +ctx.lineCap = 'round'; +ctx.lineWidth = 20; + + +ctx.fillStyle = '#f00'; +ctx.strokeStyle = '#0f0'; + +ctx.beginPath(); +ctx.moveTo(35-tol, 15); +ctx.arc(25, 15, 10-tol, 0, Math.PI, true); +ctx.arc(25, 35, 10-tol, Math.PI, 0, true); +ctx.fill(); + +ctx.beginPath(); +ctx.moveTo(25, 15); +ctx.lineTo(25, 35); +ctx.stroke(); + + +ctx.fillStyle = '#0f0'; +ctx.strokeStyle = '#f00'; + +ctx.beginPath(); +ctx.moveTo(75, 15); +ctx.lineTo(75, 35); +ctx.stroke(); + +ctx.beginPath(); +ctx.moveTo(85+tol, 15); +ctx.arc(75, 15, 10+tol, 0, Math.PI, true); +ctx.arc(75, 35, 10+tol, Math.PI, 0, true); +ctx.fill(); + +_assertPixel(canvas, 17,6, 0,255,0,255, "17,6", "0,255,0,255"); +_assertPixel(canvas, 25,6, 0,255,0,255, "25,6", "0,255,0,255"); +_assertPixel(canvas, 32,6, 0,255,0,255, "32,6", "0,255,0,255"); +_assertPixel(canvas, 17,43, 0,255,0,255, "17,43", "0,255,0,255"); +_assertPixel(canvas, 25,43, 0,255,0,255, "25,43", "0,255,0,255"); +_assertPixel(canvas, 32,43, 0,255,0,255, "32,43", "0,255,0,255"); + +_assertPixel(canvas, 67,6, 0,255,0,255, "67,6", "0,255,0,255"); +_assertPixel(canvas, 75,6, 0,255,0,255, "75,6", "0,255,0,255"); +_assertPixel(canvas, 82,6, 0,255,0,255, "82,6", "0,255,0,255"); +_assertPixel(canvas, 67,43, 0,255,0,255, "67,43", "0,255,0,255"); +_assertPixel(canvas, 75,43, 0,255,0,255, "75,43", "0,255,0,255"); +_assertPixel(canvas, 82,43, 0,255,0,255, "82,43", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.line.cap.square.js b/platforms/ios/www/test/tests-todo/framed.2d.line.cap.square.js new file mode 100644 index 0000000..992dc5c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.line.cap.square.js @@ -0,0 +1,40 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineCap = 'square'; +ctx.lineWidth = 20; + +ctx.fillStyle = '#f00'; +ctx.strokeStyle = '#0f0'; +ctx.fillRect(15, 5, 20, 40); +ctx.beginPath(); +ctx.moveTo(25, 15); +ctx.lineTo(25, 35); +ctx.stroke(); + +ctx.fillStyle = '#0f0'; +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(75, 15); +ctx.lineTo(75, 35); +ctx.stroke(); +ctx.fillRect(65, 5, 20, 40); + +_assertPixel(canvas, 25,4, 0,255,0,255, "25,4", "0,255,0,255"); +_assertPixel(canvas, 25,5, 0,255,0,255, "25,5", "0,255,0,255"); +_assertPixel(canvas, 25,6, 0,255,0,255, "25,6", "0,255,0,255"); +_assertPixel(canvas, 25,44, 0,255,0,255, "25,44", "0,255,0,255"); +_assertPixel(canvas, 25,45, 0,255,0,255, "25,45", "0,255,0,255"); +_assertPixel(canvas, 25,46, 0,255,0,255, "25,46", "0,255,0,255"); + +_assertPixel(canvas, 75,4, 0,255,0,255, "75,4", "0,255,0,255"); +_assertPixel(canvas, 75,5, 0,255,0,255, "75,5", "0,255,0,255"); +_assertPixel(canvas, 75,6, 0,255,0,255, "75,6", "0,255,0,255"); +_assertPixel(canvas, 75,44, 0,255,0,255, "75,44", "0,255,0,255"); +_assertPixel(canvas, 75,45, 0,255,0,255, "75,45", "0,255,0,255"); +_assertPixel(canvas, 75,46, 0,255,0,255, "75,46", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.line.cap.valid.js b/platforms/ios/www/test/tests-todo/framed.2d.line.cap.valid.js new file mode 100644 index 0000000..25a5256 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.line.cap.valid.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.lineCap = 'butt' +_assertSame(ctx.lineCap, 'butt', "ctx.lineCap", "'butt'"); + +ctx.lineCap = 'round'; +_assertSame(ctx.lineCap, 'round', "ctx.lineCap", "'round'"); + +ctx.lineCap = 'square'; +_assertSame(ctx.lineCap, 'square', "ctx.lineCap", "'square'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.line.cross.js b/platforms/ios/www/test/tests-todo/framed.2d.line.cross.js new file mode 100644 index 0000000..baaaa6a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.line.cross.js @@ -0,0 +1,22 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineWidth = 200; +ctx.lineJoin = 'bevel'; + +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(110, 50); +ctx.lineTo(110, 60); +ctx.lineTo(100, 60); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.line.defaults.js b/platforms/ios/www/test/tests-todo/framed.2d.line.defaults.js new file mode 100644 index 0000000..3705322 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.line.defaults.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +_assertSame(ctx.lineWidth, 1, "ctx.lineWidth", "1"); +_assertSame(ctx.lineCap, 'butt', "ctx.lineCap", "'butt'"); +_assertSame(ctx.lineJoin, 'miter', "ctx.lineJoin", "'miter'"); +_assertSame(ctx.miterLimit, 10, "ctx.miterLimit", "10"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.line.join.bevel.js b/platforms/ios/www/test/tests-todo/framed.2d.line.join.bevel.js new file mode 100644 index 0000000..5fc241d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.line.join.bevel.js @@ -0,0 +1,59 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var tol = 1; // tolerance to avoid antialiasing artifacts + +ctx.lineJoin = 'bevel'; +ctx.lineWidth = 20; + +ctx.fillStyle = '#f00'; +ctx.strokeStyle = '#0f0'; + +ctx.fillRect(10, 10, 20, 20); +ctx.fillRect(20, 20, 20, 20); +ctx.beginPath(); +ctx.moveTo(30, 20); +ctx.lineTo(40-tol, 20); +ctx.lineTo(30, 10+tol); +ctx.fill(); + +ctx.beginPath(); +ctx.moveTo(10, 20); +ctx.lineTo(30, 20); +ctx.lineTo(30, 40); +ctx.stroke(); + + +ctx.fillStyle = '#0f0'; +ctx.strokeStyle = '#f00'; + +ctx.beginPath(); +ctx.moveTo(60, 20); +ctx.lineTo(80, 20); +ctx.lineTo(80, 40); +ctx.stroke(); + +ctx.fillRect(60, 10, 20, 20); +ctx.fillRect(70, 20, 20, 20); +ctx.beginPath(); +ctx.moveTo(80, 20); +ctx.lineTo(90+tol, 20); +ctx.lineTo(80, 10-tol); +ctx.fill(); + +_assertPixel(canvas, 34,16, 0,255,0,255, "34,16", "0,255,0,255"); +_assertPixel(canvas, 34,15, 0,255,0,255, "34,15", "0,255,0,255"); +_assertPixel(canvas, 35,15, 0,255,0,255, "35,15", "0,255,0,255"); +_assertPixel(canvas, 36,15, 0,255,0,255, "36,15", "0,255,0,255"); +_assertPixel(canvas, 36,14, 0,255,0,255, "36,14", "0,255,0,255"); + +_assertPixel(canvas, 84,16, 0,255,0,255, "84,16", "0,255,0,255"); +_assertPixel(canvas, 84,15, 0,255,0,255, "84,15", "0,255,0,255"); +_assertPixel(canvas, 85,15, 0,255,0,255, "85,15", "0,255,0,255"); +_assertPixel(canvas, 86,15, 0,255,0,255, "86,15", "0,255,0,255"); +_assertPixel(canvas, 86,14, 0,255,0,255, "86,14", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.line.join.closed.js b/platforms/ios/www/test/tests-todo/framed.2d.line.join.closed.js new file mode 100644 index 0000000..f835bf9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.line.join.closed.js @@ -0,0 +1,24 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.strokeStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineJoin = 'miter'; +ctx.lineWidth = 200; + +ctx.beginPath(); +ctx.moveTo(100, 50); +ctx.lineTo(100, 1000); +ctx.lineTo(1000, 1000); +ctx.lineTo(1000, 50); +ctx.closePath(); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.line.join.invalid.js b/platforms/ios/www/test/tests-todo/framed.2d.line.join.invalid.js new file mode 100644 index 0000000..c60bec8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.line.join.invalid.js @@ -0,0 +1,31 @@ +_addTest(function(canvas, ctx) { + +ctx.lineJoin = 'bevel' +_assertSame(ctx.lineJoin, 'bevel', "ctx.lineJoin", "'bevel'"); + +ctx.lineJoin = 'bevel'; +ctx.lineJoin = 'invalid'; +_assertSame(ctx.lineJoin, 'bevel', "ctx.lineJoin", "'bevel'"); + +ctx.lineJoin = 'bevel'; +ctx.lineJoin = 'ROUND'; +_assertSame(ctx.lineJoin, 'bevel', "ctx.lineJoin", "'bevel'"); + +ctx.lineJoin = 'bevel'; +ctx.lineJoin = 'round\0'; +_assertSame(ctx.lineJoin, 'bevel', "ctx.lineJoin", "'bevel'"); + +ctx.lineJoin = 'bevel'; +ctx.lineJoin = 'round '; +_assertSame(ctx.lineJoin, 'bevel', "ctx.lineJoin", "'bevel'"); + +ctx.lineJoin = 'bevel'; +ctx.lineJoin = ""; +_assertSame(ctx.lineJoin, 'bevel', "ctx.lineJoin", "'bevel'"); + +ctx.lineJoin = 'bevel'; +ctx.lineJoin = 'butt'; +_assertSame(ctx.lineJoin, 'bevel', "ctx.lineJoin", "'bevel'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.line.join.miter.js b/platforms/ios/www/test/tests-todo/framed.2d.line.join.miter.js new file mode 100644 index 0000000..bbcb340 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.line.join.miter.js @@ -0,0 +1,50 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineJoin = 'miter'; +ctx.lineWidth = 20; + +ctx.fillStyle = '#f00'; +ctx.strokeStyle = '#0f0'; + +ctx.fillStyle = '#f00'; +ctx.strokeStyle = '#0f0'; + +ctx.fillRect(10, 10, 30, 20); +ctx.fillRect(20, 10, 20, 30); + +ctx.beginPath(); +ctx.moveTo(10, 20); +ctx.lineTo(30, 20); +ctx.lineTo(30, 40); +ctx.stroke(); + + +ctx.fillStyle = '#0f0'; +ctx.strokeStyle = '#f00'; + +ctx.beginPath(); +ctx.moveTo(60, 20); +ctx.lineTo(80, 20); +ctx.lineTo(80, 40); +ctx.stroke(); + +ctx.fillRect(60, 10, 30, 20); +ctx.fillRect(70, 10, 20, 30); + +_assertPixel(canvas, 38,12, 0,255,0,255, "38,12", "0,255,0,255"); +_assertPixel(canvas, 39,11, 0,255,0,255, "39,11", "0,255,0,255"); +_assertPixel(canvas, 40,10, 0,255,0,255, "40,10", "0,255,0,255"); +_assertPixel(canvas, 41,9, 0,255,0,255, "41,9", "0,255,0,255"); +_assertPixel(canvas, 42,8, 0,255,0,255, "42,8", "0,255,0,255"); + +_assertPixel(canvas, 88,12, 0,255,0,255, "88,12", "0,255,0,255"); +_assertPixel(canvas, 89,11, 0,255,0,255, "89,11", "0,255,0,255"); +_assertPixel(canvas, 90,10, 0,255,0,255, "90,10", "0,255,0,255"); +_assertPixel(canvas, 91,9, 0,255,0,255, "91,9", "0,255,0,255"); +_assertPixel(canvas, 92,8, 0,255,0,255, "92,8", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.line.join.open.js b/platforms/ios/www/test/tests-todo/framed.2d.line.join.open.js new file mode 100644 index 0000000..837c8c2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.line.join.open.js @@ -0,0 +1,24 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.strokeStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineJoin = 'miter'; +ctx.lineWidth = 200; + +ctx.beginPath(); +ctx.moveTo(100, 50); +ctx.lineTo(100, 1000); +ctx.lineTo(1000, 1000); +ctx.lineTo(1000, 50); +ctx.lineTo(100, 50); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.line.join.parallel.js b/platforms/ios/www/test/tests-todo/framed.2d.line.join.parallel.js new file mode 100644 index 0000000..c041ecb --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.line.join.parallel.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 300; +ctx.lineJoin = 'round'; +ctx.beginPath(); +ctx.moveTo(-100, 25); +ctx.lineTo(0, 25); +ctx.lineTo(-100, 25); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.line.join.round.js b/platforms/ios/www/test/tests-todo/framed.2d.line.join.round.js new file mode 100644 index 0000000..96ce608 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.line.join.round.js @@ -0,0 +1,57 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var tol = 1; // tolerance to avoid antialiasing artifacts + +ctx.lineJoin = 'round'; +ctx.lineWidth = 20; + +ctx.fillStyle = '#f00'; +ctx.strokeStyle = '#0f0'; + +ctx.fillRect(10, 10, 20, 20); +ctx.fillRect(20, 20, 20, 20); +ctx.beginPath(); +ctx.moveTo(30, 20); +ctx.arc(30, 20, 10-tol, 0, 2*Math.PI, true); +ctx.fill(); + +ctx.beginPath(); +ctx.moveTo(10, 20); +ctx.lineTo(30, 20); +ctx.lineTo(30, 40); +ctx.stroke(); + + +ctx.fillStyle = '#0f0'; +ctx.strokeStyle = '#f00'; + +ctx.beginPath(); +ctx.moveTo(60, 20); +ctx.lineTo(80, 20); +ctx.lineTo(80, 40); +ctx.stroke(); + +ctx.fillRect(60, 10, 20, 20); +ctx.fillRect(70, 20, 20, 20); +ctx.beginPath(); +ctx.moveTo(80, 20); +ctx.arc(80, 20, 10+tol, 0, 2*Math.PI, true); +ctx.fill(); + +_assertPixel(canvas, 36,14, 0,255,0,255, "36,14", "0,255,0,255"); +_assertPixel(canvas, 36,13, 0,255,0,255, "36,13", "0,255,0,255"); +_assertPixel(canvas, 37,13, 0,255,0,255, "37,13", "0,255,0,255"); +_assertPixel(canvas, 38,13, 0,255,0,255, "38,13", "0,255,0,255"); +_assertPixel(canvas, 38,12, 0,255,0,255, "38,12", "0,255,0,255"); + +_assertPixel(canvas, 86,14, 0,255,0,255, "86,14", "0,255,0,255"); +_assertPixel(canvas, 86,13, 0,255,0,255, "86,13", "0,255,0,255"); +_assertPixel(canvas, 87,13, 0,255,0,255, "87,13", "0,255,0,255"); +_assertPixel(canvas, 88,13, 0,255,0,255, "88,13", "0,255,0,255"); +_assertPixel(canvas, 88,12, 0,255,0,255, "88,12", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.line.join.valid.js b/platforms/ios/www/test/tests-todo/framed.2d.line.join.valid.js new file mode 100644 index 0000000..2097661 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.line.join.valid.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.lineJoin = 'bevel' +_assertSame(ctx.lineJoin, 'bevel', "ctx.lineJoin", "'bevel'"); + +ctx.lineJoin = 'round'; +_assertSame(ctx.lineJoin, 'round', "ctx.lineJoin", "'round'"); + +ctx.lineJoin = 'miter'; +_assertSame(ctx.lineJoin, 'miter', "ctx.lineJoin", "'miter'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.line.miter.acute.js b/platforms/ios/www/test/tests-todo/framed.2d.line.miter.acute.js new file mode 100644 index 0000000..e742f87 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.line.miter.acute.js @@ -0,0 +1,31 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineWidth = 200; +ctx.lineJoin = 'miter'; + +ctx.strokeStyle = '#0f0'; +ctx.miterLimit = 2.614; +ctx.beginPath(); +ctx.moveTo(100, 1000); +ctx.lineTo(100, 100); +ctx.lineTo(1000, 1000); +ctx.stroke(); + +ctx.strokeStyle = '#f00'; +ctx.miterLimit = 2.613; +ctx.beginPath(); +ctx.moveTo(100, 1000); +ctx.lineTo(100, 100); +ctx.lineTo(1000, 1000); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.line.miter.exceeded.js b/platforms/ios/www/test/tests-todo/framed.2d.line.miter.exceeded.js new file mode 100644 index 0000000..c86ce52 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.line.miter.exceeded.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineWidth = 400; +ctx.lineJoin = 'miter'; + +ctx.strokeStyle = '#f00'; +ctx.miterLimit = 1.414; +ctx.beginPath(); +ctx.moveTo(200, 1000); +ctx.lineTo(200, 200); +ctx.lineTo(1000, 201); // slightly non-right-angle to avoid being a special case +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.line.miter.invalid.js b/platforms/ios/www/test/tests-todo/framed.2d.line.miter.invalid.js new file mode 100644 index 0000000..e9982e0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.line.miter.invalid.js @@ -0,0 +1,27 @@ +_addTest(function(canvas, ctx) { + +ctx.miterLimit = 1.5; +_assertSame(ctx.miterLimit, 1.5, "ctx.miterLimit", "1.5"); + +ctx.miterLimit = 1.5; +ctx.miterLimit = 0; +_assertSame(ctx.miterLimit, 1.5, "ctx.miterLimit", "1.5"); + +ctx.miterLimit = 1.5; +ctx.miterLimit = -1; +_assertSame(ctx.miterLimit, 1.5, "ctx.miterLimit", "1.5"); + +ctx.miterLimit = 1.5; +ctx.miterLimit = Infinity; +_assertSame(ctx.miterLimit, 1.5, "ctx.miterLimit", "1.5"); + +ctx.miterLimit = 1.5; +ctx.miterLimit = -Infinity; +_assertSame(ctx.miterLimit, 1.5, "ctx.miterLimit", "1.5"); + +ctx.miterLimit = 1.5; +ctx.miterLimit = NaN; +_assertSame(ctx.miterLimit, 1.5, "ctx.miterLimit", "1.5"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.line.miter.lineedge.js b/platforms/ios/www/test/tests-todo/framed.2d.line.miter.lineedge.js new file mode 100644 index 0000000..ef5f616 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.line.miter.lineedge.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineWidth = 200; +ctx.lineJoin = 'miter'; + +ctx.strokeStyle = '#f00'; +ctx.miterLimit = 1.414; +ctx.beginPath(); +ctx.strokeRect(100, 25, 200, 0); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.line.miter.obtuse.js b/platforms/ios/www/test/tests-todo/framed.2d.line.miter.obtuse.js new file mode 100644 index 0000000..46e4a6b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.line.miter.obtuse.js @@ -0,0 +1,31 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineWidth = 1600; +ctx.lineJoin = 'miter'; + +ctx.strokeStyle = '#0f0'; +ctx.miterLimit = 1.083; +ctx.beginPath(); +ctx.moveTo(800, 10000); +ctx.lineTo(800, 300); +ctx.lineTo(10000, -8900); +ctx.stroke(); + +ctx.strokeStyle = '#f00'; +ctx.miterLimit = 1.082; +ctx.beginPath(); +ctx.moveTo(800, 10000); +ctx.lineTo(800, 300); +ctx.lineTo(10000, -8900); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.line.miter.rightangle.js b/platforms/ios/www/test/tests-todo/framed.2d.line.miter.rightangle.js new file mode 100644 index 0000000..150bffb --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.line.miter.rightangle.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineWidth = 400; +ctx.lineJoin = 'miter'; + +ctx.strokeStyle = '#f00'; +ctx.miterLimit = 1.414; +ctx.beginPath(); +ctx.moveTo(200, 1000); +ctx.lineTo(200, 200); +ctx.lineTo(1000, 200); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.line.miter.valid.js b/platforms/ios/www/test/tests-todo/framed.2d.line.miter.valid.js new file mode 100644 index 0000000..26a88b3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.line.miter.valid.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.miterLimit = 1.5; +_assertSame(ctx.miterLimit, 1.5, "ctx.miterLimit", "1.5"); + +ctx.miterLimit = "1e1"; +_assertSame(ctx.miterLimit, 10, "ctx.miterLimit", "10"); + +ctx.miterLimit = 1/1024; +_assertSame(ctx.miterLimit, 1/1024, "ctx.miterLimit", "1/1024"); + +ctx.miterLimit = 1000; +_assertSame(ctx.miterLimit, 1000, "ctx.miterLimit", "1000"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.line.miter.within.js b/platforms/ios/www/test/tests-todo/framed.2d.line.miter.within.js new file mode 100644 index 0000000..09b3eb9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.line.miter.within.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineWidth = 400; +ctx.lineJoin = 'miter'; + +ctx.strokeStyle = '#0f0'; +ctx.miterLimit = 1.416; +ctx.beginPath(); +ctx.moveTo(200, 1000); +ctx.lineTo(200, 200); +ctx.lineTo(1000, 201); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.line.union.js b/platforms/ios/www/test/tests-todo/framed.2d.line.union.js new file mode 100644 index 0000000..d2950b0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.line.union.js @@ -0,0 +1,25 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineWidth = 100; +ctx.lineCap = 'round'; + +ctx.strokeStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(0, 24); +ctx.lineTo(100, 25); +ctx.lineTo(0, 26); +ctx.closePath(); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 25,1, 0,255,0,255, "25,1", "0,255,0,255"); +_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 25,1, 0,255,0,255, "25,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.line.width.basic.js b/platforms/ios/www/test/tests-todo/framed.2d.line.width.basic.js new file mode 100644 index 0000000..a6d46ea --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.line.width.basic.js @@ -0,0 +1,42 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineWidth = 20; +// Draw a green line over a red box, to check the line is not too small +ctx.fillStyle = '#f00'; +ctx.strokeStyle = '#0f0'; +ctx.fillRect(15, 15, 20, 20); +ctx.beginPath(); +ctx.moveTo(25, 15); +ctx.lineTo(25, 35); +ctx.stroke(); + +// Draw a green box over a red line, to check the line is not too large +ctx.fillStyle = '#0f0'; +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(75, 15); +ctx.lineTo(75, 35); +ctx.stroke(); +ctx.fillRect(65, 15, 20, 20); + +_assertPixel(canvas, 14,25, 0,255,0,255, "14,25", "0,255,0,255"); +_assertPixel(canvas, 15,25, 0,255,0,255, "15,25", "0,255,0,255"); +_assertPixel(canvas, 16,25, 0,255,0,255, "16,25", "0,255,0,255"); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 34,25, 0,255,0,255, "34,25", "0,255,0,255"); +_assertPixel(canvas, 35,25, 0,255,0,255, "35,25", "0,255,0,255"); +_assertPixel(canvas, 36,25, 0,255,0,255, "36,25", "0,255,0,255"); + +_assertPixel(canvas, 64,25, 0,255,0,255, "64,25", "0,255,0,255"); +_assertPixel(canvas, 65,25, 0,255,0,255, "65,25", "0,255,0,255"); +_assertPixel(canvas, 66,25, 0,255,0,255, "66,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); +_assertPixel(canvas, 84,25, 0,255,0,255, "84,25", "0,255,0,255"); +_assertPixel(canvas, 85,25, 0,255,0,255, "85,25", "0,255,0,255"); +_assertPixel(canvas, 86,25, 0,255,0,255, "86,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.line.width.invalid.js b/platforms/ios/www/test/tests-todo/framed.2d.line.width.invalid.js new file mode 100644 index 0000000..f48f0d3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.line.width.invalid.js @@ -0,0 +1,27 @@ +_addTest(function(canvas, ctx) { + +ctx.lineWidth = 1.5; +_assertSame(ctx.lineWidth, 1.5, "ctx.lineWidth", "1.5"); + +ctx.lineWidth = 1.5; +ctx.lineWidth = 0; +_assertSame(ctx.lineWidth, 1.5, "ctx.lineWidth", "1.5"); + +ctx.lineWidth = 1.5; +ctx.lineWidth = -1; +_assertSame(ctx.lineWidth, 1.5, "ctx.lineWidth", "1.5"); + +ctx.lineWidth = 1.5; +ctx.lineWidth = Infinity; +_assertSame(ctx.lineWidth, 1.5, "ctx.lineWidth", "1.5"); + +ctx.lineWidth = 1.5; +ctx.lineWidth = -Infinity; +_assertSame(ctx.lineWidth, 1.5, "ctx.lineWidth", "1.5"); + +ctx.lineWidth = 1.5; +ctx.lineWidth = NaN; +_assertSame(ctx.lineWidth, 1.5, "ctx.lineWidth", "1.5"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.line.width.scaledefault.js b/platforms/ios/www/test/tests-todo/framed.2d.line.width.scaledefault.js new file mode 100644 index 0000000..e52773c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.line.width.scaledefault.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.scale(50, 50); +ctx.strokeStyle = '#0f0'; +ctx.moveTo(0, 0.5); +ctx.lineTo(2, 0.5); +ctx.stroke(); + +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); +_assertPixel(canvas, 50,5, 0,255,0,255, "50,5", "0,255,0,255"); +_assertPixel(canvas, 50,45, 0,255,0,255, "50,45", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.line.width.transformed.js b/platforms/ios/www/test/tests-todo/framed.2d.line.width.transformed.js new file mode 100644 index 0000000..981e884 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.line.width.transformed.js @@ -0,0 +1,48 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineWidth = 4; +// Draw a green line over a red box, to check the line is not too small +ctx.fillStyle = '#f00'; +ctx.strokeStyle = '#0f0'; +ctx.fillRect(15, 15, 20, 20); +ctx.save(); + ctx.scale(5, 1); + ctx.beginPath(); + ctx.moveTo(5, 15); + ctx.lineTo(5, 35); + ctx.stroke(); +ctx.restore(); + +// Draw a green box over a red line, to check the line is not too large +ctx.fillStyle = '#0f0'; +ctx.strokeStyle = '#f00'; +ctx.save(); + ctx.scale(-5, 1); + ctx.beginPath(); + ctx.moveTo(-15, 15); + ctx.lineTo(-15, 35); + ctx.stroke(); +ctx.restore(); +ctx.fillRect(65, 15, 20, 20); + +_assertPixel(canvas, 14,25, 0,255,0,255, "14,25", "0,255,0,255"); +_assertPixel(canvas, 15,25, 0,255,0,255, "15,25", "0,255,0,255"); +_assertPixel(canvas, 16,25, 0,255,0,255, "16,25", "0,255,0,255"); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 34,25, 0,255,0,255, "34,25", "0,255,0,255"); +_assertPixel(canvas, 35,25, 0,255,0,255, "35,25", "0,255,0,255"); +_assertPixel(canvas, 36,25, 0,255,0,255, "36,25", "0,255,0,255"); + +_assertPixel(canvas, 64,25, 0,255,0,255, "64,25", "0,255,0,255"); +_assertPixel(canvas, 65,25, 0,255,0,255, "65,25", "0,255,0,255"); +_assertPixel(canvas, 66,25, 0,255,0,255, "66,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); +_assertPixel(canvas, 84,25, 0,255,0,255, "84,25", "0,255,0,255"); +_assertPixel(canvas, 85,25, 0,255,0,255, "85,25", "0,255,0,255"); +_assertPixel(canvas, 86,25, 0,255,0,255, "86,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.line.width.valid.js b/platforms/ios/www/test/tests-todo/framed.2d.line.width.valid.js new file mode 100644 index 0000000..2c5e700 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.line.width.valid.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.lineWidth = 1.5; +_assertSame(ctx.lineWidth, 1.5, "ctx.lineWidth", "1.5"); + +ctx.lineWidth = "1e1"; +_assertSame(ctx.lineWidth, 10, "ctx.lineWidth", "10"); + +ctx.lineWidth = 1/1024; +_assertSame(ctx.lineWidth, 1/1024, "ctx.lineWidth", "1/1024"); + +ctx.lineWidth = 1000; +_assertSame(ctx.lineWidth, 1000, "ctx.lineWidth", "1000"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.missingargs.js b/platforms/ios/www/test/tests-todo/framed.2d.missingargs.js new file mode 100644 index 0000000..3140fba --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.missingargs.js @@ -0,0 +1,311 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.scale(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.scale()"); } +try { var _thrown = false; + ctx.scale(1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.scale(1)"); } +try { var _thrown = false; + ctx.rotate(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.rotate()"); } +try { var _thrown = false; + ctx.translate(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.translate()"); } +try { var _thrown = false; + ctx.translate(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.translate(0)"); } +if (ctx.transform) { // (avoid spurious failures, since the aim here is not to test that all features are supported) + try { var _thrown = false; + ctx.transform(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.transform()"); } + try { var _thrown = false; + ctx.transform(1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.transform(1)"); } + try { var _thrown = false; + ctx.transform(1, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.transform(1, 0)"); } + try { var _thrown = false; + ctx.transform(1, 0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.transform(1, 0, 0)"); } + try { var _thrown = false; + ctx.transform(1, 0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.transform(1, 0, 0, 1)"); } + try { var _thrown = false; + ctx.transform(1, 0, 0, 1, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.transform(1, 0, 0, 1, 0)"); } +} +if (ctx.setTransform) { + try { var _thrown = false; + ctx.setTransform(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.setTransform()"); } + try { var _thrown = false; + ctx.setTransform(1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.setTransform(1)"); } + try { var _thrown = false; + ctx.setTransform(1, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.setTransform(1, 0)"); } + try { var _thrown = false; + ctx.setTransform(1, 0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.setTransform(1, 0, 0)"); } + try { var _thrown = false; + ctx.setTransform(1, 0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.setTransform(1, 0, 0, 1)"); } + try { var _thrown = false; + ctx.setTransform(1, 0, 0, 1, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.setTransform(1, 0, 0, 1, 0)"); } +} +try { var _thrown = false; + ctx.createLinearGradient(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient()"); } +try { var _thrown = false; + ctx.createLinearGradient(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient()"); } +try { var _thrown = false; + ctx.createRadialGradient(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, 1, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, 1, 0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, 0)"); } +try { var _thrown = false; + ctx.createPattern(canvas); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createPattern(canvas)"); } +try { var _thrown = false; + ctx.clearRect(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.clearRect()"); } +try { var _thrown = false; + ctx.clearRect(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.clearRect(0)"); } +try { var _thrown = false; + ctx.clearRect(0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.clearRect(0, 0)"); } +try { var _thrown = false; + ctx.clearRect(0, 0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.clearRect(0, 0, 0)"); } +try { var _thrown = false; + ctx.fillRect(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.fillRect()"); } +try { var _thrown = false; + ctx.fillRect(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.fillRect(0)"); } +try { var _thrown = false; + ctx.fillRect(0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.fillRect(0, 0)"); } +try { var _thrown = false; + ctx.fillRect(0, 0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.fillRect(0, 0, 0)"); } +try { var _thrown = false; + ctx.strokeRect(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.strokeRect()"); } +try { var _thrown = false; + ctx.strokeRect(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.strokeRect(0)"); } +try { var _thrown = false; + ctx.strokeRect(0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.strokeRect(0, 0)"); } +try { var _thrown = false; + ctx.strokeRect(0, 0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.strokeRect(0, 0, 0)"); } +try { var _thrown = false; + ctx.moveTo(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.moveTo()"); } +try { var _thrown = false; + ctx.moveTo(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.moveTo(0)"); } +try { var _thrown = false; + ctx.lineTo(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.lineTo()"); } +try { var _thrown = false; + ctx.lineTo(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.lineTo(0)"); } +try { var _thrown = false; + ctx.quadraticCurveTo(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.quadraticCurveTo()"); } +try { var _thrown = false; + ctx.quadraticCurveTo(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.quadraticCurveTo(0)"); } +try { var _thrown = false; + ctx.quadraticCurveTo(0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.quadraticCurveTo(0, 0)"); } +try { var _thrown = false; + ctx.quadraticCurveTo(0, 0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.quadraticCurveTo(0, 0, 0)"); } +try { var _thrown = false; + ctx.bezierCurveTo(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.bezierCurveTo()"); } +try { var _thrown = false; + ctx.bezierCurveTo(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.bezierCurveTo(0)"); } +try { var _thrown = false; + ctx.bezierCurveTo(0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.bezierCurveTo(0, 0)"); } +try { var _thrown = false; + ctx.bezierCurveTo(0, 0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.bezierCurveTo(0, 0, 0)"); } +try { var _thrown = false; + ctx.bezierCurveTo(0, 0, 0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.bezierCurveTo(0, 0, 0, 0)"); } +try { var _thrown = false; + ctx.bezierCurveTo(0, 0, 0, 0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.bezierCurveTo(0, 0, 0, 0, 0)"); } +try { var _thrown = false; + ctx.arcTo(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arcTo()"); } +try { var _thrown = false; + ctx.arcTo(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arcTo(0)"); } +try { var _thrown = false; + ctx.arcTo(0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arcTo(0, 0)"); } +try { var _thrown = false; + ctx.arcTo(0, 0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arcTo(0, 0, 0)"); } +try { var _thrown = false; + ctx.arcTo(0, 0, 0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arcTo(0, 0, 0, 0)"); } +try { var _thrown = false; + ctx.rect(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.rect()"); } +try { var _thrown = false; + ctx.rect(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.rect(0)"); } +try { var _thrown = false; + ctx.rect(0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.rect(0, 0)"); } +try { var _thrown = false; + ctx.rect(0, 0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.rect(0, 0, 0)"); } +try { var _thrown = false; + ctx.arc(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arc()"); } +try { var _thrown = false; + ctx.arc(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arc(0)"); } +try { var _thrown = false; + ctx.arc(0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arc(0, 0)"); } +try { var _thrown = false; + ctx.arc(0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arc(0, 0, 1)"); } +try { var _thrown = false; + ctx.arc(0, 0, 1, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arc(0, 0, 1, 0)"); } +try { var _thrown = false; + ctx.arc(0, 0, 1, 0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arc(0, 0, 1, 0, 0)"); } +if (ctx.isPointInPath) { + try { var _thrown = false; + ctx.isPointInPath(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.isPointInPath()"); } + try { var _thrown = false; + ctx.isPointInPath(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.isPointInPath(0)"); } +} +if (ctx.drawFocusRing) { + try { var _thrown = false; + ctx.drawFocusRing(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.drawFocusRing()"); } + try { var _thrown = false; + ctx.drawFocusRing(canvas); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.drawFocusRing(canvas)"); } + try { var _thrown = false; + ctx.drawFocusRing(canvas, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.drawFocusRing(canvas, 0)"); } +} +if (ctx.fillText) { + try { var _thrown = false; + ctx.fillText(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.fillText()"); } + try { var _thrown = false; + ctx.fillText('test'); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.fillText('test')"); } + try { var _thrown = false; + ctx.fillText('test', 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.fillText('test', 0)"); } + try { var _thrown = false; + ctx.strokeText(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.strokeText()"); } + try { var _thrown = false; + ctx.strokeText('test'); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.strokeText('test')"); } + try { var _thrown = false; + ctx.strokeText('test', 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.strokeText('test', 0)"); } + try { var _thrown = false; + ctx.measureText(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.measureText()"); } +} +try { var _thrown = false; + ctx.drawImage(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.drawImage()"); } +try { var _thrown = false; + ctx.drawImage(canvas); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.drawImage(canvas)"); } +try { var _thrown = false; + ctx.drawImage(canvas, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.drawImage(canvas, 0)"); } +// TODO: n >= 3 args on drawImage could be either a valid overload, +// or too few for another overload, or too many for another +// overload - what should happen? +if (ctx.createImageData) { + try { var _thrown = false; + ctx.createImageData(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createImageData()"); } + try { var _thrown = false; + ctx.createImageData(1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createImageData(1)"); } +} +if (ctx.getImageData) { + try { var _thrown = false; + ctx.getImageData(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData()"); } + try { var _thrown = false; + ctx.getImageData(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(0)"); } + try { var _thrown = false; + ctx.getImageData(0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(0, 0)"); } + try { var _thrown = false; + ctx.getImageData(0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(0, 0, 1)"); } +} +if (ctx.putImageData) { + var imgdata = ctx.getImageData(0, 0, 1, 1); + try { var _thrown = false; + ctx.putImageData(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData()"); } + try { var _thrown = false; + ctx.putImageData(imgdata); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata)"); } + try { var _thrown = false; + ctx.putImageData(imgdata, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 0)"); } +} +var g = ctx.createLinearGradient(0, 0, 0, 0); +try { var _thrown = false; + g.addColorStop(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: g.addColorStop()"); } +try { var _thrown = false; + g.addColorStop(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: g.addColorStop(0)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.arc.angle.1.js b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.angle.1.js new file mode 100644 index 0000000..9216664 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.angle.1.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(100, 0); +ctx.arc(100, 0, 150, Math.PI/2, -Math.PI, true); +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.arc.angle.2.js b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.angle.2.js new file mode 100644 index 0000000..f8306c0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.angle.2.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(100, 0); +ctx.arc(100, 0, 150, -3*Math.PI/2, -Math.PI, true); +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.arc.angle.3.js b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.angle.3.js new file mode 100644 index 0000000..8b812a2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.angle.3.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(100, 0); +ctx.arc(100, 0, 150, (512+1/2)*Math.PI, (1024-1)*Math.PI, true); +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.arc.angle.4.js b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.angle.4.js new file mode 100644 index 0000000..82b041a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.angle.4.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(50, 25); +ctx.arc(50, 25, 60, (512+1/2)*Math.PI, (1024-1)*Math.PI, false); +ctx.fill(); +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.arc.angle.5.js b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.angle.5.js new file mode 100644 index 0000000..bbb0243 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.angle.5.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(100, 0); +ctx.arc(100, 0, 150, (1024-1)*Math.PI, (512+1/2)*Math.PI, false); +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.arc.angle.6.js b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.angle.6.js new file mode 100644 index 0000000..be5c9ac --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.angle.6.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(50, 25); +ctx.arc(50, 25, 60, (1024-1)*Math.PI, (512+1/2)*Math.PI, true); +ctx.fill(); +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.arc.empty.js b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.empty.js new file mode 100644 index 0000000..49e1b57 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.empty.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 50; +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.arc(200, 25, 5, 0, 2*Math.PI, true); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.arc.end.js b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.end.js new file mode 100644 index 0000000..fec59f2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.end.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 50; +ctx.strokeStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(-100, 0); +ctx.arc(-100, 0, 25, -Math.PI/2, Math.PI/2, true); +ctx.lineTo(100, 25); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.arc.negative.js b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.negative.js new file mode 100644 index 0000000..935a633 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.negative.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.arc(0, 0, -1, 0, 0, true); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.arc(0, 0, -1, 0, 0, true)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.arc.nonempty.js b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.nonempty.js new file mode 100644 index 0000000..544f1a9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.nonempty.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 50; +ctx.strokeStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(0, 25); +ctx.arc(200, 25, 5, 0, 2*Math.PI, true); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.arc.nonfinite.js b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.nonfinite.js new file mode 100644 index 0000000..2fed434 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.nonfinite.js @@ -0,0 +1,56 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.moveTo(0, 0); +ctx.lineTo(100, 0); +ctx.arc(Infinity, 0, 50, 0, 2*Math.PI, true); +ctx.arc(-Infinity, 0, 50, 0, 2*Math.PI, true); +ctx.arc(NaN, 0, 50, 0, 2*Math.PI, true); +ctx.arc(0, Infinity, 50, 0, 2*Math.PI, true); +ctx.arc(0, -Infinity, 50, 0, 2*Math.PI, true); +ctx.arc(0, NaN, 50, 0, 2*Math.PI, true); +ctx.arc(0, 0, Infinity, 0, 2*Math.PI, true); +ctx.arc(0, 0, -Infinity, 0, 2*Math.PI, true); +ctx.arc(0, 0, NaN, 0, 2*Math.PI, true); +ctx.arc(0, 0, 50, Infinity, 2*Math.PI, true); +ctx.arc(0, 0, 50, -Infinity, 2*Math.PI, true); +ctx.arc(0, 0, 50, NaN, 2*Math.PI, true); +ctx.arc(0, 0, 50, 0, Infinity, true); +ctx.arc(0, 0, 50, 0, -Infinity, true); +ctx.arc(0, 0, 50, 0, NaN, true); +ctx.arc(Infinity, Infinity, 50, 0, 2*Math.PI, true); +ctx.arc(Infinity, Infinity, Infinity, 0, 2*Math.PI, true); +ctx.arc(Infinity, Infinity, Infinity, Infinity, 2*Math.PI, true); +ctx.arc(Infinity, Infinity, Infinity, Infinity, Infinity, true); +ctx.arc(Infinity, Infinity, Infinity, 0, Infinity, true); +ctx.arc(Infinity, Infinity, 50, Infinity, 2*Math.PI, true); +ctx.arc(Infinity, Infinity, 50, Infinity, Infinity, true); +ctx.arc(Infinity, Infinity, 50, 0, Infinity, true); +ctx.arc(Infinity, 0, Infinity, 0, 2*Math.PI, true); +ctx.arc(Infinity, 0, Infinity, Infinity, 2*Math.PI, true); +ctx.arc(Infinity, 0, Infinity, Infinity, Infinity, true); +ctx.arc(Infinity, 0, Infinity, 0, Infinity, true); +ctx.arc(Infinity, 0, 50, Infinity, 2*Math.PI, true); +ctx.arc(Infinity, 0, 50, Infinity, Infinity, true); +ctx.arc(Infinity, 0, 50, 0, Infinity, true); +ctx.arc(0, Infinity, Infinity, 0, 2*Math.PI, true); +ctx.arc(0, Infinity, Infinity, Infinity, 2*Math.PI, true); +ctx.arc(0, Infinity, Infinity, Infinity, Infinity, true); +ctx.arc(0, Infinity, Infinity, 0, Infinity, true); +ctx.arc(0, Infinity, 50, Infinity, 2*Math.PI, true); +ctx.arc(0, Infinity, 50, Infinity, Infinity, true); +ctx.arc(0, Infinity, 50, 0, Infinity, true); +ctx.arc(0, 0, Infinity, Infinity, 2*Math.PI, true); +ctx.arc(0, 0, Infinity, Infinity, Infinity, true); +ctx.arc(0, 0, Infinity, 0, Infinity, true); +ctx.arc(0, 0, 50, Infinity, Infinity, true); +ctx.lineTo(100, 50); +ctx.lineTo(0, 50); +ctx.fillStyle = '#0f0'; +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 90,45, 0,255,0,255, "90,45", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.arc.scale.1.js b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.scale.1.js new file mode 100644 index 0000000..8648fd9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.scale.1.js @@ -0,0 +1,33 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.scale(2, 0.5); +ctx.fillStyle = '#0f0'; +ctx.beginPath(); +ctx.arc(25, 50, 56, 0, 2*Math.PI, false); +ctx.fill(); +ctx.fillStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(-25, 50); +ctx.arc(-25, 50, 24, 0, 2*Math.PI, false); +ctx.moveTo(75, 50); +ctx.arc(75, 50, 24, 0, 2*Math.PI, false); +ctx.moveTo(25, -25); +ctx.arc(25, -25, 24, 0, 2*Math.PI, false); +ctx.moveTo(25, 125); +ctx.arc(25, 125, 24, 0, 2*Math.PI, false); +ctx.fill(); + +_assertPixel(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255"); +_assertPixel(canvas, 50,0, 0,255,0,255, "50,0", "0,255,0,255"); +_assertPixel(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255"); +_assertPixel(canvas, 0,25, 0,255,0,255, "0,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 99,25, 0,255,0,255, "99,25", "0,255,0,255"); +_assertPixel(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255"); +_assertPixel(canvas, 50,49, 0,255,0,255, "50,49", "0,255,0,255"); +_assertPixel(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.arc.scale.2.js b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.scale.2.js new file mode 100644 index 0000000..e00a809 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.scale.2.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.scale(100, 100); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 1.2; +ctx.beginPath(); +ctx.arc(0, 0, 0.6, 0, Math.PI/2, false); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.arc.selfintersect.1.js b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.selfintersect.1.js new file mode 100644 index 0000000..9a8ec74 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.selfintersect.1.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 200; +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.arc(100, 50, 25, 0, -Math.PI/2, true); +ctx.stroke(); +ctx.beginPath(); +ctx.arc(0, 0, 25, 0, -Math.PI/2, true); +ctx.stroke(); +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.arc.selfintersect.2.js b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.selfintersect.2.js new file mode 100644 index 0000000..428f621 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.selfintersect.2.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 180; +ctx.strokeStyle = '#0f0'; +ctx.beginPath(); +ctx.arc(-50, 50, 25, 0, -Math.PI/2, true); +ctx.stroke(); +ctx.beginPath(); +ctx.arc(100, 0, 25, 0, -Math.PI/2, true); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 90,10, 0,255,0,255, "90,10", "0,255,0,255"); +_assertPixel(canvas, 97,1, 0,255,0,255, "97,1", "0,255,0,255"); +_assertPixel(canvas, 97,2, 0,255,0,255, "97,2", "0,255,0,255"); +_assertPixel(canvas, 97,3, 0,255,0,255, "97,3", "0,255,0,255"); +_assertPixel(canvas, 2,48, 0,255,0,255, "2,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.arc.shape.1.js b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.shape.1.js new file mode 100644 index 0000000..549f509 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.shape.1.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 50; +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.arc(50, 50, 50, 0, Math.PI, false); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 20,48, 0,255,0,255, "20,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.arc.shape.2.js b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.shape.2.js new file mode 100644 index 0000000..b852f1b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.shape.2.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 100; +ctx.strokeStyle = '#0f0'; +ctx.beginPath(); +ctx.arc(50, 50, 50, 0, Math.PI, true); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 20,48, 0,255,0,255, "20,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.arc.shape.3.js b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.shape.3.js new file mode 100644 index 0000000..4df1161 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.shape.3.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 100; +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.arc(0, 50, 50, 0, -Math.PI/2, false); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.arc.shape.4.js b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.shape.4.js new file mode 100644 index 0000000..7ba2bcf --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.shape.4.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 150; +ctx.strokeStyle = '#0f0'; +ctx.beginPath(); +ctx.arc(-50, 50, 100, 0, -Math.PI/2, true); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.arc.shape.5.js b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.shape.5.js new file mode 100644 index 0000000..65e3384 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.shape.5.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 200; +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.arc(300, 0, 100, 0, 5*Math.PI, false); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.arc.twopie.1.js b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.twopie.1.js new file mode 100644 index 0000000..a77ac0c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.twopie.1.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 100; +ctx.beginPath(); +ctx.arc(50, 25, 50, 0, 2*Math.PI - 1e-4, true); +ctx.stroke(); +_assertPixel(canvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.arc.twopie.2.js b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.twopie.2.js new file mode 100644 index 0000000..284c167 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.twopie.2.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 100; +ctx.beginPath(); +ctx.arc(50, 25, 50, 0, 2*Math.PI - 1e-4, false); +ctx.stroke(); +_assertPixel(canvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.arc.twopie.3.js b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.twopie.3.js new file mode 100644 index 0000000..17f86d6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.twopie.3.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 100; +ctx.beginPath(); +ctx.arc(50, 25, 50, 0, 2*Math.PI + 1e-4, true); +ctx.stroke(); +_assertPixel(canvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.arc.twopie.4.js b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.twopie.4.js new file mode 100644 index 0000000..935f0b2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.twopie.4.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 100; +ctx.beginPath(); +ctx.arc(50, 25, 50, 0, 2*Math.PI + 1e-4, false); +ctx.stroke(); +_assertPixel(canvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.arc.zeroradius.js b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.zeroradius.js new file mode 100644 index 0000000..5466d13 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.arc.zeroradius.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00' +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 50; +ctx.strokeStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(0, 25); +ctx.arc(200, 25, 0, 0, Math.PI, true); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.arcTo.coincide.1.js b/platforms/ios/www/test/tests-todo/framed.2d.path.arcTo.coincide.1.js new file mode 100644 index 0000000..3d53b5b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.arcTo.coincide.1.js @@ -0,0 +1,25 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 50; + +ctx.strokeStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(0, 25); +ctx.arcTo(0, 25, 50, 1000, 1); +ctx.lineTo(100, 25); +ctx.stroke(); + +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(50, 25); +ctx.arcTo(50, 25, 100, 25, 1); +ctx.stroke(); + +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.arcTo.collinear.2.js b/platforms/ios/www/test/tests-todo/framed.2d.path.arcTo.collinear.2.js new file mode 100644 index 0000000..13579f4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.arcTo.collinear.2.js @@ -0,0 +1,22 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 50; + +ctx.strokeStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(0, 25); +ctx.arcTo(100, 25, 10, 25, 1); +ctx.stroke(); + +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(100, 25); +ctx.arcTo(200, 25, 110, 25, 1); +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.arcTo.negative.js b/platforms/ios/www/test/tests-todo/framed.2d.path.arcTo.negative.js new file mode 100644 index 0000000..c57d2e3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.arcTo.negative.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.arcTo(0, 0, 0, 0, -1); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.arcTo(0, 0, 0, 0, -1)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.arcTo.nonfinite.js b/platforms/ios/www/test/tests-todo/framed.2d.path.arcTo.nonfinite.js new file mode 100644 index 0000000..e580981 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.arcTo.nonfinite.js @@ -0,0 +1,54 @@ +_addTest(function(canvas, ctx) { + +ctx.moveTo(0, 0); +ctx.lineTo(100, 0); +ctx.arcTo(Infinity, 50, 0, 50, 0); +ctx.arcTo(-Infinity, 50, 0, 50, 0); +ctx.arcTo(NaN, 50, 0, 50, 0); +ctx.arcTo(0, Infinity, 0, 50, 0); +ctx.arcTo(0, -Infinity, 0, 50, 0); +ctx.arcTo(0, NaN, 0, 50, 0); +ctx.arcTo(0, 50, Infinity, 50, 0); +ctx.arcTo(0, 50, -Infinity, 50, 0); +ctx.arcTo(0, 50, NaN, 50, 0); +ctx.arcTo(0, 50, 0, Infinity, 0); +ctx.arcTo(0, 50, 0, -Infinity, 0); +ctx.arcTo(0, 50, 0, NaN, 0); +ctx.arcTo(0, 50, 0, 50, Infinity); +ctx.arcTo(0, 50, 0, 50, -Infinity); +ctx.arcTo(0, 50, 0, 50, NaN); +ctx.arcTo(Infinity, Infinity, 0, 50, 0); +ctx.arcTo(Infinity, Infinity, Infinity, 50, 0); +ctx.arcTo(Infinity, Infinity, Infinity, Infinity, 0); +ctx.arcTo(Infinity, Infinity, Infinity, Infinity, Infinity); +ctx.arcTo(Infinity, Infinity, Infinity, 50, Infinity); +ctx.arcTo(Infinity, Infinity, 0, Infinity, 0); +ctx.arcTo(Infinity, Infinity, 0, Infinity, Infinity); +ctx.arcTo(Infinity, Infinity, 0, 50, Infinity); +ctx.arcTo(Infinity, 50, Infinity, 50, 0); +ctx.arcTo(Infinity, 50, Infinity, Infinity, 0); +ctx.arcTo(Infinity, 50, Infinity, Infinity, Infinity); +ctx.arcTo(Infinity, 50, Infinity, 50, Infinity); +ctx.arcTo(Infinity, 50, 0, Infinity, 0); +ctx.arcTo(Infinity, 50, 0, Infinity, Infinity); +ctx.arcTo(Infinity, 50, 0, 50, Infinity); +ctx.arcTo(0, Infinity, Infinity, 50, 0); +ctx.arcTo(0, Infinity, Infinity, Infinity, 0); +ctx.arcTo(0, Infinity, Infinity, Infinity, Infinity); +ctx.arcTo(0, Infinity, Infinity, 50, Infinity); +ctx.arcTo(0, Infinity, 0, Infinity, 0); +ctx.arcTo(0, Infinity, 0, Infinity, Infinity); +ctx.arcTo(0, Infinity, 0, 50, Infinity); +ctx.arcTo(0, 50, Infinity, Infinity, 0); +ctx.arcTo(0, 50, Infinity, Infinity, Infinity); +ctx.arcTo(0, 50, Infinity, 50, Infinity); +ctx.arcTo(0, 50, 0, Infinity, Infinity); +ctx.lineTo(100, 50); +ctx.lineTo(0, 50); +ctx.fillStyle = '#0f0'; +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 90,45, 0,255,0,255, "90,45", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.arcTo.scale.js b/platforms/ios/www/test/tests-todo/framed.2d.path.arcTo.scale.js new file mode 100644 index 0000000..48bdf0a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.arcTo.scale.js @@ -0,0 +1,26 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(0, 50); +ctx.translate(100, 0); +ctx.scale(0.1, 1); +ctx.arcTo(50, 50, 50, 0, 50); +ctx.lineTo(-1000, 0); +ctx.fill(); + +_assertPixel(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255"); +_assertPixel(canvas, 50,0, 0,255,0,255, "50,0", "0,255,0,255"); +_assertPixel(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255"); +_assertPixel(canvas, 0,25, 0,255,0,255, "0,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 99,25, 0,255,0,255, "99,25", "0,255,0,255"); +_assertPixel(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255"); +_assertPixel(canvas, 50,49, 0,255,0,255, "50,49", "0,255,0,255"); +_assertPixel(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.arcTo.shape.curve1.js b/platforms/ios/www/test/tests-todo/framed.2d.path.arcTo.shape.curve1.js new file mode 100644 index 0000000..31a724a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.arcTo.shape.curve1.js @@ -0,0 +1,39 @@ +_addTest(function(canvas, ctx) { + +var tol = 1.5; // tolerance to avoid antialiasing artifacts + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 10; +ctx.beginPath(); +ctx.moveTo(10, 25); +ctx.arcTo(75, 25, 75, 60, 20); +ctx.stroke(); + +ctx.fillStyle = '#0f0'; +ctx.beginPath(); +ctx.rect(10, 20, 45, 10); +ctx.moveTo(80, 45); +ctx.arc(55, 45, 25+tol, 0, -Math.PI/2, true); +ctx.arc(55, 45, 15-tol, -Math.PI/2, 0, false); +ctx.fill(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 55,19, 0,255,0,255, "55,19", "0,255,0,255"); +_assertPixel(canvas, 55,20, 0,255,0,255, "55,20", "0,255,0,255"); +_assertPixel(canvas, 55,21, 0,255,0,255, "55,21", "0,255,0,255"); +_assertPixel(canvas, 64,22, 0,255,0,255, "64,22", "0,255,0,255"); +_assertPixel(canvas, 65,21, 0,255,0,255, "65,21", "0,255,0,255"); +_assertPixel(canvas, 72,28, 0,255,0,255, "72,28", "0,255,0,255"); +_assertPixel(canvas, 73,27, 0,255,0,255, "73,27", "0,255,0,255"); +_assertPixel(canvas, 78,36, 0,255,0,255, "78,36", "0,255,0,255"); +_assertPixel(canvas, 79,35, 0,255,0,255, "79,35", "0,255,0,255"); +_assertPixel(canvas, 80,44, 0,255,0,255, "80,44", "0,255,0,255"); +_assertPixel(canvas, 80,45, 0,255,0,255, "80,45", "0,255,0,255"); +_assertPixel(canvas, 80,46, 0,255,0,255, "80,46", "0,255,0,255"); +_assertPixel(canvas, 65,45, 0,255,0,255, "65,45", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.arcTo.shape.curve2.js b/platforms/ios/www/test/tests-todo/framed.2d.path.arcTo.shape.curve2.js new file mode 100644 index 0000000..6e2e767 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.arcTo.shape.curve2.js @@ -0,0 +1,38 @@ +_addTest(function(canvas, ctx) { + +var tol = 1.5; // tolerance to avoid antialiasing artifacts + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#f00'; +ctx.beginPath(); +ctx.rect(10, 20, 45, 10); +ctx.moveTo(80, 45); +ctx.arc(55, 45, 25-tol, 0, -Math.PI/2, true); +ctx.arc(55, 45, 15+tol, -Math.PI/2, 0, false); +ctx.fill(); + +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 10; +ctx.beginPath(); +ctx.moveTo(10, 25); +ctx.arcTo(75, 25, 75, 60, 20); +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 55,19, 0,255,0,255, "55,19", "0,255,0,255"); +_assertPixel(canvas, 55,20, 0,255,0,255, "55,20", "0,255,0,255"); +_assertPixel(canvas, 55,21, 0,255,0,255, "55,21", "0,255,0,255"); +_assertPixel(canvas, 64,22, 0,255,0,255, "64,22", "0,255,0,255"); +_assertPixel(canvas, 65,21, 0,255,0,255, "65,21", "0,255,0,255"); +_assertPixel(canvas, 72,28, 0,255,0,255, "72,28", "0,255,0,255"); +_assertPixel(canvas, 73,27, 0,255,0,255, "73,27", "0,255,0,255"); +_assertPixel(canvas, 78,36, 0,255,0,255, "78,36", "0,255,0,255"); +_assertPixel(canvas, 79,35, 0,255,0,255, "79,35", "0,255,0,255"); +_assertPixel(canvas, 80,44, 0,255,0,255, "80,44", "0,255,0,255"); +_assertPixel(canvas, 80,45, 0,255,0,255, "80,45", "0,255,0,255"); +_assertPixel(canvas, 80,46, 0,255,0,255, "80,46", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.arcTo.shape.end.js b/platforms/ios/www/test/tests-todo/framed.2d.path.arcTo.shape.end.js new file mode 100644 index 0000000..434fe1c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.arcTo.shape.end.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 50; +ctx.beginPath(); +ctx.moveTo(-100, -100); +ctx.arcTo(-100, 25, 200, 25, 10); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.arcTo.shape.start.js b/platforms/ios/www/test/tests-todo/framed.2d.path.arcTo.shape.start.js new file mode 100644 index 0000000..d75b912 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.arcTo.shape.start.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 50; +ctx.beginPath(); +ctx.moveTo(0, 25); +ctx.arcTo(200, 25, 200, 50, 10); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.arcTo.transformation.js b/platforms/ios/www/test/tests-todo/framed.2d.path.arcTo.transformation.js new file mode 100644 index 0000000..a4393b9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.arcTo.transformation.js @@ -0,0 +1,25 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(0, 50); +ctx.translate(100, 0); +ctx.arcTo(50, 50, 50, 0, 50); +ctx.lineTo(-100, 0); +ctx.fill(); + +_assertPixel(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255"); +_assertPixel(canvas, 50,0, 0,255,0,255, "50,0", "0,255,0,255"); +_assertPixel(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255"); +_assertPixel(canvas, 0,25, 0,255,0,255, "0,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 99,25, 0,255,0,255, "99,25", "0,255,0,255"); +_assertPixel(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255"); +_assertPixel(canvas, 50,49, 0,255,0,255, "50,49", "0,255,0,255"); +_assertPixel(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.arcTo.zero.1.js b/platforms/ios/www/test/tests-todo/framed.2d.path.arcTo.zero.1.js new file mode 100644 index 0000000..6f9de58 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.arcTo.zero.1.js @@ -0,0 +1,22 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 50; + +ctx.strokeStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(0, 25); +ctx.arcTo(100, 25, 100, 100, 0); +ctx.stroke(); + +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(0, -25); +ctx.arcTo(50, -25, 50, 50, 0); +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.arcTo.zero.2.js b/platforms/ios/www/test/tests-todo/framed.2d.path.arcTo.zero.2.js new file mode 100644 index 0000000..5131547 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.arcTo.zero.2.js @@ -0,0 +1,22 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 50; + +ctx.strokeStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(0, 25); +ctx.arcTo(100, 25, -100, 25, 0); +ctx.stroke(); + +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(100, 25); +ctx.arcTo(200, 25, 50, 25, 0); +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.beginPath.js b/platforms/ios/www/test/tests-todo/framed.2d.path.beginPath.js new file mode 100644 index 0000000..863d90e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.beginPath.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.rect(0, 0, 100, 50); +ctx.beginPath(); +ctx.fillStyle = '#f00'; +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.bezierCurveTo.basic.js b/platforms/ios/www/test/tests-todo/framed.2d.path.bezierCurveTo.basic.js new file mode 100644 index 0000000..ed39006 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.bezierCurveTo.basic.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 50; +ctx.beginPath(); +ctx.moveTo(0, 25); +ctx.bezierCurveTo(100, 25, 100, 25, 100, 25); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.bezierCurveTo.ensuresubpath.1.js b/platforms/ios/www/test/tests-todo/framed.2d.path.bezierCurveTo.ensuresubpath.1.js new file mode 100644 index 0000000..2e043d2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.bezierCurveTo.ensuresubpath.1.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 50; +ctx.beginPath(); +ctx.bezierCurveTo(100, 50, 200, 50, 200, 50); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 95,45, 0,255,0,255, "95,45", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.bezierCurveTo.ensuresubpath.2.js b/platforms/ios/www/test/tests-todo/framed.2d.path.bezierCurveTo.ensuresubpath.2.js new file mode 100644 index 0000000..7526400 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.bezierCurveTo.ensuresubpath.2.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 50; +ctx.beginPath(); +ctx.bezierCurveTo(0, 25, 100, 25, 100, 25); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 5,45, 0,255,0,255, "5,45", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.bezierCurveTo.nonfinite.js b/platforms/ios/www/test/tests-todo/framed.2d.path.bezierCurveTo.nonfinite.js new file mode 100644 index 0000000..95e947d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.bezierCurveTo.nonfinite.js @@ -0,0 +1,88 @@ +_addTest(function(canvas, ctx) { + +ctx.moveTo(0, 0); +ctx.lineTo(100, 0); +ctx.bezierCurveTo(Infinity, 50, 0, 50, 0, 50); +ctx.bezierCurveTo(-Infinity, 50, 0, 50, 0, 50); +ctx.bezierCurveTo(NaN, 50, 0, 50, 0, 50); +ctx.bezierCurveTo(0, Infinity, 0, 50, 0, 50); +ctx.bezierCurveTo(0, -Infinity, 0, 50, 0, 50); +ctx.bezierCurveTo(0, NaN, 0, 50, 0, 50); +ctx.bezierCurveTo(0, 50, Infinity, 50, 0, 50); +ctx.bezierCurveTo(0, 50, -Infinity, 50, 0, 50); +ctx.bezierCurveTo(0, 50, NaN, 50, 0, 50); +ctx.bezierCurveTo(0, 50, 0, Infinity, 0, 50); +ctx.bezierCurveTo(0, 50, 0, -Infinity, 0, 50); +ctx.bezierCurveTo(0, 50, 0, NaN, 0, 50); +ctx.bezierCurveTo(0, 50, 0, 50, Infinity, 50); +ctx.bezierCurveTo(0, 50, 0, 50, -Infinity, 50); +ctx.bezierCurveTo(0, 50, 0, 50, NaN, 50); +ctx.bezierCurveTo(0, 50, 0, 50, 0, Infinity); +ctx.bezierCurveTo(0, 50, 0, 50, 0, -Infinity); +ctx.bezierCurveTo(0, 50, 0, 50, 0, NaN); +ctx.bezierCurveTo(Infinity, Infinity, 0, 50, 0, 50); +ctx.bezierCurveTo(Infinity, Infinity, Infinity, 50, 0, 50); +ctx.bezierCurveTo(Infinity, Infinity, Infinity, Infinity, 0, 50); +ctx.bezierCurveTo(Infinity, Infinity, Infinity, Infinity, Infinity, 50); +ctx.bezierCurveTo(Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); +ctx.bezierCurveTo(Infinity, Infinity, Infinity, Infinity, 0, Infinity); +ctx.bezierCurveTo(Infinity, Infinity, Infinity, 50, Infinity, 50); +ctx.bezierCurveTo(Infinity, Infinity, Infinity, 50, Infinity, Infinity); +ctx.bezierCurveTo(Infinity, Infinity, Infinity, 50, 0, Infinity); +ctx.bezierCurveTo(Infinity, Infinity, 0, Infinity, 0, 50); +ctx.bezierCurveTo(Infinity, Infinity, 0, Infinity, Infinity, 50); +ctx.bezierCurveTo(Infinity, Infinity, 0, Infinity, Infinity, Infinity); +ctx.bezierCurveTo(Infinity, Infinity, 0, Infinity, 0, Infinity); +ctx.bezierCurveTo(Infinity, Infinity, 0, 50, Infinity, 50); +ctx.bezierCurveTo(Infinity, Infinity, 0, 50, Infinity, Infinity); +ctx.bezierCurveTo(Infinity, Infinity, 0, 50, 0, Infinity); +ctx.bezierCurveTo(Infinity, 50, Infinity, 50, 0, 50); +ctx.bezierCurveTo(Infinity, 50, Infinity, Infinity, 0, 50); +ctx.bezierCurveTo(Infinity, 50, Infinity, Infinity, Infinity, 50); +ctx.bezierCurveTo(Infinity, 50, Infinity, Infinity, Infinity, Infinity); +ctx.bezierCurveTo(Infinity, 50, Infinity, Infinity, 0, Infinity); +ctx.bezierCurveTo(Infinity, 50, Infinity, 50, Infinity, 50); +ctx.bezierCurveTo(Infinity, 50, Infinity, 50, Infinity, Infinity); +ctx.bezierCurveTo(Infinity, 50, Infinity, 50, 0, Infinity); +ctx.bezierCurveTo(Infinity, 50, 0, Infinity, 0, 50); +ctx.bezierCurveTo(Infinity, 50, 0, Infinity, Infinity, 50); +ctx.bezierCurveTo(Infinity, 50, 0, Infinity, Infinity, Infinity); +ctx.bezierCurveTo(Infinity, 50, 0, Infinity, 0, Infinity); +ctx.bezierCurveTo(Infinity, 50, 0, 50, Infinity, 50); +ctx.bezierCurveTo(Infinity, 50, 0, 50, Infinity, Infinity); +ctx.bezierCurveTo(Infinity, 50, 0, 50, 0, Infinity); +ctx.bezierCurveTo(0, Infinity, Infinity, 50, 0, 50); +ctx.bezierCurveTo(0, Infinity, Infinity, Infinity, 0, 50); +ctx.bezierCurveTo(0, Infinity, Infinity, Infinity, Infinity, 50); +ctx.bezierCurveTo(0, Infinity, Infinity, Infinity, Infinity, Infinity); +ctx.bezierCurveTo(0, Infinity, Infinity, Infinity, 0, Infinity); +ctx.bezierCurveTo(0, Infinity, Infinity, 50, Infinity, 50); +ctx.bezierCurveTo(0, Infinity, Infinity, 50, Infinity, Infinity); +ctx.bezierCurveTo(0, Infinity, Infinity, 50, 0, Infinity); +ctx.bezierCurveTo(0, Infinity, 0, Infinity, 0, 50); +ctx.bezierCurveTo(0, Infinity, 0, Infinity, Infinity, 50); +ctx.bezierCurveTo(0, Infinity, 0, Infinity, Infinity, Infinity); +ctx.bezierCurveTo(0, Infinity, 0, Infinity, 0, Infinity); +ctx.bezierCurveTo(0, Infinity, 0, 50, Infinity, 50); +ctx.bezierCurveTo(0, Infinity, 0, 50, Infinity, Infinity); +ctx.bezierCurveTo(0, Infinity, 0, 50, 0, Infinity); +ctx.bezierCurveTo(0, 50, Infinity, Infinity, 0, 50); +ctx.bezierCurveTo(0, 50, Infinity, Infinity, Infinity, 50); +ctx.bezierCurveTo(0, 50, Infinity, Infinity, Infinity, Infinity); +ctx.bezierCurveTo(0, 50, Infinity, Infinity, 0, Infinity); +ctx.bezierCurveTo(0, 50, Infinity, 50, Infinity, 50); +ctx.bezierCurveTo(0, 50, Infinity, 50, Infinity, Infinity); +ctx.bezierCurveTo(0, 50, Infinity, 50, 0, Infinity); +ctx.bezierCurveTo(0, 50, 0, Infinity, Infinity, 50); +ctx.bezierCurveTo(0, 50, 0, Infinity, Infinity, Infinity); +ctx.bezierCurveTo(0, 50, 0, Infinity, 0, Infinity); +ctx.bezierCurveTo(0, 50, 0, 50, Infinity, Infinity); +ctx.lineTo(100, 50); +ctx.lineTo(0, 50); +ctx.fillStyle = '#0f0'; +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 90,45, 0,255,0,255, "90,45", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.bezierCurveTo.scaled.js b/platforms/ios/www/test/tests-todo/framed.2d.path.bezierCurveTo.scaled.js new file mode 100644 index 0000000..699d256 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.bezierCurveTo.scaled.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.scale(1000, 1000); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 0.055; +ctx.beginPath(); +ctx.moveTo(-2, 3.1); +ctx.bezierCurveTo(-2, -1, 2.1, -1, 2.1, 3.1); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.bezierCurveTo.shape.js b/platforms/ios/www/test/tests-todo/framed.2d.path.bezierCurveTo.shape.js new file mode 100644 index 0000000..fa96b5d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.bezierCurveTo.shape.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 55; +ctx.beginPath(); +ctx.moveTo(-2000, 3100); +ctx.bezierCurveTo(-2000, -1000, 2100, -1000, 2100, 3100); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.clip.basic.1.js b/platforms/ios/www/test/tests-todo/framed.2d.path.clip.basic.1.js new file mode 100644 index 0000000..45f643f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.clip.basic.1.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.beginPath(); +ctx.rect(0, 0, 100, 50); +ctx.clip(); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.clip.basic.2.js b/platforms/ios/www/test/tests-todo/framed.2d.path.clip.basic.2.js new file mode 100644 index 0000000..3ce3267 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.clip.basic.2.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.beginPath(); +ctx.rect(-100, 0, 100, 50); +ctx.clip(); + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.clip.empty.js b/platforms/ios/www/test/tests-todo/framed.2d.path.clip.empty.js new file mode 100644 index 0000000..9346e97 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.clip.empty.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.beginPath(); +ctx.clip(); + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.clip.intersect.js b/platforms/ios/www/test/tests-todo/framed.2d.path.clip.intersect.js new file mode 100644 index 0000000..bf0fcd8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.clip.intersect.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.beginPath(); +ctx.rect(0, 0, 50, 50); +ctx.clip(); +ctx.beginPath(); +ctx.rect(50, 0, 50, 50) +ctx.clip(); + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.clip.unaffected.js b/platforms/ios/www/test/tests-todo/framed.2d.path.clip.unaffected.js new file mode 100644 index 0000000..e13c60e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.clip.unaffected.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; + +ctx.beginPath(); +ctx.moveTo(0, 0); +ctx.lineTo(0, 50); +ctx.lineTo(100, 50); +ctx.lineTo(100, 0); +ctx.clip(); + +ctx.lineTo(0, 0); +ctx.fill(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.clip.winding.1.js b/platforms/ios/www/test/tests-todo/framed.2d.path.clip.winding.1.js new file mode 100644 index 0000000..e1f8cbc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.clip.winding.1.js @@ -0,0 +1,24 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.beginPath(); +ctx.moveTo(-10, -10); +ctx.lineTo(110, -10); +ctx.lineTo(110, 60); +ctx.lineTo(-10, 60); +ctx.lineTo(-10, -10); +ctx.lineTo(0, 0); +ctx.lineTo(0, 50); +ctx.lineTo(100, 50); +ctx.lineTo(100, 0); +ctx.clip(); + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.clip.winding.2.js b/platforms/ios/www/test/tests-todo/framed.2d.path.clip.winding.2.js new file mode 100644 index 0000000..57f3b99 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.clip.winding.2.js @@ -0,0 +1,28 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.beginPath(); +ctx.moveTo(-10, -10); +ctx.lineTo(110, -10); +ctx.lineTo(110, 60); +ctx.lineTo(-10, 60); +ctx.lineTo(-10, -10); +ctx.clip(); + +ctx.beginPath(); +ctx.moveTo(0, 0); +ctx.lineTo(0, 50); +ctx.lineTo(100, 50); +ctx.lineTo(100, 0); +ctx.lineTo(0, 0); +ctx.clip(); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.closePath.empty.js b/platforms/ios/www/test/tests-todo/framed.2d.path.closePath.empty.js new file mode 100644 index 0000000..9a679db --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.closePath.empty.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.closePath(); +ctx.fillStyle = '#f00'; +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.closePath.newline.js b/platforms/ios/www/test/tests-todo/framed.2d.path.closePath.newline.js new file mode 100644 index 0000000..8cc2aa5 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.closePath.newline.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 50; +ctx.moveTo(-100, 25); +ctx.lineTo(-100, -100); +ctx.lineTo(200, -100); +ctx.lineTo(200, 25); +ctx.closePath(); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.closePath.nextpoint.js b/platforms/ios/www/test/tests-todo/framed.2d.path.closePath.nextpoint.js new file mode 100644 index 0000000..7d56902 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.closePath.nextpoint.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 50; +ctx.moveTo(-100, 25); +ctx.lineTo(-100, -1000); +ctx.closePath(); +ctx.lineTo(1000, 25); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.fill.closed.basic.js b/platforms/ios/www/test/tests-todo/framed.2d.path.fill.closed.basic.js new file mode 100644 index 0000000..29c08ba --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.fill.closed.basic.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.moveTo(0, 0); +ctx.lineTo(100, 0); +ctx.lineTo(100, 50); +ctx.lineTo(0, 50); +ctx.fill(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.fill.closed.unaffected.js b/platforms/ios/www/test/tests-todo/framed.2d.path.fill.closed.unaffected.js new file mode 100644 index 0000000..6dccb77 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.fill.closed.unaffected.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#00f'; +ctx.fillRect(0, 0, 100, 50); + +ctx.moveTo(0, 0); +ctx.lineTo(100, 0); +ctx.lineTo(100, 50); +ctx.fillStyle = '#f00'; +ctx.fill(); +ctx.lineTo(0, 50); +ctx.fillStyle = '#0f0'; +ctx.fill(); + +_assertPixel(canvas, 90,10, 0,255,0,255, "90,10", "0,255,0,255"); +_assertPixel(canvas, 10,40, 0,255,0,255, "10,40", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.fill.overlap.js b/platforms/ios/www/test/tests-todo/framed.2d.path.fill.overlap.js new file mode 100644 index 0000000..8f0715c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.fill.overlap.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#000'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.rect(0, 0, 100, 50); +ctx.closePath(); +ctx.rect(10, 10, 80, 30); +ctx.fill(); + +_assertPixelApprox(canvas, 50,25, 0,127,0,255, "50,25", "0,127,0,255", 1); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.fill.winding.add.js b/platforms/ios/www/test/tests-todo/framed.2d.path.fill.winding.add.js new file mode 100644 index 0000000..fb5ae74 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.fill.winding.add.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.moveTo(-10, -10); +ctx.lineTo(110, -10); +ctx.lineTo(110, 60); +ctx.lineTo(-10, 60); +ctx.lineTo(-10, -10); +ctx.lineTo(0, 0); +ctx.lineTo(100, 0); +ctx.lineTo(100, 50); +ctx.lineTo(0, 50); +ctx.fill(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.fill.winding.subtract.1.js b/platforms/ios/www/test/tests-todo/framed.2d.path.fill.winding.subtract.1.js new file mode 100644 index 0000000..c2bec22 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.fill.winding.subtract.1.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#f00'; +ctx.moveTo(-10, -10); +ctx.lineTo(110, -10); +ctx.lineTo(110, 60); +ctx.lineTo(-10, 60); +ctx.lineTo(-10, -10); +ctx.lineTo(0, 0); +ctx.lineTo(0, 50); +ctx.lineTo(100, 50); +ctx.lineTo(100, 0); +ctx.fill(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.fill.winding.subtract.2.js b/platforms/ios/www/test/tests-todo/framed.2d.path.fill.winding.subtract.2.js new file mode 100644 index 0000000..b7e4bbd --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.fill.winding.subtract.2.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#f00'; +ctx.moveTo(-10, -10); +ctx.lineTo(110, -10); +ctx.lineTo(110, 60); +ctx.lineTo(-10, 60); +ctx.moveTo(0, 0); +ctx.lineTo(0, 50); +ctx.lineTo(100, 50); +ctx.lineTo(100, 0); +ctx.fill(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.fill.winding.subtract.3.js b/platforms/ios/www/test/tests-todo/framed.2d.path.fill.winding.subtract.3.js new file mode 100644 index 0000000..5b9ccda --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.fill.winding.subtract.3.js @@ -0,0 +1,26 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.moveTo(-10, -10); +ctx.lineTo(110, -10); +ctx.lineTo(110, 60); +ctx.lineTo(-10, 60); +ctx.lineTo(-10, -10); +ctx.lineTo(-20, -20); +ctx.lineTo(120, -20); +ctx.lineTo(120, 70); +ctx.lineTo(-20, 70); +ctx.lineTo(-20, -20); +ctx.lineTo(0, 0); +ctx.lineTo(0, 50); +ctx.lineTo(100, 50); +ctx.lineTo(100, 0); +ctx.fill(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.initial.js b/platforms/ios/www/test/tests-todo/framed.2d.path.initial.js new file mode 100644 index 0000000..9a679db --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.initial.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.closePath(); +ctx.fillStyle = '#f00'; +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.arc.js b/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.arc.js new file mode 100644 index 0000000..68f1a92 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.arc.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.arc(50, 25, 10, 0, Math.PI, false); +_assertSame(ctx.isPointInPath(50, 10), false, "ctx.isPointInPath(50, 10)", "false"); +_assertSame(ctx.isPointInPath(50, 20), false, "ctx.isPointInPath(50, 20)", "false"); +_assertSame(ctx.isPointInPath(50, 30), true, "ctx.isPointInPath(50, 30)", "true"); +_assertSame(ctx.isPointInPath(50, 40), false, "ctx.isPointInPath(50, 40)", "false"); +_assertSame(ctx.isPointInPath(30, 20), false, "ctx.isPointInPath(30, 20)", "false"); +_assertSame(ctx.isPointInPath(70, 20), false, "ctx.isPointInPath(70, 20)", "false"); +_assertSame(ctx.isPointInPath(30, 30), false, "ctx.isPointInPath(30, 30)", "false"); +_assertSame(ctx.isPointInPath(70, 30), false, "ctx.isPointInPath(70, 30)", "false"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.basic.1.js b/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.basic.1.js new file mode 100644 index 0000000..2924135 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.basic.1.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +ctx.rect(0, 0, 20, 20); +_assertSame(ctx.isPointInPath(10, 10), true, "ctx.isPointInPath(10, 10)", "true"); +_assertSame(ctx.isPointInPath(30, 10), false, "ctx.isPointInPath(30, 10)", "false"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.basic.2.js b/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.basic.2.js new file mode 100644 index 0000000..98f540e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.basic.2.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +ctx.rect(20, 0, 20, 20); +_assertSame(ctx.isPointInPath(10, 10), false, "ctx.isPointInPath(10, 10)", "false"); +_assertSame(ctx.isPointInPath(30, 10), true, "ctx.isPointInPath(30, 10)", "true"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.bezier.js b/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.bezier.js new file mode 100644 index 0000000..c71fd65 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.bezier.js @@ -0,0 +1,27 @@ +_addTest(function(canvas, ctx) { + +ctx.moveTo(25, 25); +ctx.bezierCurveTo(50, -50, 50, 100, 75, 25); +_assertEqual(ctx.isPointInPath(25, 20), false, "ctx.isPointInPath(25, 20)", "false"); +_assertEqual(ctx.isPointInPath(25, 30), false, "ctx.isPointInPath(25, 30)", "false"); +_assertEqual(ctx.isPointInPath(30, 20), true, "ctx.isPointInPath(30, 20)", "true"); +_assertEqual(ctx.isPointInPath(30, 30), false, "ctx.isPointInPath(30, 30)", "false"); +_assertEqual(ctx.isPointInPath(40, 2), false, "ctx.isPointInPath(40, 2)", "false"); +_assertEqual(ctx.isPointInPath(40, 20), true, "ctx.isPointInPath(40, 20)", "true"); +_assertEqual(ctx.isPointInPath(40, 30), false, "ctx.isPointInPath(40, 30)", "false"); +_assertEqual(ctx.isPointInPath(40, 47), false, "ctx.isPointInPath(40, 47)", "false"); +_assertEqual(ctx.isPointInPath(45, 20), true, "ctx.isPointInPath(45, 20)", "true"); +_assertEqual(ctx.isPointInPath(45, 30), false, "ctx.isPointInPath(45, 30)", "false"); +_assertEqual(ctx.isPointInPath(55, 20), false, "ctx.isPointInPath(55, 20)", "false"); +_assertEqual(ctx.isPointInPath(55, 30), true, "ctx.isPointInPath(55, 30)", "true"); +_assertEqual(ctx.isPointInPath(60, 2), false, "ctx.isPointInPath(60, 2)", "false"); +_assertEqual(ctx.isPointInPath(60, 20), false, "ctx.isPointInPath(60, 20)", "false"); +_assertEqual(ctx.isPointInPath(60, 30), true, "ctx.isPointInPath(60, 30)", "true"); +_assertEqual(ctx.isPointInPath(60, 47), false, "ctx.isPointInPath(60, 47)", "false"); +_assertEqual(ctx.isPointInPath(70, 20), false, "ctx.isPointInPath(70, 20)", "false"); +_assertEqual(ctx.isPointInPath(70, 30), true, "ctx.isPointInPath(70, 30)", "true"); +_assertEqual(ctx.isPointInPath(75, 20), false, "ctx.isPointInPath(75, 20)", "false"); +_assertEqual(ctx.isPointInPath(75, 30), false, "ctx.isPointInPath(75, 30)", "false"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.bigarc.js b/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.bigarc.js new file mode 100644 index 0000000..badb306 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.bigarc.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.arc(50, 25, 10, 0, 7, false); +_assertSame(ctx.isPointInPath(50, 10), false, "ctx.isPointInPath(50, 10)", "false"); +_assertSame(ctx.isPointInPath(50, 20), true, "ctx.isPointInPath(50, 20)", "true"); +_assertSame(ctx.isPointInPath(50, 30), true, "ctx.isPointInPath(50, 30)", "true"); +_assertSame(ctx.isPointInPath(50, 40), false, "ctx.isPointInPath(50, 40)", "false"); +_assertSame(ctx.isPointInPath(30, 20), false, "ctx.isPointInPath(30, 20)", "false"); +_assertSame(ctx.isPointInPath(70, 20), false, "ctx.isPointInPath(70, 20)", "false"); +_assertSame(ctx.isPointInPath(30, 30), false, "ctx.isPointInPath(30, 30)", "false"); +_assertSame(ctx.isPointInPath(70, 30), false, "ctx.isPointInPath(70, 30)", "false"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.edge.js b/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.edge.js new file mode 100644 index 0000000..3821726 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.edge.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.rect(0, 0, 20, 20); +_assertSame(ctx.isPointInPath(0, 0), true, "ctx.isPointInPath(0, 0)", "true"); +_assertSame(ctx.isPointInPath(10, 0), true, "ctx.isPointInPath(10, 0)", "true"); +_assertSame(ctx.isPointInPath(20, 0), true, "ctx.isPointInPath(20, 0)", "true"); +_assertSame(ctx.isPointInPath(20, 10), true, "ctx.isPointInPath(20, 10)", "true"); +_assertSame(ctx.isPointInPath(20, 20), true, "ctx.isPointInPath(20, 20)", "true"); +_assertSame(ctx.isPointInPath(10, 20), true, "ctx.isPointInPath(10, 20)", "true"); +_assertSame(ctx.isPointInPath(0, 20), true, "ctx.isPointInPath(0, 20)", "true"); +_assertSame(ctx.isPointInPath(0, 10), true, "ctx.isPointInPath(0, 10)", "true"); +_assertSame(ctx.isPointInPath(10, -0.01), false, "ctx.isPointInPath(10, -0.01)", "false"); +_assertSame(ctx.isPointInPath(10, 20.01), false, "ctx.isPointInPath(10, 20.01)", "false"); +_assertSame(ctx.isPointInPath(-0.01, 10), false, "ctx.isPointInPath(-0.01, 10)", "false"); +_assertSame(ctx.isPointInPath(20.01, 10), false, "ctx.isPointInPath(20.01, 10)", "false"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.empty.js b/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.empty.js new file mode 100644 index 0000000..b55df31 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.empty.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(ctx.isPointInPath(0, 0), false, "ctx.isPointInPath(0, 0)", "false"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.nonfinite.js b/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.nonfinite.js new file mode 100644 index 0000000..e3c1719 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.nonfinite.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.rect(-100, -50, 200, 100); +_assertSame(ctx.isPointInPath(Infinity, 0), false, "ctx.isPointInPath(Infinity, 0)", "false"); +_assertSame(ctx.isPointInPath(-Infinity, 0), false, "ctx.isPointInPath(-Infinity, 0)", "false"); +_assertSame(ctx.isPointInPath(NaN, 0), false, "ctx.isPointInPath(NaN, 0)", "false"); +_assertSame(ctx.isPointInPath(0, Infinity), false, "ctx.isPointInPath(0, Infinity)", "false"); +_assertSame(ctx.isPointInPath(0, -Infinity), false, "ctx.isPointInPath(0, -Infinity)", "false"); +_assertSame(ctx.isPointInPath(0, NaN), false, "ctx.isPointInPath(0, NaN)", "false"); +_assertSame(ctx.isPointInPath(NaN, NaN), false, "ctx.isPointInPath(NaN, NaN)", "false"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.outside.js b/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.outside.js new file mode 100644 index 0000000..1afad01 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.outside.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.rect(0, -100, 20, 20); +ctx.rect(20, -10, 20, 20); +_assertSame(ctx.isPointInPath(10, -110), false, "ctx.isPointInPath(10, -110)", "false"); +_assertSame(ctx.isPointInPath(10, -90), true, "ctx.isPointInPath(10, -90)", "true"); +_assertSame(ctx.isPointInPath(10, -70), false, "ctx.isPointInPath(10, -70)", "false"); +_assertSame(ctx.isPointInPath(30, -20), false, "ctx.isPointInPath(30, -20)", "false"); +_assertSame(ctx.isPointInPath(30, 0), true, "ctx.isPointInPath(30, 0)", "true"); +_assertSame(ctx.isPointInPath(30, 20), false, "ctx.isPointInPath(30, 20)", "false"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.subpath.js b/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.subpath.js new file mode 100644 index 0000000..8a75a30 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.subpath.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.rect(0, 0, 20, 20); +ctx.beginPath(); +ctx.rect(20, 0, 20, 20); +ctx.closePath(); +ctx.rect(40, 0, 20, 20); +_assertSame(ctx.isPointInPath(10, 10), false, "ctx.isPointInPath(10, 10)", "false"); +_assertSame(ctx.isPointInPath(30, 10), true, "ctx.isPointInPath(30, 10)", "true"); +_assertSame(ctx.isPointInPath(50, 10), true, "ctx.isPointInPath(50, 10)", "true"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.transform.1.js b/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.transform.1.js new file mode 100644 index 0000000..ad91a4a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.transform.1.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.translate(50, 0); +ctx.rect(0, 0, 20, 20); +_assertSame(ctx.isPointInPath(-40, 10), false, "ctx.isPointInPath(-40, 10)", "false"); +_assertSame(ctx.isPointInPath(10, 10), false, "ctx.isPointInPath(10, 10)", "false"); +_assertSame(ctx.isPointInPath(49, 10), false, "ctx.isPointInPath(49, 10)", "false"); +_assertSame(ctx.isPointInPath(51, 10), true, "ctx.isPointInPath(51, 10)", "true"); +_assertSame(ctx.isPointInPath(69, 10), true, "ctx.isPointInPath(69, 10)", "true"); +_assertSame(ctx.isPointInPath(71, 10), false, "ctx.isPointInPath(71, 10)", "false"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.transform.2.js b/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.transform.2.js new file mode 100644 index 0000000..b82c30b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.transform.2.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.rect(50, 0, 20, 20); +ctx.translate(50, 0); +_assertSame(ctx.isPointInPath(-40, 10), false, "ctx.isPointInPath(-40, 10)", "false"); +_assertSame(ctx.isPointInPath(10, 10), false, "ctx.isPointInPath(10, 10)", "false"); +_assertSame(ctx.isPointInPath(49, 10), false, "ctx.isPointInPath(49, 10)", "false"); +_assertSame(ctx.isPointInPath(51, 10), true, "ctx.isPointInPath(51, 10)", "true"); +_assertSame(ctx.isPointInPath(69, 10), true, "ctx.isPointInPath(69, 10)", "true"); +_assertSame(ctx.isPointInPath(71, 10), false, "ctx.isPointInPath(71, 10)", "false"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.transform.3.js b/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.transform.3.js new file mode 100644 index 0000000..9513d3a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.transform.3.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.scale(-1, 1); +ctx.rect(-70, 0, 20, 20); +_assertSame(ctx.isPointInPath(-40, 10), false, "ctx.isPointInPath(-40, 10)", "false"); +_assertSame(ctx.isPointInPath(10, 10), false, "ctx.isPointInPath(10, 10)", "false"); +_assertSame(ctx.isPointInPath(49, 10), false, "ctx.isPointInPath(49, 10)", "false"); +_assertSame(ctx.isPointInPath(51, 10), true, "ctx.isPointInPath(51, 10)", "true"); +_assertSame(ctx.isPointInPath(69, 10), true, "ctx.isPointInPath(69, 10)", "true"); +_assertSame(ctx.isPointInPath(71, 10), false, "ctx.isPointInPath(71, 10)", "false"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.unclosed.js b/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.unclosed.js new file mode 100644 index 0000000..38722b1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.unclosed.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.moveTo(0, 0); +ctx.lineTo(20, 0); +ctx.lineTo(20, 20); +ctx.lineTo(0, 20); +_assertSame(ctx.isPointInPath(10, 10), true, "ctx.isPointInPath(10, 10)", "true"); +_assertSame(ctx.isPointInPath(30, 10), false, "ctx.isPointInPath(30, 10)", "false"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.winding.js b/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.winding.js new file mode 100644 index 0000000..5ca7f65 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.isPointInPath.winding.js @@ -0,0 +1,26 @@ +_addTest(function(canvas, ctx) { + +// Create a square ring, using opposite windings to make a hole in the centre +ctx.moveTo(0, 0); +ctx.lineTo(50, 0); +ctx.lineTo(50, 50); +ctx.lineTo(0, 50); +ctx.lineTo(0, 0); +ctx.lineTo(10, 10); +ctx.lineTo(10, 40); +ctx.lineTo(40, 40); +ctx.lineTo(40, 10); +ctx.lineTo(10, 10); + +_assertSame(ctx.isPointInPath(5, 5), true, "ctx.isPointInPath(5, 5)", "true"); +_assertSame(ctx.isPointInPath(25, 5), true, "ctx.isPointInPath(25, 5)", "true"); +_assertSame(ctx.isPointInPath(45, 5), true, "ctx.isPointInPath(45, 5)", "true"); +_assertSame(ctx.isPointInPath(5, 25), true, "ctx.isPointInPath(5, 25)", "true"); +_assertSame(ctx.isPointInPath(25, 25), false, "ctx.isPointInPath(25, 25)", "false"); +_assertSame(ctx.isPointInPath(45, 25), true, "ctx.isPointInPath(45, 25)", "true"); +_assertSame(ctx.isPointInPath(5, 45), true, "ctx.isPointInPath(5, 45)", "true"); +_assertSame(ctx.isPointInPath(25, 45), true, "ctx.isPointInPath(25, 45)", "true"); +_assertSame(ctx.isPointInPath(45, 45), true, "ctx.isPointInPath(45, 45)", "true"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.lineTo.basic.js b/platforms/ios/www/test/tests-todo/framed.2d.path.lineTo.basic.js new file mode 100644 index 0000000..1967cfc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.lineTo.basic.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 50; +ctx.beginPath(); +ctx.moveTo(0, 25); +ctx.lineTo(100, 25); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.lineTo.ensuresubpath.1.js b/platforms/ios/www/test/tests-todo/framed.2d.path.lineTo.ensuresubpath.1.js new file mode 100644 index 0000000..bb1037d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.lineTo.ensuresubpath.1.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 50; +ctx.beginPath(); +ctx.lineTo(100, 50); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.lineTo.ensuresubpath.2.js b/platforms/ios/www/test/tests-todo/framed.2d.path.lineTo.ensuresubpath.2.js new file mode 100644 index 0000000..b15887a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.lineTo.ensuresubpath.2.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 50; +ctx.beginPath(); +ctx.lineTo(0, 25); +ctx.lineTo(100, 25); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.lineTo.nextpoint.js b/platforms/ios/www/test/tests-todo/framed.2d.path.lineTo.nextpoint.js new file mode 100644 index 0000000..084edb0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.lineTo.nextpoint.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 50; +ctx.beginPath(); +ctx.moveTo(-100, -100); +ctx.lineTo(0, 25); +ctx.lineTo(100, 25); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.lineTo.nonfinite.js b/platforms/ios/www/test/tests-todo/framed.2d.path.lineTo.nonfinite.js new file mode 100644 index 0000000..b25e811 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.lineTo.nonfinite.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +ctx.moveTo(0, 0); +ctx.lineTo(100, 0); +ctx.lineTo(Infinity, 50); +ctx.lineTo(-Infinity, 50); +ctx.lineTo(NaN, 50); +ctx.lineTo(0, Infinity); +ctx.lineTo(0, -Infinity); +ctx.lineTo(0, NaN); +ctx.lineTo(Infinity, Infinity); +ctx.lineTo(100, 50); +ctx.lineTo(0, 50); +ctx.fillStyle = '#0f0'; +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 90,45, 0,255,0,255, "90,45", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.moveTo.basic.js b/platforms/ios/www/test/tests-todo/framed.2d.path.moveTo.basic.js new file mode 100644 index 0000000..8b6766e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.moveTo.basic.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.rect(0, 0, 10, 50); +ctx.moveTo(100, 0); +ctx.lineTo(10, 0); +ctx.lineTo(10, 50); +ctx.lineTo(100, 50); +ctx.fillStyle = '#0f0'; +ctx.fill(); +_assertPixel(canvas, 90,25, 0,255,0,255, "90,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.moveTo.multiple.js b/platforms/ios/www/test/tests-todo/framed.2d.path.moveTo.multiple.js new file mode 100644 index 0000000..46082e1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.moveTo.multiple.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.moveTo(0, 25); +ctx.moveTo(100, 25); +ctx.moveTo(0, 25); +ctx.lineTo(100, 25); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 50; +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.moveTo.newsubpath.js b/platforms/ios/www/test/tests-todo/framed.2d.path.moveTo.newsubpath.js new file mode 100644 index 0000000..5216d3d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.moveTo.newsubpath.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.beginPath(); +ctx.moveTo(0, 0); +ctx.moveTo(100, 0); +ctx.moveTo(100, 50); +ctx.moveTo(0, 50); +ctx.fillStyle = '#f00'; +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.moveTo.nonfinite.js b/platforms/ios/www/test/tests-todo/framed.2d.path.moveTo.nonfinite.js new file mode 100644 index 0000000..1925721 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.moveTo.nonfinite.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.moveTo(0, 0); +ctx.lineTo(100, 0); +ctx.moveTo(Infinity, 50); +ctx.moveTo(-Infinity, 50); +ctx.moveTo(NaN, 50); +ctx.moveTo(0, Infinity); +ctx.moveTo(0, -Infinity); +ctx.moveTo(0, NaN); +ctx.moveTo(Infinity, Infinity); +ctx.lineTo(100, 50); +ctx.lineTo(0, 50); +ctx.fillStyle = '#0f0'; +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.quadraticCurveTo.basic.js b/platforms/ios/www/test/tests-todo/framed.2d.path.quadraticCurveTo.basic.js new file mode 100644 index 0000000..bd962f2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.quadraticCurveTo.basic.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 50; +ctx.beginPath(); +ctx.moveTo(0, 25); +ctx.quadraticCurveTo(100, 25, 100, 25); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.quadraticCurveTo.ensuresubpath.1.js b/platforms/ios/www/test/tests-todo/framed.2d.path.quadraticCurveTo.ensuresubpath.1.js new file mode 100644 index 0000000..ac66e98 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.quadraticCurveTo.ensuresubpath.1.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 50; +ctx.beginPath(); +ctx.quadraticCurveTo(100, 50, 200, 50); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 95,45, 0,255,0,255, "95,45", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.quadraticCurveTo.ensuresubpath.2.js b/platforms/ios/www/test/tests-todo/framed.2d.path.quadraticCurveTo.ensuresubpath.2.js new file mode 100644 index 0000000..f9c0536 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.quadraticCurveTo.ensuresubpath.2.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 50; +ctx.beginPath(); +ctx.quadraticCurveTo(0, 25, 100, 25); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 5,45, 0,255,0,255, "5,45", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.quadraticCurveTo.nonfinite.js b/platforms/ios/www/test/tests-todo/framed.2d.path.quadraticCurveTo.nonfinite.js new file mode 100644 index 0000000..668cee8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.quadraticCurveTo.nonfinite.js @@ -0,0 +1,36 @@ +_addTest(function(canvas, ctx) { + +ctx.moveTo(0, 0); +ctx.lineTo(100, 0); +ctx.quadraticCurveTo(Infinity, 50, 0, 50); +ctx.quadraticCurveTo(-Infinity, 50, 0, 50); +ctx.quadraticCurveTo(NaN, 50, 0, 50); +ctx.quadraticCurveTo(0, Infinity, 0, 50); +ctx.quadraticCurveTo(0, -Infinity, 0, 50); +ctx.quadraticCurveTo(0, NaN, 0, 50); +ctx.quadraticCurveTo(0, 50, Infinity, 50); +ctx.quadraticCurveTo(0, 50, -Infinity, 50); +ctx.quadraticCurveTo(0, 50, NaN, 50); +ctx.quadraticCurveTo(0, 50, 0, Infinity); +ctx.quadraticCurveTo(0, 50, 0, -Infinity); +ctx.quadraticCurveTo(0, 50, 0, NaN); +ctx.quadraticCurveTo(Infinity, Infinity, 0, 50); +ctx.quadraticCurveTo(Infinity, Infinity, Infinity, 50); +ctx.quadraticCurveTo(Infinity, Infinity, Infinity, Infinity); +ctx.quadraticCurveTo(Infinity, Infinity, 0, Infinity); +ctx.quadraticCurveTo(Infinity, 50, Infinity, 50); +ctx.quadraticCurveTo(Infinity, 50, Infinity, Infinity); +ctx.quadraticCurveTo(Infinity, 50, 0, Infinity); +ctx.quadraticCurveTo(0, Infinity, Infinity, 50); +ctx.quadraticCurveTo(0, Infinity, Infinity, Infinity); +ctx.quadraticCurveTo(0, Infinity, 0, Infinity); +ctx.quadraticCurveTo(0, 50, Infinity, Infinity); +ctx.lineTo(100, 50); +ctx.lineTo(0, 50); +ctx.fillStyle = '#0f0'; +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 90,45, 0,255,0,255, "90,45", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.quadraticCurveTo.scaled.js b/platforms/ios/www/test/tests-todo/framed.2d.path.quadraticCurveTo.scaled.js new file mode 100644 index 0000000..4ba2c00 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.quadraticCurveTo.scaled.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.scale(1000, 1000); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 0.055; +ctx.beginPath(); +ctx.moveTo(-1, 1.05); +ctx.quadraticCurveTo(0, -1, 1.2, 1.05); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.quadraticCurveTo.shape.js b/platforms/ios/www/test/tests-todo/framed.2d.path.quadraticCurveTo.shape.js new file mode 100644 index 0000000..214f05a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.quadraticCurveTo.shape.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 55; +ctx.beginPath(); +ctx.moveTo(-1000, 1050); +ctx.quadraticCurveTo(0, -1000, 1200, 1050); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.rect.basic.js b/platforms/ios/www/test/tests-todo/framed.2d.path.rect.basic.js new file mode 100644 index 0000000..ff8909d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.rect.basic.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.rect(0, 0, 100, 50); +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.rect.closed.js b/platforms/ios/www/test/tests-todo/framed.2d.path.rect.closed.js new file mode 100644 index 0000000..a045caa --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.rect.closed.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 200; +ctx.lineJoin = 'miter'; +ctx.rect(100, 50, 100, 100); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.rect.end.1.js b/platforms/ios/www/test/tests-todo/framed.2d.path.rect.end.1.js new file mode 100644 index 0000000..933861b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.rect.end.1.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 100; +ctx.rect(200, 100, 400, 1000); +ctx.lineTo(-2000, -1000); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.rect.end.2.js b/platforms/ios/www/test/tests-todo/framed.2d.path.rect.end.2.js new file mode 100644 index 0000000..6f01fc9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.rect.end.2.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 450; +ctx.lineCap = 'round'; +ctx.lineJoin = 'bevel'; +ctx.rect(150, 150, 2000, 2000); +ctx.lineTo(160, 160); +ctx.stroke(); +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.rect.negative.js b/platforms/ios/www/test/tests-todo/framed.2d.path.rect.negative.js new file mode 100644 index 0000000..daf8eae --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.rect.negative.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.beginPath(); +ctx.fillStyle = '#0f0'; +ctx.rect(0, 0, 50, 25); +ctx.rect(100, 0, -50, 25); +ctx.rect(0, 50, 50, -25); +ctx.rect(100, 50, -50, -25); +ctx.fill(); +_assertPixel(canvas, 25,12, 0,255,0,255, "25,12", "0,255,0,255"); +_assertPixel(canvas, 75,12, 0,255,0,255, "75,12", "0,255,0,255"); +_assertPixel(canvas, 25,37, 0,255,0,255, "25,37", "0,255,0,255"); +_assertPixel(canvas, 75,37, 0,255,0,255, "75,37", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.rect.newsubpath.js b/platforms/ios/www/test/tests-todo/framed.2d.path.rect.newsubpath.js new file mode 100644 index 0000000..edec4c6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.rect.newsubpath.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.beginPath(); +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 50; +ctx.moveTo(-100, 25); +ctx.lineTo(-50, 25); +ctx.rect(200, 25, 1, 1); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.rect.nonfinite.js b/platforms/ios/www/test/tests-todo/framed.2d.path.rect.nonfinite.js new file mode 100644 index 0000000..f256cd2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.rect.nonfinite.js @@ -0,0 +1,36 @@ +_addTest(function(canvas, ctx) { + +ctx.moveTo(0, 0); +ctx.lineTo(100, 0); +ctx.rect(Infinity, 50, 1, 1); +ctx.rect(-Infinity, 50, 1, 1); +ctx.rect(NaN, 50, 1, 1); +ctx.rect(0, Infinity, 1, 1); +ctx.rect(0, -Infinity, 1, 1); +ctx.rect(0, NaN, 1, 1); +ctx.rect(0, 50, Infinity, 1); +ctx.rect(0, 50, -Infinity, 1); +ctx.rect(0, 50, NaN, 1); +ctx.rect(0, 50, 1, Infinity); +ctx.rect(0, 50, 1, -Infinity); +ctx.rect(0, 50, 1, NaN); +ctx.rect(Infinity, Infinity, 1, 1); +ctx.rect(Infinity, Infinity, Infinity, 1); +ctx.rect(Infinity, Infinity, Infinity, Infinity); +ctx.rect(Infinity, Infinity, 1, Infinity); +ctx.rect(Infinity, 50, Infinity, 1); +ctx.rect(Infinity, 50, Infinity, Infinity); +ctx.rect(Infinity, 50, 1, Infinity); +ctx.rect(0, Infinity, Infinity, 1); +ctx.rect(0, Infinity, Infinity, Infinity); +ctx.rect(0, Infinity, 1, Infinity); +ctx.rect(0, 50, Infinity, Infinity); +ctx.lineTo(100, 50); +ctx.lineTo(0, 50); +ctx.fillStyle = '#0f0'; +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 90,45, 0,255,0,255, "90,45", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.rect.selfintersect.js b/platforms/ios/www/test/tests-todo/framed.2d.path.rect.selfintersect.js new file mode 100644 index 0000000..175749a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.rect.selfintersect.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 90; +ctx.beginPath(); +ctx.rect(45, 20, 10, 10); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.rect.winding.js b/platforms/ios/www/test/tests-todo/framed.2d.path.rect.winding.js new file mode 100644 index 0000000..965bce2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.rect.winding.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.beginPath(); +ctx.fillStyle = '#f00'; +ctx.rect(0, 0, 50, 50); +ctx.rect(100, 50, -50, -50); +ctx.rect(0, 25, 100, -25); +ctx.rect(100, 25, -100, 25); +ctx.fill(); +_assertPixel(canvas, 25,12, 0,255,0,255, "25,12", "0,255,0,255"); +_assertPixel(canvas, 75,12, 0,255,0,255, "75,12", "0,255,0,255"); +_assertPixel(canvas, 25,37, 0,255,0,255, "25,37", "0,255,0,255"); +_assertPixel(canvas, 75,37, 0,255,0,255, "75,37", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.rect.zero.1.js b/platforms/ios/www/test/tests-todo/framed.2d.path.rect.zero.1.js new file mode 100644 index 0000000..9bee74f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.rect.zero.1.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 100; +ctx.beginPath(); +ctx.rect(0, 50, 100, 0); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.rect.zero.2.js b/platforms/ios/www/test/tests-todo/framed.2d.path.rect.zero.2.js new file mode 100644 index 0000000..eefaa2c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.rect.zero.2.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 100; +ctx.beginPath(); +ctx.rect(50, -100, 0, 250); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.rect.zero.3.js b/platforms/ios/www/test/tests-todo/framed.2d.path.rect.zero.3.js new file mode 100644 index 0000000..720f299 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.rect.zero.3.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 100; +ctx.beginPath(); +ctx.rect(50, 25, 0, 0); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.rect.zero.4.js b/platforms/ios/www/test/tests-todo/framed.2d.path.rect.zero.4.js new file mode 100644 index 0000000..bae9388 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.rect.zero.4.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 50; +ctx.rect(100, 25, 0, 0); +ctx.lineTo(0, 25); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.rect.zero.5.js b/platforms/ios/www/test/tests-todo/framed.2d.path.rect.zero.5.js new file mode 100644 index 0000000..55c35cc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.rect.zero.5.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 50; +ctx.moveTo(0, 0); +ctx.rect(100, 25, 0, 0); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.rect.zero.6.js b/platforms/ios/www/test/tests-todo/framed.2d.path.rect.zero.6.js new file mode 100644 index 0000000..a5f7d54 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.rect.zero.6.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.lineJoin = 'miter'; +ctx.miterLimit = 1.5; +ctx.lineWidth = 200; +ctx.beginPath(); +ctx.rect(100, 25, 1000, 0); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.stroke.empty.js b/platforms/ios/www/test/tests-todo/framed.2d.path.stroke.empty.js new file mode 100644 index 0000000..4be7dbf --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.stroke.empty.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 100; +ctx.lineCap = 'round'; +ctx.lineJoin = 'round'; + +ctx.beginPath(); +ctx.moveTo(40, 25); +ctx.moveTo(60, 25); +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.stroke.overlap.js b/platforms/ios/www/test/tests-todo/framed.2d.path.stroke.overlap.js new file mode 100644 index 0000000..ba1dfee --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.stroke.overlap.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#000'; +ctx.fillRect(0, 0, 100, 50); + +ctx.strokeStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.lineWidth = 50; +ctx.moveTo(0, 20); +ctx.lineTo(100, 20); +ctx.moveTo(0, 30); +ctx.lineTo(100, 30); +ctx.stroke(); + +_assertPixelApprox(canvas, 50,25, 0,127,0,255, "50,25", "0,127,0,255", 1); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.stroke.prune.arc.js b/platforms/ios/www/test/tests-todo/framed.2d.path.stroke.prune.arc.js new file mode 100644 index 0000000..5b0d46c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.stroke.prune.arc.js @@ -0,0 +1,24 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 100; +ctx.lineCap = 'round'; +ctx.lineJoin = 'round'; + +ctx.beginPath(); +ctx.moveTo(50, 25); +ctx.arcTo(50, 25, 150, 25, 10); +ctx.stroke(); + +ctx.beginPath(); +ctx.moveTo(50, 25); +ctx.arc(50, 25, 10, 0, 0, false); +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.stroke.prune.closed.js b/platforms/ios/www/test/tests-todo/framed.2d.path.stroke.prune.closed.js new file mode 100644 index 0000000..b90942c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.stroke.prune.closed.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 100; +ctx.lineCap = 'round'; +ctx.lineJoin = 'round'; + +ctx.beginPath(); +ctx.moveTo(50, 25); +ctx.lineTo(50, 25); +ctx.closePath(); +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.stroke.prune.corner.js b/platforms/ios/www/test/tests-todo/framed.2d.path.stroke.prune.corner.js new file mode 100644 index 0000000..53278d3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.stroke.prune.corner.js @@ -0,0 +1,22 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 400; +ctx.lineJoin = 'miter'; +ctx.miterLimit = 1.4; + +ctx.beginPath(); +ctx.moveTo(-1000, 200, 0, 0); +ctx.lineTo(-100, 200); +ctx.lineTo(-100, 200); +ctx.lineTo(-100, 200); +ctx.lineTo(-100, 1000); +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.stroke.prune.curve.js b/platforms/ios/www/test/tests-todo/framed.2d.path.stroke.prune.curve.js new file mode 100644 index 0000000..1638bb1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.stroke.prune.curve.js @@ -0,0 +1,24 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 100; +ctx.lineCap = 'round'; +ctx.lineJoin = 'round'; + +ctx.beginPath(); +ctx.moveTo(50, 25); +ctx.quadraticCurveTo(50, 25, 50, 25); +ctx.stroke(); + +ctx.beginPath(); +ctx.moveTo(50, 25); +ctx.bezierCurveTo(50, 25, 50, 25, 50, 25); +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.stroke.prune.line.js b/platforms/ios/www/test/tests-todo/framed.2d.path.stroke.prune.line.js new file mode 100644 index 0000000..08b92f4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.stroke.prune.line.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 100; +ctx.lineCap = 'round'; +ctx.lineJoin = 'round'; + +ctx.beginPath(); +ctx.moveTo(50, 25); +ctx.lineTo(50, 25); +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.stroke.prune.rect.js b/platforms/ios/www/test/tests-todo/framed.2d.path.stroke.prune.rect.js new file mode 100644 index 0000000..ba98361 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.stroke.prune.rect.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 100; +ctx.lineCap = 'round'; +ctx.lineJoin = 'round'; + +ctx.beginPath(); +ctx.rect(50, 25, 0, 0); +ctx.stroke(); + +ctx.strokeRect(50, 25, 0, 0); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.stroke.scale1.js b/platforms/ios/www/test/tests-todo/framed.2d.path.stroke.scale1.js new file mode 100644 index 0000000..87b2f2c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.stroke.scale1.js @@ -0,0 +1,33 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.beginPath(); +ctx.rect(25, 12.5, 50, 25); +ctx.save(); +ctx.scale(50, 25); +ctx.strokeStyle = '#0f0'; +ctx.stroke(); +ctx.restore(); + +ctx.beginPath(); +ctx.rect(-25, -12.5, 150, 75); +ctx.save(); +ctx.scale(50, 25); +ctx.strokeStyle = '#f00'; +ctx.stroke(); +ctx.restore(); + +_assertPixel(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255"); +_assertPixel(canvas, 50,0, 0,255,0,255, "50,0", "0,255,0,255"); +_assertPixel(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255"); +_assertPixel(canvas, 0,25, 0,255,0,255, "0,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 99,25, 0,255,0,255, "99,25", "0,255,0,255"); +_assertPixel(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255"); +_assertPixel(canvas, 50,49, 0,255,0,255, "50,49", "0,255,0,255"); +_assertPixel(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.stroke.scale2.js b/platforms/ios/www/test/tests-todo/framed.2d.path.stroke.scale2.js new file mode 100644 index 0000000..3a0f188 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.stroke.scale2.js @@ -0,0 +1,35 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.beginPath(); +ctx.rect(25, 12.5, 50, 25); +ctx.save(); +ctx.rotate(Math.PI/2); +ctx.scale(25, 50); +ctx.strokeStyle = '#0f0'; +ctx.stroke(); +ctx.restore(); + +ctx.beginPath(); +ctx.rect(-25, -12.5, 150, 75); +ctx.save(); +ctx.rotate(Math.PI/2); +ctx.scale(25, 50); +ctx.strokeStyle = '#f00'; +ctx.stroke(); +ctx.restore(); + +_assertPixel(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255"); +_assertPixel(canvas, 50,0, 0,255,0,255, "50,0", "0,255,0,255"); +_assertPixel(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255"); +_assertPixel(canvas, 0,25, 0,255,0,255, "0,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 99,25, 0,255,0,255, "99,25", "0,255,0,255"); +_assertPixel(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255"); +_assertPixel(canvas, 50,49, 0,255,0,255, "50,49", "0,255,0,255"); +_assertPixel(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.stroke.skew.js b/platforms/ios/www/test/tests-todo/framed.2d.path.stroke.skew.js new file mode 100644 index 0000000..acb4888 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.stroke.skew.js @@ -0,0 +1,49 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.save(); +ctx.beginPath(); +ctx.moveTo(49, -50); +ctx.lineTo(201, -50); +ctx.rotate(Math.PI/4); +ctx.scale(1, 283); +ctx.strokeStyle = '#0f0'; +ctx.stroke(); +ctx.restore(); + +ctx.save(); +ctx.beginPath(); +ctx.translate(-150, 0); +ctx.moveTo(49, -50); +ctx.lineTo(199, -50); +ctx.rotate(Math.PI/4); +ctx.scale(1, 142); +ctx.strokeStyle = '#f00'; +ctx.stroke(); +ctx.restore(); + +ctx.save(); +ctx.beginPath(); +ctx.translate(-150, 0); +ctx.moveTo(49, -50); +ctx.lineTo(199, -50); +ctx.rotate(Math.PI/4); +ctx.scale(1, 142); +ctx.strokeStyle = '#f00'; +ctx.stroke(); +ctx.restore(); + +_assertPixel(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255"); +_assertPixel(canvas, 50,0, 0,255,0,255, "50,0", "0,255,0,255"); +_assertPixel(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255"); +_assertPixel(canvas, 0,25, 0,255,0,255, "0,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 99,25, 0,255,0,255, "99,25", "0,255,0,255"); +_assertPixel(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255"); +_assertPixel(canvas, 50,49, 0,255,0,255, "50,49", "0,255,0,255"); +_assertPixel(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.stroke.unaffected.js b/platforms/ios/www/test/tests-todo/framed.2d.path.stroke.unaffected.js new file mode 100644 index 0000000..087c5a7 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.stroke.unaffected.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineWidth = 50; +ctx.moveTo(-100, 25); +ctx.lineTo(-100, -100); +ctx.lineTo(200, -100); +ctx.lineTo(200, 25); +ctx.strokeStyle = '#f00'; +ctx.stroke(); + +ctx.closePath(); +ctx.strokeStyle = '#0f0'; +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.stroke.union.js b/platforms/ios/www/test/tests-todo/framed.2d.path.stroke.union.js new file mode 100644 index 0000000..47fa81c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.stroke.union.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 40; +ctx.moveTo(0, 10); +ctx.lineTo(100, 10); +ctx.moveTo(100, 40); +ctx.lineTo(0, 40); +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.transformation.basic.js b/platforms/ios/www/test/tests-todo/framed.2d.path.transformation.basic.js new file mode 100644 index 0000000..faf5348 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.transformation.basic.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.translate(-100, 0); +ctx.rect(100, 0, 100, 50); +ctx.translate(0, -100); +ctx.fillStyle = '#0f0'; +ctx.fill(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.transformation.changing.js b/platforms/ios/www/test/tests-todo/framed.2d.path.transformation.changing.js new file mode 100644 index 0000000..4fe7bf4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.transformation.changing.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.moveTo(0, 0); +ctx.translate(100, 0); +ctx.lineTo(0, 0); +ctx.translate(0, 50); +ctx.lineTo(0, 0); +ctx.translate(-100, 0); +ctx.lineTo(0, 0); +ctx.translate(1000, 1000); +ctx.rotate(Math.PI/2); +ctx.scale(0.1, 0.1); +ctx.fill(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.path.transformation.multiple.js b/platforms/ios/www/test/tests-todo/framed.2d.path.transformation.multiple.js new file mode 100644 index 0000000..601d25d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.path.transformation.multiple.js @@ -0,0 +1,26 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#f00'; +ctx.translate(-100, 0); +ctx.rect(0, 0, 100, 50); +ctx.fill(); +ctx.translate(100, 0); +ctx.fill(); + +ctx.beginPath(); +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 50; +ctx.translate(0, -50); +ctx.moveTo(0, 25); +ctx.lineTo(100, 25); +ctx.stroke(); +ctx.translate(0, 50); +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.pattern.animated.gif.js b/platforms/ios/www/test/tests-todo/framed.2d.pattern.animated.gif.js new file mode 100644 index 0000000..03c155f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.pattern.animated.gif.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +deferTest(); +setTimeout(function () { + var pattern = ctx.createPattern(document.getElementById('anim-gr.gif'), 'repeat'); + ctx.fillStyle = pattern; + ctx.fillRect(0, 0, 50, 50); + setTimeout(wrapFunction(function () { + ctx.fillRect(50, 0, 50, 50); + _assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2); + _assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2); + }), 250); +}, 250); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.pattern.basic.canvas.js b/platforms/ios/www/test/tests-todo/framed.2d.pattern.basic.canvas.js new file mode 100644 index 0000000..c19b8fc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.pattern.basic.canvas.js @@ -0,0 +1,28 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = '#0f0'; +ctx2.fillRect(0, 0, 100, 50); + +var pattern = ctx.createPattern(canvas2, 'no-repeat'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.pattern.basic.image.js b/platforms/ios/www/test/tests-todo/framed.2d.pattern.basic.image.js new file mode 100644 index 0000000..1049cb8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.pattern.basic.image.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +var img = document.getElementById('green.png'); +var pattern = ctx.createPattern(img, 'no-repeat'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.pattern.basic.nocontext.js b/platforms/ios/www/test/tests-todo/framed.2d.pattern.basic.nocontext.js new file mode 100644 index 0000000..f4eba65 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.pattern.basic.nocontext.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var pattern = ctx.createPattern(canvas2, 'no-repeat'); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.pattern.basic.type.js b/platforms/ios/www/test/tests-todo/framed.2d.pattern.basic.type.js new file mode 100644 index 0000000..4273479 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.pattern.basic.type.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +_assertDifferent(window.CanvasPattern, undefined, "window.CanvasPattern", "undefined"); + +window.CanvasPattern.prototype.thisImplementsCanvasPattern = true; + +var img = document.getElementById('green.png'); +var pattern = ctx.createPattern(img, 'no-repeat'); +_assert(pattern.thisImplementsCanvasPattern, "pattern.thisImplementsCanvasPattern"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.pattern.basic.zerocanvas.js b/platforms/ios/www/test/tests-todo/framed.2d.pattern.basic.zerocanvas.js new file mode 100644 index 0000000..e70aba7 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.pattern.basic.zerocanvas.js @@ -0,0 +1,28 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 0; +canvas.height = 10; +_assertSame(canvas.width, 0, "canvas.width", "0"); +_assertSame(canvas.height, 10, "canvas.height", "10"); +try { var _thrown = false; + ctx.createPattern(canvas, 'repeat'); +} catch (e) { if (e.code != DOMException.INVALID_STATE_ERR) _fail("Failed assertion: expected exception of type INVALID_STATE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INVALID_STATE_ERR: ctx.createPattern(canvas, 'repeat')"); } + +canvas.width = 10; +canvas.height = 0; +_assertSame(canvas.width, 10, "canvas.width", "10"); +_assertSame(canvas.height, 0, "canvas.height", "0"); +try { var _thrown = false; + ctx.createPattern(canvas, 'repeat'); +} catch (e) { if (e.code != DOMException.INVALID_STATE_ERR) _fail("Failed assertion: expected exception of type INVALID_STATE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INVALID_STATE_ERR: ctx.createPattern(canvas, 'repeat')"); } + +canvas.width = 0; +canvas.height = 0; +_assertSame(canvas.width, 0, "canvas.width", "0"); +_assertSame(canvas.height, 0, "canvas.height", "0"); +try { var _thrown = false; + ctx.createPattern(canvas, 'repeat'); +} catch (e) { if (e.code != DOMException.INVALID_STATE_ERR) _fail("Failed assertion: expected exception of type INVALID_STATE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INVALID_STATE_ERR: ctx.createPattern(canvas, 'repeat')"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.pattern.crosscanvas.js b/platforms/ios/www/test/tests-todo/framed.2d.pattern.crosscanvas.js new file mode 100644 index 0000000..c4251d3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.pattern.crosscanvas.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +var img = document.getElementById('green.png'); + +var pattern = document.createElement('canvas').getContext('2d').createPattern(img, 'no-repeat'); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.pattern.image.broken.js b/platforms/ios/www/test/tests-todo/framed.2d.pattern.image.broken.js new file mode 100644 index 0000000..422048a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.pattern.image.broken.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +var img = document.getElementById('broken.png'); +_assertSame(img.complete, false, "img.complete", "false"); +_assertSame(ctx.createPattern(img, 'repeat'), null, "ctx.createPattern(img, 'repeat')", "null"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.pattern.image.incomplete.js b/platforms/ios/www/test/tests-todo/framed.2d.pattern.image.incomplete.js new file mode 100644 index 0000000..3764e83 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.pattern.image.incomplete.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +var img = new Image(); +_assertSame(img.complete, false, "img.complete", "false"); +_assertSame(ctx.createPattern(img, 'repeat'), null, "ctx.createPattern(img, 'repeat')", "null"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.pattern.image.null.js b/platforms/ios/www/test/tests-todo/framed.2d.pattern.image.null.js new file mode 100644 index 0000000..75e4549 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.pattern.image.null.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.createPattern(null, 'repeat'); +} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail("Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TYPE_MISMATCH_ERR: ctx.createPattern(null, 'repeat')"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.pattern.image.string.js b/platforms/ios/www/test/tests-todo/framed.2d.pattern.image.string.js new file mode 100644 index 0000000..3f1d4a0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.pattern.image.string.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.createPattern('../images/red.png', 'repeat'); +} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail("Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TYPE_MISMATCH_ERR: ctx.createPattern('../images/red.png', 'repeat')"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.pattern.image.undefined.js b/platforms/ios/www/test/tests-todo/framed.2d.pattern.image.undefined.js new file mode 100644 index 0000000..052b250 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.pattern.image.undefined.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.createPattern(undefined, 'repeat'); +} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail("Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TYPE_MISMATCH_ERR: ctx.createPattern(undefined, 'repeat')"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.pattern.modify.canvas1.js b/platforms/ios/www/test/tests-todo/framed.2d.pattern.modify.canvas1.js new file mode 100644 index 0000000..2500755 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.pattern.modify.canvas1.js @@ -0,0 +1,24 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = '#0f0'; +ctx2.fillRect(0, 0, 100, 50); + +var pattern = ctx.createPattern(canvas2, 'no-repeat'); + +ctx2.fillStyle = '#f00'; +ctx2.fillRect(0, 0, 100, 50); + +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.pattern.modify.canvas2.js b/platforms/ios/www/test/tests-todo/framed.2d.pattern.modify.canvas2.js new file mode 100644 index 0000000..d6f8a67 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.pattern.modify.canvas2.js @@ -0,0 +1,28 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = '#0f0'; +ctx2.fillRect(0, 0, 100, 50); + +var pattern = ctx.createPattern(canvas2, 'no-repeat'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx2.fillStyle = '#f00'; +ctx2.fillRect(0, 0, 100, 50); + +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.pattern.modify.image1.js b/platforms/ios/www/test/tests-todo/framed.2d.pattern.modify.image1.js new file mode 100644 index 0000000..32fcb86 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.pattern.modify.image1.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +var img = document.getElementById('green.png'); +var pattern = ctx.createPattern(img, 'no-repeat'); +deferTest(); +img.onload = wrapFunction(function () +{ + ctx.fillStyle = pattern; + ctx.fillRect(0, 0, 100, 50); + + _assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); + _assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); + _assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + _assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); +}); +img.src = '../images/red.png'; + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.pattern.modify.image2.js b/platforms/ios/www/test/tests-todo/framed.2d.pattern.modify.image2.js new file mode 100644 index 0000000..26b5aa1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.pattern.modify.image2.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +var img = document.getElementById('green.png'); +var pattern = ctx.createPattern(img, 'no-repeat'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#00f'; +ctx.fillRect(0, 0, 100, 50); +deferTest(); +img.onload = wrapFunction(function () +{ + ctx.fillStyle = pattern; + ctx.fillRect(0, 0, 100, 50); + + _assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); + _assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); + _assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + _assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); +}); +img.src = '../images/red.png'; + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.norepeat.basic.js b/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.norepeat.basic.js new file mode 100644 index 0000000..37d5310 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.norepeat.basic.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('green.png'); +var pattern = ctx.createPattern(img, 'no-repeat'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.norepeat.coord1.js b/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.norepeat.coord1.js new file mode 100644 index 0000000..8e66bcd --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.norepeat.coord1.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 50, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(50, 0, 50, 50); + +var img = document.getElementById('green.png'); +var pattern = ctx.createPattern(img, 'no-repeat'); +ctx.fillStyle = pattern; +ctx.translate(50, 0); +ctx.fillRect(-50, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.norepeat.coord2.js b/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.norepeat.coord2.js new file mode 100644 index 0000000..d09b6ed --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.norepeat.coord2.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +var img = document.getElementById('green.png'); +var pattern = ctx.createPattern(img, 'no-repeat'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 50, 50); + +ctx.fillStyle = '#f00'; +ctx.fillRect(50, 0, 50, 50); + +ctx.fillStyle = pattern; +ctx.translate(50, 0); +ctx.fillRect(-50, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.norepeat.coord3.js b/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.norepeat.coord3.js new file mode 100644 index 0000000..b4b0cc8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.norepeat.coord3.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('red.png'); +var pattern = ctx.createPattern(img, 'no-repeat'); +ctx.fillStyle = pattern; +ctx.translate(50, 25); +ctx.fillRect(-50, -25, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 50, 25); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.norepeat.outside.js b/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.norepeat.outside.js new file mode 100644 index 0000000..8dddb46 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.norepeat.outside.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('red.png'); +var pattern = ctx.createPattern(img, 'no-repeat'); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = pattern; +ctx.fillRect(0, -50, 100, 50); +ctx.fillRect(-100, 0, 100, 50); +ctx.fillRect(0, 50, 100, 50); +ctx.fillRect(100, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.orientation.canvas.js b/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.orientation.canvas.js new file mode 100644 index 0000000..4492b71 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.orientation.canvas.js @@ -0,0 +1,27 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = '#f00'; +ctx2.fillRect(0, 0, 100, 25); +ctx2.fillStyle = '#0f0'; +ctx2.fillRect(0, 25, 100, 25); + +var pattern = ctx.createPattern(canvas2, 'no-repeat'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 25); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.orientation.image.js b/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.orientation.image.js new file mode 100644 index 0000000..1f0f031 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.orientation.image.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('rrgg-256x256.png'); +var pattern = ctx.createPattern(img, 'no-repeat'); +ctx.fillStyle = pattern; +ctx.save(); +ctx.translate(0, -103); +ctx.fillRect(0, 103, 100, 50); +ctx.restore(); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 25); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.repeat.basic.js b/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.repeat.basic.js new file mode 100644 index 0000000..ee19c77 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.repeat.basic.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('green-16x16.png'); +var pattern = ctx.createPattern(img, 'repeat'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.repeat.coord1.js b/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.repeat.coord1.js new file mode 100644 index 0000000..d3c9c4d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.repeat.coord1.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('rgrg-256x256.png'); +var pattern = ctx.createPattern(img, 'repeat'); +ctx.fillStyle = pattern; +ctx.translate(-128, -78); +ctx.fillRect(128, 78, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.repeat.coord2.js b/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.repeat.coord2.js new file mode 100644 index 0000000..2939568 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.repeat.coord2.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +var img = document.getElementById('ggrr-256x256.png'); +var pattern = ctx.createPattern(img, 'repeat'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.repeat.coord3.js b/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.repeat.coord3.js new file mode 100644 index 0000000..0879ca3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.repeat.coord3.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +var img = document.getElementById('rgrg-256x256.png'); +var pattern = ctx.createPattern(img, 'repeat'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +ctx.translate(-128, -78); +ctx.fillRect(128, 78, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.repeat.outside.js b/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.repeat.outside.js new file mode 100644 index 0000000..9727f0b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.repeat.outside.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('green-16x16.png'); +var pattern = ctx.createPattern(img, 'repeat'); +ctx.fillStyle = pattern; +ctx.translate(50, 25); +ctx.fillRect(-50, -25, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.repeatx.basic.js b/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.repeatx.basic.js new file mode 100644 index 0000000..e113835 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.repeatx.basic.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 16); + +var img = document.getElementById('green-16x16.png'); +var pattern = ctx.createPattern(img, 'repeat-x'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.repeatx.coord1.js b/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.repeatx.coord1.js new file mode 100644 index 0000000..b151153 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.repeatx.coord1.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('red-16x16.png'); +var pattern = ctx.createPattern(img, 'repeat-x'); +ctx.fillStyle = pattern; +ctx.translate(0, 16); +ctx.fillRect(0, -16, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 16); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.repeatx.outside.js b/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.repeatx.outside.js new file mode 100644 index 0000000..d2ef7eb --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.repeatx.outside.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('red-16x16.png'); +var pattern = ctx.createPattern(img, 'repeat-x'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 16); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.repeaty.basic.js b/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.repeaty.basic.js new file mode 100644 index 0000000..1b7feda --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.repeaty.basic.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 16, 50); + +var img = document.getElementById('green-16x16.png'); +var pattern = ctx.createPattern(img, 'repeat-y'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.repeaty.coord1.js b/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.repeaty.coord1.js new file mode 100644 index 0000000..2d5eb80 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.repeaty.coord1.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('red-16x16.png'); +var pattern = ctx.createPattern(img, 'repeat-y'); +ctx.fillStyle = pattern; +ctx.translate(48, 0); +ctx.fillRect(-48, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 16, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.repeaty.outside.js b/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.repeaty.outside.js new file mode 100644 index 0000000..8125837 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.pattern.paint.repeaty.outside.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('red-16x16.png'); +var pattern = ctx.createPattern(img, 'repeat-y'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 16, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.pattern.repeat.case.js b/platforms/ios/www/test/tests-todo/framed.2d.pattern.repeat.case.js new file mode 100644 index 0000000..ad45bed --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.pattern.repeat.case.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.createPattern(canvas, "Repeat"); +} catch (e) { if (e.code != DOMException.SYNTAX_ERR) _fail("Failed assertion: expected exception of type SYNTAX_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type SYNTAX_ERR: ctx.createPattern(canvas, \"Repeat\")"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.pattern.repeat.empty.js b/platforms/ios/www/test/tests-todo/framed.2d.pattern.repeat.empty.js new file mode 100644 index 0000000..f251ed4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.pattern.repeat.empty.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +var img = document.getElementById('green-1x1.png'); +var pattern = ctx.createPattern(img, ""); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 200, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.pattern.repeat.null.js b/platforms/ios/www/test/tests-todo/framed.2d.pattern.repeat.null.js new file mode 100644 index 0000000..6a13765 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.pattern.repeat.null.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +var img = document.getElementById('green-1x1.png'); +var pattern = ctx.createPattern(img, null); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.pattern.repeat.nullsuffix.js b/platforms/ios/www/test/tests-todo/framed.2d.pattern.repeat.nullsuffix.js new file mode 100644 index 0000000..adf6eae --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.pattern.repeat.nullsuffix.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.createPattern(canvas, "repeat\0"); +} catch (e) { if (e.code != DOMException.SYNTAX_ERR) _fail("Failed assertion: expected exception of type SYNTAX_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type SYNTAX_ERR: ctx.createPattern(canvas, \"repeat\\0\")"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.pattern.repeat.undefined.js b/platforms/ios/www/test/tests-todo/framed.2d.pattern.repeat.undefined.js new file mode 100644 index 0000000..661cd0d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.pattern.repeat.undefined.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.createPattern(canvas, undefined); +} catch (e) { if (e.code != DOMException.SYNTAX_ERR) _fail("Failed assertion: expected exception of type SYNTAX_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type SYNTAX_ERR: ctx.createPattern(canvas, undefined)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.pattern.repeat.unrecognised.js b/platforms/ios/www/test/tests-todo/framed.2d.pattern.repeat.unrecognised.js new file mode 100644 index 0000000..d24500b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.pattern.repeat.unrecognised.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.createPattern(canvas, "invalid"); +} catch (e) { if (e.code != DOMException.SYNTAX_ERR) _fail("Failed assertion: expected exception of type SYNTAX_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type SYNTAX_ERR: ctx.createPattern(canvas, \"invalid\")"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.scaled.js b/platforms/ios/www/test/tests-todo/framed.2d.scaled.js new file mode 100644 index 0000000..3ed3b0e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.scaled.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#00f'; +ctx.fillRect(0, 0, 50, 25); +ctx.fillStyle = '#0ff'; +ctx.fillRect(0, 0, 25, 10); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.alpha.1.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.alpha.1.js new file mode 100644 index 0000000..1aac375 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.alpha.1.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = 'rgba(255, 0, 0, 0.01)'; +ctx.shadowOffsetY = 50; +ctx.fillRect(0, -50, 100, 50); + +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 4); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.alpha.2.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.alpha.2.js new file mode 100644 index 0000000..536144b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.alpha.2.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = 'rgba(0, 0, 255, 0.5)'; +ctx.shadowOffsetY = 50; +ctx.fillRect(0, -50, 100, 50); + +_assertPixelApprox(canvas, 50,25, 127,0,127,255, "50,25", "127,0,127,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.alpha.3.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.alpha.3.js new file mode 100644 index 0000000..2b89a2b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.alpha.3.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; // (work around broken Firefox globalAlpha caching) +ctx.shadowColor = '#00f'; +ctx.shadowOffsetY = 50; +ctx.globalAlpha = 0.5; +ctx.fillRect(0, -50, 100, 50); + +_assertPixelApprox(canvas, 50,25, 127,0,127,255, "50,25", "127,0,127,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.alpha.4.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.alpha.4.js new file mode 100644 index 0000000..9b7ac01 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.alpha.4.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; // (work around broken Firefox globalAlpha caching) +ctx.shadowColor = 'rgba(0, 0, 255, 0.707)'; +ctx.shadowOffsetY = 50; +ctx.globalAlpha = 0.707; +ctx.fillRect(0, -50, 100, 50); + +_assertPixelApprox(canvas, 50,25, 127,0,127,255, "50,25", "127,0,127,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.alpha.5.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.alpha.5.js new file mode 100644 index 0000000..71c396f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.alpha.5.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = 'rgba(64, 0, 0, 0.5)'; +ctx.shadowColor = '#00f'; +ctx.shadowOffsetY = 50; +ctx.fillRect(0, -50, 100, 50); + +_assertPixelApprox(canvas, 50,25, 127,0,127,255, "50,25", "127,0,127,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.attributes.shadowBlur.initial.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.attributes.shadowBlur.initial.js new file mode 100644 index 0000000..6410228 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.attributes.shadowBlur.initial.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(ctx.shadowBlur, 0, "ctx.shadowBlur", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.attributes.shadowBlur.invalid.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.attributes.shadowBlur.invalid.js new file mode 100644 index 0000000..a0a823a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.attributes.shadowBlur.invalid.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +ctx.shadowBlur = 1; +ctx.shadowBlur = -2; +_assertSame(ctx.shadowBlur, 1, "ctx.shadowBlur", "1"); + +ctx.shadowBlur = 1; +ctx.shadowBlur = Infinity; +_assertSame(ctx.shadowBlur, 1, "ctx.shadowBlur", "1"); + +ctx.shadowBlur = 1; +ctx.shadowBlur = -Infinity; +_assertSame(ctx.shadowBlur, 1, "ctx.shadowBlur", "1"); + +ctx.shadowBlur = 1; +ctx.shadowBlur = NaN; +_assertSame(ctx.shadowBlur, 1, "ctx.shadowBlur", "1"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.attributes.shadowBlur.valid.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.attributes.shadowBlur.valid.js new file mode 100644 index 0000000..0a02f2e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.attributes.shadowBlur.valid.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.shadowBlur = 1; +_assertSame(ctx.shadowBlur, 1, "ctx.shadowBlur", "1"); + +ctx.shadowBlur = 0.5; +_assertSame(ctx.shadowBlur, 0.5, "ctx.shadowBlur", "0.5"); + +ctx.shadowBlur = 1e6; +_assertSame(ctx.shadowBlur, 1e6, "ctx.shadowBlur", "1e6"); + +ctx.shadowBlur = 0; +_assertSame(ctx.shadowBlur, 0, "ctx.shadowBlur", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.attributes.shadowColor.initial.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.attributes.shadowColor.initial.js new file mode 100644 index 0000000..1d8539b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.attributes.shadowColor.initial.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(ctx.shadowColor, 'rgba(0, 0, 0, 0.0)', "ctx.shadowColor", "'rgba(0, 0, 0, 0.0)'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.attributes.shadowColor.invalid.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.attributes.shadowColor.invalid.js new file mode 100644 index 0000000..f287f30 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.attributes.shadowColor.invalid.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +ctx.shadowColor = '#00ff00'; +ctx.shadowColor = 'bogus'; +_assertSame(ctx.shadowColor, '#00ff00', "ctx.shadowColor", "'#00ff00'"); + +ctx.shadowColor = '#00ff00'; +ctx.shadowColor = 'red bogus'; +_assertSame(ctx.shadowColor, '#00ff00', "ctx.shadowColor", "'#00ff00'"); + +ctx.shadowColor = '#00ff00'; +ctx.shadowColor = ctx; +_assertSame(ctx.shadowColor, '#00ff00', "ctx.shadowColor", "'#00ff00'"); + +ctx.shadowColor = '#00ff00'; +ctx.shadowColor = undefined; +_assertSame(ctx.shadowColor, '#00ff00', "ctx.shadowColor", "'#00ff00'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.attributes.shadowColor.valid.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.attributes.shadowColor.valid.js new file mode 100644 index 0000000..02a5f5c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.attributes.shadowColor.valid.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.shadowColor = 'lime'; +_assertSame(ctx.shadowColor, '#00ff00', "ctx.shadowColor", "'#00ff00'"); + +ctx.shadowColor = 'RGBA(0,255, 0,0)'; +_assertSame(ctx.shadowColor, 'rgba(0, 255, 0, 0.0)', "ctx.shadowColor", "'rgba(0, 255, 0, 0.0)'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.attributes.shadowOffset.initial.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.attributes.shadowOffset.initial.js new file mode 100644 index 0000000..48cf0ca --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.attributes.shadowOffset.initial.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +_assertSame(ctx.shadowOffsetX, 0, "ctx.shadowOffsetX", "0"); +_assertSame(ctx.shadowOffsetY, 0, "ctx.shadowOffsetY", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.attributes.shadowOffset.invalid.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.attributes.shadowOffset.invalid.js new file mode 100644 index 0000000..4b9c04e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.attributes.shadowOffset.invalid.js @@ -0,0 +1,25 @@ +_addTest(function(canvas, ctx) { + +ctx.shadowOffsetX = 1; +ctx.shadowOffsetY = 2; +ctx.shadowOffsetX = Infinity; +ctx.shadowOffsetY = Infinity; +_assertSame(ctx.shadowOffsetX, 1, "ctx.shadowOffsetX", "1"); +_assertSame(ctx.shadowOffsetY, 2, "ctx.shadowOffsetY", "2"); + +ctx.shadowOffsetX = 1; +ctx.shadowOffsetY = 2; +ctx.shadowOffsetX = -Infinity; +ctx.shadowOffsetY = -Infinity; +_assertSame(ctx.shadowOffsetX, 1, "ctx.shadowOffsetX", "1"); +_assertSame(ctx.shadowOffsetY, 2, "ctx.shadowOffsetY", "2"); + +ctx.shadowOffsetX = 1; +ctx.shadowOffsetY = 2; +ctx.shadowOffsetX = NaN; +ctx.shadowOffsetY = NaN; +_assertSame(ctx.shadowOffsetX, 1, "ctx.shadowOffsetX", "1"); +_assertSame(ctx.shadowOffsetY, 2, "ctx.shadowOffsetY", "2"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.attributes.shadowOffset.valid.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.attributes.shadowOffset.valid.js new file mode 100644 index 0000000..75937f0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.attributes.shadowOffset.valid.js @@ -0,0 +1,29 @@ +_addTest(function(canvas, ctx) { + +ctx.shadowOffsetX = 1; +ctx.shadowOffsetY = 2; +_assertSame(ctx.shadowOffsetX, 1, "ctx.shadowOffsetX", "1"); +_assertSame(ctx.shadowOffsetY, 2, "ctx.shadowOffsetY", "2"); + +ctx.shadowOffsetX = 0.5; +ctx.shadowOffsetY = 0.25; +_assertSame(ctx.shadowOffsetX, 0.5, "ctx.shadowOffsetX", "0.5"); +_assertSame(ctx.shadowOffsetY, 0.25, "ctx.shadowOffsetY", "0.25"); + +ctx.shadowOffsetX = -0.5; +ctx.shadowOffsetY = -0.25; +_assertSame(ctx.shadowOffsetX, -0.5, "ctx.shadowOffsetX", "-0.5"); +_assertSame(ctx.shadowOffsetY, -0.25, "ctx.shadowOffsetY", "-0.25"); + +ctx.shadowOffsetX = 0; +ctx.shadowOffsetY = 0; +_assertSame(ctx.shadowOffsetX, 0, "ctx.shadowOffsetX", "0"); +_assertSame(ctx.shadowOffsetY, 0, "ctx.shadowOffsetY", "0"); + +ctx.shadowOffsetX = 1e6; +ctx.shadowOffsetY = 1e6; +_assertSame(ctx.shadowOffsetX, 1e6, "ctx.shadowOffsetX", "1e6"); +_assertSame(ctx.shadowOffsetY, 1e6, "ctx.shadowOffsetY", "1e6"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.blur.high.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.blur.high.js new file mode 100644 index 0000000..b3c9e4f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.blur.high.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#ff0'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = '#00f'; +ctx.shadowOffsetY = 0; +ctx.shadowBlur = 555.6; +ctx.fillRect(-200, -200, 200, 400); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.blur.low.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.blur.low.js new file mode 100644 index 0000000..9703121 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.blur.low.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#ff0'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = '#00f'; +ctx.shadowOffsetY = 25; +for (var x = 0; x < 100; ++x) { + ctx.save(); + ctx.beginPath(); + ctx.rect(x, 0, 1, 50); + ctx.clip(); + ctx.shadowBlur = x; + ctx.fillRect(-200, -200, 500, 200); + ctx.restore(); +} + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.canvas.alpha.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.canvas.alpha.js new file mode 100644 index 0000000..7f9af4e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.canvas.alpha.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = 'rgba(255, 0, 0, 0.5)'; +ctx2.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowOffsetY = 50; +ctx.shadowColor = '#00f'; +ctx.drawImage(canvas2, 0, -50); + +_assertPixelApprox(canvas, 50,25, 127,0,127,255, "50,25", "127,0,127,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.canvas.basic.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.canvas.basic.js new file mode 100644 index 0000000..0b9b795 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.canvas.basic.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = '#f00'; +ctx2.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetY = 50; +ctx.drawImage(canvas2, 0, -50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.canvas.transparent.1.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.canvas.transparent.1.js new file mode 100644 index 0000000..00bf2c7 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.canvas.transparent.1.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = '#f00'; +ctx.shadowOffsetY = 50; +ctx.drawImage(canvas2, 0, -50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.canvas.transparent.2.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.canvas.transparent.2.js new file mode 100644 index 0000000..6e5f276 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.canvas.transparent.2.js @@ -0,0 +1,25 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = '#f00'; +ctx2.fillRect(0, 0, 50, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 50, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(50, 0, 50, 50); +ctx.shadowOffsetY = 50; +ctx.shadowColor = '#0f0'; +ctx.drawImage(canvas2, 50, -50); +ctx.shadowColor = '#f00'; +ctx.drawImage(canvas2, -50, -50); + +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.clip.1.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.clip.1.js new file mode 100644 index 0000000..d23e68c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.clip.1.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 50, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(50, 0, 50, 50); + +ctx.save(); +ctx.beginPath(); +ctx.rect(50, 0, 50, 50); +ctx.clip(); +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetX = 50; +ctx.fillRect(0, 0, 50, 50); +ctx.restore(); + +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.clip.2.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.clip.2.js new file mode 100644 index 0000000..7142fd0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.clip.2.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +ctx.fillStyle = '#0f0'; +ctx.fillRect(50, 0, 50, 50); + +ctx.save(); +ctx.beginPath(); +ctx.rect(0, 0, 50, 50); +ctx.clip(); +ctx.shadowColor = '#f00'; +ctx.shadowOffsetX = 50; +ctx.fillRect(0, 0, 50, 50); +ctx.restore(); + +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.clip.3.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.clip.3.js new file mode 100644 index 0000000..bfa775f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.clip.3.js @@ -0,0 +1,22 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +ctx.fillStyle = '#0f0'; +ctx.fillRect(50, 0, 50, 50); + +ctx.save(); +ctx.beginPath(); +ctx.rect(0, 0, 50, 50); +ctx.clip(); +ctx.fillStyle = '#f00'; +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetX = 50; +ctx.fillRect(-50, 0, 50, 50); +ctx.restore(); + +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.composite.1.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.composite.1.js new file mode 100644 index 0000000..855bca0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.composite.1.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'xor'; +ctx.shadowColor = '#f00'; +ctx.shadowOffsetX = 100; +ctx.fillStyle = '#0f0'; +ctx.fillRect(-100, 0, 200, 50); + +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.composite.2.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.composite.2.js new file mode 100644 index 0000000..da3b03f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.composite.2.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'xor'; +ctx.shadowColor = '#f00'; +ctx.shadowBlur = 1; +ctx.fillStyle = '#0f0'; +ctx.fillRect(-10, -10, 120, 70); + +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.composite.3.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.composite.3.js new file mode 100644 index 0000000..3a77b71 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.composite.3.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-out'; +ctx.shadowColor = '#f00'; +ctx.shadowBlur = 10; +ctx.fillStyle = '#f00'; +ctx.fillRect(200, 0, 100, 50); + +_assertPixelApprox(canvas, 5,5, 0,255,0,255, "5,5", "0,255,0,255", 2); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.enable.blur.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.enable.blur.js new file mode 100644 index 0000000..2f1127e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.enable.blur.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.globalCompositeOperation = 'destination-atop'; +ctx.shadowColor = '#0f0'; +ctx.shadowBlur = 0.1; +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.enable.off.1.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.enable.off.1.js new file mode 100644 index 0000000..9bb20b8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.enable.off.1.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +ctx.shadowColor = '#f00'; +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.enable.off.2.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.enable.off.2.js new file mode 100644 index 0000000..800c731 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.enable.off.2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.globalCompositeOperation = 'destination-atop'; +ctx.shadowColor = '#f00'; +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.enable.x.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.enable.x.js new file mode 100644 index 0000000..bf80da6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.enable.x.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.globalCompositeOperation = 'destination-atop'; +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetX = 0.1; +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.enable.y.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.enable.y.js new file mode 100644 index 0000000..eda5f53 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.enable.y.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.globalCompositeOperation = 'destination-atop'; +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetY = 0.1; +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.gradient.alpha.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.gradient.alpha.js new file mode 100644 index 0000000..6174354 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.gradient.alpha.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +var gradient = ctx.createLinearGradient(0, 0, 100, 0); +gradient.addColorStop(0, 'rgba(255,0,0,0.5)'); +gradient.addColorStop(1, 'rgba(255,0,0,0.5)'); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowOffsetY = 50; +ctx.shadowColor = '#00f'; +ctx.fillStyle = gradient; +ctx.fillRect(0, -50, 100, 50); + +_assertPixelApprox(canvas, 50,25, 127,0,127,255, "50,25", "127,0,127,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.gradient.basic.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.gradient.basic.js new file mode 100644 index 0000000..ddb028a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.gradient.basic.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +var gradient = ctx.createLinearGradient(0, 0, 100, 0); +gradient.addColorStop(0, '#f00'); +gradient.addColorStop(1, '#f00'); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetY = 50; +ctx.fillStyle = gradient; +ctx.fillRect(0, -50, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.gradient.transparent.1.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.gradient.transparent.1.js new file mode 100644 index 0000000..9627019 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.gradient.transparent.1.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +var gradient = ctx.createLinearGradient(0, 0, 100, 0); +gradient.addColorStop(0, 'rgba(0,0,0,0)'); +gradient.addColorStop(1, 'rgba(0,0,0,0)'); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = '#f00'; +ctx.shadowOffsetY = 50; +ctx.fillStyle = gradient; +ctx.fillRect(0, -50, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.gradient.transparent.2.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.gradient.transparent.2.js new file mode 100644 index 0000000..f13ba5d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.gradient.transparent.2.js @@ -0,0 +1,22 @@ +_addTest(function(canvas, ctx) { + +var gradient = ctx.createLinearGradient(0, 0, 100, 0); +gradient.addColorStop(0, '#f00'); +gradient.addColorStop(0.499, '#f00'); +gradient.addColorStop(0.5, 'rgba(0,0,0,0)'); +gradient.addColorStop(1, 'rgba(0,0,0,0)'); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +ctx.fillStyle = '#0f0'; +ctx.fillRect(50, 0, 50, 50); +ctx.shadowOffsetY = 50; +ctx.shadowColor = '#0f0'; +ctx.fillStyle = gradient; +ctx.fillRect(0, -50, 100, 50); + +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.image.alpha.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.image.alpha.js new file mode 100644 index 0000000..67b935c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.image.alpha.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowOffsetY = 50; +ctx.shadowColor = '#00f'; +ctx.drawImage(document.getElementById('transparent50.png'), 0, -50); + +_assertPixelApprox(canvas, 50,25, 127,0,127,255, "50,25", "127,0,127,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.image.basic.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.image.basic.js new file mode 100644 index 0000000..46accfa --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.image.basic.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetY = 50; +ctx.drawImage(document.getElementById('red.png'), 0, -50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.image.scale.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.image.scale.js new file mode 100644 index 0000000..34ef1ea --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.image.scale.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowOffsetY = 50; +ctx.shadowColor = '#0f0'; +ctx.drawImage(document.getElementById('redtransparent.png'), 0, 0, 100, 50, -10, -50, 240, 50); + +_assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.image.section.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.image.section.js new file mode 100644 index 0000000..0da6055 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.image.section.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowOffsetY = 50; +ctx.shadowColor = '#f00'; +ctx.drawImage(document.getElementById('redtransparent.png'), 50, 0, 50, 50, 0, -50, 50, 50); + +_assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.image.transparent.1.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.image.transparent.1.js new file mode 100644 index 0000000..9397db6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.image.transparent.1.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = '#f00'; +ctx.shadowOffsetY = 50; +ctx.drawImage(document.getElementById('transparent.png'), 0, -50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.image.transparent.2.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.image.transparent.2.js new file mode 100644 index 0000000..7a5e570 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.image.transparent.2.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 50, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(50, 0, 50, 50); +ctx.shadowOffsetY = 50; +ctx.shadowColor = '#0f0'; +ctx.drawImage(document.getElementById('redtransparent.png'), 50, -50); +ctx.shadowColor = '#f00'; +ctx.drawImage(document.getElementById('redtransparent.png'), -50, -50); + +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.offset.negativeX.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.offset.negativeX.js new file mode 100644 index 0000000..fd0a4a0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.offset.negativeX.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetX = -50; +ctx.fillRect(50, 0, 50, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.offset.negativeY.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.offset.negativeY.js new file mode 100644 index 0000000..29054cc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.offset.negativeY.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetY = -25; +ctx.fillRect(0, 25, 100, 25); +_assertPixel(canvas, 50,12, 0,255,0,255, "50,12", "0,255,0,255"); +_assertPixel(canvas, 50,37, 0,255,0,255, "50,37", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.offset.positiveX.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.offset.positiveX.js new file mode 100644 index 0000000..c07b951 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.offset.positiveX.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetX = 50; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.offset.positiveY.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.offset.positiveY.js new file mode 100644 index 0000000..907c5ce --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.offset.positiveY.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetY = 25; +ctx.fillRect(0, 0, 100, 25); +_assertPixel(canvas, 50,12, 0,255,0,255, "50,12", "0,255,0,255"); +_assertPixel(canvas, 50,37, 0,255,0,255, "50,37", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.outside.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.outside.js new file mode 100644 index 0000000..b87a9c6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.outside.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetX = 100; +ctx.fillRect(-100, 0, 25, 50); +ctx.shadowOffsetX = -100; +ctx.fillRect(175, 0, 25, 50); +ctx.shadowOffsetX = 0; +ctx.shadowOffsetY = 100; +ctx.fillRect(25, -100, 50, 25); +ctx.shadowOffsetY = -100; +ctx.fillRect(25, 125, 50, 25); +_assertPixel(canvas, 12,25, 0,255,0,255, "12,25", "0,255,0,255"); +_assertPixel(canvas, 87,25, 0,255,0,255, "87,25", "0,255,0,255"); +_assertPixel(canvas, 50,12, 0,255,0,255, "50,12", "0,255,0,255"); +_assertPixel(canvas, 50,37, 0,255,0,255, "50,37", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.pattern.alpha.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.pattern.alpha.js new file mode 100644 index 0000000..b362073 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.pattern.alpha.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +var pattern = ctx.createPattern(document.getElementById('transparent50.png'), 'repeat'); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowOffsetY = 50; +ctx.shadowColor = '#00f'; +ctx.fillStyle = pattern; +ctx.fillRect(0, -50, 100, 50); + +_assertPixelApprox(canvas, 50,25, 127,0,127,255, "50,25", "127,0,127,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.pattern.basic.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.pattern.basic.js new file mode 100644 index 0000000..5c15887 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.pattern.basic.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +var pattern = ctx.createPattern(document.getElementById('red.png'), 'repeat'); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetY = 50; +ctx.fillStyle = pattern; +ctx.fillRect(0, -50, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.pattern.transparent.1.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.pattern.transparent.1.js new file mode 100644 index 0000000..721f77f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.pattern.transparent.1.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +var pattern = ctx.createPattern(document.getElementById('transparent.png'), 'repeat'); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = '#f00'; +ctx.shadowOffsetY = 50; +ctx.fillStyle = pattern; +ctx.fillRect(0, -50, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.pattern.transparent.2.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.pattern.transparent.2.js new file mode 100644 index 0000000..acca923 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.pattern.transparent.2.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +var pattern = ctx.createPattern(document.getElementById('redtransparent.png'), 'repeat'); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +ctx.fillStyle = '#0f0'; +ctx.fillRect(50, 0, 50, 50); +ctx.shadowOffsetY = 50; +ctx.shadowColor = '#0f0'; +ctx.fillStyle = pattern; +ctx.fillRect(0, -50, 100, 50); + +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.stroke.basic.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.stroke.basic.js new file mode 100644 index 0000000..7f5b18b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.stroke.basic.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetY = 50; +ctx.beginPath(); +ctx.lineWidth = 50; +ctx.moveTo(0, -25); +ctx.lineTo(100, -25); +ctx.stroke(); + +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.stroke.cap.1.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.stroke.cap.1.js new file mode 100644 index 0000000..236e300 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.stroke.cap.1.js @@ -0,0 +1,22 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.shadowColor = '#f00'; +ctx.shadowOffsetY = 50; +ctx.beginPath(); +ctx.lineWidth = 50; +ctx.lineCap = 'butt'; +ctx.moveTo(-50, -25); +ctx.lineTo(0, -25); +ctx.moveTo(100, -25); +ctx.lineTo(150, -25); +ctx.stroke(); + +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.stroke.cap.2.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.stroke.cap.2.js new file mode 100644 index 0000000..175d0fb --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.stroke.cap.2.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetY = 50; +ctx.beginPath(); +ctx.lineWidth = 50; +ctx.lineCap = 'square'; +ctx.moveTo(25, -25); +ctx.lineTo(75, -25); +ctx.stroke(); + +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.stroke.join.1.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.stroke.join.1.js new file mode 100644 index 0000000..f719a77 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.stroke.join.1.js @@ -0,0 +1,22 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.shadowColor = '#f00'; +ctx.shadowOffsetX = 100; +ctx.lineWidth = 200; +ctx.lineJoin = 'bevel'; +ctx.beginPath(); +ctx.moveTo(-200, -50); +ctx.lineTo(-150, -50); +ctx.lineTo(-151, -100); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.stroke.join.2.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.stroke.join.2.js new file mode 100644 index 0000000..4c27ff3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.stroke.join.2.js @@ -0,0 +1,24 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +ctx.fillStyle = '#0f0'; +ctx.fillRect(50, 0, 50, 50); +ctx.strokeStyle = '#f00'; +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetX = 100; +ctx.lineWidth = 200; +ctx.lineJoin = 'miter'; +ctx.beginPath(); +ctx.moveTo(-200, -50); +ctx.lineTo(-150, -50); +ctx.lineTo(-151, -100); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.stroke.join.3.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.stroke.join.3.js new file mode 100644 index 0000000..304775b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.stroke.join.3.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.shadowColor = '#f00'; +ctx.shadowOffsetX = 100; +ctx.lineWidth = 200; +ctx.lineJoin = 'miter'; +ctx.miterLimit = 0.1; +ctx.beginPath(); +ctx.moveTo(-200, -50); +ctx.lineTo(-150, -50); +ctx.lineTo(-151, -100); // (not an exact right angle, to avoid some other bug in Firefox 3) +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.transform.1.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.transform.1.js new file mode 100644 index 0000000..55b51ec --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.transform.1.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowOffsetY = 50; +ctx.shadowColor = '#0f0'; +ctx.translate(100, 100); +ctx.fillRect(-100, -150, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.shadow.transform.2.js b/platforms/ios/www/test/tests-todo/framed.2d.shadow.transform.2.js new file mode 100644 index 0000000..fb3eece --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.shadow.transform.2.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowOffsetY = 50; +ctx.shadowColor = '#0f0'; +ctx.rotate(Math.PI) +ctx.fillRect(-100, 0, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.bitmap.js b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.bitmap.js new file mode 100644 index 0000000..8f6f459 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.bitmap.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.save(); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.restore(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.clip.js b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.clip.js new file mode 100644 index 0000000..4375086 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.clip.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.save(); +ctx.rect(0, 0, 1, 1); +ctx.clip(); +ctx.restore(); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.fillStyle.js b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.fillStyle.js new file mode 100644 index 0000000..0e5d128 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.fillStyle.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.fillStyle; +ctx.save(); +ctx.fillStyle = "#ff0000"; +ctx.restore(); +_assertSame(ctx.fillStyle, old, "ctx.fillStyle", "old"); + +// Also test that save() doesn't modify the values +ctx.fillStyle = "#ff0000"; +old = ctx.fillStyle; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against "#ff0000" +ctx.save(); +_assertSame(ctx.fillStyle, old, "ctx.fillStyle", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.font.js b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.font.js new file mode 100644 index 0000000..c0d4e3a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.font.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.font; +ctx.save(); +ctx.font = "25px serif"; +ctx.restore(); +_assertSame(ctx.font, old, "ctx.font", "old"); + +// Also test that save() doesn't modify the values +ctx.font = "25px serif"; +old = ctx.font; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against "25px serif" +ctx.save(); +_assertSame(ctx.font, old, "ctx.font", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.globalAlpha.js b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.globalAlpha.js new file mode 100644 index 0000000..f3d6363 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.globalAlpha.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.globalAlpha; +ctx.save(); +ctx.globalAlpha = 0.5; +ctx.restore(); +_assertSame(ctx.globalAlpha, old, "ctx.globalAlpha", "old"); + +// Also test that save() doesn't modify the values +ctx.globalAlpha = 0.5; +old = ctx.globalAlpha; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against 0.5 +ctx.save(); +_assertSame(ctx.globalAlpha, old, "ctx.globalAlpha", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.globalCompositeOperation.js b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.globalCompositeOperation.js new file mode 100644 index 0000000..070093b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.globalCompositeOperation.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.globalCompositeOperation; +ctx.save(); +ctx.globalCompositeOperation = "copy"; +ctx.restore(); +_assertSame(ctx.globalCompositeOperation, old, "ctx.globalCompositeOperation", "old"); + +// Also test that save() doesn't modify the values +ctx.globalCompositeOperation = "copy"; +old = ctx.globalCompositeOperation; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against "copy" +ctx.save(); +_assertSame(ctx.globalCompositeOperation, old, "ctx.globalCompositeOperation", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.lineCap.js b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.lineCap.js new file mode 100644 index 0000000..c8c2cbd --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.lineCap.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.lineCap; +ctx.save(); +ctx.lineCap = "round"; +ctx.restore(); +_assertSame(ctx.lineCap, old, "ctx.lineCap", "old"); + +// Also test that save() doesn't modify the values +ctx.lineCap = "round"; +old = ctx.lineCap; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against "round" +ctx.save(); +_assertSame(ctx.lineCap, old, "ctx.lineCap", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.lineJoin.js b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.lineJoin.js new file mode 100644 index 0000000..fc1a51a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.lineJoin.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.lineJoin; +ctx.save(); +ctx.lineJoin = "round"; +ctx.restore(); +_assertSame(ctx.lineJoin, old, "ctx.lineJoin", "old"); + +// Also test that save() doesn't modify the values +ctx.lineJoin = "round"; +old = ctx.lineJoin; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against "round" +ctx.save(); +_assertSame(ctx.lineJoin, old, "ctx.lineJoin", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.lineWidth.js b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.lineWidth.js new file mode 100644 index 0000000..849a201 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.lineWidth.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.lineWidth; +ctx.save(); +ctx.lineWidth = 0.5; +ctx.restore(); +_assertSame(ctx.lineWidth, old, "ctx.lineWidth", "old"); + +// Also test that save() doesn't modify the values +ctx.lineWidth = 0.5; +old = ctx.lineWidth; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against 0.5 +ctx.save(); +_assertSame(ctx.lineWidth, old, "ctx.lineWidth", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.miterLimit.js b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.miterLimit.js new file mode 100644 index 0000000..9e27575 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.miterLimit.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.miterLimit; +ctx.save(); +ctx.miterLimit = 0.5; +ctx.restore(); +_assertSame(ctx.miterLimit, old, "ctx.miterLimit", "old"); + +// Also test that save() doesn't modify the values +ctx.miterLimit = 0.5; +old = ctx.miterLimit; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against 0.5 +ctx.save(); +_assertSame(ctx.miterLimit, old, "ctx.miterLimit", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.path.js b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.path.js new file mode 100644 index 0000000..cc7234b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.path.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.save(); +ctx.rect(0, 0, 100, 50); +ctx.restore(); +ctx.fillStyle = '#0f0'; +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.shadowBlur.js b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.shadowBlur.js new file mode 100644 index 0000000..e6b6345 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.shadowBlur.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.shadowBlur; +ctx.save(); +ctx.shadowBlur = 5; +ctx.restore(); +_assertSame(ctx.shadowBlur, old, "ctx.shadowBlur", "old"); + +// Also test that save() doesn't modify the values +ctx.shadowBlur = 5; +old = ctx.shadowBlur; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against 5 +ctx.save(); +_assertSame(ctx.shadowBlur, old, "ctx.shadowBlur", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.shadowColor.js b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.shadowColor.js new file mode 100644 index 0000000..ded4349 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.shadowColor.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.shadowColor; +ctx.save(); +ctx.shadowColor = "#ff0000"; +ctx.restore(); +_assertSame(ctx.shadowColor, old, "ctx.shadowColor", "old"); + +// Also test that save() doesn't modify the values +ctx.shadowColor = "#ff0000"; +old = ctx.shadowColor; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against "#ff0000" +ctx.save(); +_assertSame(ctx.shadowColor, old, "ctx.shadowColor", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.shadowOffsetX.js b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.shadowOffsetX.js new file mode 100644 index 0000000..e4eaf54 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.shadowOffsetX.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.shadowOffsetX; +ctx.save(); +ctx.shadowOffsetX = 5; +ctx.restore(); +_assertSame(ctx.shadowOffsetX, old, "ctx.shadowOffsetX", "old"); + +// Also test that save() doesn't modify the values +ctx.shadowOffsetX = 5; +old = ctx.shadowOffsetX; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against 5 +ctx.save(); +_assertSame(ctx.shadowOffsetX, old, "ctx.shadowOffsetX", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.shadowOffsetY.js b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.shadowOffsetY.js new file mode 100644 index 0000000..57066b8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.shadowOffsetY.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.shadowOffsetY; +ctx.save(); +ctx.shadowOffsetY = 5; +ctx.restore(); +_assertSame(ctx.shadowOffsetY, old, "ctx.shadowOffsetY", "old"); + +// Also test that save() doesn't modify the values +ctx.shadowOffsetY = 5; +old = ctx.shadowOffsetY; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against 5 +ctx.save(); +_assertSame(ctx.shadowOffsetY, old, "ctx.shadowOffsetY", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.stack.js b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.stack.js new file mode 100644 index 0000000..8847aa6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.stack.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.lineWidth = 1; +ctx.save(); +ctx.lineWidth = 2; +ctx.save(); +ctx.lineWidth = 3; +_assertEqual(ctx.lineWidth, 3, "ctx.lineWidth", "3"); +ctx.restore(); +_assertEqual(ctx.lineWidth, 2, "ctx.lineWidth", "2"); +ctx.restore(); +_assertEqual(ctx.lineWidth, 1, "ctx.lineWidth", "1"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.stackdepth.js b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.stackdepth.js new file mode 100644 index 0000000..5b38313 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.stackdepth.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +var limit = 512; +for (var i = 1; i < limit; ++i) +{ + ctx.save(); + ctx.lineWidth = i; +} +for (var i = limit-1; i > 0; --i) +{ + _assertEqual(ctx.lineWidth, i, "ctx.lineWidth", "i"); + ctx.restore(); +} + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.strokeStyle.js b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.strokeStyle.js new file mode 100644 index 0000000..22391e8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.strokeStyle.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.strokeStyle; +ctx.save(); +ctx.strokeStyle = "#ff0000"; +ctx.restore(); +_assertSame(ctx.strokeStyle, old, "ctx.strokeStyle", "old"); + +// Also test that save() doesn't modify the values +ctx.strokeStyle = "#ff0000"; +old = ctx.strokeStyle; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against "#ff0000" +ctx.save(); +_assertSame(ctx.strokeStyle, old, "ctx.strokeStyle", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.textAlign.js b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.textAlign.js new file mode 100644 index 0000000..9c88e00 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.textAlign.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.textAlign; +ctx.save(); +ctx.textAlign = "center"; +ctx.restore(); +_assertSame(ctx.textAlign, old, "ctx.textAlign", "old"); + +// Also test that save() doesn't modify the values +ctx.textAlign = "center"; +old = ctx.textAlign; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against "center" +ctx.save(); +_assertSame(ctx.textAlign, old, "ctx.textAlign", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.textBaseline.js b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.textBaseline.js new file mode 100644 index 0000000..0e2e64e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.textBaseline.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.textBaseline; +ctx.save(); +ctx.textBaseline = "bottom"; +ctx.restore(); +_assertSame(ctx.textBaseline, old, "ctx.textBaseline", "old"); + +// Also test that save() doesn't modify the values +ctx.textBaseline = "bottom"; +old = ctx.textBaseline; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against "bottom" +ctx.save(); +_assertSame(ctx.textBaseline, old, "ctx.textBaseline", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.transformation.js b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.transformation.js new file mode 100644 index 0000000..4050b9b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.transformation.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.save(); +ctx.translate(200, 0); +ctx.restore(); +ctx.fillStyle = '#f00'; +ctx.fillRect(-200, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.underflow.js b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.underflow.js new file mode 100644 index 0000000..64aff9c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.state.saverestore.underflow.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +for (var i = 0; i < 16; ++i) + ctx.restore(); +ctx.lineWidth = 0.5; +ctx.restore(); +_assertEqual(ctx.lineWidth, 0.5, "ctx.lineWidth", "0.5"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.strokeRect.basic.js b/platforms/ios/www/test/tests-todo/framed.2d.strokeRect.basic.js new file mode 100644 index 0000000..e64fb73 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.strokeRect.basic.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 50; +ctx.strokeRect(25, 24, 50, 2); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.strokeRect.clip.js b/platforms/ios/www/test/tests-todo/framed.2d.strokeRect.clip.js new file mode 100644 index 0000000..9315308 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.strokeRect.clip.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.beginPath(); +ctx.rect(0, 0, 16, 16); +ctx.clip(); + +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 50; +ctx.strokeRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 16, 16); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.strokeRect.globalalpha.js b/platforms/ios/www/test/tests-todo/framed.2d.strokeRect.globalalpha.js new file mode 100644 index 0000000..faed405 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.strokeRect.globalalpha.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.globalAlpha = 0; +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 50; +ctx.strokeRect(25, 24, 50, 2); +_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.strokeRect.globalcomposite.js b/platforms/ios/www/test/tests-todo/framed.2d.strokeRect.globalcomposite.js new file mode 100644 index 0000000..8c2f596 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.strokeRect.globalcomposite.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.globalCompositeOperation = 'source-in'; +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 50; +ctx.strokeRect(25, 24, 50, 2); +_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.strokeRect.negative.js b/platforms/ios/www/test/tests-todo/framed.2d.strokeRect.negative.js new file mode 100644 index 0000000..337dbb3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.strokeRect.negative.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 25; +ctx.strokeRect(12, 12, 26, 1); +ctx.strokeRect(88, 12, -26, 1); +ctx.strokeRect(12, 38, 26, -1); +ctx.strokeRect(88, 38, -26, -1); +_assertPixel(canvas, 25,12, 0,255,0,255, "25,12", "0,255,0,255"); +_assertPixel(canvas, 75,12, 0,255,0,255, "75,12", "0,255,0,255"); +_assertPixel(canvas, 25,37, 0,255,0,255, "25,37", "0,255,0,255"); +_assertPixel(canvas, 75,37, 0,255,0,255, "75,37", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.strokeRect.nonfinite.js b/platforms/ios/www/test/tests-todo/framed.2d.strokeRect.nonfinite.js new file mode 100644 index 0000000..334e9f6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.strokeRect.nonfinite.js @@ -0,0 +1,35 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 150; +ctx.strokeRect(Infinity, 0, 100, 50); +ctx.strokeRect(-Infinity, 0, 100, 50); +ctx.strokeRect(NaN, 0, 100, 50); +ctx.strokeRect(0, Infinity, 100, 50); +ctx.strokeRect(0, -Infinity, 100, 50); +ctx.strokeRect(0, NaN, 100, 50); +ctx.strokeRect(0, 0, Infinity, 50); +ctx.strokeRect(0, 0, -Infinity, 50); +ctx.strokeRect(0, 0, NaN, 50); +ctx.strokeRect(0, 0, 100, Infinity); +ctx.strokeRect(0, 0, 100, -Infinity); +ctx.strokeRect(0, 0, 100, NaN); +ctx.strokeRect(Infinity, Infinity, 100, 50); +ctx.strokeRect(Infinity, Infinity, Infinity, 50); +ctx.strokeRect(Infinity, Infinity, Infinity, Infinity); +ctx.strokeRect(Infinity, Infinity, 100, Infinity); +ctx.strokeRect(Infinity, 0, Infinity, 50); +ctx.strokeRect(Infinity, 0, Infinity, Infinity); +ctx.strokeRect(Infinity, 0, 100, Infinity); +ctx.strokeRect(0, Infinity, Infinity, 50); +ctx.strokeRect(0, Infinity, Infinity, Infinity); +ctx.strokeRect(0, Infinity, 100, Infinity); +ctx.strokeRect(0, 0, Infinity, Infinity); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.strokeRect.path.js b/platforms/ios/www/test/tests-todo/framed.2d.strokeRect.path.js new file mode 100644 index 0000000..3ed7a86 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.strokeRect.path.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.beginPath(); +ctx.rect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 5; +ctx.strokeRect(0, 0, 16, 16); +ctx.fillStyle = '#0f0'; +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.strokeRect.shadow.js b/platforms/ios/www/test/tests-todo/framed.2d.strokeRect.shadow.js new file mode 100644 index 0000000..6e10988 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.strokeRect.shadow.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.shadowColor = '#0f0'; +ctx.shadowBlur = 0; +ctx.shadowOffsetX = 0; +ctx.shadowOffsetY = 50; +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 50; +ctx.strokeRect(0, -75, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.strokeRect.transform.js b/platforms/ios/www/test/tests-todo/framed.2d.strokeRect.transform.js new file mode 100644 index 0000000..9835d7c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.strokeRect.transform.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.scale(10, 10); +ctx.translate(0, 5); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 5; +ctx.strokeRect(2.5, -2.6, 5, 0.2); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.strokeRect.zero.1.js b/platforms/ios/www/test/tests-todo/framed.2d.strokeRect.zero.1.js new file mode 100644 index 0000000..6ef2399 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.strokeRect.zero.1.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 250; +ctx.strokeRect(50, 25, 0, 0); +_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.strokeRect.zero.2.js b/platforms/ios/www/test/tests-todo/framed.2d.strokeRect.zero.2.js new file mode 100644 index 0000000..14315e1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.strokeRect.zero.2.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 250; +ctx.lineCap = 'round'; +ctx.lineJoin = 'round'; +ctx.strokeRect(50, 25, 0, 0); +_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.strokeRect.zero.3.js b/platforms/ios/www/test/tests-todo/framed.2d.strokeRect.zero.3.js new file mode 100644 index 0000000..759224f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.strokeRect.zero.3.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 50; +ctx.strokeRect(0, 25, 100, 0); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.strokeRect.zero.4.js b/platforms/ios/www/test/tests-todo/framed.2d.strokeRect.zero.4.js new file mode 100644 index 0000000..11461dc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.strokeRect.zero.4.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 250; +ctx.lineCap = 'round'; +ctx.strokeRect(100, 25, 100, 0); +_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.strokeRect.zero.5.js b/platforms/ios/www/test/tests-todo/framed.2d.strokeRect.zero.5.js new file mode 100644 index 0000000..5fb410d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.strokeRect.zero.5.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 250; +ctx.lineJoin = 'round'; +ctx.strokeRect(100, 25, 100, 0); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.strokeStyle.default.js b/platforms/ios/www/test/tests-todo/framed.2d.strokeStyle.default.js new file mode 100644 index 0000000..7f80eb8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.strokeStyle.default.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertEqual(ctx.strokeStyle, '#000000', "ctx.strokeStyle", "'#000000'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.text.align.default.js b/platforms/ios/www/test/tests-todo/framed.2d.text.align.default.js new file mode 100644 index 0000000..172f8cb --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.text.align.default.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(ctx.textAlign, 'start', "ctx.textAlign", "'start'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.text.align.invalid.js b/platforms/ios/www/test/tests-todo/framed.2d.text.align.invalid.js new file mode 100644 index 0000000..95f9e13 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.text.align.invalid.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +ctx.textAlign = 'start'; +ctx.textAlign = 'bogus'; +_assertSame(ctx.textAlign, 'start', "ctx.textAlign", "'start'"); + +ctx.textAlign = 'start'; +ctx.textAlign = 'END'; +_assertSame(ctx.textAlign, 'start', "ctx.textAlign", "'start'"); + +ctx.textAlign = 'start'; +ctx.textAlign = 'end '; +_assertSame(ctx.textAlign, 'start', "ctx.textAlign", "'start'"); + +ctx.textAlign = 'start'; +ctx.textAlign = 'end\0'; +_assertSame(ctx.textAlign, 'start', "ctx.textAlign", "'start'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.text.align.valid.js b/platforms/ios/www/test/tests-todo/framed.2d.text.align.valid.js new file mode 100644 index 0000000..c59a065 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.text.align.valid.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.textAlign = 'start'; +_assertSame(ctx.textAlign, 'start', "ctx.textAlign", "'start'"); + +ctx.textAlign = 'end'; +_assertSame(ctx.textAlign, 'end', "ctx.textAlign", "'end'"); + +ctx.textAlign = 'left'; +_assertSame(ctx.textAlign, 'left', "ctx.textAlign", "'left'"); + +ctx.textAlign = 'right'; +_assertSame(ctx.textAlign, 'right', "ctx.textAlign", "'right'"); + +ctx.textAlign = 'center'; +_assertSame(ctx.textAlign, 'center', "ctx.textAlign", "'center'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.text.baseline.default.js b/platforms/ios/www/test/tests-todo/framed.2d.text.baseline.default.js new file mode 100644 index 0000000..c6b84c9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.text.baseline.default.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(ctx.textBaseline, 'alphabetic', "ctx.textBaseline", "'alphabetic'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.text.baseline.invalid.js b/platforms/ios/www/test/tests-todo/framed.2d.text.baseline.invalid.js new file mode 100644 index 0000000..3002e28 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.text.baseline.invalid.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +ctx.textBaseline = 'top'; +ctx.textBaseline = 'bogus'; +_assertSame(ctx.textBaseline, 'top', "ctx.textBaseline", "'top'"); + +ctx.textBaseline = 'top'; +ctx.textBaseline = 'MIDDLE'; +_assertSame(ctx.textBaseline, 'top', "ctx.textBaseline", "'top'"); + +ctx.textBaseline = 'top'; +ctx.textBaseline = 'middle '; +_assertSame(ctx.textBaseline, 'top', "ctx.textBaseline", "'top'"); + +ctx.textBaseline = 'top'; +ctx.textBaseline = 'middle\0'; +_assertSame(ctx.textBaseline, 'top', "ctx.textBaseline", "'top'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.text.baseline.valid.js b/platforms/ios/www/test/tests-todo/framed.2d.text.baseline.valid.js new file mode 100644 index 0000000..406d664 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.text.baseline.valid.js @@ -0,0 +1,22 @@ +_addTest(function(canvas, ctx) { + +ctx.textBaseline = 'top'; +_assertSame(ctx.textBaseline, 'top', "ctx.textBaseline", "'top'"); + +ctx.textBaseline = 'hanging'; +_assertSame(ctx.textBaseline, 'hanging', "ctx.textBaseline", "'hanging'"); + +ctx.textBaseline = 'middle'; +_assertSame(ctx.textBaseline, 'middle', "ctx.textBaseline", "'middle'"); + +ctx.textBaseline = 'alphabetic'; +_assertSame(ctx.textBaseline, 'alphabetic', "ctx.textBaseline", "'alphabetic'"); + +ctx.textBaseline = 'ideographic'; +_assertSame(ctx.textBaseline, 'ideographic', "ctx.textBaseline", "'ideographic'"); + +ctx.textBaseline = 'bottom'; +_assertSame(ctx.textBaseline, 'bottom', "ctx.textBaseline", "'bottom'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.text.draw.align.center.js b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.align.center.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.align.center.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.text.draw.align.end.ltr.js b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.align.end.ltr.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.align.end.ltr.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.text.draw.align.end.rtl.js b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.align.end.rtl.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.align.end.rtl.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.text.draw.align.left.js b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.align.left.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.align.left.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.text.draw.align.right.js b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.align.right.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.align.right.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.text.draw.align.start.ltr.js b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.align.start.ltr.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.align.start.ltr.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.text.draw.align.start.rtl.js b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.align.start.rtl.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.align.start.rtl.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.text.draw.baseline.alphabetic.js b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.baseline.alphabetic.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.baseline.alphabetic.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.text.draw.baseline.bottom.js b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.baseline.bottom.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.baseline.bottom.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.text.draw.baseline.hanging.js b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.baseline.hanging.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.baseline.hanging.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.text.draw.baseline.ideographic.js b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.baseline.ideographic.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.baseline.ideographic.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.text.draw.baseline.middle.js b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.baseline.middle.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.baseline.middle.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.text.draw.baseline.top.js b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.baseline.top.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.baseline.top.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.text.draw.fill.basic.js b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.fill.basic.js new file mode 100644 index 0000000..0319659 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.fill.basic.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#000'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.strokeStyle = '#f00'; +ctx.font = '35px Arial, sans-serif'; +ctx.fillText('PASS', 5, 35); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.text.draw.fill.maxWidth.bound.js b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.fill.maxWidth.bound.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.fill.maxWidth.bound.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.text.draw.fill.maxWidth.fontface.js b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.fill.maxWidth.fontface.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.fill.maxWidth.fontface.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.text.draw.fill.maxWidth.large.js b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.fill.maxWidth.large.js new file mode 100644 index 0000000..e168e3e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.fill.maxWidth.large.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#000'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.font = '35px Arial, sans-serif'; +ctx.fillText('PASS', 5, 35, 200); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.text.draw.fill.maxWidth.small.js b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.fill.maxWidth.small.js new file mode 100644 index 0000000..3d8cd0b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.fill.maxWidth.small.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.font = '35px Arial, sans-serif'; +ctx.fillText('fail fail fail fail fail', -100, 35, 90); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.text.draw.fill.maxWidth.zero.js b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.fill.maxWidth.zero.js new file mode 100644 index 0000000..26c430d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.fill.maxWidth.zero.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.font = '35px Arial, sans-serif'; +ctx.fillText('fail fail fail fail fail', 5, 35, 0); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.text.draw.fill.rtl.js b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.fill.rtl.js new file mode 100644 index 0000000..da865fb --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.fill.rtl.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#000'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.strokeStyle = '#f00'; +ctx.font = '35px Arial, sans-serif'; +ctx.fillText('\u202eFAIL \xa0 \xa0 SSAP', 5, 35); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.text.draw.fill.unaffected.js b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.fill.unaffected.js new file mode 100644 index 0000000..10b63bd --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.fill.unaffected.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.moveTo(0, 0); +ctx.lineTo(100, 0); + +ctx.font = '35px Arial, sans-serif'; +ctx.fillText('FAIL', 5, 35); + +ctx.lineTo(100, 50); +ctx.lineTo(0, 50); +ctx.fillStyle = '#0f0'; +ctx.fill(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 5,45, 0,255,0,255, "5,45", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.text.draw.fontface.js b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.fontface.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.fontface.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.text.draw.fontface.notinpage.js b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.fontface.notinpage.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.fontface.notinpage.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.text.draw.fontface.repeat.js b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.fontface.repeat.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.fontface.repeat.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.text.draw.space.collapse.end.js b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.space.collapse.end.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.space.collapse.end.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.text.draw.space.collapse.nonspace.js b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.space.collapse.nonspace.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.space.collapse.nonspace.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.text.draw.space.collapse.other.js b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.space.collapse.other.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.space.collapse.other.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.text.draw.space.collapse.space.js b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.space.collapse.space.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.space.collapse.space.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.text.draw.space.collapse.start.js b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.space.collapse.start.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.text.draw.space.collapse.start.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.text.font.default.js b/platforms/ios/www/test/tests-todo/framed.2d.text.font.default.js new file mode 100644 index 0000000..80821d0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.text.font.default.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(ctx.font, '10px sans-serif', "ctx.font", "'10px sans-serif'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.text.font.parse.basic.js b/platforms/ios/www/test/tests-todo/framed.2d.text.font.parse.basic.js new file mode 100644 index 0000000..24d505a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.text.font.parse.basic.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.font = '20px serif'; +_assertSame(ctx.font, '20px serif', "ctx.font", "'20px serif'"); + +ctx.font = '20PX SERIF'; +_assertSame(ctx.font, '20px serif', "ctx.font", "'20px serif'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.text.font.parse.complex.js b/platforms/ios/www/test/tests-todo/framed.2d.text.font.parse.complex.js new file mode 100644 index 0000000..0d4449b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.text.font.parse.complex.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +ctx.font = 'small-caps italic 400 12px/2 Unknown Font, sans-serif'; +_assertSame(ctx.font, 'italic small-caps 12px "Unknown Font", sans-serif', "ctx.font", "'italic small-caps 12px \"Unknown Font\", sans-serif'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.text.font.parse.size.percentage.default.js b/platforms/ios/www/test/tests-todo/framed.2d.text.font.parse.size.percentage.default.js new file mode 100644 index 0000000..fcf9e9f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.text.font.parse.size.percentage.default.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +var ctx2 = canvas2.getContext('2d'); +ctx.font = '1000% serif'; +_assertSame(ctx.font, '100px serif', "ctx.font", "'100px serif'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.text.font.parse.system.js b/platforms/ios/www/test/tests-todo/framed.2d.text.font.parse.system.js new file mode 100644 index 0000000..844742e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.text.font.parse.system.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +ctx.font = 'message-box'; +_assertDifferent(ctx.font, 'message-box', "ctx.font", "'message-box'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.transformation.order.js b/platforms/ios/www/test/tests-todo/framed.2d.transformation.order.js new file mode 100644 index 0000000..0bc0790 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.transformation.order.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.scale(2, 1); +ctx.rotate(Math.PI / 2); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, -50, 50, 50); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.transformation.rotate.radians.js b/platforms/ios/www/test/tests-todo/framed.2d.transformation.rotate.radians.js new file mode 100644 index 0000000..6fe1650 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.transformation.rotate.radians.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.rotate(Math.PI); // should fail obviously if this is 3.1 degrees +ctx.fillStyle = '#0f0'; +ctx.fillRect(-100, -50, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.transformation.rotate.wrap.js b/platforms/ios/www/test/tests-todo/framed.2d.transformation.rotate.wrap.js new file mode 100644 index 0000000..a079b58 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.transformation.rotate.wrap.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.rotate(Math.PI * (1 + 4096)); // == pi (mod 2*pi) +// We need about pi +/- 0.001 in order to get correct-looking results +// 32-bit floats can store pi*4097 with precision 2^-10, so that should +// be safe enough on reasonable implementations +ctx.fillStyle = '#0f0'; +ctx.fillRect(-100, -50, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,2, 0,255,0,255, "98,2", "0,255,0,255"); +_assertPixel(canvas, 98,47, 0,255,0,255, "98,47", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.transformation.rotate.wrapnegative.js b/platforms/ios/www/test/tests-todo/framed.2d.transformation.rotate.wrapnegative.js new file mode 100644 index 0000000..58a6015 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.transformation.rotate.wrapnegative.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.rotate(-Math.PI * (1 + 4096)); +ctx.fillStyle = '#0f0'; +ctx.fillRect(-100, -50, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,2, 0,255,0,255, "98,2", "0,255,0,255"); +_assertPixel(canvas, 98,47, 0,255,0,255, "98,47", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.transformation.rotate.zero.js b/platforms/ios/www/test/tests-todo/framed.2d.transformation.rotate.zero.js new file mode 100644 index 0000000..d752131 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.transformation.rotate.zero.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.rotate(0); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.transformation.scale.basic.js b/platforms/ios/www/test/tests-todo/framed.2d.transformation.scale.basic.js new file mode 100644 index 0000000..7e7ef5b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.transformation.scale.basic.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.scale(2, 4); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 50, 12.5); +_assertPixel(canvas, 90,40, 0,255,0,255, "90,40", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.transformation.scale.large.js b/platforms/ios/www/test/tests-todo/framed.2d.transformation.scale.large.js new file mode 100644 index 0000000..8cdc2b3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.transformation.scale.large.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.scale(1e5, 1e5); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 1, 1); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.transformation.scale.multiple.js b/platforms/ios/www/test/tests-todo/framed.2d.transformation.scale.multiple.js new file mode 100644 index 0000000..4f2345f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.transformation.scale.multiple.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.scale(Math.sqrt(2), Math.sqrt(2)); +ctx.scale(Math.sqrt(2), Math.sqrt(2)); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 50, 25); +_assertPixel(canvas, 90,40, 0,255,0,255, "90,40", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.transformation.scale.negative.js b/platforms/ios/www/test/tests-todo/framed.2d.transformation.scale.negative.js new file mode 100644 index 0000000..c25972b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.transformation.scale.negative.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.save(); +ctx.scale(-1, 1); +ctx.fillStyle = '#0f0'; +ctx.fillRect(-50, 0, 50, 50); +ctx.restore(); + +ctx.save(); +ctx.scale(1, -1); +ctx.fillStyle = '#0f0'; +ctx.fillRect(50, -50, 50, 50); +ctx.restore(); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.transformation.scale.nonfinite.js b/platforms/ios/www/test/tests-todo/framed.2d.transformation.scale.nonfinite.js new file mode 100644 index 0000000..7cdc79f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.transformation.scale.nonfinite.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.translate(100, 10); +ctx.scale(Infinity, 0.1); +ctx.scale(-Infinity, 0.1); +ctx.scale(NaN, 0.1); +ctx.scale(0.1, Infinity); +ctx.scale(0.1, -Infinity); +ctx.scale(0.1, NaN); +ctx.scale(Infinity, Infinity); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(-100, -10, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.transformation.scale.zero.js b/platforms/ios/www/test/tests-todo/framed.2d.transformation.scale.zero.js new file mode 100644 index 0000000..2d7daf1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.transformation.scale.zero.js @@ -0,0 +1,26 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.save(); +ctx.translate(50, 0); +ctx.scale(0, 1); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.restore(); + +ctx.save(); +ctx.translate(0, 25); +ctx.scale(1, 0); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.restore(); + +// Firefox has a bug where it renders the canvas as empty and toDataURL throws an exception +canvas.toDataURL(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.transformation.setTransform.multiple.js b/platforms/ios/www/test/tests-todo/framed.2d.transformation.setTransform.multiple.js new file mode 100644 index 0000000..28baaaf --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.transformation.setTransform.multiple.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.setTransform(1/2,0, 0,1/2, 0,0); +ctx.setTransform(2,0, 0,2, 0,0); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 50, 25); +_assertPixel(canvas, 75,35, 0,255,0,255, "75,35", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.transformation.setTransform.nonfinite.js b/platforms/ios/www/test/tests-todo/framed.2d.transformation.setTransform.nonfinite.js new file mode 100644 index 0000000..381afd7 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.transformation.setTransform.nonfinite.js @@ -0,0 +1,89 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.translate(100, 10); +ctx.setTransform(Infinity, 0, 0, 0, 0, 0); +ctx.setTransform(-Infinity, 0, 0, 0, 0, 0); +ctx.setTransform(NaN, 0, 0, 0, 0, 0); +ctx.setTransform(0, Infinity, 0, 0, 0, 0); +ctx.setTransform(0, -Infinity, 0, 0, 0, 0); +ctx.setTransform(0, NaN, 0, 0, 0, 0); +ctx.setTransform(0, 0, Infinity, 0, 0, 0); +ctx.setTransform(0, 0, -Infinity, 0, 0, 0); +ctx.setTransform(0, 0, NaN, 0, 0, 0); +ctx.setTransform(0, 0, 0, Infinity, 0, 0); +ctx.setTransform(0, 0, 0, -Infinity, 0, 0); +ctx.setTransform(0, 0, 0, NaN, 0, 0); +ctx.setTransform(0, 0, 0, 0, Infinity, 0); +ctx.setTransform(0, 0, 0, 0, -Infinity, 0); +ctx.setTransform(0, 0, 0, 0, NaN, 0); +ctx.setTransform(0, 0, 0, 0, 0, Infinity); +ctx.setTransform(0, 0, 0, 0, 0, -Infinity); +ctx.setTransform(0, 0, 0, 0, 0, NaN); +ctx.setTransform(Infinity, Infinity, 0, 0, 0, 0); +ctx.setTransform(Infinity, Infinity, Infinity, 0, 0, 0); +ctx.setTransform(Infinity, Infinity, Infinity, Infinity, 0, 0); +ctx.setTransform(Infinity, Infinity, Infinity, Infinity, Infinity, 0); +ctx.setTransform(Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); +ctx.setTransform(Infinity, Infinity, Infinity, Infinity, 0, Infinity); +ctx.setTransform(Infinity, Infinity, Infinity, 0, Infinity, 0); +ctx.setTransform(Infinity, Infinity, Infinity, 0, Infinity, Infinity); +ctx.setTransform(Infinity, Infinity, Infinity, 0, 0, Infinity); +ctx.setTransform(Infinity, Infinity, 0, Infinity, 0, 0); +ctx.setTransform(Infinity, Infinity, 0, Infinity, Infinity, 0); +ctx.setTransform(Infinity, Infinity, 0, Infinity, Infinity, Infinity); +ctx.setTransform(Infinity, Infinity, 0, Infinity, 0, Infinity); +ctx.setTransform(Infinity, Infinity, 0, 0, Infinity, 0); +ctx.setTransform(Infinity, Infinity, 0, 0, Infinity, Infinity); +ctx.setTransform(Infinity, Infinity, 0, 0, 0, Infinity); +ctx.setTransform(Infinity, 0, Infinity, 0, 0, 0); +ctx.setTransform(Infinity, 0, Infinity, Infinity, 0, 0); +ctx.setTransform(Infinity, 0, Infinity, Infinity, Infinity, 0); +ctx.setTransform(Infinity, 0, Infinity, Infinity, Infinity, Infinity); +ctx.setTransform(Infinity, 0, Infinity, Infinity, 0, Infinity); +ctx.setTransform(Infinity, 0, Infinity, 0, Infinity, 0); +ctx.setTransform(Infinity, 0, Infinity, 0, Infinity, Infinity); +ctx.setTransform(Infinity, 0, Infinity, 0, 0, Infinity); +ctx.setTransform(Infinity, 0, 0, Infinity, 0, 0); +ctx.setTransform(Infinity, 0, 0, Infinity, Infinity, 0); +ctx.setTransform(Infinity, 0, 0, Infinity, Infinity, Infinity); +ctx.setTransform(Infinity, 0, 0, Infinity, 0, Infinity); +ctx.setTransform(Infinity, 0, 0, 0, Infinity, 0); +ctx.setTransform(Infinity, 0, 0, 0, Infinity, Infinity); +ctx.setTransform(Infinity, 0, 0, 0, 0, Infinity); +ctx.setTransform(0, Infinity, Infinity, 0, 0, 0); +ctx.setTransform(0, Infinity, Infinity, Infinity, 0, 0); +ctx.setTransform(0, Infinity, Infinity, Infinity, Infinity, 0); +ctx.setTransform(0, Infinity, Infinity, Infinity, Infinity, Infinity); +ctx.setTransform(0, Infinity, Infinity, Infinity, 0, Infinity); +ctx.setTransform(0, Infinity, Infinity, 0, Infinity, 0); +ctx.setTransform(0, Infinity, Infinity, 0, Infinity, Infinity); +ctx.setTransform(0, Infinity, Infinity, 0, 0, Infinity); +ctx.setTransform(0, Infinity, 0, Infinity, 0, 0); +ctx.setTransform(0, Infinity, 0, Infinity, Infinity, 0); +ctx.setTransform(0, Infinity, 0, Infinity, Infinity, Infinity); +ctx.setTransform(0, Infinity, 0, Infinity, 0, Infinity); +ctx.setTransform(0, Infinity, 0, 0, Infinity, 0); +ctx.setTransform(0, Infinity, 0, 0, Infinity, Infinity); +ctx.setTransform(0, Infinity, 0, 0, 0, Infinity); +ctx.setTransform(0, 0, Infinity, Infinity, 0, 0); +ctx.setTransform(0, 0, Infinity, Infinity, Infinity, 0); +ctx.setTransform(0, 0, Infinity, Infinity, Infinity, Infinity); +ctx.setTransform(0, 0, Infinity, Infinity, 0, Infinity); +ctx.setTransform(0, 0, Infinity, 0, Infinity, 0); +ctx.setTransform(0, 0, Infinity, 0, Infinity, Infinity); +ctx.setTransform(0, 0, Infinity, 0, 0, Infinity); +ctx.setTransform(0, 0, 0, Infinity, Infinity, 0); +ctx.setTransform(0, 0, 0, Infinity, Infinity, Infinity); +ctx.setTransform(0, 0, 0, Infinity, 0, Infinity); +ctx.setTransform(0, 0, 0, 0, Infinity, Infinity); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(-100, -10, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.transformation.setTransform.skewed.js b/platforms/ios/www/test/tests-todo/framed.2d.transformation.setTransform.skewed.js new file mode 100644 index 0000000..325b5c6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.transformation.setTransform.skewed.js @@ -0,0 +1,34 @@ +_addTest(function(canvas, ctx) { + +// Create green with a red square ring inside it +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(20, 10, 60, 30); +ctx.fillStyle = '#0f0'; +ctx.fillRect(40, 20, 20, 10); + +// Draw a skewed shape to fill that gap, to make sure it is aligned correctly +ctx.setTransform(1,4, 2,3, 5,6); +// Post-transform coordinates: +// [[20,10],[80,10],[80,40],[20,40],[20,10],[40,20],[40,30],[60,30],[60,20],[40,20],[20,10]]; +// Hence pre-transform coordinates: +var pts=[[-7.4,11.2],[-43.4,59.2],[-31.4,53.2],[4.6,5.2],[-7.4,11.2], + [-15.4,25.2],[-11.4,23.2],[-23.4,39.2],[-27.4,41.2],[-15.4,25.2], + [-7.4,11.2]]; +ctx.beginPath(); +ctx.moveTo(pts[0][0], pts[0][1]); +for (var i = 0; i < pts.length; ++i) + ctx.lineTo(pts[i][0], pts[i][1]); +ctx.fill(); +_assertPixel(canvas, 21,11, 0,255,0,255, "21,11", "0,255,0,255"); +_assertPixel(canvas, 79,11, 0,255,0,255, "79,11", "0,255,0,255"); +_assertPixel(canvas, 21,39, 0,255,0,255, "21,39", "0,255,0,255"); +_assertPixel(canvas, 79,39, 0,255,0,255, "79,39", "0,255,0,255"); +_assertPixel(canvas, 39,19, 0,255,0,255, "39,19", "0,255,0,255"); +_assertPixel(canvas, 61,19, 0,255,0,255, "61,19", "0,255,0,255"); +_assertPixel(canvas, 39,31, 0,255,0,255, "39,31", "0,255,0,255"); +_assertPixel(canvas, 61,31, 0,255,0,255, "61,31", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.transformation.transform.identity.js b/platforms/ios/www/test/tests-todo/framed.2d.transformation.transform.identity.js new file mode 100644 index 0000000..2b8e39f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.transformation.transform.identity.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.transform(1,0, 0,1, 0,0); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.transformation.transform.multiply.js b/platforms/ios/www/test/tests-todo/framed.2d.transformation.transform.multiply.js new file mode 100644 index 0000000..f91ed59 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.transformation.transform.multiply.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.transform(1,2, 3,4, 5,6); +ctx.transform(-2,1, 3/2,-1/2, 1,-2); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.transformation.transform.nonfinite.js b/platforms/ios/www/test/tests-todo/framed.2d.transformation.transform.nonfinite.js new file mode 100644 index 0000000..e8eaec2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.transformation.transform.nonfinite.js @@ -0,0 +1,89 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.translate(100, 10); +ctx.transform(Infinity, 0, 0, 0, 0, 0); +ctx.transform(-Infinity, 0, 0, 0, 0, 0); +ctx.transform(NaN, 0, 0, 0, 0, 0); +ctx.transform(0, Infinity, 0, 0, 0, 0); +ctx.transform(0, -Infinity, 0, 0, 0, 0); +ctx.transform(0, NaN, 0, 0, 0, 0); +ctx.transform(0, 0, Infinity, 0, 0, 0); +ctx.transform(0, 0, -Infinity, 0, 0, 0); +ctx.transform(0, 0, NaN, 0, 0, 0); +ctx.transform(0, 0, 0, Infinity, 0, 0); +ctx.transform(0, 0, 0, -Infinity, 0, 0); +ctx.transform(0, 0, 0, NaN, 0, 0); +ctx.transform(0, 0, 0, 0, Infinity, 0); +ctx.transform(0, 0, 0, 0, -Infinity, 0); +ctx.transform(0, 0, 0, 0, NaN, 0); +ctx.transform(0, 0, 0, 0, 0, Infinity); +ctx.transform(0, 0, 0, 0, 0, -Infinity); +ctx.transform(0, 0, 0, 0, 0, NaN); +ctx.transform(Infinity, Infinity, 0, 0, 0, 0); +ctx.transform(Infinity, Infinity, Infinity, 0, 0, 0); +ctx.transform(Infinity, Infinity, Infinity, Infinity, 0, 0); +ctx.transform(Infinity, Infinity, Infinity, Infinity, Infinity, 0); +ctx.transform(Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); +ctx.transform(Infinity, Infinity, Infinity, Infinity, 0, Infinity); +ctx.transform(Infinity, Infinity, Infinity, 0, Infinity, 0); +ctx.transform(Infinity, Infinity, Infinity, 0, Infinity, Infinity); +ctx.transform(Infinity, Infinity, Infinity, 0, 0, Infinity); +ctx.transform(Infinity, Infinity, 0, Infinity, 0, 0); +ctx.transform(Infinity, Infinity, 0, Infinity, Infinity, 0); +ctx.transform(Infinity, Infinity, 0, Infinity, Infinity, Infinity); +ctx.transform(Infinity, Infinity, 0, Infinity, 0, Infinity); +ctx.transform(Infinity, Infinity, 0, 0, Infinity, 0); +ctx.transform(Infinity, Infinity, 0, 0, Infinity, Infinity); +ctx.transform(Infinity, Infinity, 0, 0, 0, Infinity); +ctx.transform(Infinity, 0, Infinity, 0, 0, 0); +ctx.transform(Infinity, 0, Infinity, Infinity, 0, 0); +ctx.transform(Infinity, 0, Infinity, Infinity, Infinity, 0); +ctx.transform(Infinity, 0, Infinity, Infinity, Infinity, Infinity); +ctx.transform(Infinity, 0, Infinity, Infinity, 0, Infinity); +ctx.transform(Infinity, 0, Infinity, 0, Infinity, 0); +ctx.transform(Infinity, 0, Infinity, 0, Infinity, Infinity); +ctx.transform(Infinity, 0, Infinity, 0, 0, Infinity); +ctx.transform(Infinity, 0, 0, Infinity, 0, 0); +ctx.transform(Infinity, 0, 0, Infinity, Infinity, 0); +ctx.transform(Infinity, 0, 0, Infinity, Infinity, Infinity); +ctx.transform(Infinity, 0, 0, Infinity, 0, Infinity); +ctx.transform(Infinity, 0, 0, 0, Infinity, 0); +ctx.transform(Infinity, 0, 0, 0, Infinity, Infinity); +ctx.transform(Infinity, 0, 0, 0, 0, Infinity); +ctx.transform(0, Infinity, Infinity, 0, 0, 0); +ctx.transform(0, Infinity, Infinity, Infinity, 0, 0); +ctx.transform(0, Infinity, Infinity, Infinity, Infinity, 0); +ctx.transform(0, Infinity, Infinity, Infinity, Infinity, Infinity); +ctx.transform(0, Infinity, Infinity, Infinity, 0, Infinity); +ctx.transform(0, Infinity, Infinity, 0, Infinity, 0); +ctx.transform(0, Infinity, Infinity, 0, Infinity, Infinity); +ctx.transform(0, Infinity, Infinity, 0, 0, Infinity); +ctx.transform(0, Infinity, 0, Infinity, 0, 0); +ctx.transform(0, Infinity, 0, Infinity, Infinity, 0); +ctx.transform(0, Infinity, 0, Infinity, Infinity, Infinity); +ctx.transform(0, Infinity, 0, Infinity, 0, Infinity); +ctx.transform(0, Infinity, 0, 0, Infinity, 0); +ctx.transform(0, Infinity, 0, 0, Infinity, Infinity); +ctx.transform(0, Infinity, 0, 0, 0, Infinity); +ctx.transform(0, 0, Infinity, Infinity, 0, 0); +ctx.transform(0, 0, Infinity, Infinity, Infinity, 0); +ctx.transform(0, 0, Infinity, Infinity, Infinity, Infinity); +ctx.transform(0, 0, Infinity, Infinity, 0, Infinity); +ctx.transform(0, 0, Infinity, 0, Infinity, 0); +ctx.transform(0, 0, Infinity, 0, Infinity, Infinity); +ctx.transform(0, 0, Infinity, 0, 0, Infinity); +ctx.transform(0, 0, 0, Infinity, Infinity, 0); +ctx.transform(0, 0, 0, Infinity, Infinity, Infinity); +ctx.transform(0, 0, 0, Infinity, 0, Infinity); +ctx.transform(0, 0, 0, 0, Infinity, Infinity); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(-100, -10, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.transformation.transform.skewed.js b/platforms/ios/www/test/tests-todo/framed.2d.transformation.transform.skewed.js new file mode 100644 index 0000000..b1d8424 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.transformation.transform.skewed.js @@ -0,0 +1,34 @@ +_addTest(function(canvas, ctx) { + +// Create green with a red square ring inside it +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(20, 10, 60, 30); +ctx.fillStyle = '#0f0'; +ctx.fillRect(40, 20, 20, 10); + +// Draw a skewed shape to fill that gap, to make sure it is aligned correctly +ctx.transform(1,4, 2,3, 5,6); +// Post-transform coordinates: +// [[20,10],[80,10],[80,40],[20,40],[20,10],[40,20],[40,30],[60,30],[60,20],[40,20],[20,10]]; +// Hence pre-transform coordinates: +var pts=[[-7.4,11.2],[-43.4,59.2],[-31.4,53.2],[4.6,5.2],[-7.4,11.2], + [-15.4,25.2],[-11.4,23.2],[-23.4,39.2],[-27.4,41.2],[-15.4,25.2], + [-7.4,11.2]]; +ctx.beginPath(); +ctx.moveTo(pts[0][0], pts[0][1]); +for (var i = 0; i < pts.length; ++i) + ctx.lineTo(pts[i][0], pts[i][1]); +ctx.fill(); +_assertPixel(canvas, 21,11, 0,255,0,255, "21,11", "0,255,0,255"); +_assertPixel(canvas, 79,11, 0,255,0,255, "79,11", "0,255,0,255"); +_assertPixel(canvas, 21,39, 0,255,0,255, "21,39", "0,255,0,255"); +_assertPixel(canvas, 79,39, 0,255,0,255, "79,39", "0,255,0,255"); +_assertPixel(canvas, 39,19, 0,255,0,255, "39,19", "0,255,0,255"); +_assertPixel(canvas, 61,19, 0,255,0,255, "61,19", "0,255,0,255"); +_assertPixel(canvas, 39,31, 0,255,0,255, "39,31", "0,255,0,255"); +_assertPixel(canvas, 61,31, 0,255,0,255, "61,31", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.transformation.translate.basic.js b/platforms/ios/www/test/tests-todo/framed.2d.transformation.translate.basic.js new file mode 100644 index 0000000..5ab55cc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.transformation.translate.basic.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.translate(100, 50); +ctx.fillStyle = '#0f0'; +ctx.fillRect(-100, -50, 100, 50); +_assertPixel(canvas, 90,40, 0,255,0,255, "90,40", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.transformation.translate.nonfinite.js b/platforms/ios/www/test/tests-todo/framed.2d.transformation.translate.nonfinite.js new file mode 100644 index 0000000..616d328 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.transformation.translate.nonfinite.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.translate(100, 10); +ctx.translate(Infinity, 0.1); +ctx.translate(-Infinity, 0.1); +ctx.translate(NaN, 0.1); +ctx.translate(0.1, Infinity); +ctx.translate(0.1, -Infinity); +ctx.translate(0.1, NaN); +ctx.translate(Infinity, Infinity); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(-100, -10, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.2d.voidreturn.js b/platforms/ios/www/test/tests-todo/framed.2d.voidreturn.js new file mode 100644 index 0000000..b419b77 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.2d.voidreturn.js @@ -0,0 +1,41 @@ +_addTest(function(canvas, ctx) { + +_assertSame(ctx.save(), undefined, "ctx.save()", "undefined"); +_assertSame(ctx.restore(), undefined, "ctx.restore()", "undefined"); +_assertSame(ctx.scale(1, 1), undefined, "ctx.scale(1, 1)", "undefined"); +_assertSame(ctx.rotate(0), undefined, "ctx.rotate(0)", "undefined"); +_assertSame(ctx.translate(0, 0), undefined, "ctx.translate(0, 0)", "undefined"); +if (ctx.transform) { // (avoid spurious failures, since the aim here is not to test that all features are supported) + _assertSame(ctx.transform(1, 0, 0, 1, 0, 0), undefined, "ctx.transform(1, 0, 0, 1, 0, 0)", "undefined"); +} +if (ctx.setTransform) { + _assertSame(ctx.setTransform(1, 0, 0, 1, 0, 0), undefined, "ctx.setTransform(1, 0, 0, 1, 0, 0)", "undefined"); +} +_assertSame(ctx.clearRect(0, 0, 0, 0), undefined, "ctx.clearRect(0, 0, 0, 0)", "undefined"); +_assertSame(ctx.fillRect(0, 0, 0, 0), undefined, "ctx.fillRect(0, 0, 0, 0)", "undefined"); +_assertSame(ctx.strokeRect(0, 0, 0, 0), undefined, "ctx.strokeRect(0, 0, 0, 0)", "undefined"); +_assertSame(ctx.beginPath(), undefined, "ctx.beginPath()", "undefined"); +_assertSame(ctx.closePath(), undefined, "ctx.closePath()", "undefined"); +_assertSame(ctx.moveTo(0, 0), undefined, "ctx.moveTo(0, 0)", "undefined"); +_assertSame(ctx.lineTo(0, 0), undefined, "ctx.lineTo(0, 0)", "undefined"); +_assertSame(ctx.quadraticCurveTo(0, 0, 0, 0), undefined, "ctx.quadraticCurveTo(0, 0, 0, 0)", "undefined"); +_assertSame(ctx.bezierCurveTo(0, 0, 0, 0, 0, 0), undefined, "ctx.bezierCurveTo(0, 0, 0, 0, 0, 0)", "undefined"); +_assertSame(ctx.arcTo(0, 0, 0, 0, 1), undefined, "ctx.arcTo(0, 0, 0, 0, 1)", "undefined"); +_assertSame(ctx.rect(0, 0, 0, 0), undefined, "ctx.rect(0, 0, 0, 0)", "undefined"); +_assertSame(ctx.arc(0, 0, 1, 0, 0, true), undefined, "ctx.arc(0, 0, 1, 0, 0, true)", "undefined"); +_assertSame(ctx.fill(), undefined, "ctx.fill()", "undefined"); +_assertSame(ctx.stroke(), undefined, "ctx.stroke()", "undefined"); +_assertSame(ctx.clip(), undefined, "ctx.clip()", "undefined"); +if (ctx.fillText) { + _assertSame(ctx.fillText('test', 0, 0), undefined, "ctx.fillText('test', 0, 0)", "undefined"); + _assertSame(ctx.strokeText('test', 0, 0), undefined, "ctx.strokeText('test', 0, 0)", "undefined"); +} +if (ctx.putImageData) { + _assertSame(ctx.putImageData(ctx.getImageData(0, 0, 1, 1), 0, 0), undefined, "ctx.putImageData(ctx.getImageData(0, 0, 1, 1), 0, 0)", "undefined"); +} +_assertSame(ctx.drawImage(document.getElementById('yellow.png'), 0, 0, 1, 1, 0, 0, 0, 0), undefined, "ctx.drawImage(document.getElementById('yellow.png'), 0, 0, 1, 1, 0, 0, 0, 0)", "undefined"); +_assertSame(ctx.drawImage(canvas, 0, 0, 1, 1, 0, 0, 0, 0), undefined, "ctx.drawImage(canvas, 0, 0, 1, 1, 0, 0, 0, 0)", "undefined"); +_assertSame(ctx.createLinearGradient(0, 0, 0, 0).addColorStop(0, 'white'), undefined, "ctx.createLinearGradient(0, 0, 0, 0).addColorStop(0, 'white')", "undefined"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.context.casesensitive.js b/platforms/ios/www/test/tests-todo/framed.context.casesensitive.js new file mode 100644 index 0000000..8ab0ef8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.context.casesensitive.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.getContext('2D'), null, "canvas.getContext('2D')", "null"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.context.emptystring.js b/platforms/ios/www/test/tests-todo/framed.context.emptystring.js new file mode 100644 index 0000000..742a111 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.context.emptystring.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.getContext(""), null, "canvas.getContext(\"\")", "null"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.context.unrecognised.badname.js b/platforms/ios/www/test/tests-todo/framed.context.unrecognised.badname.js new file mode 100644 index 0000000..941a0b8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.context.unrecognised.badname.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.getContext('This is not an implemented context in any real browser'), null, "canvas.getContext('This is not an implemented context in any real browser')", "null"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.context.unrecognised.badsuffix.js b/platforms/ios/www/test/tests-todo/framed.context.unrecognised.badsuffix.js new file mode 100644 index 0000000..c56623c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.context.unrecognised.badsuffix.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.getContext("2d#"), null, "canvas.getContext(\"2d#\")", "null"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.context.unrecognised.nullsuffix.js b/platforms/ios/www/test/tests-todo/framed.context.unrecognised.nullsuffix.js new file mode 100644 index 0000000..121a5ca --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.context.unrecognised.nullsuffix.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.getContext("2d\0"), null, "canvas.getContext(\"2d\\0\")", "null"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.context.unrecognised.unicode.js b/platforms/ios/www/test/tests-todo/framed.context.unrecognised.unicode.js new file mode 100644 index 0000000..1bf51ef --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.context.unrecognised.unicode.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.getContext("2\uFF44"), null, "canvas.getContext(\"2\\uFF44\")", "null"); // Fullwidth Latin Small Letter D + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.fallback.multiple.js b/platforms/ios/www/test/tests-todo/framed.fallback.multiple.js new file mode 100644 index 0000000..6eddbe1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.fallback.multiple.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertEqual(canvas.childNodes.length, 2, "canvas.childNodes.length", "2"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.fallback.nested.js b/platforms/ios/www/test/tests-todo/framed.fallback.nested.js new file mode 100644 index 0000000..6eddbe1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.fallback.nested.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertEqual(canvas.childNodes.length, 2, "canvas.childNodes.length", "2"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.initial.colour.js b/platforms/ios/www/test/tests-todo/framed.initial.colour.js new file mode 100644 index 0000000..be87769 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.initial.colour.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertPixel(canvas, 20,20, 0,0,0,0, "20,20", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.initial.reset.2dstate.js b/platforms/ios/www/test/tests-todo/framed.initial.reset.2dstate.js new file mode 100644 index 0000000..c3a970b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.initial.reset.2dstate.js @@ -0,0 +1,82 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 100; +var default_val; + +default_val = ctx.strokeStyle; +ctx.strokeStyle = "#ff0000"; +canvas.width = 100; +_assertSame(ctx.strokeStyle, default_val, "ctx.strokeStyle", "default_val"); + +default_val = ctx.fillStyle; +ctx.fillStyle = "#ff0000"; +canvas.width = 100; +_assertSame(ctx.fillStyle, default_val, "ctx.fillStyle", "default_val"); + +default_val = ctx.globalAlpha; +ctx.globalAlpha = 0.5; +canvas.width = 100; +_assertSame(ctx.globalAlpha, default_val, "ctx.globalAlpha", "default_val"); + +default_val = ctx.lineWidth; +ctx.lineWidth = 0.5; +canvas.width = 100; +_assertSame(ctx.lineWidth, default_val, "ctx.lineWidth", "default_val"); + +default_val = ctx.lineCap; +ctx.lineCap = "round"; +canvas.width = 100; +_assertSame(ctx.lineCap, default_val, "ctx.lineCap", "default_val"); + +default_val = ctx.lineJoin; +ctx.lineJoin = "round"; +canvas.width = 100; +_assertSame(ctx.lineJoin, default_val, "ctx.lineJoin", "default_val"); + +default_val = ctx.miterLimit; +ctx.miterLimit = 0.5; +canvas.width = 100; +_assertSame(ctx.miterLimit, default_val, "ctx.miterLimit", "default_val"); + +default_val = ctx.shadowOffsetX; +ctx.shadowOffsetX = 5; +canvas.width = 100; +_assertSame(ctx.shadowOffsetX, default_val, "ctx.shadowOffsetX", "default_val"); + +default_val = ctx.shadowOffsetY; +ctx.shadowOffsetY = 5; +canvas.width = 100; +_assertSame(ctx.shadowOffsetY, default_val, "ctx.shadowOffsetY", "default_val"); + +default_val = ctx.shadowBlur; +ctx.shadowBlur = 5; +canvas.width = 100; +_assertSame(ctx.shadowBlur, default_val, "ctx.shadowBlur", "default_val"); + +default_val = ctx.shadowColor; +ctx.shadowColor = "#ff0000"; +canvas.width = 100; +_assertSame(ctx.shadowColor, default_val, "ctx.shadowColor", "default_val"); + +default_val = ctx.globalCompositeOperation; +ctx.globalCompositeOperation = "copy"; +canvas.width = 100; +_assertSame(ctx.globalCompositeOperation, default_val, "ctx.globalCompositeOperation", "default_val"); + +default_val = ctx.font; +ctx.font = "25px serif"; +canvas.width = 100; +_assertSame(ctx.font, default_val, "ctx.font", "default_val"); + +default_val = ctx.textAlign; +ctx.textAlign = "center"; +canvas.width = 100; +_assertSame(ctx.textAlign, default_val, "ctx.textAlign", "default_val"); + +default_val = ctx.textBaseline; +ctx.textBaseline = "bottom"; +canvas.width = 100; +_assertSame(ctx.textBaseline, default_val, "ctx.textBaseline", "default_val"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.initial.reset.clip.js b/platforms/ios/www/test/tests-todo/framed.initial.reset.clip.js new file mode 100644 index 0000000..3c86bd3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.initial.reset.clip.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 100; +ctx.rect(0, 0, 1, 1); +ctx.clip(); +canvas.width = 100; +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 20,20, 0,255,0,255, "20,20", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.initial.reset.different.js b/platforms/ios/www/test/tests-todo/framed.initial.reset.different.js new file mode 100644 index 0000000..032822c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.initial.reset.different.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 20,20, 255,0,0,255, "20,20", "255,0,0,255"); +canvas.width = 50; +_assertPixel(canvas, 20,20, 0,0,0,0, "20,20", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.initial.reset.gradient.js b/platforms/ios/www/test/tests-todo/framed.initial.reset.gradient.js new file mode 100644 index 0000000..54e141e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.initial.reset.gradient.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 50; +var g = ctx.createLinearGradient(0, 0, 100, 0); +g.addColorStop(0, '#0f0'); +g.addColorStop(1, '#0f0'); +canvas.width = 100; +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.initial.reset.path.js b/platforms/ios/www/test/tests-todo/framed.initial.reset.path.js new file mode 100644 index 0000000..2b8b948 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.initial.reset.path.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 100; +ctx.rect(0, 0, 100, 50); +canvas.width = 100; +ctx.fillStyle = '#f00'; +ctx.fill(); +_assertPixel(canvas, 20,20, 0,0,0,0, "20,20", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.initial.reset.pattern.js b/platforms/ios/www/test/tests-todo/framed.initial.reset.pattern.js new file mode 100644 index 0000000..12b78fb --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.initial.reset.pattern.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 30; +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 30, 50); +var p = ctx.createPattern(canvas, 'repeat-x'); +canvas.width = 100; +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = p; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.initial.reset.same.js b/platforms/ios/www/test/tests-todo/framed.initial.reset.same.js new file mode 100644 index 0000000..14deafb --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.initial.reset.same.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 100; +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 20,20, 255,0,0,255, "20,20", "255,0,0,255"); +canvas.width = 100; +_assertPixel(canvas, 20,20, 0,0,0,0, "20,20", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.initial.reset.transform.js b/platforms/ios/www/test/tests-todo/framed.initial.reset.transform.js new file mode 100644 index 0000000..5a3f98b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.initial.reset.transform.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 100; +ctx.scale(0.1, 0.1); +canvas.width = 100; +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 20,20, 0,255,0,255, "20,20", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.security.dataURI.js b/platforms/ios/www/test/tests-todo/framed.security.dataURI.js new file mode 100644 index 0000000..4a31daa --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.security.dataURI.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +var data = canvas.toDataURL(); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +var img = new Image(); +deferTest(); +img.onload = wrapFunction(function () +{ + ctx.drawImage(img, 0, 0); + canvas.toDataURL(); // should be permitted + _assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +}); +img.src = data; + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.security.drawImage.canvas.js b/platforms/ios/www/test/tests-todo/framed.security.drawImage.canvas.js new file mode 100644 index 0000000..c000ef4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.security.drawImage.canvas.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.drawImage(document.getElementById('yellow.png'), 0, 0); +ctx.drawImage(canvas2, 0, 0); +try { var _thrown = false; canvas.toDataURL(); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: canvas.toDataURL()"); } +try { var _thrown = false; ctx.getImageData(0, 0, 1, 1); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: ctx.getImageData(0, 0, 1, 1)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.security.drawImage.image.js b/platforms/ios/www/test/tests-todo/framed.security.drawImage.image.js new file mode 100644 index 0000000..8f29754 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.security.drawImage.image.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +ctx.drawImage(document.getElementById('yellow.png'), 0, 0); +try { var _thrown = false; canvas.toDataURL(); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: canvas.toDataURL()"); } +try { var _thrown = false; ctx.getImageData(0, 0, 1, 1); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: ctx.getImageData(0, 0, 1, 1)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.security.pattern.canvas.fillStyle.js b/platforms/ios/www/test/tests-todo/framed.security.pattern.canvas.fillStyle.js new file mode 100644 index 0000000..32c9d57 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.security.pattern.canvas.fillStyle.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.drawImage(document.getElementById('yellow.png'), 0, 0); +var p = ctx.createPattern(canvas2, 'repeat'); +ctx.fillStyle = p; +ctx.fillStyle = 'red'; +try { var _thrown = false; canvas.toDataURL(); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: canvas.toDataURL()"); } +try { var _thrown = false; ctx.getImageData(0, 0, 1, 1); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: ctx.getImageData(0, 0, 1, 1)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.security.pattern.canvas.strokeStyle.js b/platforms/ios/www/test/tests-todo/framed.security.pattern.canvas.strokeStyle.js new file mode 100644 index 0000000..9c14a15 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.security.pattern.canvas.strokeStyle.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.drawImage(document.getElementById('yellow.png'), 0, 0); +var p = ctx.createPattern(canvas2, 'repeat'); +ctx.strokeStyle = p; +ctx.strokeStyle = 'red'; +try { var _thrown = false; canvas.toDataURL(); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: canvas.toDataURL()"); } +try { var _thrown = false; ctx.getImageData(0, 0, 1, 1); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: ctx.getImageData(0, 0, 1, 1)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.security.pattern.canvas.timing.js b/platforms/ios/www/test/tests-todo/framed.security.pattern.canvas.timing.js new file mode 100644 index 0000000..76ed28a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.security.pattern.canvas.timing.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = '#0f0'; +ctx2.fillRect(0, 0, 100, 50); +var p = ctx.createPattern(canvas2, 'repeat'); +ctx2.drawImage(document.getElementById('yellow.png'), 0, 0); // make canvas2 origin-unclean +ctx.fillStyle = p; +ctx.fillRect(0, 0, 100, 50); +canvas.toDataURL(); +ctx.getImageData(0, 0, 1, 1); +_assert(true, "true"); // okay if there was no exception + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.security.pattern.create.js b/platforms/ios/www/test/tests-todo/framed.security.pattern.create.js new file mode 100644 index 0000000..a45b354 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.security.pattern.create.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +var p = ctx.createPattern(document.getElementById('yellow.png'), 'repeat'); +canvas.toDataURL(); +ctx.getImageData(0, 0, 1, 1); +_assert(true, "true"); // okay if there was no exception + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.security.pattern.image.fillStyle.js b/platforms/ios/www/test/tests-todo/framed.security.pattern.image.fillStyle.js new file mode 100644 index 0000000..9818f60 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.security.pattern.image.fillStyle.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +var p = ctx.createPattern(document.getElementById('yellow.png'), 'repeat'); +ctx.fillStyle = p; +ctx.fillStyle = 'red'; +try { var _thrown = false; canvas.toDataURL(); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: canvas.toDataURL()"); } +try { var _thrown = false; ctx.getImageData(0, 0, 1, 1); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: ctx.getImageData(0, 0, 1, 1)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.security.pattern.image.strokeStyle.js b/platforms/ios/www/test/tests-todo/framed.security.pattern.image.strokeStyle.js new file mode 100644 index 0000000..89e7561 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.security.pattern.image.strokeStyle.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +var p = ctx.createPattern(document.getElementById('yellow.png'), 'repeat'); +ctx.strokeStyle = p; +ctx.strokeStyle = 'red'; +try { var _thrown = false; canvas.toDataURL(); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: canvas.toDataURL()"); } +try { var _thrown = false; ctx.getImageData(0, 0, 1, 1); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: ctx.getImageData(0, 0, 1, 1)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.security.reset.js b/platforms/ios/www/test/tests-todo/framed.security.reset.js new file mode 100644 index 0000000..22cd77c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.security.reset.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 50; +ctx.drawImage(document.getElementById('yellow.png'), 0, 0); +try { var _thrown = false; canvas.toDataURL(); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: canvas.toDataURL()"); } +canvas.width = 100; +try { var _thrown = false; canvas.toDataURL(); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: canvas.toDataURL()"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.size.attributes.default.js b/platforms/ios/www/test/tests-todo/framed.size.attributes.default.js new file mode 100644 index 0000000..7f32024 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.size.attributes.default.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 300, "canvas.width", "300"); +_assertSame(canvas.height, 150, "canvas.height", "150"); +_assert(!canvas.hasAttribute('width'), "!canvas.hasAttribute('width')"); +_assert(!canvas.hasAttribute('height'), "!canvas.hasAttribute('height')"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.size.attributes.get.js b/platforms/ios/www/test/tests-todo/framed.size.attributes.get.js new file mode 100644 index 0000000..47eef4f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.size.attributes.get.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 120, "canvas.width", "120"); +_assertSame(canvas.height, 60, "canvas.height", "60"); +_assertSame(canvas.getAttribute('width'), '120', "canvas.getAttribute('width')", "'120'"); +_assertSame(canvas.getAttribute('height'), '60', "canvas.getAttribute('height')", "'60'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.size.attributes.idl.js b/platforms/ios/www/test/tests-todo/framed.size.attributes.idl.js new file mode 100644 index 0000000..edd0f4b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.size.attributes.idl.js @@ -0,0 +1,29 @@ +_addTest(function(canvas, ctx) { + +canvas.width = "100"; +canvas.height = "100"; +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); + +canvas.width = "+1.5e2"; +canvas.height = "0x96"; +_assertSame(canvas.width, 150, "canvas.width", "150"); +_assertSame(canvas.height, 150, "canvas.height", "150"); + +canvas.width = 200 - Math.pow(2, 32); +canvas.height = 200 - Math.pow(2, 32); +_assertSame(canvas.width, 200, "canvas.width", "200"); +_assertSame(canvas.height, 200, "canvas.height", "200"); + +canvas.width = 301.999; +canvas.height = 301.001; +_assertSame(canvas.width, 301, "canvas.width", "301"); +_assertSame(canvas.height, 301, "canvas.height", "301"); + +canvas.width = "400x"; +canvas.height = "foo"; +_assertSame(canvas.width, 0, "canvas.width", "0"); +_assertSame(canvas.height, 0, "canvas.height", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.size.attributes.idl.set.zero.js b/platforms/ios/www/test/tests-todo/framed.size.attributes.idl.set.zero.js new file mode 100644 index 0000000..5952df1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.size.attributes.idl.set.zero.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 0; +canvas.height = 0; +_assertSame(canvas.width, 0, "canvas.width", "0"); +_assertSame(canvas.height, 0, "canvas.height", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.size.attributes.parse.decimal.js b/platforms/ios/www/test/tests-todo/framed.size.attributes.parse.decimal.js new file mode 100644 index 0000000..044156b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.size.attributes.parse.decimal.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.size.attributes.parse.em.js b/platforms/ios/www/test/tests-todo/framed.size.attributes.parse.em.js new file mode 100644 index 0000000..044156b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.size.attributes.parse.em.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.size.attributes.parse.empty.js b/platforms/ios/www/test/tests-todo/framed.size.attributes.parse.empty.js new file mode 100644 index 0000000..78b3641 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.size.attributes.parse.empty.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 300, "canvas.width", "300"); +_assertSame(canvas.height, 150, "canvas.height", "150"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.size.attributes.parse.exp.js b/platforms/ios/www/test/tests-todo/framed.size.attributes.parse.exp.js new file mode 100644 index 0000000..044156b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.size.attributes.parse.exp.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.size.attributes.parse.hex.js b/platforms/ios/www/test/tests-todo/framed.size.attributes.parse.hex.js new file mode 100644 index 0000000..7d69957 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.size.attributes.parse.hex.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 0, "canvas.width", "0"); +_assertSame(canvas.height, 0, "canvas.height", "0"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "0px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"0px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.size.attributes.parse.junk.js b/platforms/ios/www/test/tests-todo/framed.size.attributes.parse.junk.js new file mode 100644 index 0000000..78b3641 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.size.attributes.parse.junk.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 300, "canvas.width", "300"); +_assertSame(canvas.height, 150, "canvas.height", "150"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.size.attributes.parse.octal.js b/platforms/ios/www/test/tests-todo/framed.size.attributes.parse.octal.js new file mode 100644 index 0000000..044156b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.size.attributes.parse.octal.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.size.attributes.parse.onlyspace.js b/platforms/ios/www/test/tests-todo/framed.size.attributes.parse.onlyspace.js new file mode 100644 index 0000000..78b3641 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.size.attributes.parse.onlyspace.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 300, "canvas.width", "300"); +_assertSame(canvas.height, 150, "canvas.height", "150"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.size.attributes.parse.plus.js b/platforms/ios/www/test/tests-todo/framed.size.attributes.parse.plus.js new file mode 100644 index 0000000..044156b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.size.attributes.parse.plus.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.size.attributes.parse.space.js b/platforms/ios/www/test/tests-todo/framed.size.attributes.parse.space.js new file mode 100644 index 0000000..044156b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.size.attributes.parse.space.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.size.attributes.parse.whitespace.js b/platforms/ios/www/test/tests-todo/framed.size.attributes.parse.whitespace.js new file mode 100644 index 0000000..044156b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.size.attributes.parse.whitespace.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.size.attributes.parse.zero.js b/platforms/ios/www/test/tests-todo/framed.size.attributes.parse.zero.js new file mode 100644 index 0000000..7d69957 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.size.attributes.parse.zero.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 0, "canvas.width", "0"); +_assertSame(canvas.height, 0, "canvas.height", "0"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "0px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"0px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.size.attributes.reflect.setcontent.js b/platforms/ios/www/test/tests-todo/framed.size.attributes.reflect.setcontent.js new file mode 100644 index 0000000..adfcc79 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.size.attributes.reflect.setcontent.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', '120'); +canvas.setAttribute('height', '60'); +_assertSame(canvas.getAttribute('width'), '120', "canvas.getAttribute('width')", "'120'"); +_assertSame(canvas.getAttribute('height'), '60', "canvas.getAttribute('height')", "'60'"); +_assertSame(canvas.width, 120, "canvas.width", "120"); +_assertSame(canvas.height, 60, "canvas.height", "60"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.size.attributes.reflect.setidlzero.js b/platforms/ios/www/test/tests-todo/framed.size.attributes.reflect.setidlzero.js new file mode 100644 index 0000000..015bfa7 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.size.attributes.reflect.setidlzero.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 0; +canvas.height = 0; +_assertSame(canvas.getAttribute('width'), '0', "canvas.getAttribute('width')", "'0'"); +_assertSame(canvas.getAttribute('height'), '0', "canvas.getAttribute('height')", "'0'"); +_assertSame(canvas.width, 0, "canvas.width", "0"); +_assertSame(canvas.height, 0, "canvas.height", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.size.attributes.removed.js b/platforms/ios/www/test/tests-todo/framed.size.attributes.removed.js new file mode 100644 index 0000000..3840046 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.size.attributes.removed.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 120, "canvas.width", "120"); +canvas.removeAttribute('width'); +_assertSame(canvas.width, 300, "canvas.width", "300"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.size.attributes.set.js b/platforms/ios/www/test/tests-todo/framed.size.attributes.set.js new file mode 100644 index 0000000..f150b97 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.size.attributes.set.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 120; +canvas.height = 60; +_assertSame(canvas.width, 120, "canvas.width", "120"); +_assertSame(canvas.height, 60, "canvas.height", "60"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.size.attributes.setAttribute.em.js b/platforms/ios/www/test/tests-todo/framed.size.attributes.setAttribute.em.js new file mode 100644 index 0000000..97f9d6b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.size.attributes.setAttribute.em.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', '100em'); +canvas.setAttribute('height', '100em'); +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.size.attributes.setAttribute.empty.js b/platforms/ios/www/test/tests-todo/framed.size.attributes.setAttribute.empty.js new file mode 100644 index 0000000..44c9ca2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.size.attributes.setAttribute.empty.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', ''); +canvas.setAttribute('height', ''); +_assertSame(canvas.width, 300, "canvas.width", "300"); +_assertSame(canvas.height, 150, "canvas.height", "150"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.size.attributes.setAttribute.exp.js b/platforms/ios/www/test/tests-todo/framed.size.attributes.setAttribute.exp.js new file mode 100644 index 0000000..ded7cee --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.size.attributes.setAttribute.exp.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', '100e1'); +canvas.setAttribute('height', '100e1'); +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.size.attributes.setAttribute.junk.js b/platforms/ios/www/test/tests-todo/framed.size.attributes.setAttribute.junk.js new file mode 100644 index 0000000..04830d5 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.size.attributes.setAttribute.junk.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', '#!?'); +canvas.setAttribute('height', '#!?'); +_assertSame(canvas.width, 300, "canvas.width", "300"); +_assertSame(canvas.height, 150, "canvas.height", "150"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.size.attributes.setAttribute.minus.js b/platforms/ios/www/test/tests-todo/framed.size.attributes.setAttribute.minus.js new file mode 100644 index 0000000..f16c035 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.size.attributes.setAttribute.minus.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', '-100'); +canvas.setAttribute('height', '-100'); +_assertSame(canvas.width, 300, "canvas.width", "300"); +_assertSame(canvas.height, 150, "canvas.height", "150"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.size.attributes.setAttribute.onlyspace.js b/platforms/ios/www/test/tests-todo/framed.size.attributes.setAttribute.onlyspace.js new file mode 100644 index 0000000..259a0c8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.size.attributes.setAttribute.onlyspace.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', ' '); +canvas.setAttribute('height', ' '); +_assertSame(canvas.width, 300, "canvas.width", "300"); +_assertSame(canvas.height, 150, "canvas.height", "150"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.size.attributes.setAttribute.percent.js b/platforms/ios/www/test/tests-todo/framed.size.attributes.setAttribute.percent.js new file mode 100644 index 0000000..411d4fc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.size.attributes.setAttribute.percent.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', '100%'); +canvas.setAttribute('height', '100%'); +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.size.attributes.setAttribute.space.js b/platforms/ios/www/test/tests-todo/framed.size.attributes.setAttribute.space.js new file mode 100644 index 0000000..56880e5 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.size.attributes.setAttribute.space.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', ' 100'); +canvas.setAttribute('height', ' 100'); +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.size.attributes.setAttribute.trailingjunk.js b/platforms/ios/www/test/tests-todo/framed.size.attributes.setAttribute.trailingjunk.js new file mode 100644 index 0000000..826a3ac --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.size.attributes.setAttribute.trailingjunk.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', '100#!?'); +canvas.setAttribute('height', '100#!?'); +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.size.attributes.setAttribute.whitespace.js b/platforms/ios/www/test/tests-todo/framed.size.attributes.setAttribute.whitespace.js new file mode 100644 index 0000000..e0db93d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.size.attributes.setAttribute.whitespace.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', '\r\n\t\x0c100'); +canvas.setAttribute('height', '\r\n\t\x0c100'); +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.size.attributes.style.js b/platforms/ios/www/test/tests-todo/framed.size.attributes.style.js new file mode 100644 index 0000000..1d91d9a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.size.attributes.style.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +_assertEqual(canvas.width, 50, "canvas.width", "50"); +_assertEqual(canvas.height, 30, "canvas.height", "30"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.toDataURL.arguments.1.js b/platforms/ios/www/test/tests-todo/framed.toDataURL.arguments.1.js new file mode 100644 index 0000000..a174352 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.toDataURL.arguments.1.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +var data = canvas.toDataURL('image/png', 'another argument that should not raise an exception'); +_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.toDataURL.arguments.2.js b/platforms/ios/www/test/tests-todo/framed.toDataURL.arguments.2.js new file mode 100644 index 0000000..f03e416 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.toDataURL.arguments.2.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +var data = canvas.toDataURL('image/png', 'another argument that should not raise an exception', 'and another'); +_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.toDataURL.arguments.3.js b/platforms/ios/www/test/tests-todo/framed.toDataURL.arguments.3.js new file mode 100644 index 0000000..3725aa9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.toDataURL.arguments.3.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +// More arguments that should not raise exceptions +var data = canvas.toDataURL('image/png', null, null, null); +_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.toDataURL.bogustype.js b/platforms/ios/www/test/tests-todo/framed.toDataURL.bogustype.js new file mode 100644 index 0000000..6cf5d2b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.toDataURL.bogustype.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +var data = canvas.toDataURL('bogus'); +_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.toDataURL.default.js b/platforms/ios/www/test/tests-todo/framed.toDataURL.default.js new file mode 100644 index 0000000..49bc0a1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.toDataURL.default.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +var data = canvas.toDataURL(); +_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.toDataURL.jpeg.alpha.js b/platforms/ios/www/test/tests-todo/framed.toDataURL.jpeg.alpha.js new file mode 100644 index 0000000..25d12d7 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.toDataURL.jpeg.alpha.js @@ -0,0 +1,25 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = 'rgba(128, 255, 128, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-over'; // should be ignored by toDataURL +var data = canvas.toDataURL('image/jpeg'); +ctx.globalCompositeOperation = 'source-over'; +if (!data.match(/^data:image\/jpeg[;,]/)) { + _assert(true, "true"); +} else { + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + var img = new Image(); + deferTest(); + img.onload = wrapFunction(function () + { + ctx.drawImage(img, 0, 0); + + _assertPixelApprox(canvas, 50,25, 63,127,63,255, "50,25", "63,127,63,255", 8); + }); + img.src = data; +} + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.toDataURL.jpeg.primarycolours.js b/platforms/ios/www/test/tests-todo/framed.toDataURL.jpeg.primarycolours.js new file mode 100644 index 0000000..a41f973 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.toDataURL.jpeg.primarycolours.js @@ -0,0 +1,28 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#ff0'; +ctx.fillRect(0, 0, 25, 40); +ctx.fillStyle = '#0ff'; +ctx.fillRect(25, 0, 50, 40); +ctx.fillStyle = '#00f'; +ctx.fillRect(75, 0, 25, 40); +ctx.fillStyle = '#fff'; +ctx.fillRect(0, 40, 100, 10); +var data = canvas.toDataURL('image/jpeg'); // it is okay if this returns a PNG instead +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +var img = new Image(); +deferTest(); +img.onload = wrapFunction(function () +{ + ctx.drawImage(img, 0, 0); + + _assertPixelApprox(canvas, 12,20, 255,255,0,255, "12,20", "255,255,0,255", 8); + _assertPixelApprox(canvas, 50,20, 0,255,255,255, "50,20", "0,255,255,255", 8); + _assertPixelApprox(canvas, 87,20, 0,0,255,255, "87,20", "0,0,255,255", 8); + _assertPixelApprox(canvas, 50,45, 255,255,255,255, "50,45", "255,255,255,255", 8); +}); +img.src = data; + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.toDataURL.jpeg.quality.basic.js b/platforms/ios/www/test/tests-todo/framed.toDataURL.jpeg.quality.basic.js new file mode 100644 index 0000000..ca1fdfa --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.toDataURL.jpeg.quality.basic.js @@ -0,0 +1,36 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#00f'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0ff'; +ctx.fillRect(0, 3, 100, 1); +// Check for JPEG support first +var data = canvas.toDataURL('image/jpeg'); +if (!data.match(/^data:image\/jpeg[;,]/)) { + _assert(true, "true"); +} else { + var data_hi = canvas.toDataURL('image/jpeg', 0.99); + var data_lo = canvas.toDataURL('image/jpeg', 0.01); + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + deferTest(); + var img_hi = new Image(); + img_hi.onload = function () + { + var img_lo = new Image(); + img_lo.onload = wrapFunction(function () + { + ctx.drawImage(img_hi, 0, 0, 50, 50, 0, 0, 50, 50); + ctx.drawImage(img_lo, 0, 0, 50, 50, 50, 0, 50, 50); + + _assert(data_hi.length > data_lo.length, "data_hi.length > data_lo.length"); + _assertPixelApprox(canvas, 25,25, 0,0,255,255, "25,25", "0,0,255,255", 8); + _assertPixelApprox(canvas, 75,25, 0,0,255,255, "75,25", "0,0,255,255", 8); + }); + img_lo.src = data_lo; + }; + img_hi.src = data_hi; +} + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.toDataURL.jpeg.quality.notnumber.js b/platforms/ios/www/test/tests-todo/framed.toDataURL.jpeg.quality.notnumber.js new file mode 100644 index 0000000..0585361 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.toDataURL.jpeg.quality.notnumber.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#00f'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0ff'; +ctx.fillRect(0, 3, 100, 1); +// Check for JPEG support first +var data = canvas.toDataURL('image/jpeg'); +if (!data.match(/^data:image\/jpeg[;,]/)) { + _assert(true, "true"); +} else { + _assertSame(canvas.toDataURL('image/jpeg', 'bogus'), data, "canvas.toDataURL('image/jpeg', 'bogus')", "data"); + _assertSame(canvas.toDataURL('image/jpeg', {}), data, "canvas.toDataURL('image/jpeg', {})", "data"); + _assertSame(canvas.toDataURL('image/jpeg', null), data, "canvas.toDataURL('image/jpeg', null)", "data"); + _assertSame(canvas.toDataURL('image/jpeg', undefined), data, "canvas.toDataURL('image/jpeg', undefined)", "data"); + _assertSame(canvas.toDataURL('image/jpeg', true), data, "canvas.toDataURL('image/jpeg', true)", "data"); + _assertSame(canvas.toDataURL('image/jpeg', '0.01'), data, "canvas.toDataURL('image/jpeg', '0.01')", "data"); +} + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.toDataURL.jpeg.quality.outsiderange.js b/platforms/ios/www/test/tests-todo/framed.toDataURL.jpeg.quality.outsiderange.js new file mode 100644 index 0000000..7b07bfc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.toDataURL.jpeg.quality.outsiderange.js @@ -0,0 +1,22 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#00f'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0ff'; +ctx.fillRect(0, 3, 100, 1); +// Check for JPEG support first +var data = canvas.toDataURL('image/jpeg'); +if (!data.match(/^data:image\/jpeg[;,]/)) { + _assert(true, "true"); +} else { + _assertSame(canvas.toDataURL('image/jpeg', 10), data, "canvas.toDataURL('image/jpeg', 10)", "data"); + _assertSame(canvas.toDataURL('image/jpeg', -10), data, "canvas.toDataURL('image/jpeg', -10)", "data"); + _assertSame(canvas.toDataURL('image/jpeg', 1.01), data, "canvas.toDataURL('image/jpeg', 1.01)", "data"); + _assertSame(canvas.toDataURL('image/jpeg', -0.01), data, "canvas.toDataURL('image/jpeg', -0.01)", "data"); + + _assert(canvas.toDataURL('image/jpeg', 1).length >= canvas.toDataURL('image/jpeg', 0.9).length, "canvas.toDataURL('image/jpeg', 1).length >= canvas.toDataURL('image/jpeg', 0.9).length"); + _assert(canvas.toDataURL('image/jpeg', 0).length <= canvas.toDataURL('image/jpeg', 0.1).length, "canvas.toDataURL('image/jpeg', 0).length <= canvas.toDataURL('image/jpeg', 0.1).length"); +} + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.toDataURL.lowercase.unicode.js b/platforms/ios/www/test/tests-todo/framed.toDataURL.lowercase.unicode.js new file mode 100644 index 0000000..321e122 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.toDataURL.lowercase.unicode.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +// Use LATIN CAPITAL LETTER I WITH DOT ABOVE (Unicode lowercase is "i") +var data = canvas.toDataURL('\u0130mage/png'); +_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/"); + +var data = canvas.toDataURL('\u0130mage/jpeg'); +_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.toDataURL.nocontext.js b/platforms/ios/www/test/tests-todo/framed.toDataURL.nocontext.js new file mode 100644 index 0000000..2a7585d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.toDataURL.nocontext.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +var data = canvas2.toDataURL(); +_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.toDataURL.png.complexcolours.js b/platforms/ios/www/test/tests-todo/framed.toDataURL.png.complexcolours.js new file mode 100644 index 0000000..f3b9a0d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.toDataURL.png.complexcolours.js @@ -0,0 +1,28 @@ +_addTest(function(canvas, ctx) { + +// (These values are chosen to survive relatively alright through being premultiplied) +ctx.fillStyle = 'rgba(1, 3, 254, 1)'; +ctx.fillRect(0, 0, 25, 25); +ctx.fillStyle = 'rgba(8, 252, 248, 0.75)'; +ctx.fillRect(25, 0, 25, 25); +ctx.fillStyle = 'rgba(6, 10, 250, 0.502)'; +ctx.fillRect(50, 0, 25, 25); +ctx.fillStyle = 'rgba(12, 16, 244, 0.25)'; +ctx.fillRect(75, 0, 25, 25); +var img = new Image(); +deferTest(); +img.onload = wrapFunction(function () +{ + ctx.drawImage(img, 0, 25); + // (The alpha values do not really survive float->int conversion, so just + // do approximate comparisons) + + _assertPixel(canvas, 12,40, 1,3,254,255, "12,40", "1,3,254,255"); + _assertPixelApprox(canvas, 37,40, 8,252,248,191, "37,40", "8,252,248,191", 2); + _assertPixelApprox(canvas, 62,40, 6,10,250,127, "62,40", "6,10,250,127", 4); + _assertPixelApprox(canvas, 87,40, 12,16,244,63, "87,40", "12,16,244,63", 8); +}); +img.src = canvas.toDataURL(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.toDataURL.png.js b/platforms/ios/www/test/tests-todo/framed.toDataURL.png.js new file mode 100644 index 0000000..f4266c1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.toDataURL.png.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +var data = canvas.toDataURL('image/png'); +_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.toDataURL.png.primarycolours.js b/platforms/ios/www/test/tests-todo/framed.toDataURL.png.primarycolours.js new file mode 100644 index 0000000..cd42cf3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.toDataURL.png.primarycolours.js @@ -0,0 +1,28 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#ff0'; +ctx.fillRect(0, 0, 25, 40); +ctx.fillStyle = '#0ff'; +ctx.fillRect(25, 0, 50, 40); +ctx.fillStyle = '#00f'; +ctx.fillRect(75, 0, 25, 40); +ctx.fillStyle = '#fff'; +ctx.fillRect(0, 40, 100, 10); +var data = canvas.toDataURL(); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +var img = new Image(); +deferTest(); +img.onload = wrapFunction(function () +{ + ctx.drawImage(img, 0, 0); + + _assertPixel(canvas, 12,20, 255,255,0,255, "12,20", "255,255,0,255"); + _assertPixel(canvas, 50,20, 0,255,255,255, "50,20", "0,255,255,255"); + _assertPixel(canvas, 87,20, 0,0,255,255, "87,20", "0,0,255,255"); + _assertPixel(canvas, 50,45, 255,255,255,255, "50,45", "255,255,255,255"); +}); +img.src = data; + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.toDataURL.unrecognised.js b/platforms/ios/www/test/tests-todo/framed.toDataURL.unrecognised.js new file mode 100644 index 0000000..684af7a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.toDataURL.unrecognised.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +var data = canvas.toDataURL('image/example'); +_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.toDataURL.zerosize.js b/platforms/ios/www/test/tests-todo/framed.toDataURL.zerosize.js new file mode 100644 index 0000000..1b0a157 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.toDataURL.zerosize.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +var data = canvas.toDataURL(); +_assertSame(data, 'data:,', "data", "'data:,'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.type.delete.js b/platforms/ios/www/test/tests-todo/framed.type.delete.js new file mode 100644 index 0000000..9989ae9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.type.delete.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +delete window.HTMLCanvasElement; +_assert(window.HTMLCanvasElement, "window.HTMLCanvasElement"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.type.exists.js b/platforms/ios/www/test/tests-todo/framed.type.exists.js new file mode 100644 index 0000000..0934d14 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.type.exists.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assert(window.HTMLCanvasElement, "window.HTMLCanvasElement"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.type.extend.js b/platforms/ios/www/test/tests-todo/framed.type.extend.js new file mode 100644 index 0000000..a1be02b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.type.extend.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +window.HTMLCanvasElement.prototype.getZero = function () { return 0; }; +_assertSame(canvas.getZero(), 0, "canvas.getZero()", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.type.name.js b/platforms/ios/www/test/tests-todo/framed.type.name.js new file mode 100644 index 0000000..9a31490 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.type.name.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(Object.prototype.toString.call(canvas), '[object HTMLCanvasElement]', "Object.prototype.toString.call(canvas)", "'[object HTMLCanvasElement]'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.type.prototype.js b/platforms/ios/www/test/tests-todo/framed.type.prototype.js new file mode 100644 index 0000000..3eb73b4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.type.prototype.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +_assert(window.HTMLCanvasElement.prototype, "window.HTMLCanvasElement.prototype"); +_assert(window.HTMLCanvasElement.prototype.getContext, "window.HTMLCanvasElement.prototype.getContext"); +window.HTMLCanvasElement.prototype = null; +_assert(window.HTMLCanvasElement.prototype, "window.HTMLCanvasElement.prototype"); +delete window.HTMLCanvasElement.prototype; +_assert(window.HTMLCanvasElement.prototype, "window.HTMLCanvasElement.prototype"); +window.HTMLCanvasElement.prototype.getContext = 1; +_assertSame(window.HTMLCanvasElement.prototype.getContext, 1, "window.HTMLCanvasElement.prototype.getContext", "1"); +delete window.HTMLCanvasElement.prototype.getContext; +_assertSame(window.HTMLCanvasElement.prototype.getContext, undefined, "window.HTMLCanvasElement.prototype.getContext", "undefined"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/framed.type.replace.js b/platforms/ios/www/test/tests-todo/framed.type.replace.js new file mode 100644 index 0000000..0f67cc1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/framed.type.replace.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +window.HTMLCanvasElement.prototype.getContext = function (name) { return 0; }; +_assertSame(canvas.getContext('2d'), 0, "canvas.getContext('2d')", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/index.2d.canvas.js b/platforms/ios/www/test/tests-todo/index.2d.canvas.js new file mode 100644 index 0000000..2ac747a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.canvas.js @@ -0,0 +1,9 @@ + +Canvas tests - 2d.canvas.* + +

    [index] +

    2d.canvas.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.clearRect.js b/platforms/ios/www/test/tests-todo/index.2d.clearRect.js new file mode 100644 index 0000000..ea714b1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.clearRect.js @@ -0,0 +1,17 @@ + +Canvas tests - 2d.clearRect.* + +

    [index] +

    2d.clearRect.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.composite.canvas.js b/platforms/ios/www/test/tests-todo/index.2d.composite.canvas.js new file mode 100644 index 0000000..78421fb --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.composite.canvas.js @@ -0,0 +1,18 @@ + +Canvas tests - 2d.composite.canvas.* + +

    [index] +

    2d.composite.canvas.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.composite.clip.js b/platforms/ios/www/test/tests-todo/index.2d.composite.clip.js new file mode 100644 index 0000000..41de815 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.composite.clip.js @@ -0,0 +1,18 @@ + +Canvas tests - 2d.composite.clip.* + +

    [index] +

    2d.composite.clip.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.composite.globalAlpha.js b/platforms/ios/www/test/tests-todo/index.2d.composite.globalAlpha.js new file mode 100644 index 0000000..2a8b150 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.composite.globalAlpha.js @@ -0,0 +1,15 @@ + +Canvas tests - 2d.composite.globalAlpha.* + +

    [index] +

    2d.composite.globalAlpha.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.composite.image.js b/platforms/ios/www/test/tests-todo/index.2d.composite.image.js new file mode 100644 index 0000000..3e1d234 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.composite.image.js @@ -0,0 +1,18 @@ + +Canvas tests - 2d.composite.image.* + +

    [index] +

    2d.composite.image.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.composite.js b/platforms/ios/www/test/tests-todo/index.2d.composite.js new file mode 100644 index 0000000..6645994 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.composite.js @@ -0,0 +1,99 @@ + +Canvas tests - 2d.composite.* + +

    [index] +

    2d.composite.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.composite.operation.js b/platforms/ios/www/test/tests-todo/index.2d.composite.operation.js new file mode 100644 index 0000000..db847e4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.composite.operation.js @@ -0,0 +1,16 @@ + +Canvas tests - 2d.composite.operation.* + +

    [index] +

    2d.composite.operation.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.composite.solid.js b/platforms/ios/www/test/tests-todo/index.2d.composite.solid.js new file mode 100644 index 0000000..02d556f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.composite.solid.js @@ -0,0 +1,18 @@ + +Canvas tests - 2d.composite.solid.* + +

    [index] +

    2d.composite.solid.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.composite.transparent.js b/platforms/ios/www/test/tests-todo/index.2d.composite.transparent.js new file mode 100644 index 0000000..c619db4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.composite.transparent.js @@ -0,0 +1,18 @@ + +Canvas tests - 2d.composite.transparent.* + +

    [index] +

    2d.composite.transparent.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.composite.uncovered.fill.js b/platforms/ios/www/test/tests-todo/index.2d.composite.uncovered.fill.js new file mode 100644 index 0000000..1a48cc6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.composite.uncovered.fill.js @@ -0,0 +1,12 @@ + +Canvas tests - 2d.composite.uncovered.fill.* + +

    [index] +

    2d.composite.uncovered.fill.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.composite.uncovered.image.js b/platforms/ios/www/test/tests-todo/index.2d.composite.uncovered.image.js new file mode 100644 index 0000000..8202cb4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.composite.uncovered.image.js @@ -0,0 +1,12 @@ + +Canvas tests - 2d.composite.uncovered.image.* + +

    [index] +

    2d.composite.uncovered.image.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.composite.uncovered.js b/platforms/ios/www/test/tests-todo/index.2d.composite.uncovered.js new file mode 100644 index 0000000..f273e66 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.composite.uncovered.js @@ -0,0 +1,27 @@ + +Canvas tests - 2d.composite.uncovered.* + +

    [index] +

    2d.composite.uncovered.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.composite.uncovered.nocontext.js b/platforms/ios/www/test/tests-todo/index.2d.composite.uncovered.nocontext.js new file mode 100644 index 0000000..13fe609 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.composite.uncovered.nocontext.js @@ -0,0 +1,12 @@ + +Canvas tests - 2d.composite.uncovered.nocontext.* + +

    [index] +

    2d.composite.uncovered.nocontext.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.composite.uncovered.pattern.js b/platforms/ios/www/test/tests-todo/index.2d.composite.uncovered.pattern.js new file mode 100644 index 0000000..49a71c6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.composite.uncovered.pattern.js @@ -0,0 +1,12 @@ + +Canvas tests - 2d.composite.uncovered.pattern.* + +

    [index] +

    2d.composite.uncovered.pattern.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.drawImage.9arg.js b/platforms/ios/www/test/tests-todo/index.2d.drawImage.9arg.js new file mode 100644 index 0000000..fa49511 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.drawImage.9arg.js @@ -0,0 +1,12 @@ + +Canvas tests - 2d.drawImage.9arg.* + +

    [index] +

    2d.drawImage.9arg.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.drawImage.animated.js b/platforms/ios/www/test/tests-todo/index.2d.drawImage.animated.js new file mode 100644 index 0000000..3ff6978 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.drawImage.animated.js @@ -0,0 +1,10 @@ + +Canvas tests - 2d.drawImage.animated.* + +

    [index] +

    2d.drawImage.animated.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.drawImage.js b/platforms/ios/www/test/tests-todo/index.2d.drawImage.js new file mode 100644 index 0000000..c084ed5 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.drawImage.js @@ -0,0 +1,38 @@ + +Canvas tests - 2d.drawImage.* + +

    [index] +

    2d.drawImage.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.drawImage.self.js b/platforms/ios/www/test/tests-todo/index.2d.drawImage.self.js new file mode 100644 index 0000000..a4dd4db --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.drawImage.self.js @@ -0,0 +1,9 @@ + +Canvas tests - 2d.drawImage.self.* + +

    [index] +

    2d.drawImage.self.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.fillRect.js b/platforms/ios/www/test/tests-todo/index.2d.fillRect.js new file mode 100644 index 0000000..7902d29 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.fillRect.js @@ -0,0 +1,15 @@ + +Canvas tests - 2d.fillRect.* + +

    [index] +

    2d.fillRect.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.fillStyle.get.js b/platforms/ios/www/test/tests-todo/index.2d.fillStyle.get.js new file mode 100644 index 0000000..babfc04 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.fillStyle.get.js @@ -0,0 +1,10 @@ + +Canvas tests - 2d.fillStyle.get.* + +

    [index] +

    2d.fillStyle.get.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.fillStyle.js b/platforms/ios/www/test/tests-todo/index.2d.fillStyle.js new file mode 100644 index 0000000..3074f43 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.fillStyle.js @@ -0,0 +1,85 @@ + +Canvas tests - 2d.fillStyle.* + +

    [index] +

    2d.fillStyle.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.fillStyle.parse.current.js b/platforms/ios/www/test/tests-todo/index.2d.fillStyle.parse.current.js new file mode 100644 index 0000000..c33473b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.fillStyle.parse.current.js @@ -0,0 +1,10 @@ + +Canvas tests - 2d.fillStyle.parse.current.* + +

    [index] +

    2d.fillStyle.parse.current.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.fillStyle.parse.invalid.js b/platforms/ios/www/test/tests-todo/index.2d.fillStyle.parse.invalid.js new file mode 100644 index 0000000..7455a80 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.fillStyle.parse.invalid.js @@ -0,0 +1,37 @@ + +Canvas tests - 2d.fillStyle.parse.invalid.* + +

    [index] +

    2d.fillStyle.parse.invalid.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.fillStyle.parse.js b/platforms/ios/www/test/tests-todo/index.2d.fillStyle.parse.js new file mode 100644 index 0000000..c13c5ba --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.fillStyle.parse.js @@ -0,0 +1,79 @@ + +Canvas tests - 2d.fillStyle.parse.* + +

    [index] +

    2d.fillStyle.parse.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.getcontext.js b/platforms/ios/www/test/tests-todo/index.2d.getcontext.js new file mode 100644 index 0000000..dddf1cf --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.getcontext.js @@ -0,0 +1,12 @@ + +Canvas tests - 2d.getcontext.* + + + +

    [index] +

    2d.getcontext.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.gradient.interpolate.js b/platforms/ios/www/test/tests-todo/index.2d.gradient.interpolate.js new file mode 100644 index 0000000..c98d8b9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.gradient.interpolate.js @@ -0,0 +1,17 @@ + +Canvas tests - 2d.gradient.interpolate.* + +

    [index] +

    2d.gradient.interpolate.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.gradient.js b/platforms/ios/www/test/tests-todo/index.2d.gradient.js new file mode 100644 index 0000000..bd9c18c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.gradient.js @@ -0,0 +1,51 @@ + +Canvas tests - 2d.gradient.* + +

    [index] +

    2d.gradient.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.gradient.linear.js b/platforms/ios/www/test/tests-todo/index.2d.gradient.linear.js new file mode 100644 index 0000000..0af2bba --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.gradient.linear.js @@ -0,0 +1,11 @@ + +Canvas tests - 2d.gradient.linear.* + +

    [index] +

    2d.gradient.linear.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.gradient.linear.transform.js b/platforms/ios/www/test/tests-todo/index.2d.gradient.linear.transform.js new file mode 100644 index 0000000..34727f6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.gradient.linear.transform.js @@ -0,0 +1,10 @@ + +Canvas tests - 2d.gradient.linear.transform.* + +

    [index] +

    2d.gradient.linear.transform.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.gradient.object.js b/platforms/ios/www/test/tests-todo/index.2d.gradient.object.js new file mode 100644 index 0000000..0288955 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.gradient.object.js @@ -0,0 +1,13 @@ + +Canvas tests - 2d.gradient.object.* + +

    [index] +

    2d.gradient.object.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.gradient.radial.cone.js b/platforms/ios/www/test/tests-todo/index.2d.gradient.radial.cone.js new file mode 100644 index 0000000..fb66455 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.gradient.radial.cone.js @@ -0,0 +1,15 @@ + +Canvas tests - 2d.gradient.radial.cone.* + +

    [index] +

    2d.gradient.radial.cone.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.gradient.radial.js b/platforms/ios/www/test/tests-todo/index.2d.gradient.radial.js new file mode 100644 index 0000000..0248316 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.gradient.radial.js @@ -0,0 +1,30 @@ + +Canvas tests - 2d.gradient.radial.* + +

    [index] +

    2d.gradient.radial.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.gradient.radial.transform.js b/platforms/ios/www/test/tests-todo/index.2d.gradient.radial.transform.js new file mode 100644 index 0000000..a78982b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.gradient.radial.transform.js @@ -0,0 +1,10 @@ + +Canvas tests - 2d.gradient.radial.transform.* + +

    [index] +

    2d.gradient.radial.transform.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.imageData.create1.js b/platforms/ios/www/test/tests-todo/index.2d.imageData.create1.js new file mode 100644 index 0000000..e5c4579 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.imageData.create1.js @@ -0,0 +1,11 @@ + +Canvas tests - 2d.imageData.create1.* + +

    [index] +

    2d.imageData.create1.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.imageData.create2.js b/platforms/ios/www/test/tests-todo/index.2d.imageData.create2.js new file mode 100644 index 0000000..71307cc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.imageData.create2.js @@ -0,0 +1,16 @@ + +Canvas tests - 2d.imageData.create2.* + +

    [index] +

    2d.imageData.create2.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.imageData.get.js b/platforms/ios/www/test/tests-todo/index.2d.imageData.get.js new file mode 100644 index 0000000..2a3d575 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.imageData.get.js @@ -0,0 +1,24 @@ + +Canvas tests - 2d.imageData.get.* + +

    [index] +

    2d.imageData.get.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.imageData.get.order.js b/platforms/ios/www/test/tests-todo/index.2d.imageData.get.order.js new file mode 100644 index 0000000..c94c9f6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.imageData.get.order.js @@ -0,0 +1,11 @@ + +Canvas tests - 2d.imageData.get.order.* + +

    [index] +

    2d.imageData.get.order.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.imageData.get.source.js b/platforms/ios/www/test/tests-todo/index.2d.imageData.get.source.js new file mode 100644 index 0000000..30ec2d0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.imageData.get.source.js @@ -0,0 +1,10 @@ + +Canvas tests - 2d.imageData.get.source.* + +

    [index] +

    2d.imageData.get.source.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.imageData.js b/platforms/ios/www/test/tests-todo/index.2d.imageData.js new file mode 100644 index 0000000..7d74400 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.imageData.js @@ -0,0 +1,63 @@ + +Canvas tests - 2d.imageData.* + +

    [index] +

    2d.imageData.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.imageData.object.js b/platforms/ios/www/test/tests-todo/index.2d.imageData.object.js new file mode 100644 index 0000000..1ba7df5 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.imageData.object.js @@ -0,0 +1,16 @@ + +Canvas tests - 2d.imageData.object.* + +

    [index] +

    2d.imageData.object.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.imageData.put.dirty.js b/platforms/ios/www/test/tests-todo/index.2d.imageData.put.dirty.js new file mode 100644 index 0000000..ca00846 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.imageData.put.dirty.js @@ -0,0 +1,12 @@ + +Canvas tests - 2d.imageData.put.dirty.* + +

    [index] +

    2d.imageData.put.dirty.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.imageData.put.js b/platforms/ios/www/test/tests-todo/index.2d.imageData.put.js new file mode 100644 index 0000000..5db0364 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.imageData.put.js @@ -0,0 +1,24 @@ + +Canvas tests - 2d.imageData.put.* + +

    [index] +

    2d.imageData.put.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.js b/platforms/ios/www/test/tests-todo/index.2d.js new file mode 100644 index 0000000..d76b953 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.js @@ -0,0 +1,702 @@ + +Canvas tests - 2d.* + +

    [index] +

    2d.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.line.join.js b/platforms/ios/www/test/tests-todo/index.2d.line.join.js new file mode 100644 index 0000000..f2145b9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.line.join.js @@ -0,0 +1,15 @@ + +Canvas tests - 2d.line.join.* + +

    [index] +

    2d.line.join.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.line.miter.js b/platforms/ios/www/test/tests-todo/index.2d.line.miter.js new file mode 100644 index 0000000..a37532f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.line.miter.js @@ -0,0 +1,15 @@ + +Canvas tests - 2d.line.miter.* + +

    [index] +

    2d.line.miter.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.line.width.js b/platforms/ios/www/test/tests-todo/index.2d.line.width.js new file mode 100644 index 0000000..1776fce --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.line.width.js @@ -0,0 +1,12 @@ + +Canvas tests - 2d.line.width.* + +

    [index] +

    2d.line.width.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.path.arc.angle.js b/platforms/ios/www/test/tests-todo/index.2d.path.arc.angle.js new file mode 100644 index 0000000..3ac8136 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.path.arc.angle.js @@ -0,0 +1,13 @@ + +Canvas tests - 2d.path.arc.angle.* + +

    [index] +

    2d.path.arc.angle.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.path.arc.js b/platforms/ios/www/test/tests-todo/index.2d.path.arc.js new file mode 100644 index 0000000..98b7d58 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.path.arc.js @@ -0,0 +1,34 @@ + +Canvas tests - 2d.path.arc.* + +

    [index] +

    2d.path.arc.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.path.arc.scale.js b/platforms/ios/www/test/tests-todo/index.2d.path.arc.scale.js new file mode 100644 index 0000000..b620800 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.path.arc.scale.js @@ -0,0 +1,9 @@ + +Canvas tests - 2d.path.arc.scale.* + +

    [index] +

    2d.path.arc.scale.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.path.arc.selfintersect.js b/platforms/ios/www/test/tests-todo/index.2d.path.arc.selfintersect.js new file mode 100644 index 0000000..4360612 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.path.arc.selfintersect.js @@ -0,0 +1,9 @@ + +Canvas tests - 2d.path.arc.selfintersect.* + +

    [index] +

    2d.path.arc.selfintersect.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.path.arc.shape.js b/platforms/ios/www/test/tests-todo/index.2d.path.arc.shape.js new file mode 100644 index 0000000..45a6e76 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.path.arc.shape.js @@ -0,0 +1,12 @@ + +Canvas tests - 2d.path.arc.shape.* + +

    [index] +

    2d.path.arc.shape.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.path.arc.twopie.js b/platforms/ios/www/test/tests-todo/index.2d.path.arc.twopie.js new file mode 100644 index 0000000..c5b2b6f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.path.arc.twopie.js @@ -0,0 +1,11 @@ + +Canvas tests - 2d.path.arc.twopie.* + +

    [index] +

    2d.path.arc.twopie.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.path.arc.zero.js b/platforms/ios/www/test/tests-todo/index.2d.path.arc.zero.js new file mode 100644 index 0000000..02dafd8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.path.arc.zero.js @@ -0,0 +1,9 @@ + +Canvas tests - 2d.path.arc.zero.* + +

    [index] +

    2d.path.arc.zero.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.path.arcTo.coincide.js b/platforms/ios/www/test/tests-todo/index.2d.path.arcTo.coincide.js new file mode 100644 index 0000000..3102c50 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.path.arcTo.coincide.js @@ -0,0 +1,9 @@ + +Canvas tests - 2d.path.arcTo.coincide.* + +

    [index] +

    2d.path.arcTo.coincide.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.path.arcTo.collinear.js b/platforms/ios/www/test/tests-todo/index.2d.path.arcTo.collinear.js new file mode 100644 index 0000000..523388e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.path.arcTo.collinear.js @@ -0,0 +1,10 @@ + +Canvas tests - 2d.path.arcTo.collinear.* + +

    [index] +

    2d.path.arcTo.collinear.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.path.arcTo.ensuresubpath.js b/platforms/ios/www/test/tests-todo/index.2d.path.arcTo.ensuresubpath.js new file mode 100644 index 0000000..d298078 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.path.arcTo.ensuresubpath.js @@ -0,0 +1,9 @@ + +Canvas tests - 2d.path.arcTo.ensuresubpath.* + +

    [index] +

    2d.path.arcTo.ensuresubpath.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.path.arcTo.js b/platforms/ios/www/test/tests-todo/index.2d.path.arcTo.js new file mode 100644 index 0000000..25e68f5 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.path.arcTo.js @@ -0,0 +1,24 @@ + +Canvas tests - 2d.path.arcTo.* + +

    [index] +

    2d.path.arcTo.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.path.arcTo.shape.js b/platforms/ios/www/test/tests-todo/index.2d.path.arcTo.shape.js new file mode 100644 index 0000000..7b7870f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.path.arcTo.shape.js @@ -0,0 +1,11 @@ + +Canvas tests - 2d.path.arcTo.shape.* + +

    [index] +

    2d.path.arcTo.shape.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.path.arcTo.zero.js b/platforms/ios/www/test/tests-todo/index.2d.path.arcTo.zero.js new file mode 100644 index 0000000..f44ac32 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.path.arcTo.zero.js @@ -0,0 +1,9 @@ + +Canvas tests - 2d.path.arcTo.zero.* + +

    [index] +

    2d.path.arcTo.zero.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.path.bezierCurveTo.ensuresubpath.js b/platforms/ios/www/test/tests-todo/index.2d.path.bezierCurveTo.ensuresubpath.js new file mode 100644 index 0000000..fda5d92 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.path.bezierCurveTo.ensuresubpath.js @@ -0,0 +1,9 @@ + +Canvas tests - 2d.path.bezierCurveTo.ensuresubpath.* + +

    [index] +

    2d.path.bezierCurveTo.ensuresubpath.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.path.bezierCurveTo.js b/platforms/ios/www/test/tests-todo/index.2d.path.bezierCurveTo.js new file mode 100644 index 0000000..969b69e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.path.bezierCurveTo.js @@ -0,0 +1,13 @@ + +Canvas tests - 2d.path.bezierCurveTo.* + +

    [index] +

    2d.path.bezierCurveTo.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.path.clip.basic.js b/platforms/ios/www/test/tests-todo/index.2d.path.clip.basic.js new file mode 100644 index 0000000..bf4c7e4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.path.clip.basic.js @@ -0,0 +1,9 @@ + +Canvas tests - 2d.path.clip.basic.* + +

    [index] +

    2d.path.clip.basic.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.path.clip.js b/platforms/ios/www/test/tests-todo/index.2d.path.clip.js new file mode 100644 index 0000000..9d142e5 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.path.clip.js @@ -0,0 +1,14 @@ + +Canvas tests - 2d.path.clip.* + +

    [index] +

    2d.path.clip.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.path.clip.winding.js b/platforms/ios/www/test/tests-todo/index.2d.path.clip.winding.js new file mode 100644 index 0000000..34b2aec --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.path.clip.winding.js @@ -0,0 +1,9 @@ + +Canvas tests - 2d.path.clip.winding.* + +

    [index] +

    2d.path.clip.winding.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.path.closePath.js b/platforms/ios/www/test/tests-todo/index.2d.path.closePath.js new file mode 100644 index 0000000..ca0a5ca --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.path.closePath.js @@ -0,0 +1,10 @@ + +Canvas tests - 2d.path.closePath.* + +

    [index] +

    2d.path.closePath.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.path.fill.closed.js b/platforms/ios/www/test/tests-todo/index.2d.path.fill.closed.js new file mode 100644 index 0000000..a22e80a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.path.fill.closed.js @@ -0,0 +1,9 @@ + +Canvas tests - 2d.path.fill.closed.* + +

    [index] +

    2d.path.fill.closed.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.path.fill.js b/platforms/ios/www/test/tests-todo/index.2d.path.fill.js new file mode 100644 index 0000000..98661d4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.path.fill.js @@ -0,0 +1,14 @@ + +Canvas tests - 2d.path.fill.* + +

    [index] +

    2d.path.fill.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.path.fill.winding.js b/platforms/ios/www/test/tests-todo/index.2d.path.fill.winding.js new file mode 100644 index 0000000..e3dfa97 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.path.fill.winding.js @@ -0,0 +1,11 @@ + +Canvas tests - 2d.path.fill.winding.* + +

    [index] +

    2d.path.fill.winding.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.path.fill.winding.subtract.js b/platforms/ios/www/test/tests-todo/index.2d.path.fill.winding.subtract.js new file mode 100644 index 0000000..ff2026e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.path.fill.winding.subtract.js @@ -0,0 +1,10 @@ + +Canvas tests - 2d.path.fill.winding.subtract.* + +

    [index] +

    2d.path.fill.winding.subtract.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.path.isPointInPath.basic.js b/platforms/ios/www/test/tests-todo/index.2d.path.isPointInPath.basic.js new file mode 100644 index 0000000..c0ee716 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.path.isPointInPath.basic.js @@ -0,0 +1,9 @@ + +Canvas tests - 2d.path.isPointInPath.basic.* + +

    [index] +

    2d.path.isPointInPath.basic.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.path.isPointInPath.js b/platforms/ios/www/test/tests-todo/index.2d.path.isPointInPath.js new file mode 100644 index 0000000..666a7ac --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.path.isPointInPath.js @@ -0,0 +1,22 @@ + +Canvas tests - 2d.path.isPointInPath.* + +

    [index] +

    2d.path.isPointInPath.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.path.isPointInPath.transform.js b/platforms/ios/www/test/tests-todo/index.2d.path.isPointInPath.transform.js new file mode 100644 index 0000000..4259a7d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.path.isPointInPath.transform.js @@ -0,0 +1,10 @@ + +Canvas tests - 2d.path.isPointInPath.transform.* + +

    [index] +

    2d.path.isPointInPath.transform.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.path.js b/platforms/ios/www/test/tests-todo/index.2d.path.js new file mode 100644 index 0000000..e48260d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.path.js @@ -0,0 +1,137 @@ + +Canvas tests - 2d.path.* + +

    [index] +

    2d.path.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.path.lineTo.ensuresubpath.js b/platforms/ios/www/test/tests-todo/index.2d.path.lineTo.ensuresubpath.js new file mode 100644 index 0000000..9e9ad8e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.path.lineTo.ensuresubpath.js @@ -0,0 +1,9 @@ + +Canvas tests - 2d.path.lineTo.ensuresubpath.* + +

    [index] +

    2d.path.lineTo.ensuresubpath.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.path.lineTo.js b/platforms/ios/www/test/tests-todo/index.2d.path.lineTo.js new file mode 100644 index 0000000..e23e7d3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.path.lineTo.js @@ -0,0 +1,12 @@ + +Canvas tests - 2d.path.lineTo.* + +

    [index] +

    2d.path.lineTo.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.path.moveTo.js b/platforms/ios/www/test/tests-todo/index.2d.path.moveTo.js new file mode 100644 index 0000000..675660e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.path.moveTo.js @@ -0,0 +1,11 @@ + +Canvas tests - 2d.path.moveTo.* + +

    [index] +

    2d.path.moveTo.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.path.quadraticCurveTo.ensuresubpath.js b/platforms/ios/www/test/tests-todo/index.2d.path.quadraticCurveTo.ensuresubpath.js new file mode 100644 index 0000000..8738727 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.path.quadraticCurveTo.ensuresubpath.js @@ -0,0 +1,9 @@ + +Canvas tests - 2d.path.quadraticCurveTo.ensuresubpath.* + +

    [index] +

    2d.path.quadraticCurveTo.ensuresubpath.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.path.quadraticCurveTo.js b/platforms/ios/www/test/tests-todo/index.2d.path.quadraticCurveTo.js new file mode 100644 index 0000000..cbe7c56 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.path.quadraticCurveTo.js @@ -0,0 +1,13 @@ + +Canvas tests - 2d.path.quadraticCurveTo.* + +

    [index] +

    2d.path.quadraticCurveTo.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.path.rect.end.js b/platforms/ios/www/test/tests-todo/index.2d.path.rect.end.js new file mode 100644 index 0000000..c3c0771 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.path.rect.end.js @@ -0,0 +1,9 @@ + +Canvas tests - 2d.path.rect.end.* + +

    [index] +

    2d.path.rect.end.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.path.rect.js b/platforms/ios/www/test/tests-todo/index.2d.path.rect.js new file mode 100644 index 0000000..8a7bfed --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.path.rect.js @@ -0,0 +1,22 @@ + +Canvas tests - 2d.path.rect.* + +

    [index] +

    2d.path.rect.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.path.rect.zero.js b/platforms/ios/www/test/tests-todo/index.2d.path.rect.zero.js new file mode 100644 index 0000000..5b0d3a4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.path.rect.zero.js @@ -0,0 +1,13 @@ + +Canvas tests - 2d.path.rect.zero.* + +

    [index] +

    2d.path.rect.zero.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.path.stroke.js b/platforms/ios/www/test/tests-todo/index.2d.path.stroke.js new file mode 100644 index 0000000..23295e5 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.path.stroke.js @@ -0,0 +1,20 @@ + +Canvas tests - 2d.path.stroke.* + +

    [index] +

    2d.path.stroke.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.path.stroke.prune.js b/platforms/ios/www/test/tests-todo/index.2d.path.stroke.prune.js new file mode 100644 index 0000000..07db14d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.path.stroke.prune.js @@ -0,0 +1,13 @@ + +Canvas tests - 2d.path.stroke.prune.* + +

    [index] +

    2d.path.stroke.prune.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.path.transformation.js b/platforms/ios/www/test/tests-todo/index.2d.path.transformation.js new file mode 100644 index 0000000..bc7fce5 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.path.transformation.js @@ -0,0 +1,10 @@ + +Canvas tests - 2d.path.transformation.* + +

    [index] +

    2d.path.transformation.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.pattern.animated.js b/platforms/ios/www/test/tests-todo/index.2d.pattern.animated.js new file mode 100644 index 0000000..c3a3164 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.pattern.animated.js @@ -0,0 +1,8 @@ + +Canvas tests - 2d.pattern.animated.* + +

    [index] +

    2d.pattern.animated.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.pattern.basic.js b/platforms/ios/www/test/tests-todo/index.2d.pattern.basic.js new file mode 100644 index 0000000..f7db670 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.pattern.basic.js @@ -0,0 +1,12 @@ + +Canvas tests - 2d.pattern.basic.* + +

    [index] +

    2d.pattern.basic.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.pattern.image.js b/platforms/ios/www/test/tests-todo/index.2d.pattern.image.js new file mode 100644 index 0000000..24ea9f6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.pattern.image.js @@ -0,0 +1,12 @@ + +Canvas tests - 2d.pattern.image.* + +

    [index] +

    2d.pattern.image.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.pattern.js b/platforms/ios/www/test/tests-todo/index.2d.pattern.js new file mode 100644 index 0000000..0ff5587 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.pattern.js @@ -0,0 +1,47 @@ + +Canvas tests - 2d.pattern.* + +

    [index] +

    2d.pattern.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.pattern.modify.js b/platforms/ios/www/test/tests-todo/index.2d.pattern.modify.js new file mode 100644 index 0000000..21b1566 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.pattern.modify.js @@ -0,0 +1,11 @@ + +Canvas tests - 2d.pattern.modify.* + +

    [index] +

    2d.pattern.modify.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.pattern.paint.js b/platforms/ios/www/test/tests-todo/index.2d.pattern.paint.js new file mode 100644 index 0000000..141e77d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.pattern.paint.js @@ -0,0 +1,25 @@ + +Canvas tests - 2d.pattern.paint.* + +

    [index] +

    2d.pattern.paint.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.pattern.paint.norepeat.js b/platforms/ios/www/test/tests-todo/index.2d.pattern.paint.norepeat.js new file mode 100644 index 0000000..5b1a472 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.pattern.paint.norepeat.js @@ -0,0 +1,12 @@ + +Canvas tests - 2d.pattern.paint.norepeat.* + +

    [index] +

    2d.pattern.paint.norepeat.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.pattern.paint.orientation.js b/platforms/ios/www/test/tests-todo/index.2d.pattern.paint.orientation.js new file mode 100644 index 0000000..245be70 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.pattern.paint.orientation.js @@ -0,0 +1,9 @@ + +Canvas tests - 2d.pattern.paint.orientation.* + +

    [index] +

    2d.pattern.paint.orientation.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.pattern.paint.repeat.js b/platforms/ios/www/test/tests-todo/index.2d.pattern.paint.repeat.js new file mode 100644 index 0000000..c488691 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.pattern.paint.repeat.js @@ -0,0 +1,12 @@ + +Canvas tests - 2d.pattern.paint.repeat.* + +

    [index] +

    2d.pattern.paint.repeat.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.pattern.paint.repeatx.js b/platforms/ios/www/test/tests-todo/index.2d.pattern.paint.repeatx.js new file mode 100644 index 0000000..7ecaf89 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.pattern.paint.repeatx.js @@ -0,0 +1,10 @@ + +Canvas tests - 2d.pattern.paint.repeatx.* + +

    [index] +

    2d.pattern.paint.repeatx.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.pattern.paint.repeaty.js b/platforms/ios/www/test/tests-todo/index.2d.pattern.paint.repeaty.js new file mode 100644 index 0000000..61a1a34 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.pattern.paint.repeaty.js @@ -0,0 +1,10 @@ + +Canvas tests - 2d.pattern.paint.repeaty.* + +

    [index] +

    2d.pattern.paint.repeaty.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.pattern.repeat.js b/platforms/ios/www/test/tests-todo/index.2d.pattern.repeat.js new file mode 100644 index 0000000..76a5fa9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.pattern.repeat.js @@ -0,0 +1,13 @@ + +Canvas tests - 2d.pattern.repeat.* + +

    [index] +

    2d.pattern.repeat.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.shadow.alpha.js b/platforms/ios/www/test/tests-todo/index.2d.shadow.alpha.js new file mode 100644 index 0000000..2753a49 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.shadow.alpha.js @@ -0,0 +1,12 @@ + +Canvas tests - 2d.shadow.alpha.* + +

    [index] +

    2d.shadow.alpha.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.shadow.attributes.js b/platforms/ios/www/test/tests-todo/index.2d.shadow.attributes.js new file mode 100644 index 0000000..0c83d19 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.shadow.attributes.js @@ -0,0 +1,16 @@ + +Canvas tests - 2d.shadow.attributes.* + +

    [index] +

    2d.shadow.attributes.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.shadow.attributes.shadowBlur.js b/platforms/ios/www/test/tests-todo/index.2d.shadow.attributes.shadowBlur.js new file mode 100644 index 0000000..748b2a6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.shadow.attributes.shadowBlur.js @@ -0,0 +1,10 @@ + +Canvas tests - 2d.shadow.attributes.shadowBlur.* + +

    [index] +

    2d.shadow.attributes.shadowBlur.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.shadow.attributes.shadowColor.js b/platforms/ios/www/test/tests-todo/index.2d.shadow.attributes.shadowColor.js new file mode 100644 index 0000000..642d1f4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.shadow.attributes.shadowColor.js @@ -0,0 +1,10 @@ + +Canvas tests - 2d.shadow.attributes.shadowColor.* + +

    [index] +

    2d.shadow.attributes.shadowColor.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.shadow.attributes.shadowOffset.js b/platforms/ios/www/test/tests-todo/index.2d.shadow.attributes.shadowOffset.js new file mode 100644 index 0000000..9005fe4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.shadow.attributes.shadowOffset.js @@ -0,0 +1,10 @@ + +Canvas tests - 2d.shadow.attributes.shadowOffset.* + +

    [index] +

    2d.shadow.attributes.shadowOffset.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.shadow.blur.js b/platforms/ios/www/test/tests-todo/index.2d.shadow.blur.js new file mode 100644 index 0000000..dd62a09 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.shadow.blur.js @@ -0,0 +1,9 @@ + +Canvas tests - 2d.shadow.blur.* + +

    [index] +

    2d.shadow.blur.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.shadow.canvas.js b/platforms/ios/www/test/tests-todo/index.2d.shadow.canvas.js new file mode 100644 index 0000000..d5e55fa --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.shadow.canvas.js @@ -0,0 +1,11 @@ + +Canvas tests - 2d.shadow.canvas.* + +

    [index] +

    2d.shadow.canvas.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.shadow.canvas.transparent.js b/platforms/ios/www/test/tests-todo/index.2d.shadow.canvas.transparent.js new file mode 100644 index 0000000..a085357 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.shadow.canvas.transparent.js @@ -0,0 +1,9 @@ + +Canvas tests - 2d.shadow.canvas.transparent.* + +

    [index] +

    2d.shadow.canvas.transparent.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.shadow.clip.js b/platforms/ios/www/test/tests-todo/index.2d.shadow.clip.js new file mode 100644 index 0000000..50edf80 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.shadow.clip.js @@ -0,0 +1,10 @@ + +Canvas tests - 2d.shadow.clip.* + +

    [index] +

    2d.shadow.clip.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.shadow.composite.js b/platforms/ios/www/test/tests-todo/index.2d.shadow.composite.js new file mode 100644 index 0000000..8584f68 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.shadow.composite.js @@ -0,0 +1,10 @@ + +Canvas tests - 2d.shadow.composite.* + +

    [index] +

    2d.shadow.composite.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.shadow.enable.js b/platforms/ios/www/test/tests-todo/index.2d.shadow.enable.js new file mode 100644 index 0000000..948cf10 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.shadow.enable.js @@ -0,0 +1,12 @@ + +Canvas tests - 2d.shadow.enable.* + +

    [index] +

    2d.shadow.enable.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.shadow.enable.off.js b/platforms/ios/www/test/tests-todo/index.2d.shadow.enable.off.js new file mode 100644 index 0000000..4e92ccb --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.shadow.enable.off.js @@ -0,0 +1,9 @@ + +Canvas tests - 2d.shadow.enable.off.* + +

    [index] +

    2d.shadow.enable.off.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.shadow.gradient.js b/platforms/ios/www/test/tests-todo/index.2d.shadow.gradient.js new file mode 100644 index 0000000..e8c96d9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.shadow.gradient.js @@ -0,0 +1,11 @@ + +Canvas tests - 2d.shadow.gradient.* + +

    [index] +

    2d.shadow.gradient.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.shadow.gradient.transparent.js b/platforms/ios/www/test/tests-todo/index.2d.shadow.gradient.transparent.js new file mode 100644 index 0000000..36a2cf7 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.shadow.gradient.transparent.js @@ -0,0 +1,9 @@ + +Canvas tests - 2d.shadow.gradient.transparent.* + +

    [index] +

    2d.shadow.gradient.transparent.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.shadow.image.js b/platforms/ios/www/test/tests-todo/index.2d.shadow.image.js new file mode 100644 index 0000000..5f818ff --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.shadow.image.js @@ -0,0 +1,13 @@ + +Canvas tests - 2d.shadow.image.* + +

    [index] +

    2d.shadow.image.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.shadow.image.transparent.js b/platforms/ios/www/test/tests-todo/index.2d.shadow.image.transparent.js new file mode 100644 index 0000000..13e212d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.shadow.image.transparent.js @@ -0,0 +1,9 @@ + +Canvas tests - 2d.shadow.image.transparent.* + +

    [index] +

    2d.shadow.image.transparent.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.shadow.js b/platforms/ios/www/test/tests-todo/index.2d.shadow.js new file mode 100644 index 0000000..bf376f2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.shadow.js @@ -0,0 +1,65 @@ + +Canvas tests - 2d.shadow.* + +

    [index] +

    2d.shadow.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.shadow.offset.js b/platforms/ios/www/test/tests-todo/index.2d.shadow.offset.js new file mode 100644 index 0000000..95e4d4a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.shadow.offset.js @@ -0,0 +1,11 @@ + +Canvas tests - 2d.shadow.offset.* + +

    [index] +

    2d.shadow.offset.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.shadow.pattern.js b/platforms/ios/www/test/tests-todo/index.2d.shadow.pattern.js new file mode 100644 index 0000000..c39efe5 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.shadow.pattern.js @@ -0,0 +1,11 @@ + +Canvas tests - 2d.shadow.pattern.* + +

    [index] +

    2d.shadow.pattern.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.shadow.pattern.transparent.js b/platforms/ios/www/test/tests-todo/index.2d.shadow.pattern.transparent.js new file mode 100644 index 0000000..716cc4e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.shadow.pattern.transparent.js @@ -0,0 +1,9 @@ + +Canvas tests - 2d.shadow.pattern.transparent.* + +

    [index] +

    2d.shadow.pattern.transparent.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.shadow.stroke.cap.js b/platforms/ios/www/test/tests-todo/index.2d.shadow.stroke.cap.js new file mode 100644 index 0000000..93dd821 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.shadow.stroke.cap.js @@ -0,0 +1,9 @@ + +Canvas tests - 2d.shadow.stroke.cap.* + +

    [index] +

    2d.shadow.stroke.cap.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.shadow.stroke.join.js b/platforms/ios/www/test/tests-todo/index.2d.shadow.stroke.join.js new file mode 100644 index 0000000..96f6f21 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.shadow.stroke.join.js @@ -0,0 +1,10 @@ + +Canvas tests - 2d.shadow.stroke.join.* + +

    [index] +

    2d.shadow.stroke.join.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.shadow.stroke.js b/platforms/ios/www/test/tests-todo/index.2d.shadow.stroke.js new file mode 100644 index 0000000..4bde820 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.shadow.stroke.js @@ -0,0 +1,13 @@ + +Canvas tests - 2d.shadow.stroke.* + +

    [index] +

    2d.shadow.stroke.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.shadow.transform.js b/platforms/ios/www/test/tests-todo/index.2d.shadow.transform.js new file mode 100644 index 0000000..434d521 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.shadow.transform.js @@ -0,0 +1,9 @@ + +Canvas tests - 2d.shadow.transform.* + +

    [index] +

    2d.shadow.transform.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.state.js b/platforms/ios/www/test/tests-todo/index.2d.state.js new file mode 100644 index 0000000..517b3a9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.state.js @@ -0,0 +1,29 @@ + +Canvas tests - 2d.state.* + +

    [index] +

    2d.state.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.state.saverestore.js b/platforms/ios/www/test/tests-todo/index.2d.state.saverestore.js new file mode 100644 index 0000000..e01055f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.state.saverestore.js @@ -0,0 +1,29 @@ + +Canvas tests - 2d.state.saverestore.* + +

    [index] +

    2d.state.saverestore.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.strokeRect.js b/platforms/ios/www/test/tests-todo/index.2d.strokeRect.js new file mode 100644 index 0000000..e0acdd7 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.strokeRect.js @@ -0,0 +1,21 @@ + +Canvas tests - 2d.strokeRect.* + +

    [index] +

    2d.strokeRect.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.strokeRect.zero.js b/platforms/ios/www/test/tests-todo/index.2d.strokeRect.zero.js new file mode 100644 index 0000000..c0b058f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.strokeRect.zero.js @@ -0,0 +1,12 @@ + +Canvas tests - 2d.strokeRect.zero.* + +

    [index] +

    2d.strokeRect.zero.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.strokeStyle.js b/platforms/ios/www/test/tests-todo/index.2d.strokeStyle.js new file mode 100644 index 0000000..d262d37 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.strokeStyle.js @@ -0,0 +1,8 @@ + +Canvas tests - 2d.strokeStyle.* + +

    [index] +

    2d.strokeStyle.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.text.align.js b/platforms/ios/www/test/tests-todo/index.2d.text.align.js new file mode 100644 index 0000000..59de0fd --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.text.align.js @@ -0,0 +1,10 @@ + +Canvas tests - 2d.text.align.* + +

    [index] +

    2d.text.align.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.text.baseline.js b/platforms/ios/www/test/tests-todo/index.2d.text.baseline.js new file mode 100644 index 0000000..261e883 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.text.baseline.js @@ -0,0 +1,10 @@ + +Canvas tests - 2d.text.baseline.* + +

    [index] +

    2d.text.baseline.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.text.draw.align.end.js b/platforms/ios/www/test/tests-todo/index.2d.text.draw.align.end.js new file mode 100644 index 0000000..5c7b6c7 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.text.draw.align.end.js @@ -0,0 +1,9 @@ + +Canvas tests - 2d.text.draw.align.end.* + +

    [index] +

    2d.text.draw.align.end.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.text.draw.align.js b/platforms/ios/www/test/tests-todo/index.2d.text.draw.align.js new file mode 100644 index 0000000..887a4e2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.text.draw.align.js @@ -0,0 +1,14 @@ + +Canvas tests - 2d.text.draw.align.* + +

    [index] +

    2d.text.draw.align.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.text.draw.align.start.js b/platforms/ios/www/test/tests-todo/index.2d.text.draw.align.start.js new file mode 100644 index 0000000..068a921 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.text.draw.align.start.js @@ -0,0 +1,9 @@ + +Canvas tests - 2d.text.draw.align.start.* + +

    [index] +

    2d.text.draw.align.start.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.text.draw.baseline.js b/platforms/ios/www/test/tests-todo/index.2d.text.draw.baseline.js new file mode 100644 index 0000000..2e9de03 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.text.draw.baseline.js @@ -0,0 +1,13 @@ + +Canvas tests - 2d.text.draw.baseline.* + +

    [index] +

    2d.text.draw.baseline.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.text.draw.fill.js b/platforms/ios/www/test/tests-todo/index.2d.text.draw.fill.js new file mode 100644 index 0000000..5636ccf --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.text.draw.fill.js @@ -0,0 +1,15 @@ + +Canvas tests - 2d.text.draw.fill.* + +

    [index] +

    2d.text.draw.fill.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.text.draw.fill.maxWidth.js b/platforms/ios/www/test/tests-todo/index.2d.text.draw.fill.maxWidth.js new file mode 100644 index 0000000..7312de6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.text.draw.fill.maxWidth.js @@ -0,0 +1,12 @@ + +Canvas tests - 2d.text.draw.fill.maxWidth.* + +

    [index] +

    2d.text.draw.fill.maxWidth.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.text.draw.fontface.js b/platforms/ios/www/test/tests-todo/index.2d.text.draw.fontface.js new file mode 100644 index 0000000..3fd3306 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.text.draw.fontface.js @@ -0,0 +1,9 @@ + +Canvas tests - 2d.text.draw.fontface.* + +

    [index] +

    2d.text.draw.fontface.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.text.draw.js b/platforms/ios/www/test/tests-todo/index.2d.text.draw.js new file mode 100644 index 0000000..5c47278 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.text.draw.js @@ -0,0 +1,40 @@ + +Canvas tests - 2d.text.draw.* + +

    [index] +

    2d.text.draw.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.text.draw.kern.js b/platforms/ios/www/test/tests-todo/index.2d.text.draw.kern.js new file mode 100644 index 0000000..4534a78 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.text.draw.kern.js @@ -0,0 +1,8 @@ + +Canvas tests - 2d.text.draw.kern.* + +

    [index] +

    2d.text.draw.kern.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.text.draw.space.collapse.js b/platforms/ios/www/test/tests-todo/index.2d.text.draw.space.collapse.js new file mode 100644 index 0000000..7677a08 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.text.draw.space.collapse.js @@ -0,0 +1,12 @@ + +Canvas tests - 2d.text.draw.space.collapse.* + +

    [index] +

    2d.text.draw.space.collapse.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.text.draw.stroke.js b/platforms/ios/www/test/tests-todo/index.2d.text.draw.stroke.js new file mode 100644 index 0000000..eb09166 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.text.draw.stroke.js @@ -0,0 +1,9 @@ + +Canvas tests - 2d.text.draw.stroke.* + +

    [index] +

    2d.text.draw.stroke.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.text.font.js b/platforms/ios/www/test/tests-todo/index.2d.text.font.js new file mode 100644 index 0000000..0e2170a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.text.font.js @@ -0,0 +1,14 @@ + +Canvas tests - 2d.text.font.* + +

    [index] +

    2d.text.font.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.text.font.parse.js b/platforms/ios/www/test/tests-todo/index.2d.text.font.parse.js new file mode 100644 index 0000000..e567198 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.text.font.parse.js @@ -0,0 +1,13 @@ + +Canvas tests - 2d.text.font.parse.* + +

    [index] +

    2d.text.font.parse.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.text.font.parse.size.js b/platforms/ios/www/test/tests-todo/index.2d.text.font.parse.size.js new file mode 100644 index 0000000..d240191 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.text.font.parse.size.js @@ -0,0 +1,9 @@ + +Canvas tests - 2d.text.font.parse.size.* + +

    [index] +

    2d.text.font.parse.size.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.text.font.parse.size.percentage.js b/platforms/ios/www/test/tests-todo/index.2d.text.font.parse.size.percentage.js new file mode 100644 index 0000000..8f3ba4f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.text.font.parse.size.percentage.js @@ -0,0 +1,8 @@ + +Canvas tests - 2d.text.font.parse.size.percentage.* + +

    [index] +

    2d.text.font.parse.size.percentage.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.text.js b/platforms/ios/www/test/tests-todo/index.2d.text.js new file mode 100644 index 0000000..9bcdbdb --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.text.js @@ -0,0 +1,56 @@ + +Canvas tests - 2d.text.* + +

    [index] +

    2d.text.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.text.measure.js b/platforms/ios/www/test/tests-todo/index.2d.text.measure.js new file mode 100644 index 0000000..53c8267 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.text.measure.js @@ -0,0 +1,10 @@ + +Canvas tests - 2d.text.measure.* + +

    [index] +

    2d.text.measure.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.text.measure.width.js b/platforms/ios/www/test/tests-todo/index.2d.text.measure.width.js new file mode 100644 index 0000000..894dfd8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.text.measure.width.js @@ -0,0 +1,10 @@ + +Canvas tests - 2d.text.measure.width.* + +

    [index] +

    2d.text.measure.width.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.transformation.js b/platforms/ios/www/test/tests-todo/index.2d.transformation.js new file mode 100644 index 0000000..b5e90a6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.transformation.js @@ -0,0 +1,29 @@ + +Canvas tests - 2d.transformation.* + +

    [index] +

    2d.transformation.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.transformation.rotate.js b/platforms/ios/www/test/tests-todo/index.2d.transformation.rotate.js new file mode 100644 index 0000000..228fdca --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.transformation.rotate.js @@ -0,0 +1,13 @@ + +Canvas tests - 2d.transformation.rotate.* + +

    [index] +

    2d.transformation.rotate.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.transformation.scale.js b/platforms/ios/www/test/tests-todo/index.2d.transformation.scale.js new file mode 100644 index 0000000..8112904 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.transformation.scale.js @@ -0,0 +1,13 @@ + +Canvas tests - 2d.transformation.scale.* + +

    [index] +

    2d.transformation.scale.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.transformation.setTransform.js b/platforms/ios/www/test/tests-todo/index.2d.transformation.setTransform.js new file mode 100644 index 0000000..7826d13 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.transformation.setTransform.js @@ -0,0 +1,10 @@ + +Canvas tests - 2d.transformation.setTransform.* + +

    [index] +

    2d.transformation.setTransform.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.transformation.transform.js b/platforms/ios/www/test/tests-todo/index.2d.transformation.transform.js new file mode 100644 index 0000000..6c61dd0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.transformation.transform.js @@ -0,0 +1,11 @@ + +Canvas tests - 2d.transformation.transform.* + +

    [index] +

    2d.transformation.transform.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.2d.transformation.translate.js b/platforms/ios/www/test/tests-todo/index.2d.transformation.translate.js new file mode 100644 index 0000000..11f8a5c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.2d.transformation.translate.js @@ -0,0 +1,9 @@ + +Canvas tests - 2d.transformation.translate.* + +

    [index] +

    2d.transformation.translate.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.all.js b/platforms/ios/www/test/tests-todo/index.all.js new file mode 100644 index 0000000..72f049c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.all.js @@ -0,0 +1,795 @@ + +Canvas tests - all.* + +

    [index] +

    all.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.context.js b/platforms/ios/www/test/tests-todo/index.context.js new file mode 100644 index 0000000..cadb4cf --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.context.js @@ -0,0 +1,13 @@ + +Canvas tests - context.* + +

    [index] +

    context.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.context.unrecognised.js b/platforms/ios/www/test/tests-todo/index.context.unrecognised.js new file mode 100644 index 0000000..ab48267 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.context.unrecognised.js @@ -0,0 +1,11 @@ + +Canvas tests - context.unrecognised.* + +

    [index] +

    context.unrecognised.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.fallback.js b/platforms/ios/www/test/tests-todo/index.fallback.js new file mode 100644 index 0000000..be1aded --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.fallback.js @@ -0,0 +1,10 @@ + +Canvas tests - fallback.* + +

    [index] +

    fallback.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.initial.js b/platforms/ios/www/test/tests-todo/index.initial.js new file mode 100644 index 0000000..3a99319 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.initial.js @@ -0,0 +1,16 @@ + +Canvas tests - initial.* + +

    [index] +

    initial.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.initial.reset.js b/platforms/ios/www/test/tests-todo/index.initial.reset.js new file mode 100644 index 0000000..c638aaa --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.initial.reset.js @@ -0,0 +1,15 @@ + +Canvas tests - initial.reset.* + +

    [index] +

    initial.reset.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.js b/platforms/ios/www/test/tests-todo/index.js new file mode 100644 index 0000000..c763e66 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.js @@ -0,0 +1,4 @@ +function expand(obj) { + obj.parentNode.className = obj.parentNode.className ? "" : "expand"; + return false; +} diff --git a/platforms/ios/www/test/tests-todo/index.security.drawImage.js b/platforms/ios/www/test/tests-todo/index.security.drawImage.js new file mode 100644 index 0000000..e3e2b22 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.security.drawImage.js @@ -0,0 +1,9 @@ + +Canvas tests - security.drawImage.* + +

    [index] +

    security.drawImage.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.security.js b/platforms/ios/www/test/tests-todo/index.security.js new file mode 100644 index 0000000..b53db93 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.security.js @@ -0,0 +1,18 @@ + +Canvas tests - security.* + +

    [index] +

    security.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.security.pattern.canvas.js b/platforms/ios/www/test/tests-todo/index.security.pattern.canvas.js new file mode 100644 index 0000000..89bd714 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.security.pattern.canvas.js @@ -0,0 +1,10 @@ + +Canvas tests - security.pattern.canvas.* + +

    [index] +

    security.pattern.canvas.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.security.pattern.image.js b/platforms/ios/www/test/tests-todo/index.security.pattern.image.js new file mode 100644 index 0000000..23be2c4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.security.pattern.image.js @@ -0,0 +1,9 @@ + +Canvas tests - security.pattern.image.* + +

    [index] +

    security.pattern.image.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.security.pattern.js b/platforms/ios/www/test/tests-todo/index.security.pattern.js new file mode 100644 index 0000000..95cf337 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.security.pattern.js @@ -0,0 +1,14 @@ + +Canvas tests - security.pattern.* + +

    [index] +

    security.pattern.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.size.attributes.idl.set.js b/platforms/ios/www/test/tests-todo/index.size.attributes.idl.set.js new file mode 100644 index 0000000..62b6fbf --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.size.attributes.idl.set.js @@ -0,0 +1,8 @@ + +Canvas tests - size.attributes.idl.set.* + +

    [index] +

    size.attributes.idl.set.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.size.attributes.js b/platforms/ios/www/test/tests-todo/index.size.attributes.js new file mode 100644 index 0000000..f854dd7 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.size.attributes.js @@ -0,0 +1,47 @@ + +Canvas tests - size.attributes.* + +

    [index] +

    size.attributes.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.size.attributes.parse.js b/platforms/ios/www/test/tests-todo/index.size.attributes.parse.js new file mode 100644 index 0000000..1879a1e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.size.attributes.parse.js @@ -0,0 +1,22 @@ + +Canvas tests - size.attributes.parse.* + +

    [index] +

    size.attributes.parse.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.size.attributes.reflect.js b/platforms/ios/www/test/tests-todo/index.size.attributes.reflect.js new file mode 100644 index 0000000..afc5b10 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.size.attributes.reflect.js @@ -0,0 +1,10 @@ + +Canvas tests - size.attributes.reflect.* + +

    [index] +

    size.attributes.reflect.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.size.attributes.setAttribute.js b/platforms/ios/www/test/tests-todo/index.size.attributes.setAttribute.js new file mode 100644 index 0000000..b799f38 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.size.attributes.setAttribute.js @@ -0,0 +1,22 @@ + +Canvas tests - size.attributes.setAttribute.* + +

    [index] +

    size.attributes.setAttribute.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.size.js b/platforms/ios/www/test/tests-todo/index.size.js new file mode 100644 index 0000000..11f1f96 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.size.js @@ -0,0 +1,47 @@ + +Canvas tests - size.* + +

    [index] +

    size.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.toDataURL.arguments.js b/platforms/ios/www/test/tests-todo/index.toDataURL.arguments.js new file mode 100644 index 0000000..caa4df4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.toDataURL.arguments.js @@ -0,0 +1,10 @@ + +Canvas tests - toDataURL.arguments.* + +

    [index] +

    toDataURL.arguments.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.toDataURL.jpeg.js b/platforms/ios/www/test/tests-todo/index.toDataURL.jpeg.js new file mode 100644 index 0000000..dbc3267 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.toDataURL.jpeg.js @@ -0,0 +1,12 @@ + +Canvas tests - toDataURL.jpeg.* + +

    [index] +

    toDataURL.jpeg.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.toDataURL.jpeg.quality.js b/platforms/ios/www/test/tests-todo/index.toDataURL.jpeg.quality.js new file mode 100644 index 0000000..4ec4cca --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.toDataURL.jpeg.quality.js @@ -0,0 +1,10 @@ + +Canvas tests - toDataURL.jpeg.quality.* + +

    [index] +

    toDataURL.jpeg.quality.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.toDataURL.js b/platforms/ios/www/test/tests-todo/index.toDataURL.js new file mode 100644 index 0000000..238a38c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.toDataURL.js @@ -0,0 +1,25 @@ + +Canvas tests - toDataURL.* + +

    [index] +

    toDataURL.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.toDataURL.lowercase.js b/platforms/ios/www/test/tests-todo/index.toDataURL.lowercase.js new file mode 100644 index 0000000..be891ac --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.toDataURL.lowercase.js @@ -0,0 +1,9 @@ + +Canvas tests - toDataURL.lowercase.* + +

    [index] +

    toDataURL.lowercase.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/index.type.js b/platforms/ios/www/test/tests-todo/index.type.js new file mode 100644 index 0000000..76301a0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/index.type.js @@ -0,0 +1,13 @@ + +Canvas tests - type.* + +

    [index] +

    type.*

    +

    + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/initial.colour.js b/platforms/ios/www/test/tests-todo/initial.colour.js new file mode 100644 index 0000000..27b8217 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/initial.colour.js @@ -0,0 +1 @@ +}); diff --git a/platforms/ios/www/test/tests-todo/initial.reset.2dstate.js b/platforms/ios/www/test/tests-todo/initial.reset.2dstate.js new file mode 100644 index 0000000..c3a970b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/initial.reset.2dstate.js @@ -0,0 +1,82 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 100; +var default_val; + +default_val = ctx.strokeStyle; +ctx.strokeStyle = "#ff0000"; +canvas.width = 100; +_assertSame(ctx.strokeStyle, default_val, "ctx.strokeStyle", "default_val"); + +default_val = ctx.fillStyle; +ctx.fillStyle = "#ff0000"; +canvas.width = 100; +_assertSame(ctx.fillStyle, default_val, "ctx.fillStyle", "default_val"); + +default_val = ctx.globalAlpha; +ctx.globalAlpha = 0.5; +canvas.width = 100; +_assertSame(ctx.globalAlpha, default_val, "ctx.globalAlpha", "default_val"); + +default_val = ctx.lineWidth; +ctx.lineWidth = 0.5; +canvas.width = 100; +_assertSame(ctx.lineWidth, default_val, "ctx.lineWidth", "default_val"); + +default_val = ctx.lineCap; +ctx.lineCap = "round"; +canvas.width = 100; +_assertSame(ctx.lineCap, default_val, "ctx.lineCap", "default_val"); + +default_val = ctx.lineJoin; +ctx.lineJoin = "round"; +canvas.width = 100; +_assertSame(ctx.lineJoin, default_val, "ctx.lineJoin", "default_val"); + +default_val = ctx.miterLimit; +ctx.miterLimit = 0.5; +canvas.width = 100; +_assertSame(ctx.miterLimit, default_val, "ctx.miterLimit", "default_val"); + +default_val = ctx.shadowOffsetX; +ctx.shadowOffsetX = 5; +canvas.width = 100; +_assertSame(ctx.shadowOffsetX, default_val, "ctx.shadowOffsetX", "default_val"); + +default_val = ctx.shadowOffsetY; +ctx.shadowOffsetY = 5; +canvas.width = 100; +_assertSame(ctx.shadowOffsetY, default_val, "ctx.shadowOffsetY", "default_val"); + +default_val = ctx.shadowBlur; +ctx.shadowBlur = 5; +canvas.width = 100; +_assertSame(ctx.shadowBlur, default_val, "ctx.shadowBlur", "default_val"); + +default_val = ctx.shadowColor; +ctx.shadowColor = "#ff0000"; +canvas.width = 100; +_assertSame(ctx.shadowColor, default_val, "ctx.shadowColor", "default_val"); + +default_val = ctx.globalCompositeOperation; +ctx.globalCompositeOperation = "copy"; +canvas.width = 100; +_assertSame(ctx.globalCompositeOperation, default_val, "ctx.globalCompositeOperation", "default_val"); + +default_val = ctx.font; +ctx.font = "25px serif"; +canvas.width = 100; +_assertSame(ctx.font, default_val, "ctx.font", "default_val"); + +default_val = ctx.textAlign; +ctx.textAlign = "center"; +canvas.width = 100; +_assertSame(ctx.textAlign, default_val, "ctx.textAlign", "default_val"); + +default_val = ctx.textBaseline; +ctx.textBaseline = "bottom"; +canvas.width = 100; +_assertSame(ctx.textBaseline, default_val, "ctx.textBaseline", "default_val"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/initial.reset.different.js b/platforms/ios/www/test/tests-todo/initial.reset.different.js new file mode 100644 index 0000000..032822c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/initial.reset.different.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 20,20, 255,0,0,255, "20,20", "255,0,0,255"); +canvas.width = 50; +_assertPixel(canvas, 20,20, 0,0,0,0, "20,20", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/initial.reset.gradient.js b/platforms/ios/www/test/tests-todo/initial.reset.gradient.js new file mode 100644 index 0000000..54e141e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/initial.reset.gradient.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 50; +var g = ctx.createLinearGradient(0, 0, 100, 0); +g.addColorStop(0, '#0f0'); +g.addColorStop(1, '#0f0'); +canvas.width = 100; +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/initial.reset.path.js b/platforms/ios/www/test/tests-todo/initial.reset.path.js new file mode 100644 index 0000000..2b8b948 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/initial.reset.path.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 100; +ctx.rect(0, 0, 100, 50); +canvas.width = 100; +ctx.fillStyle = '#f00'; +ctx.fill(); +_assertPixel(canvas, 20,20, 0,0,0,0, "20,20", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/initial.reset.pattern.js b/platforms/ios/www/test/tests-todo/initial.reset.pattern.js new file mode 100644 index 0000000..12b78fb --- /dev/null +++ b/platforms/ios/www/test/tests-todo/initial.reset.pattern.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 30; +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 30, 50); +var p = ctx.createPattern(canvas, 'repeat-x'); +canvas.width = 100; +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = p; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/initial.reset.same.js b/platforms/ios/www/test/tests-todo/initial.reset.same.js new file mode 100644 index 0000000..14deafb --- /dev/null +++ b/platforms/ios/www/test/tests-todo/initial.reset.same.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 100; +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 20,20, 255,0,0,255, "20,20", "255,0,0,255"); +canvas.width = 100; +_assertPixel(canvas, 20,20, 0,0,0,0, "20,20", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/initial.reset.transform.js b/platforms/ios/www/test/tests-todo/initial.reset.transform.js new file mode 100644 index 0000000..5a3f98b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/initial.reset.transform.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 100; +ctx.scale(0.1, 0.1); +canvas.width = 100; +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 20,20, 0,255,0,255, "20,20", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.canvas.readonly.js b/platforms/ios/www/test/tests-todo/minimal.2d.canvas.readonly.js new file mode 100644 index 0000000..3d67615 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.canvas.readonly.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +var c = document.createElement('canvas'); +var d = ctx.canvas; +_assertDifferent(c, d, "c", "d"); +try { ctx.canvas = c; } catch (e) {} // TODO: not sure whether this should throw or not... +_assertSame(ctx.canvas, d, "ctx.canvas", "d"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.canvas.reference.js b/platforms/ios/www/test/tests-todo/minimal.2d.canvas.reference.js new file mode 100644 index 0000000..23d3429 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.canvas.reference.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(ctx.canvas, canvas, "ctx.canvas", "canvas"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.clearRect.basic.js b/platforms/ios/www/test/tests-todo/minimal.2d.clearRect.basic.js new file mode 100644 index 0000000..57341a3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.clearRect.basic.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.clearRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.clearRect.clip.js b/platforms/ios/www/test/tests-todo/minimal.2d.clearRect.clip.js new file mode 100644 index 0000000..057de6f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.clearRect.clip.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.beginPath(); +ctx.rect(0, 0, 16, 16); +ctx.clip(); + +ctx.clearRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 16, 16); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.clearRect.globalalpha.js b/platforms/ios/www/test/tests-todo/minimal.2d.clearRect.globalalpha.js new file mode 100644 index 0000000..4525615 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.clearRect.globalalpha.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalAlpha = 0.1; +ctx.clearRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.clearRect.globalcomposite.js b/platforms/ios/www/test/tests-todo/minimal.2d.clearRect.globalcomposite.js new file mode 100644 index 0000000..8285119 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.clearRect.globalcomposite.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-atop'; +ctx.clearRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.clearRect.negative.js b/platforms/ios/www/test/tests-todo/minimal.2d.clearRect.negative.js new file mode 100644 index 0000000..a3574f3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.clearRect.negative.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.clearRect(0, 0, 50, 25); +ctx.clearRect(100, 0, -50, 25); +ctx.clearRect(0, 50, 50, -25); +ctx.clearRect(100, 50, -50, -25); +_assertPixel(canvas, 25,12, 0,0,0,0, "25,12", "0,0,0,0"); +_assertPixel(canvas, 75,12, 0,0,0,0, "75,12", "0,0,0,0"); +_assertPixel(canvas, 25,37, 0,0,0,0, "25,37", "0,0,0,0"); +_assertPixel(canvas, 75,37, 0,0,0,0, "75,37", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.clearRect.nonfinite.js b/platforms/ios/www/test/tests-todo/minimal.2d.clearRect.nonfinite.js new file mode 100644 index 0000000..5347945 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.clearRect.nonfinite.js @@ -0,0 +1,33 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.clearRect(Infinity, 0, 100, 50); +ctx.clearRect(-Infinity, 0, 100, 50); +ctx.clearRect(NaN, 0, 100, 50); +ctx.clearRect(0, Infinity, 100, 50); +ctx.clearRect(0, -Infinity, 100, 50); +ctx.clearRect(0, NaN, 100, 50); +ctx.clearRect(0, 0, Infinity, 50); +ctx.clearRect(0, 0, -Infinity, 50); +ctx.clearRect(0, 0, NaN, 50); +ctx.clearRect(0, 0, 100, Infinity); +ctx.clearRect(0, 0, 100, -Infinity); +ctx.clearRect(0, 0, 100, NaN); +ctx.clearRect(Infinity, Infinity, 100, 50); +ctx.clearRect(Infinity, Infinity, Infinity, 50); +ctx.clearRect(Infinity, Infinity, Infinity, Infinity); +ctx.clearRect(Infinity, Infinity, 100, Infinity); +ctx.clearRect(Infinity, 0, Infinity, 50); +ctx.clearRect(Infinity, 0, Infinity, Infinity); +ctx.clearRect(Infinity, 0, 100, Infinity); +ctx.clearRect(0, Infinity, Infinity, 50); +ctx.clearRect(0, Infinity, Infinity, Infinity); +ctx.clearRect(0, Infinity, 100, Infinity); +ctx.clearRect(0, 0, Infinity, Infinity); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.clearRect.path.js b/platforms/ios/www/test/tests-todo/minimal.2d.clearRect.path.js new file mode 100644 index 0000000..360372a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.clearRect.path.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.beginPath(); +ctx.rect(0, 0, 100, 50); +ctx.clearRect(0, 0, 16, 16); +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.clearRect.shadow.js b/platforms/ios/www/test/tests-todo/minimal.2d.clearRect.shadow.js new file mode 100644 index 0000000..152d3dd --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.clearRect.shadow.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = '#f00'; +ctx.shadowBlur = 0; +ctx.shadowOffsetX = 0; +ctx.shadowOffsetY = 50; +ctx.clearRect(0, -50, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.clearRect.transform.js b/platforms/ios/www/test/tests-todo/minimal.2d.clearRect.transform.js new file mode 100644 index 0000000..6b407f4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.clearRect.transform.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.scale(10, 10); +ctx.translate(0, 5); +ctx.clearRect(0, -5, 10, 5); +_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.clearRect.zero.js b/platforms/ios/www/test/tests-todo/minimal.2d.clearRect.zero.js new file mode 100644 index 0000000..efdde6b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.clearRect.zero.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.clearRect(0, 0, 100, 0); +ctx.clearRect(0, 0, 0, 50); +ctx.clearRect(0, 0, 0, 0); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.canvas.copy.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.canvas.copy.js new file mode 100644 index 0000000..01e90bf --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.canvas.copy.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + + +var canvas2 = document.createElement('canvas'); +canvas2.width = canvas.width; +canvas2.height = canvas.height; +var ctx2 = canvas2.getContext('2d'); +ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0); +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'copy'; +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 255,255,0,191, "50,25", "255,255,0,191", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.canvas.destination-atop.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.canvas.destination-atop.js new file mode 100644 index 0000000..c4b9d04 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.canvas.destination-atop.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + + +var canvas2 = document.createElement('canvas'); +canvas2.width = canvas.width; +canvas2.height = canvas.height; +var ctx2 = canvas2.getContext('2d'); +ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0); +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-atop'; +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 127,255,127,191, "50,25", "127,255,127,191", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.canvas.destination-in.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.canvas.destination-in.js new file mode 100644 index 0000000..61f0166 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.canvas.destination-in.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + + +var canvas2 = document.createElement('canvas'); +canvas2.width = canvas.width; +canvas2.height = canvas.height; +var ctx2 = canvas2.getContext('2d'); +ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0); +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-in'; +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 0,255,255,95, "50,25", "0,255,255,95", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.canvas.destination-out.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.canvas.destination-out.js new file mode 100644 index 0000000..55e32d8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.canvas.destination-out.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + + +var canvas2 = document.createElement('canvas'); +canvas2.width = canvas.width; +canvas2.height = canvas.height; +var ctx2 = canvas2.getContext('2d'); +ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0); +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-out'; +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 0,255,255,31, "50,25", "0,255,255,31", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.canvas.destination-over.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.canvas.destination-over.js new file mode 100644 index 0000000..0ae2682 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.canvas.destination-over.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + + +var canvas2 = document.createElement('canvas'); +canvas2.width = canvas.width; +canvas2.height = canvas.height; +var ctx2 = canvas2.getContext('2d'); +ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0); +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-over'; +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 109,255,145,223, "50,25", "109,255,145,223", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.canvas.lighter.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.canvas.lighter.js new file mode 100644 index 0000000..fbb860d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.canvas.lighter.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + + +var canvas2 = document.createElement('canvas'); +canvas2.width = canvas.width; +canvas2.height = canvas.height; +var ctx2 = canvas2.getContext('2d'); +ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0); +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'lighter'; +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 191,255,127,255, "50,25", "191,255,127,255", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.canvas.source-atop.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.canvas.source-atop.js new file mode 100644 index 0000000..92c4999 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.canvas.source-atop.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + + +var canvas2 = document.createElement('canvas'); +canvas2.width = canvas.width; +canvas2.height = canvas.height; +var ctx2 = canvas2.getContext('2d'); +ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0); +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-atop'; +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 191,255,63,127, "50,25", "191,255,63,127", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.canvas.source-in.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.canvas.source-in.js new file mode 100644 index 0000000..1aa5c4c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.canvas.source-in.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + + +var canvas2 = document.createElement('canvas'); +canvas2.width = canvas.width; +canvas2.height = canvas.height; +var ctx2 = canvas2.getContext('2d'); +ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0); +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-in'; +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 255,255,0,95, "50,25", "255,255,0,95", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.canvas.source-out.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.canvas.source-out.js new file mode 100644 index 0000000..d182826 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.canvas.source-out.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + + +var canvas2 = document.createElement('canvas'); +canvas2.width = canvas.width; +canvas2.height = canvas.height; +var ctx2 = canvas2.getContext('2d'); +ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0); +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-out'; +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 255,255,0,95, "50,25", "255,255,0,95", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.canvas.source-over.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.canvas.source-over.js new file mode 100644 index 0000000..9a050b6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.canvas.source-over.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + + +var canvas2 = document.createElement('canvas'); +canvas2.width = canvas.width; +canvas2.height = canvas.height; +var ctx2 = canvas2.getContext('2d'); +ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0); +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-over'; +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 218,255,36,223, "50,25", "218,255,36,223", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.canvas.xor.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.canvas.xor.js new file mode 100644 index 0000000..3a9df1c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.canvas.xor.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + + +var canvas2 = document.createElement('canvas'); +canvas2.width = canvas.width; +canvas2.height = canvas.height; +var ctx2 = canvas2.getContext('2d'); +ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0); +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'xor'; +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 191,255,63,127, "50,25", "191,255,63,127", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.clip.copy.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.clip.copy.js new file mode 100644 index 0000000..f3dfba4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.clip.copy.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'copy'; +ctx.rect(-20, -20, 10, 10); +ctx.clip(); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.clip.destination-atop.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.clip.destination-atop.js new file mode 100644 index 0000000..70645dc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.clip.destination-atop.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-atop'; +ctx.rect(-20, -20, 10, 10); +ctx.clip(); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.clip.destination-in.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.clip.destination-in.js new file mode 100644 index 0000000..f6f0e76 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.clip.destination-in.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-in'; +ctx.rect(-20, -20, 10, 10); +ctx.clip(); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.clip.destination-out.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.clip.destination-out.js new file mode 100644 index 0000000..b21df0b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.clip.destination-out.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-out'; +ctx.rect(-20, -20, 10, 10); +ctx.clip(); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.clip.destination-over.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.clip.destination-over.js new file mode 100644 index 0000000..1877ee6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.clip.destination-over.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-over'; +ctx.rect(-20, -20, 10, 10); +ctx.clip(); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.clip.lighter.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.clip.lighter.js new file mode 100644 index 0000000..a8f2b0e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.clip.lighter.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'lighter'; +ctx.rect(-20, -20, 10, 10); +ctx.clip(); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.clip.source-atop.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.clip.source-atop.js new file mode 100644 index 0000000..d086776 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.clip.source-atop.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-atop'; +ctx.rect(-20, -20, 10, 10); +ctx.clip(); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.clip.source-in.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.clip.source-in.js new file mode 100644 index 0000000..34fe397 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.clip.source-in.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-in'; +ctx.rect(-20, -20, 10, 10); +ctx.clip(); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.clip.source-out.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.clip.source-out.js new file mode 100644 index 0000000..977a39c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.clip.source-out.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-out'; +ctx.rect(-20, -20, 10, 10); +ctx.clip(); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.clip.source-over.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.clip.source-over.js new file mode 100644 index 0000000..8d49d2e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.clip.source-over.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-over'; +ctx.rect(-20, -20, 10, 10); +ctx.clip(); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.clip.xor.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.clip.xor.js new file mode 100644 index 0000000..4b3e980 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.clip.xor.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'xor'; +ctx.rect(-20, -20, 10, 10); +ctx.clip(); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.globalAlpha.canvas.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.globalAlpha.canvas.js new file mode 100644 index 0000000..e11ab64 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.globalAlpha.canvas.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = '#f00'; +ctx2.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalAlpha = 0.01; // avoid any potential alpha=0 optimisations +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 2,253,0,255, "50,25", "2,253,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.globalAlpha.canvaspattern.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.globalAlpha.canvaspattern.js new file mode 100644 index 0000000..d3eb366 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.globalAlpha.canvaspattern.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = '#f00'; +ctx2.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = ctx.createPattern(canvas2, 'no-repeat'); +ctx.globalAlpha = 0.01; // avoid any potential alpha=0 optimisations +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 2,253,0,255, "50,25", "2,253,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.globalAlpha.default.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.globalAlpha.default.js new file mode 100644 index 0000000..af46748 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.globalAlpha.default.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(ctx.globalAlpha, 1.0, "ctx.globalAlpha", "1.0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.globalAlpha.fill.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.globalAlpha.fill.js new file mode 100644 index 0000000..c310590 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.globalAlpha.fill.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalAlpha = 0.01; // avoid any potential alpha=0 optimisations +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 2,253,0,255, "50,25", "2,253,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.globalAlpha.image.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.globalAlpha.image.js new file mode 100644 index 0000000..479dedd --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.globalAlpha.image.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalAlpha = 0.01; // avoid any potential alpha=0 optimisations +ctx.drawImage(document.getElementById('red.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 2,253,0,255, "50,25", "2,253,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.globalAlpha.imagepattern.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.globalAlpha.imagepattern.js new file mode 100644 index 0000000..d269796 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.globalAlpha.imagepattern.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = ctx.createPattern(document.getElementById('red.png'), 'no-repeat'); +ctx.globalAlpha = 0.01; // avoid any potential alpha=0 optimisations +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 2,253,0,255, "50,25", "2,253,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.globalAlpha.invalid.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.globalAlpha.invalid.js new file mode 100644 index 0000000..e53a289 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.globalAlpha.invalid.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.globalAlpha = 0.5; +var a = ctx.globalAlpha; // might not be exactly 0.5, if it is rounded/quantised, so remember for future comparisons +ctx.globalAlpha = Infinity; +_assertEqual(ctx.globalAlpha, a, "ctx.globalAlpha", "a"); +ctx.globalAlpha = -Infinity; +_assertEqual(ctx.globalAlpha, a, "ctx.globalAlpha", "a"); +ctx.globalAlpha = NaN; +_assertEqual(ctx.globalAlpha, a, "ctx.globalAlpha", "a"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.globalAlpha.range.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.globalAlpha.range.js new file mode 100644 index 0000000..60c8901 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.globalAlpha.range.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.globalAlpha = 0.5; +var a = ctx.globalAlpha; // might not be exactly 0.5, if it is rounded/quantised, so remember for future comparisons +ctx.globalAlpha = 1.1; +_assertEqual(ctx.globalAlpha, a, "ctx.globalAlpha", "a"); +ctx.globalAlpha = -0.1; +_assertEqual(ctx.globalAlpha, a, "ctx.globalAlpha", "a"); +ctx.globalAlpha = 0; +_assertEqual(ctx.globalAlpha, 0, "ctx.globalAlpha", "0"); +ctx.globalAlpha = 1; +_assertEqual(ctx.globalAlpha, 1, "ctx.globalAlpha", "1"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.image.copy.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.image.copy.js new file mode 100644 index 0000000..92d325f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.image.copy.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'copy'; +ctx.drawImage(document.getElementById('yellow75.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 255,255,0,191, "50,25", "255,255,0,191", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.image.destination-atop.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.image.destination-atop.js new file mode 100644 index 0000000..18836f6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.image.destination-atop.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-atop'; +ctx.drawImage(document.getElementById('yellow75.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 127,255,127,191, "50,25", "127,255,127,191", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.image.destination-in.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.image.destination-in.js new file mode 100644 index 0000000..6b424df --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.image.destination-in.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-in'; +ctx.drawImage(document.getElementById('yellow75.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 0,255,255,95, "50,25", "0,255,255,95", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.image.destination-out.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.image.destination-out.js new file mode 100644 index 0000000..d78d191 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.image.destination-out.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-out'; +ctx.drawImage(document.getElementById('yellow75.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 0,255,255,31, "50,25", "0,255,255,31", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.image.destination-over.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.image.destination-over.js new file mode 100644 index 0000000..9bdbd52 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.image.destination-over.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-over'; +ctx.drawImage(document.getElementById('yellow75.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 109,255,145,223, "50,25", "109,255,145,223", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.image.lighter.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.image.lighter.js new file mode 100644 index 0000000..5b3fdcf --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.image.lighter.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'lighter'; +ctx.drawImage(document.getElementById('yellow75.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 191,255,127,255, "50,25", "191,255,127,255", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.image.source-atop.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.image.source-atop.js new file mode 100644 index 0000000..90157da --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.image.source-atop.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-atop'; +ctx.drawImage(document.getElementById('yellow75.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 191,255,63,127, "50,25", "191,255,63,127", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.image.source-in.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.image.source-in.js new file mode 100644 index 0000000..76a2bf5 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.image.source-in.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-in'; +ctx.drawImage(document.getElementById('yellow75.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 255,255,0,95, "50,25", "255,255,0,95", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.image.source-out.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.image.source-out.js new file mode 100644 index 0000000..2b09cd8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.image.source-out.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-out'; +ctx.drawImage(document.getElementById('yellow75.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 255,255,0,95, "50,25", "255,255,0,95", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.image.source-over.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.image.source-over.js new file mode 100644 index 0000000..dcd3291 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.image.source-over.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-over'; +ctx.drawImage(document.getElementById('yellow75.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 218,255,36,223, "50,25", "218,255,36,223", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.image.xor.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.image.xor.js new file mode 100644 index 0000000..2ae1fa5 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.image.xor.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'xor'; +ctx.drawImage(document.getElementById('yellow75.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 191,255,63,127, "50,25", "191,255,63,127", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.operation.casesensitive.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.operation.casesensitive.js new file mode 100644 index 0000000..bc185fc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.operation.casesensitive.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +ctx.globalCompositeOperation = 'xor'; +ctx.globalCompositeOperation = 'Source-over'; +_assertEqual(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.operation.clear.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.operation.clear.js new file mode 100644 index 0000000..b44825e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.operation.clear.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +ctx.globalCompositeOperation = 'xor'; +ctx.globalCompositeOperation = 'clear'; +_assertEqual(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.operation.darker.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.operation.darker.js new file mode 100644 index 0000000..c93ed3b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.operation.darker.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +ctx.globalCompositeOperation = 'xor'; +ctx.globalCompositeOperation = 'darker'; +_assertEqual(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.operation.default.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.operation.default.js new file mode 100644 index 0000000..cc02047 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.operation.default.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertEqual(ctx.globalCompositeOperation, 'source-over', "ctx.globalCompositeOperation", "'source-over'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.operation.get.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.operation.get.js new file mode 100644 index 0000000..faa06dc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.operation.get.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +var modes = ['source-atop', 'source-in', 'source-out', 'source-over', + 'destination-atop', 'destination-in', 'destination-out', 'destination-over', + 'lighter', 'copy', 'xor']; +for (var i = 0; i < modes.length; ++i) +{ + ctx.globalCompositeOperation = modes[i]; + _assertEqual(ctx.globalCompositeOperation, modes[i], "ctx.globalCompositeOperation", "modes[\""+(i)+"\"]"); +} + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.operation.highlight.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.operation.highlight.js new file mode 100644 index 0000000..33f45c8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.operation.highlight.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +ctx.globalCompositeOperation = 'xor'; +ctx.globalCompositeOperation = 'highlight'; +_assertEqual(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.operation.nullsuffix.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.operation.nullsuffix.js new file mode 100644 index 0000000..62e8c42 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.operation.nullsuffix.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +ctx.globalCompositeOperation = 'xor'; +ctx.globalCompositeOperation = 'source-over\0'; +_assertEqual(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.operation.over.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.operation.over.js new file mode 100644 index 0000000..464c3c9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.operation.over.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +ctx.globalCompositeOperation = 'xor'; +ctx.globalCompositeOperation = 'over'; +_assertEqual(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.operation.unrecognised.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.operation.unrecognised.js new file mode 100644 index 0000000..00c853b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.operation.unrecognised.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +ctx.globalCompositeOperation = 'xor'; +ctx.globalCompositeOperation = 'nonexistent'; +_assertEqual(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.solid.copy.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.solid.copy.js new file mode 100644 index 0000000..0c143dc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.solid.copy.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'copy'; +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 255,255,0,255, "50,25", "255,255,0,255", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.solid.destination-atop.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.solid.destination-atop.js new file mode 100644 index 0000000..d5e7f62 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.solid.destination-atop.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-atop'; +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,255,255,255, "50,25", "0,255,255,255", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.solid.destination-in.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.solid.destination-in.js new file mode 100644 index 0000000..2d7733a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.solid.destination-in.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-in'; +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,255,255,255, "50,25", "0,255,255,255", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.solid.destination-out.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.solid.destination-out.js new file mode 100644 index 0000000..cbfded4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.solid.destination-out.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-out'; +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.solid.destination-over.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.solid.destination-over.js new file mode 100644 index 0000000..3d94ca4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.solid.destination-over.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-over'; +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,255,255,255, "50,25", "0,255,255,255", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.solid.lighter.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.solid.lighter.js new file mode 100644 index 0000000..ee3fe61 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.solid.lighter.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'lighter'; +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 255,255,255,255, "50,25", "255,255,255,255", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.solid.source-atop.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.solid.source-atop.js new file mode 100644 index 0000000..41d0df3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.solid.source-atop.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-atop'; +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 255,255,0,255, "50,25", "255,255,0,255", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.solid.source-in.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.solid.source-in.js new file mode 100644 index 0000000..71b94de --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.solid.source-in.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-in'; +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 255,255,0,255, "50,25", "255,255,0,255", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.solid.source-out.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.solid.source-out.js new file mode 100644 index 0000000..cd1c484 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.solid.source-out.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-out'; +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.solid.source-over.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.solid.source-over.js new file mode 100644 index 0000000..969f474 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.solid.source-over.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-over'; +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 255,255,0,255, "50,25", "255,255,0,255", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.solid.xor.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.solid.xor.js new file mode 100644 index 0000000..6f15f72 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.solid.xor.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'xor'; +ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.transparent.copy.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.transparent.copy.js new file mode 100644 index 0000000..dec49c9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.transparent.copy.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'copy'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,255,191, "50,25", "0,0,255,191", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.transparent.destination-atop.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.transparent.destination-atop.js new file mode 100644 index 0000000..502dce5 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.transparent.destination-atop.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-atop'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,127,127,191, "50,25", "0,127,127,191", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.transparent.destination-in.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.transparent.destination-in.js new file mode 100644 index 0000000..11c86d8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.transparent.destination-in.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-in'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,255,0,95, "50,25", "0,255,0,95", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.transparent.destination-out.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.transparent.destination-out.js new file mode 100644 index 0000000..c350691 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.transparent.destination-out.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-out'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,255,0,31, "50,25", "0,255,0,31", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.transparent.destination-over.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.transparent.destination-over.js new file mode 100644 index 0000000..01bd9e2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.transparent.destination-over.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-over'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,145,109,223, "50,25", "0,145,109,223", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.transparent.lighter.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.transparent.lighter.js new file mode 100644 index 0000000..fac6a7d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.transparent.lighter.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'lighter'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,127,191,255, "50,25", "0,127,191,255", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.transparent.source-atop.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.transparent.source-atop.js new file mode 100644 index 0000000..c878090 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.transparent.source-atop.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-atop'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,63,191,127, "50,25", "0,63,191,127", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.transparent.source-in.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.transparent.source-in.js new file mode 100644 index 0000000..5855881 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.transparent.source-in.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-in'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,255,95, "50,25", "0,0,255,95", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.transparent.source-out.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.transparent.source-out.js new file mode 100644 index 0000000..bca551e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.transparent.source-out.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-out'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,255,95, "50,25", "0,0,255,95", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.transparent.source-over.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.transparent.source-over.js new file mode 100644 index 0000000..cc36cb9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.transparent.source-over.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-over'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,36,218,223, "50,25", "0,36,218,223", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.transparent.xor.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.transparent.xor.js new file mode 100644 index 0000000..d3e4a0a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.transparent.xor.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'xor'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,63,191,127, "50,25", "0,63,191,127", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.fill.copy.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.fill.copy.js new file mode 100644 index 0000000..b1ca3a2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.fill.copy.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'copy'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.translate(0, 25); +ctx.fillRect(0, 50, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.fill.destination-atop.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.fill.destination-atop.js new file mode 100644 index 0000000..f76e616 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.fill.destination-atop.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-atop'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.translate(0, 25); +ctx.fillRect(0, 50, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.fill.destination-in.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.fill.destination-in.js new file mode 100644 index 0000000..2613ed3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.fill.destination-in.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-in'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.translate(0, 25); +ctx.fillRect(0, 50, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.fill.source-in.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.fill.source-in.js new file mode 100644 index 0000000..15d10f3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.fill.source-in.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-in'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.translate(0, 25); +ctx.fillRect(0, 50, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.fill.source-out.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.fill.source-out.js new file mode 100644 index 0000000..653121b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.fill.source-out.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-out'; +ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; +ctx.translate(0, 25); +ctx.fillRect(0, 50, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.image.destination-atop.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.image.destination-atop.js new file mode 100644 index 0000000..509aff6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.image.destination-atop.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-atop'; +ctx.drawImage(document.getElementById('yellow.png'), 40, 40, 10, 10, 40, 50, 10, 10); +_assertPixelApprox(canvas, 15,15, 0,0,0,0, "15,15", "0,0,0,0", 5); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.image.destination-in.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.image.destination-in.js new file mode 100644 index 0000000..451a51b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.image.destination-in.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-in'; +ctx.drawImage(document.getElementById('yellow.png'), 40, 40, 10, 10, 40, 50, 10, 10); +_assertPixelApprox(canvas, 15,15, 0,0,0,0, "15,15", "0,0,0,0", 5); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.image.source-in.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.image.source-in.js new file mode 100644 index 0000000..7b81106 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.image.source-in.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-in'; +ctx.drawImage(document.getElementById('yellow.png'), 40, 40, 10, 10, 40, 50, 10, 10); +_assertPixelApprox(canvas, 15,15, 0,0,0,0, "15,15", "0,0,0,0", 5); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.image.source-out.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.image.source-out.js new file mode 100644 index 0000000..44df955 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.image.source-out.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-out'; +ctx.drawImage(document.getElementById('yellow.png'), 40, 40, 10, 10, 40, 50, 10, 10); +_assertPixelApprox(canvas, 15,15, 0,0,0,0, "15,15", "0,0,0,0", 5); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.nocontext.copy.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.nocontext.copy.js new file mode 100644 index 0000000..339105c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.nocontext.copy.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'copy'; +var canvas2 = document.createElement('canvas'); +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.nocontext.destination-atop.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.nocontext.destination-atop.js new file mode 100644 index 0000000..91a09c9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.nocontext.destination-atop.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-atop'; +var canvas2 = document.createElement('canvas'); +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.nocontext.destination-in.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.nocontext.destination-in.js new file mode 100644 index 0000000..5c2d617 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.nocontext.destination-in.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-in'; +var canvas2 = document.createElement('canvas'); +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.nocontext.source-in.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.nocontext.source-in.js new file mode 100644 index 0000000..1de64cb --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.nocontext.source-in.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-in'; +var canvas2 = document.createElement('canvas'); +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.nocontext.source-out.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.nocontext.source-out.js new file mode 100644 index 0000000..bfc1901 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.nocontext.source-out.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-out'; +var canvas2 = document.createElement('canvas'); +ctx.drawImage(canvas2, 0, 0); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.pattern.copy.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.pattern.copy.js new file mode 100644 index 0000000..cdb9d7a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.pattern.copy.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'copy'; +ctx.fillStyle = ctx.createPattern(document.getElementById('yellow.png'), 'no-repeat'); +ctx.fillRect(0, 50, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.pattern.destination-atop.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.pattern.destination-atop.js new file mode 100644 index 0000000..c1c63a8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.pattern.destination-atop.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-atop'; +ctx.fillStyle = ctx.createPattern(document.getElementById('yellow.png'), 'no-repeat'); +ctx.fillRect(0, 50, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.pattern.destination-in.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.pattern.destination-in.js new file mode 100644 index 0000000..e69936f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.pattern.destination-in.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-in'; +ctx.fillStyle = ctx.createPattern(document.getElementById('yellow.png'), 'no-repeat'); +ctx.fillRect(0, 50, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.pattern.source-in.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.pattern.source-in.js new file mode 100644 index 0000000..b211541 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.pattern.source-in.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-in'; +ctx.fillStyle = ctx.createPattern(document.getElementById('yellow.png'), 'no-repeat'); +ctx.fillRect(0, 50, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.pattern.source-out.js b/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.pattern.source-out.js new file mode 100644 index 0000000..e84e1f0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.composite.uncovered.pattern.source-out.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'source-out'; +ctx.fillStyle = ctx.createPattern(document.getElementById('yellow.png'), 'no-repeat'); +ctx.fillRect(0, 50, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.coordinatespace.js b/platforms/ios/www/test/tests-todo/minimal.2d.coordinatespace.js new file mode 100644 index 0000000..8220b08 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.coordinatespace.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#00f'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0ff'; +ctx.fillRect(0, 0, 50, 25); +_assertPixel(canvas, 25,12, 0,255,255,255, "25,12", "0,255,255,255"); +_assertPixel(canvas, 75,12, 0,0,255,255, "75,12", "0,0,255,255"); +_assertPixel(canvas, 25,37, 0,0,255,255, "25,37", "0,0,255,255"); +_assertPixel(canvas, 75,37, 0,0,255,255, "75,37", "0,0,255,255"); +_requireManualCheck(); // because we can't tell that getPixelData isn't using the wrong coordinate space too + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.3arg.js b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.3arg.js new file mode 100644 index 0000000..a0c66bf --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.3arg.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.drawImage(document.getElementById('green.png'), 0, 0); +ctx.drawImage(document.getElementById('red.png'), -100, 0); +ctx.drawImage(document.getElementById('red.png'), 100, 0); +ctx.drawImage(document.getElementById('red.png'), 0, -50); +ctx.drawImage(document.getElementById('red.png'), 0, 50); + +_assertPixelApprox(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2); +_assertPixelApprox(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2); +_assertPixelApprox(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2); +_assertPixelApprox(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.5arg.js b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.5arg.js new file mode 100644 index 0000000..ca0667e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.5arg.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.drawImage(document.getElementById('green.png'), 50, 0, 50, 50); +ctx.drawImage(document.getElementById('red.png'), 0, 0, 50, 50); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 50, 50); + +_assertPixelApprox(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2); +_assertPixelApprox(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2); +_assertPixelApprox(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2); +_assertPixelApprox(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.9arg.basic.js b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.9arg.basic.js new file mode 100644 index 0000000..19bb506 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.9arg.basic.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.drawImage(document.getElementById('green.png'), 0, 0, 100, 50, 0, 0, 100, 50); +_assertPixelApprox(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2); +_assertPixelApprox(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2); +_assertPixelApprox(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2); +_assertPixelApprox(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.9arg.destpos.js b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.9arg.destpos.js new file mode 100644 index 0000000..4ac7a26 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.9arg.destpos.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.drawImage(document.getElementById('green.png'), 0, 0, 100, 50, 0, 0, 100, 50); +ctx.drawImage(document.getElementById('red.png'), 0, 0, 100, 50, -100, 0, 100, 50); +ctx.drawImage(document.getElementById('red.png'), 0, 0, 100, 50, 100, 0, 100, 50); +ctx.drawImage(document.getElementById('red.png'), 0, 0, 100, 50, 0, -50, 100, 50); +ctx.drawImage(document.getElementById('red.png'), 0, 0, 100, 50, 0, 50, 100, 50); +_assertPixelApprox(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2); +_assertPixelApprox(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2); +_assertPixelApprox(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2); +_assertPixelApprox(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.9arg.destsize.js b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.9arg.destsize.js new file mode 100644 index 0000000..2c7381b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.9arg.destsize.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.drawImage(document.getElementById('green.png'), 1, 1, 1, 1, 0, 0, 100, 50); +ctx.drawImage(document.getElementById('red.png'), 0, 0, 100, 50, -50, 0, 50, 50); +ctx.drawImage(document.getElementById('red.png'), 0, 0, 100, 50, 100, 0, 50, 50); +ctx.drawImage(document.getElementById('red.png'), 0, 0, 100, 50, 0, -25, 100, 25); +ctx.drawImage(document.getElementById('red.png'), 0, 0, 100, 50, 0, 50, 100, 25); +_assertPixelApprox(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2); +_assertPixelApprox(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2); +_assertPixelApprox(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2); +_assertPixelApprox(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.9arg.sourcepos.js b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.9arg.sourcepos.js new file mode 100644 index 0000000..6139b64 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.9arg.sourcepos.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.drawImage(document.getElementById('rgrg-256x256.png'), 140, 20, 100, 50, 0, 0, 100, 50); +_assertPixelApprox(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2); +_assertPixelApprox(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2); +_assertPixelApprox(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2); +_assertPixelApprox(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.9arg.sourcesize.js b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.9arg.sourcesize.js new file mode 100644 index 0000000..5081fc1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.9arg.sourcesize.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.drawImage(document.getElementById('rgrg-256x256.png'), 0, 0, 256, 256, 0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 51, 26); +ctx.fillRect(49, 24, 51, 26); +_assertPixelApprox(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2); +_assertPixelApprox(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2); +_assertPixelApprox(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2); +_assertPixelApprox(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2); +_assertPixelApprox(canvas, 20,20, 0,255,0,255, "20,20", "0,255,0,255", 2); +_assertPixelApprox(canvas, 80,20, 0,255,0,255, "80,20", "0,255,0,255", 2); +_assertPixelApprox(canvas, 20,30, 0,255,0,255, "20,30", "0,255,0,255", 2); +_assertPixelApprox(canvas, 80,30, 0,255,0,255, "80,30", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.alpha.js b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.alpha.js new file mode 100644 index 0000000..09b4776 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.alpha.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalAlpha = 0; +ctx.drawImage(document.getElementById('red.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.animated.apng.js b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.animated.apng.js new file mode 100644 index 0000000..7cbffd1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.animated.apng.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +deferTest(); +setTimeout(wrapFunction(function () { + ctx.drawImage(document.getElementById('anim-gr.png'), 0, 0); + _assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.animated.gif.js b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.animated.gif.js new file mode 100644 index 0000000..4e5a3ce --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.animated.gif.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +deferTest(); +setTimeout(wrapFunction(function () { + ctx.drawImage(document.getElementById('anim-gr.gif'), 0, 0); + _assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.animated.poster.js b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.animated.poster.js new file mode 100644 index 0000000..180bb47 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.animated.poster.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +ctx.drawImage(document.getElementById('anim-poster-gr.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.broken.js b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.broken.js new file mode 100644 index 0000000..bdd7c31 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.broken.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +var img = document.getElementById('broken.png'); +_assertSame(img.complete, false, "img.complete", "false"); +ctx.drawImage(img, 0, 0); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.canvas.js b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.canvas.js new file mode 100644 index 0000000..b4a881d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.canvas.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = '#0f0'; +ctx2.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#f00'; +ctx.drawImage(canvas2, 0, 0); + +_assertPixelApprox(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2); +_assertPixelApprox(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2); +_assertPixelApprox(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2); +_assertPixelApprox(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.clip.js b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.clip.js new file mode 100644 index 0000000..45b5600 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.clip.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.rect(-10, -10, 1, 1); +ctx.clip(); +ctx.drawImage(document.getElementById('red.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.composite.js b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.composite.js new file mode 100644 index 0000000..ebd95e6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.composite.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-over'; +ctx.drawImage(document.getElementById('red.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.floatsource.js b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.floatsource.js new file mode 100644 index 0000000..632308a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.floatsource.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +ctx.drawImage(document.getElementById('green.png'), 10.1, 10.1, 0.1, 0.1, 0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.incomplete.js b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.incomplete.js new file mode 100644 index 0000000..b27df0c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.incomplete.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +var img = new Image(); +_assertSame(img.complete, false, "img.complete", "false"); +ctx.drawImage(img, 0, 0); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.negativedest.js b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.negativedest.js new file mode 100644 index 0000000..51a7120 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.negativedest.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.drawImage(document.getElementById('ggrr-256x256.png'), 100, 78, 50, 50, 0, 50, 50, -50); +ctx.drawImage(document.getElementById('ggrr-256x256.png'), 100, 128, 50, -50, 100, 50, -50, -50); +_assertPixelApprox(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255", 2); +_assertPixelApprox(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255", 2); +_assertPixelApprox(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255", 2); +_assertPixelApprox(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255", 2); +_assertPixelApprox(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255", 2); +_assertPixelApprox(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255", 2); +_assertPixelApprox(canvas, 51,1, 0,255,0,255, "51,1", "0,255,0,255", 2); +_assertPixelApprox(canvas, 51,48, 0,255,0,255, "51,48", "0,255,0,255", 2); +_assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.negativedir.js b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.negativedir.js new file mode 100644 index 0000000..dbca7a5 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.negativedir.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.drawImage(document.getElementById('ggrr-256x256.png'), 0, 178, 50, -100, 0, 0, 50, 100); +ctx.drawImage(document.getElementById('ggrr-256x256.png'), 0, 78, 50, 100, 50, 100, 50, -100); +_assertPixelApprox(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255", 2); +_assertPixelApprox(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255", 2); +_assertPixelApprox(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255", 2); +_assertPixelApprox(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255", 2); +_assertPixelApprox(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255", 2); +_assertPixelApprox(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255", 2); +_assertPixelApprox(canvas, 51,1, 0,255,0,255, "51,1", "0,255,0,255", 2); +_assertPixelApprox(canvas, 51,48, 0,255,0,255, "51,48", "0,255,0,255", 2); +_assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.negativesource.js b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.negativesource.js new file mode 100644 index 0000000..dfe7bc0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.negativesource.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.drawImage(document.getElementById('ggrr-256x256.png'), 100, 78, -100, 50, 0, 0, 50, 50); +ctx.drawImage(document.getElementById('ggrr-256x256.png'), 100, 128, -100, -50, 50, 0, 50, 50); +_assertPixelApprox(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255", 2); +_assertPixelApprox(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255", 2); +_assertPixelApprox(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255", 2); +_assertPixelApprox(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255", 2); +_assertPixelApprox(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255", 2); +_assertPixelApprox(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255", 2); +_assertPixelApprox(canvas, 51,1, 0,255,0,255, "51,1", "0,255,0,255", 2); +_assertPixelApprox(canvas, 51,48, 0,255,0,255, "51,48", "0,255,0,255", 2); +_assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.nonfinite.js b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.nonfinite.js new file mode 100644 index 0000000..10971d3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.nonfinite.js @@ -0,0 +1,310 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +var red = document.getElementById('red.png'); +ctx.drawImage(red, Infinity, 0); +ctx.drawImage(red, -Infinity, 0); +ctx.drawImage(red, NaN, 0); +ctx.drawImage(red, 0, Infinity); +ctx.drawImage(red, 0, -Infinity); +ctx.drawImage(red, 0, NaN); +ctx.drawImage(red, Infinity, Infinity); +ctx.drawImage(red, Infinity, 0, 100, 50); +ctx.drawImage(red, -Infinity, 0, 100, 50); +ctx.drawImage(red, NaN, 0, 100, 50); +ctx.drawImage(red, 0, Infinity, 100, 50); +ctx.drawImage(red, 0, -Infinity, 100, 50); +ctx.drawImage(red, 0, NaN, 100, 50); +ctx.drawImage(red, 0, 0, Infinity, 50); +ctx.drawImage(red, 0, 0, -Infinity, 50); +ctx.drawImage(red, 0, 0, NaN, 50); +ctx.drawImage(red, 0, 0, 100, Infinity); +ctx.drawImage(red, 0, 0, 100, -Infinity); +ctx.drawImage(red, 0, 0, 100, NaN); +ctx.drawImage(red, Infinity, Infinity, 100, 50); +ctx.drawImage(red, Infinity, Infinity, Infinity, 50); +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity); +ctx.drawImage(red, Infinity, Infinity, 100, Infinity); +ctx.drawImage(red, Infinity, 0, Infinity, 50); +ctx.drawImage(red, Infinity, 0, Infinity, Infinity); +ctx.drawImage(red, Infinity, 0, 100, Infinity); +ctx.drawImage(red, 0, Infinity, Infinity, 50); +ctx.drawImage(red, 0, Infinity, Infinity, Infinity); +ctx.drawImage(red, 0, Infinity, 100, Infinity); +ctx.drawImage(red, 0, 0, Infinity, Infinity); +ctx.drawImage(red, Infinity, 0, 100, 50, 0, 0, 100, 50); +ctx.drawImage(red, -Infinity, 0, 100, 50, 0, 0, 100, 50); +ctx.drawImage(red, NaN, 0, 100, 50, 0, 0, 100, 50); +ctx.drawImage(red, 0, Infinity, 100, 50, 0, 0, 100, 50); +ctx.drawImage(red, 0, -Infinity, 100, 50, 0, 0, 100, 50); +ctx.drawImage(red, 0, NaN, 100, 50, 0, 0, 100, 50); +ctx.drawImage(red, 0, 0, Infinity, 50, 0, 0, 100, 50); +ctx.drawImage(red, 0, 0, -Infinity, 50, 0, 0, 100, 50); +ctx.drawImage(red, 0, 0, NaN, 50, 0, 0, 100, 50); +ctx.drawImage(red, 0, 0, 100, Infinity, 0, 0, 100, 50); +ctx.drawImage(red, 0, 0, 100, -Infinity, 0, 0, 100, 50); +ctx.drawImage(red, 0, 0, 100, NaN, 0, 0, 100, 50); +ctx.drawImage(red, 0, 0, 100, 50, Infinity, 0, 100, 50); +ctx.drawImage(red, 0, 0, 100, 50, -Infinity, 0, 100, 50); +ctx.drawImage(red, 0, 0, 100, 50, NaN, 0, 100, 50); +ctx.drawImage(red, 0, 0, 100, 50, 0, Infinity, 100, 50); +ctx.drawImage(red, 0, 0, 100, 50, 0, -Infinity, 100, 50); +ctx.drawImage(red, 0, 0, 100, 50, 0, NaN, 100, 50); +ctx.drawImage(red, 0, 0, 100, 50, 0, 0, Infinity, 50); +ctx.drawImage(red, 0, 0, 100, 50, 0, 0, -Infinity, 50); +ctx.drawImage(red, 0, 0, 100, 50, 0, 0, NaN, 50); +ctx.drawImage(red, 0, 0, 100, 50, 0, 0, 100, Infinity); +ctx.drawImage(red, 0, 0, 100, 50, 0, 0, 100, -Infinity); +ctx.drawImage(red, 0, 0, 100, 50, 0, 0, 100, NaN); +ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, 0, 100, 50); +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, 0, 100, 50); +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, 0, 100, 50); +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, 0, 100, 50); +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, 100, 50); +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, 50); +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, 100, Infinity); +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, 0, Infinity, 50); +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, 0, Infinity, Infinity); +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, 0, 100, Infinity); +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, Infinity, 100, 50); +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, Infinity, Infinity, 50); +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, Infinity, Infinity, Infinity); +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, Infinity, 100, Infinity); +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, 0, Infinity, 50); +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, 0, Infinity, Infinity); +ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, 0, 100, Infinity); +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, 0, 100, 50); +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, Infinity, 100, 50); +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, Infinity, Infinity, 50); +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, Infinity, Infinity, Infinity); +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, Infinity, 100, Infinity); +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, 0, Infinity, 50); +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, 0, Infinity, Infinity); +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, 0, 100, Infinity); +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, Infinity, 100, 50); +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, Infinity, Infinity, 50); +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, Infinity, Infinity, Infinity); +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, Infinity, 100, Infinity); +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, 0, Infinity, 50); +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, 0, Infinity, Infinity); +ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, 0, 100, Infinity); +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, 0, 100, 50); +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, 0, 100, 50); +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, Infinity, 100, 50); +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, Infinity, Infinity, 50); +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, Infinity, Infinity, Infinity); +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, Infinity, 100, Infinity); +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, 0, Infinity, 50); +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, 0, Infinity, Infinity); +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, 0, 100, Infinity); +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, Infinity, 100, 50); +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, Infinity, Infinity, 50); +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, Infinity, Infinity, Infinity); +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, Infinity, 100, Infinity); +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, 0, Infinity, 50); +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, 0, Infinity, Infinity); +ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, 0, 100, Infinity); +ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, 0, 100, 50); +ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, Infinity, 100, 50); +ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, Infinity, Infinity, 50); +ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, Infinity, Infinity, Infinity); +ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, Infinity, 100, Infinity); +ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, 0, Infinity, 50); +ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, 0, Infinity, Infinity); +ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, 0, 100, Infinity); +ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, Infinity, 100, 50); +ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, Infinity, Infinity, 50); +ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, Infinity, Infinity, Infinity); +ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, Infinity, 100, Infinity); +ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, 0, Infinity, 50); +ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, 0, Infinity, Infinity); +ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, 0, 100, Infinity); +ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, 0, 100, 50); +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, 0, 100, 50); +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, 0, 100, 50); +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, Infinity, 100, 50); +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, Infinity, Infinity, 50); +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, Infinity, 100, Infinity); +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, 0, Infinity, 50); +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, 0, Infinity, Infinity); +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, 0, 100, Infinity); +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, Infinity, 100, 50); +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, Infinity, Infinity, 50); +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, Infinity, Infinity, Infinity); +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, Infinity, 100, Infinity); +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, 0, Infinity, 50); +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, 0, Infinity, Infinity); +ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, 0, 100, Infinity); +ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, 0, 100, 50); +ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, Infinity, 100, 50); +ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, Infinity, Infinity, 50); +ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, Infinity, Infinity, Infinity); +ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, Infinity, 100, Infinity); +ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, 0, Infinity, 50); +ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, 0, Infinity, Infinity); +ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, 0, 100, Infinity); +ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, Infinity, 100, 50); +ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, Infinity, Infinity, 50); +ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, Infinity, Infinity, Infinity); +ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, Infinity, 100, Infinity); +ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, 0, Infinity, 50); +ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, 0, Infinity, Infinity); +ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, 0, 100, Infinity); +ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, 0, 100, 50); +ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, 0, 100, 50); +ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, Infinity, 100, 50); +ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, Infinity, Infinity, 50); +ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, Infinity, Infinity, Infinity); +ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, Infinity, 100, Infinity); +ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, 0, Infinity, 50); +ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, 0, Infinity, Infinity); +ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, 0, 100, Infinity); +ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, Infinity, 100, 50); +ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, Infinity, Infinity, 50); +ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, Infinity, Infinity, Infinity); +ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, Infinity, 100, Infinity); +ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, 0, Infinity, 50); +ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, 0, Infinity, Infinity); +ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, 0, 100, Infinity); +ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, 0, 100, 50); +ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, Infinity, 100, 50); +ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, Infinity, Infinity, 50); +ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, Infinity, Infinity, Infinity); +ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, Infinity, 100, Infinity); +ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, 0, Infinity, 50); +ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, 0, Infinity, Infinity); +ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, 0, 100, Infinity); +ctx.drawImage(red, Infinity, 0, 100, 50, 0, Infinity, 100, 50); +ctx.drawImage(red, Infinity, 0, 100, 50, 0, Infinity, Infinity, 50); +ctx.drawImage(red, Infinity, 0, 100, 50, 0, Infinity, Infinity, Infinity); +ctx.drawImage(red, Infinity, 0, 100, 50, 0, Infinity, 100, Infinity); +ctx.drawImage(red, Infinity, 0, 100, 50, 0, 0, Infinity, 50); +ctx.drawImage(red, Infinity, 0, 100, 50, 0, 0, Infinity, Infinity); +ctx.drawImage(red, Infinity, 0, 100, 50, 0, 0, 100, Infinity); +ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, 0, 100, 50); +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, 0, 100, 50); +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, 0, 100, 50); +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, Infinity, 100, 50); +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, 50); +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, Infinity, 100, Infinity); +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, 0, Infinity, 50); +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, 0, Infinity, Infinity); +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, 0, 100, Infinity); +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, Infinity, 100, 50); +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, Infinity, Infinity, 50); +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, Infinity, Infinity, Infinity); +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, Infinity, 100, Infinity); +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, 0, Infinity, 50); +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, 0, Infinity, Infinity); +ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, 0, 100, Infinity); +ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, 0, 100, 50); +ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, Infinity, 100, 50); +ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, Infinity, Infinity, 50); +ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, Infinity, Infinity, Infinity); +ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, Infinity, 100, Infinity); +ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, 0, Infinity, 50); +ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, 0, Infinity, Infinity); +ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, 0, 100, Infinity); +ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, Infinity, 100, 50); +ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, Infinity, Infinity, 50); +ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, Infinity, Infinity, Infinity); +ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, Infinity, 100, Infinity); +ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, 0, Infinity, 50); +ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, 0, Infinity, Infinity); +ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, 0, 100, Infinity); +ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, 0, 100, 50); +ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, 0, 100, 50); +ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, Infinity, 100, 50); +ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, Infinity, Infinity, 50); +ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, Infinity, Infinity, Infinity); +ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, Infinity, 100, Infinity); +ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, 0, Infinity, 50); +ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, 0, Infinity, Infinity); +ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, 0, 100, Infinity); +ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, Infinity, 100, 50); +ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, Infinity, Infinity, 50); +ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, Infinity, Infinity, Infinity); +ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, Infinity, 100, Infinity); +ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, 0, Infinity, 50); +ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, 0, Infinity, Infinity); +ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, 0, 100, Infinity); +ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, 0, 100, 50); +ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, Infinity, 100, 50); +ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, Infinity, Infinity, 50); +ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, Infinity, Infinity, Infinity); +ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, Infinity, 100, Infinity); +ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, 0, Infinity, 50); +ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, 0, Infinity, Infinity); +ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, 0, 100, Infinity); +ctx.drawImage(red, 0, Infinity, 100, 50, 0, Infinity, 100, 50); +ctx.drawImage(red, 0, Infinity, 100, 50, 0, Infinity, Infinity, 50); +ctx.drawImage(red, 0, Infinity, 100, 50, 0, Infinity, Infinity, Infinity); +ctx.drawImage(red, 0, Infinity, 100, 50, 0, Infinity, 100, Infinity); +ctx.drawImage(red, 0, Infinity, 100, 50, 0, 0, Infinity, 50); +ctx.drawImage(red, 0, Infinity, 100, 50, 0, 0, Infinity, Infinity); +ctx.drawImage(red, 0, Infinity, 100, 50, 0, 0, 100, Infinity); +ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, 0, 100, 50); +ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, 0, 100, 50); +ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, Infinity, 100, 50); +ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, Infinity, Infinity, 50); +ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); +ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, Infinity, 100, Infinity); +ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, 0, Infinity, 50); +ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, 0, Infinity, Infinity); +ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, 0, 100, Infinity); +ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, Infinity, 100, 50); +ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, Infinity, Infinity, 50); +ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, Infinity, Infinity, Infinity); +ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, Infinity, 100, Infinity); +ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, 0, Infinity, 50); +ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, 0, Infinity, Infinity); +ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, 0, 100, Infinity); +ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, 0, 100, 50); +ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, Infinity, 100, 50); +ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, Infinity, Infinity, 50); +ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, Infinity, Infinity, Infinity); +ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, Infinity, 100, Infinity); +ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, 0, Infinity, 50); +ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, 0, Infinity, Infinity); +ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, 0, 100, Infinity); +ctx.drawImage(red, 0, 0, Infinity, 50, 0, Infinity, 100, 50); +ctx.drawImage(red, 0, 0, Infinity, 50, 0, Infinity, Infinity, 50); +ctx.drawImage(red, 0, 0, Infinity, 50, 0, Infinity, Infinity, Infinity); +ctx.drawImage(red, 0, 0, Infinity, 50, 0, Infinity, 100, Infinity); +ctx.drawImage(red, 0, 0, Infinity, 50, 0, 0, Infinity, 50); +ctx.drawImage(red, 0, 0, Infinity, 50, 0, 0, Infinity, Infinity); +ctx.drawImage(red, 0, 0, Infinity, 50, 0, 0, 100, Infinity); +ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, 0, 100, 50); +ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, Infinity, 100, 50); +ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, Infinity, Infinity, 50); +ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, Infinity, Infinity, Infinity); +ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, Infinity, 100, Infinity); +ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, 0, Infinity, 50); +ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, 0, Infinity, Infinity); +ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, 0, 100, Infinity); +ctx.drawImage(red, 0, 0, 100, Infinity, 0, Infinity, 100, 50); +ctx.drawImage(red, 0, 0, 100, Infinity, 0, Infinity, Infinity, 50); +ctx.drawImage(red, 0, 0, 100, Infinity, 0, Infinity, Infinity, Infinity); +ctx.drawImage(red, 0, 0, 100, Infinity, 0, Infinity, 100, Infinity); +ctx.drawImage(red, 0, 0, 100, Infinity, 0, 0, Infinity, 50); +ctx.drawImage(red, 0, 0, 100, Infinity, 0, 0, Infinity, Infinity); +ctx.drawImage(red, 0, 0, 100, Infinity, 0, 0, 100, Infinity); +ctx.drawImage(red, 0, 0, 100, 50, Infinity, Infinity, 100, 50); +ctx.drawImage(red, 0, 0, 100, 50, Infinity, Infinity, Infinity, 50); +ctx.drawImage(red, 0, 0, 100, 50, Infinity, Infinity, Infinity, Infinity); +ctx.drawImage(red, 0, 0, 100, 50, Infinity, Infinity, 100, Infinity); +ctx.drawImage(red, 0, 0, 100, 50, Infinity, 0, Infinity, 50); +ctx.drawImage(red, 0, 0, 100, 50, Infinity, 0, Infinity, Infinity); +ctx.drawImage(red, 0, 0, 100, 50, Infinity, 0, 100, Infinity); +ctx.drawImage(red, 0, 0, 100, 50, 0, Infinity, Infinity, 50); +ctx.drawImage(red, 0, 0, 100, 50, 0, Infinity, Infinity, Infinity); +ctx.drawImage(red, 0, 0, 100, 50, 0, Infinity, 100, Infinity); +ctx.drawImage(red, 0, 0, 100, 50, 0, 0, Infinity, Infinity); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.nowrap.js b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.nowrap.js new file mode 100644 index 0000000..44a38e0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.nowrap.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.drawImage(document.getElementById('redtransparent.png'), -1950, 0, 2000, 50); +_assertPixelApprox(canvas, 45,25, 0,255,0,255, "45,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 55,25, 0,255,0,255, "55,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.null.js b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.null.js new file mode 100644 index 0000000..34de2e4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.null.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.drawImage(null, 0, 0); +} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail("Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TYPE_MISMATCH_ERR: ctx.drawImage(null, 0, 0)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.outsidesource.js b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.outsidesource.js new file mode 100644 index 0000000..266460f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.outsidesource.js @@ -0,0 +1,33 @@ +_addTest(function(canvas, ctx) { + +ctx.drawImage(document.getElementById('green.png'), 10.5, 10.5, 89.5, 39.5, 0, 0, 100, 50); +ctx.drawImage(document.getElementById('green.png'), 5.5, 5.5, -5.5, -5.5, 0, 0, 100, 50); +ctx.drawImage(document.getElementById('green.png'), 100, 50, -5, -5, 0, 0, 100, 50); +try { var _thrown = false; + ctx.drawImage(document.getElementById('red.png'), -0.001, 0, 100, 50, 0, 0, 100, 50); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), -0.001, 0, 100, 50, 0, 0, 100, 50)"); } +try { var _thrown = false; + ctx.drawImage(document.getElementById('red.png'), 0, -0.001, 100, 50, 0, 0, 100, 50); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 0, -0.001, 100, 50, 0, 0, 100, 50)"); } +try { var _thrown = false; + ctx.drawImage(document.getElementById('red.png'), 0, 0, 100.001, 50, 0, 0, 100, 50); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 0, 0, 100.001, 50, 0, 0, 100, 50)"); } +try { var _thrown = false; + ctx.drawImage(document.getElementById('red.png'), 0, 0, 100, 50.001, 0, 0, 100, 50); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 0, 0, 100, 50.001, 0, 0, 100, 50)"); } +try { var _thrown = false; + ctx.drawImage(document.getElementById('red.png'), 50, 0, 50.001, 50, 0, 0, 100, 50); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 50, 0, 50.001, 50, 0, 0, 100, 50)"); } +try { var _thrown = false; + ctx.drawImage(document.getElementById('red.png'), 0, 0, -5, 5, 0, 0, 100, 50); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 0, 0, -5, 5, 0, 0, 100, 50)"); } +try { var _thrown = false; + ctx.drawImage(document.getElementById('red.png'), 0, 0, 5, -5, 0, 0, 100, 50); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 0, 0, 5, -5, 0, 0, 100, 50)"); } +try { var _thrown = false; + ctx.drawImage(document.getElementById('red.png'), 110, 60, -20, -20, 0, 0, 100, 50); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 110, 60, -20, -20, 0, 0, 100, 50)"); } +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.path.js b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.path.js new file mode 100644 index 0000000..b3236a1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.path.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.rect(0, 0, 100, 50); +ctx.drawImage(document.getElementById('red.png'), 0, 0); +ctx.fill(); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.self.1.js b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.self.1.js new file mode 100644 index 0000000..3032061 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.self.1.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 50, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(50, 0, 50, 50); +ctx.drawImage(canvas, 50, 0); + +_assertPixelApprox(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2); +_assertPixelApprox(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2); +_assertPixelApprox(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2); +_assertPixelApprox(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.self.2.js b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.self.2.js new file mode 100644 index 0000000..0cc507d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.self.2.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 1, 100, 49); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 1); +ctx.drawImage(canvas, 0, 1); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 2); + +_assertPixelApprox(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2); +_assertPixelApprox(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2); +_assertPixelApprox(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2); +_assertPixelApprox(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.transform.js b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.transform.js new file mode 100644 index 0000000..0817a8e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.transform.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.translate(100, 0); +ctx.drawImage(document.getElementById('red.png'), 0, 0); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.wrongtype.js b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.wrongtype.js new file mode 100644 index 0000000..64fb6e4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.wrongtype.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.drawImage(undefined, 0, 0); +} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail("Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TYPE_MISMATCH_ERR: ctx.drawImage(undefined, 0, 0)"); } +try { var _thrown = false; + ctx.drawImage(0, 0, 0); +} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail("Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TYPE_MISMATCH_ERR: ctx.drawImage(0, 0, 0)"); } +try { var _thrown = false; + ctx.drawImage("", 0, 0); +} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail("Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TYPE_MISMATCH_ERR: ctx.drawImage(\"\", 0, 0)"); } +try { var _thrown = false; + ctx.drawImage(document.createElement('p'), 0, 0); +} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail("Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TYPE_MISMATCH_ERR: ctx.drawImage(document.createElement('p'), 0, 0)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.zerocanvas.js b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.zerocanvas.js new file mode 100644 index 0000000..2282f8e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.zerocanvas.js @@ -0,0 +1,28 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var canvas2 = document.createElement('canvas'); +canvas2.width = 0; +canvas2.height = 10; +try { var _thrown = false; + ctx.drawImage(canvas2, 0, 0); +} catch (e) { if (e.code != DOMException.INVALID_STATE_ERR) _fail("Failed assertion: expected exception of type INVALID_STATE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INVALID_STATE_ERR: ctx.drawImage(canvas2, 0, 0)"); } + +canvas2.width = 10; +canvas2.height = 0; +try { var _thrown = false; + ctx.drawImage(canvas2, 0, 0); +} catch (e) { if (e.code != DOMException.INVALID_STATE_ERR) _fail("Failed assertion: expected exception of type INVALID_STATE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INVALID_STATE_ERR: ctx.drawImage(canvas2, 0, 0)"); } + +canvas2.width = 0; +canvas2.height = 0; +try { var _thrown = false; + ctx.drawImage(canvas2, 0, 0); +} catch (e) { if (e.code != DOMException.INVALID_STATE_ERR) _fail("Failed assertion: expected exception of type INVALID_STATE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INVALID_STATE_ERR: ctx.drawImage(canvas2, 0, 0)"); } + +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.zerosource.js b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.zerosource.js new file mode 100644 index 0000000..6873b86 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.drawImage.zerosource.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +try { var _thrown = false; + ctx.drawImage(document.getElementById('red.png'), 10, 10, 0, 1, 0, 0, 100, 50); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 10, 10, 0, 1, 0, 0, 100, 50)"); } +try { var _thrown = false; + ctx.drawImage(document.getElementById('red.png'), 10, 10, 1, 0, 0, 0, 100, 50); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 10, 10, 1, 0, 0, 0, 100, 50)"); } +try { var _thrown = false; + ctx.drawImage(document.getElementById('red.png'), 10, 10, 0, 0, 0, 0, 100, 50); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 10, 10, 0, 0, 0, 0, 100, 50)"); } +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillRect.basic.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillRect.basic.js new file mode 100644 index 0000000..d7e98b3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillRect.basic.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillRect.clip.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillRect.clip.js new file mode 100644 index 0000000..1259f13 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillRect.clip.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.beginPath(); +ctx.rect(0, 0, 16, 16); +ctx.clip(); + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 16, 16); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillRect.negative.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillRect.negative.js new file mode 100644 index 0000000..b582917 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillRect.negative.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 50, 25); +ctx.fillRect(100, 0, -50, 25); +ctx.fillRect(0, 50, 50, -25); +ctx.fillRect(100, 50, -50, -25); +_assertPixel(canvas, 25,12, 0,255,0,255, "25,12", "0,255,0,255"); +_assertPixel(canvas, 75,12, 0,255,0,255, "75,12", "0,255,0,255"); +_assertPixel(canvas, 25,37, 0,255,0,255, "25,37", "0,255,0,255"); +_assertPixel(canvas, 75,37, 0,255,0,255, "75,37", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillRect.nonfinite.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillRect.nonfinite.js new file mode 100644 index 0000000..c224f49 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillRect.nonfinite.js @@ -0,0 +1,34 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#f00'; +ctx.fillRect(Infinity, 0, 100, 50); +ctx.fillRect(-Infinity, 0, 100, 50); +ctx.fillRect(NaN, 0, 100, 50); +ctx.fillRect(0, Infinity, 100, 50); +ctx.fillRect(0, -Infinity, 100, 50); +ctx.fillRect(0, NaN, 100, 50); +ctx.fillRect(0, 0, Infinity, 50); +ctx.fillRect(0, 0, -Infinity, 50); +ctx.fillRect(0, 0, NaN, 50); +ctx.fillRect(0, 0, 100, Infinity); +ctx.fillRect(0, 0, 100, -Infinity); +ctx.fillRect(0, 0, 100, NaN); +ctx.fillRect(Infinity, Infinity, 100, 50); +ctx.fillRect(Infinity, Infinity, Infinity, 50); +ctx.fillRect(Infinity, Infinity, Infinity, Infinity); +ctx.fillRect(Infinity, Infinity, 100, Infinity); +ctx.fillRect(Infinity, 0, Infinity, 50); +ctx.fillRect(Infinity, 0, Infinity, Infinity); +ctx.fillRect(Infinity, 0, 100, Infinity); +ctx.fillRect(0, Infinity, Infinity, 50); +ctx.fillRect(0, Infinity, Infinity, Infinity); +ctx.fillRect(0, Infinity, 100, Infinity); +ctx.fillRect(0, 0, Infinity, Infinity); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillRect.path.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillRect.path.js new file mode 100644 index 0000000..6d5fec5 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillRect.path.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.beginPath(); +ctx.rect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 16, 16); +ctx.fillStyle = '#0f0'; +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillRect.shadow.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillRect.shadow.js new file mode 100644 index 0000000..8847506 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillRect.shadow.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = '#0f0'; +ctx.shadowBlur = 0; +ctx.shadowOffsetX = 0; +ctx.shadowOffsetY = 50; +ctx.fillRect(0, -50, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillRect.transform.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillRect.transform.js new file mode 100644 index 0000000..d80df06 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillRect.transform.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.scale(10, 10); +ctx.translate(0, 5); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, -5, 10, 5); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillRect.zero.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillRect.zero.js new file mode 100644 index 0000000..f600d5e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillRect.zero.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 0); +ctx.fillRect(0, 0, 0, 50); +ctx.fillRect(0, 0, 0, 0); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.default.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.default.js new file mode 100644 index 0000000..8256830 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.default.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertEqual(ctx.fillStyle, '#000000', "ctx.fillStyle", "'#000000'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.get.semitransparent.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.get.semitransparent.js new file mode 100644 index 0000000..ae13c6e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.get.semitransparent.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = 'rgba(255,255,255,0.45)'; +_assertMatch(ctx.fillStyle, /^rgba\(255, 255, 255, 0\.4\d+\)$/, "ctx.fillStyle", "/^rgba\\(255, 255, 255, 0\\.4\\d+\\)$/"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.get.solid.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.get.solid.js new file mode 100644 index 0000000..b466c83 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.get.solid.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#fa0'; +_assertSame(ctx.fillStyle, '#ffaa00', "ctx.fillStyle", "'#ffaa00'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.get.transparent.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.get.transparent.js new file mode 100644 index 0000000..ce98d44 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.get.transparent.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = 'rgba(0,0,0,0)'; +_assertEqual(ctx.fillStyle, 'rgba(0, 0, 0, 0.0)', "ctx.fillStyle", "'rgba(0, 0, 0, 0.0)'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.invalidstring.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.invalidstring.js new file mode 100644 index 0000000..45031cc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.invalidstring.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.fillStyle = 'invalid'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.invalidtype.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.invalidtype.js new file mode 100644 index 0000000..3d098f4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.invalidtype.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.fillStyle = null; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.current.basic.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.current.basic.js new file mode 100644 index 0000000..c4e3ef8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.current.basic.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('style', 'color: #0f0'); +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'currentColor'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.current.changed.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.current.changed.js new file mode 100644 index 0000000..aecd2e7 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.current.changed.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('style', 'color: #0f0'); +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'currentColor'; +canvas.setAttribute('style', 'color: #f00'); +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.current.removed.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.current.removed.js new file mode 100644 index 0000000..9c4cb3b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.current.removed.js @@ -0,0 +1,22 @@ +_addTest(function(canvas, ctx) { + +// Try not to let it undetectably incorrectly pick up opaque-black +// from other parts of the document: +document.body.parentNode.setAttribute('style', 'color: #f00'); +document.body.setAttribute('style', 'color: #f00'); +canvas.setAttribute('style', 'color: #f00'); + +var canvas2 = document.createElement('canvas'); +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = '#f00'; +ctx2.fillStyle = 'currentColor'; +ctx2.fillRect(0, 0, 100, 50); +ctx.drawImage(canvas2, 0, 0); + +document.body.parentNode.removeAttribute('style'); +document.body.removeAttribute('style'); + +_assertPixel(canvas, 50,25, 0,0,0,255, "50,25", "0,0,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hex3.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hex3.js new file mode 100644 index 0000000..74b4b25 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hex3.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hex6.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hex6.js new file mode 100644 index 0000000..e076f53 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hex6.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = '#00fF00'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsl-1.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsl-1.js new file mode 100644 index 0000000..0b48479 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsl-1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(120, 100%, 50%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsl-2.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsl-2.js new file mode 100644 index 0000000..1210c7f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsl-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl( -240 , 100% , 50% )'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsl-3.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsl-3.js new file mode 100644 index 0000000..5fbfea0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsl-3.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(360120, 100%, 50%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsl-4.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsl-4.js new file mode 100644 index 0000000..f2b086a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsl-4.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(-360240, 100%, 50%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsl-5.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsl-5.js new file mode 100644 index 0000000..d8c7c27 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsl-5.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(120.0, 100.0%, 50.0%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsl-clamp-1.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsl-clamp-1.js new file mode 100644 index 0000000..375c1f2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsl-clamp-1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(120, 200%, 50%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsl-clamp-2.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsl-clamp-2.js new file mode 100644 index 0000000..c0a6b5b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsl-clamp-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(120, -200%, 49.9%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 127,127,127,255, "50,25", "127,127,127,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsl-clamp-3.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsl-clamp-3.js new file mode 100644 index 0000000..6bb9a8d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsl-clamp-3.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(120, 100%, 200%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 255,255,255,255, "50,25", "255,255,255,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsl-clamp-4.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsl-clamp-4.js new file mode 100644 index 0000000..091eb3c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsl-clamp-4.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(120, 100%, -200%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,0,0,255, "50,25", "0,0,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsla-1.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsla-1.js new file mode 100644 index 0000000..da51825 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsla-1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsla(120, 100%, 50%, 0.499)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,127, "50,25", "0,255,0,127"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsla-2.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsla-2.js new file mode 100644 index 0000000..b746602 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsla-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsla( 120.0 , 100.0% , 50.0% , 1 )'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsla-clamp-1.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsla-clamp-1.js new file mode 100644 index 0000000..97f9eec --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsla-clamp-1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsla(120, 200%, 50%, 1)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsla-clamp-2.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsla-clamp-2.js new file mode 100644 index 0000000..a479c09 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsla-clamp-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsla(120, -200%, 49.9%, 1)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 127,127,127,255, "50,25", "127,127,127,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsla-clamp-3.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsla-clamp-3.js new file mode 100644 index 0000000..69af398 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsla-clamp-3.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsla(120, 100%, 200%, 1)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 255,255,255,255, "50,25", "255,255,255,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsla-clamp-4.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsla-clamp-4.js new file mode 100644 index 0000000..bca6ff3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsla-clamp-4.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsla(120, 100%, -200%, 1)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,0,0,255, "50,25", "0,0,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsla-clamp-5.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsla-clamp-5.js new file mode 100644 index 0000000..9d1a095 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsla-clamp-5.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsla(120, 100%, 50%, 2)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsla-clamp-6.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsla-clamp-6.js new file mode 100644 index 0000000..488477a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.hsla-clamp-6.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsla(120, 100%, 0%, -2)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.html4.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.html4.js new file mode 100644 index 0000000..945cc00 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.html4.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'limE'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.hex1.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.hex1.js new file mode 100644 index 0000000..85949a0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.hex1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = '#f'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.hex2.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.hex2.js new file mode 100644 index 0000000..d028340 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.hex2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = '#f0'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.hex4.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.hex4.js new file mode 100644 index 0000000..1abcd75 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.hex4.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = '#ff00'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.hex5.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.hex5.js new file mode 100644 index 0000000..8a59b56 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.hex5.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = '#ff000'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.hex7.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.hex7.js new file mode 100644 index 0000000..6ef24b8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.hex7.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = '#ff0000f'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.hex8.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.hex8.js new file mode 100644 index 0000000..cca73d9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.hex8.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = '#ff0000ff'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.hsl-2.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.hsl-2.js new file mode 100644 index 0000000..0569b91 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.hsl-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'hsl(z, 100%, 50%)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.hsl-3.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.hsl-3.js new file mode 100644 index 0000000..24b21c5 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.hsl-3.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'hsl(0, 0, 50%)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.hsl-4.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.hsl-4.js new file mode 100644 index 0000000..1a0e021 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.hsl-4.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'hsl(0, 100%, 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.hsl-5.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.hsl-5.js new file mode 100644 index 0000000..a274be3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.hsl-5.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'hsl(0, 100%, 100%, 1)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.hsla-1.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.hsla-1.js new file mode 100644 index 0000000..8bafae8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.hsla-1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'hsla(0%, 100%, 50%, 1)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.hsla-2.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.hsla-2.js new file mode 100644 index 0000000..cdd0063 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.hsla-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'hsla(0, 0, 50%, 1)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.name-1.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.name-1.js new file mode 100644 index 0000000..2db78f7 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.name-1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'darkbrown'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.name-2.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.name-2.js new file mode 100644 index 0000000..16334ed --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.name-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'firebrick1'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.name-3.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.name-3.js new file mode 100644 index 0000000..01c3d71 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.name-3.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'red blue'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.rgb-3.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.rgb-3.js new file mode 100644 index 0000000..64ace0b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.rgb-3.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgb(255.0, 0, 0,)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.rgb-4.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.rgb-4.js new file mode 100644 index 0000000..c56ec66 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.rgb-4.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgb(100%, 0, 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.rgb-5.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.rgb-5.js new file mode 100644 index 0000000..deccba0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.rgb-5.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgb(255 0 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.rgb-7.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.rgb-7.js new file mode 100644 index 0000000..c919b73 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.rgb-7.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgb(255, 0, 0, 1)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.rgba-1.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.rgba-1.js new file mode 100644 index 0000000..f44a25e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.rgba-1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgba(255, 0, 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.rgba-3.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.rgba-3.js new file mode 100644 index 0000000..2a51261 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.rgba-3.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgba(100%, 0, 0, 1)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.rgba-4.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.rgba-4.js new file mode 100644 index 0000000..e6e9f3a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.rgba-4.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgba(255, 0, 0, 100%)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.rgba-5.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.rgba-5.js new file mode 100644 index 0000000..89ad25d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.invalid.rgba-5.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgba(255, 0, 0, 1. 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.rgb-clamp-1.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.rgb-clamp-1.js new file mode 100644 index 0000000..0647a16 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.rgb-clamp-1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgb(-1000, 1000, -1000)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.rgb-clamp-2.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.rgb-clamp-2.js new file mode 100644 index 0000000..13ecd74 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.rgb-clamp-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgb(-200%, 200%, -200%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.rgb-clamp-5.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.rgb-clamp-5.js new file mode 100644 index 0000000..8fcb56a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.rgb-clamp-5.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgb(-10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, -10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.rgb-num.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.rgb-num.js new file mode 100644 index 0000000..a7e459d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.rgb-num.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgb(0,255,0)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.rgb-percent.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.rgb-percent.js new file mode 100644 index 0000000..e44de2a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.rgb-percent.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgb(0% ,100% ,0%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.rgba-clamp-2.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.rgba-clamp-2.js new file mode 100644 index 0000000..baf6e24 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.rgba-clamp-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgba(0, 255, 0, 2)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.rgba-num-1.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.rgba-num-1.js new file mode 100644 index 0000000..adb60fb --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.rgba-num-1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgba( 0 , 255 , 0 , .499 )'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,127, "50,25", "0,255,0,127"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.rgba-num-2.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.rgba-num-2.js new file mode 100644 index 0000000..0a9e66c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.rgba-num-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgba( 0 , 255 , 0 , 0.499 )'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,127, "50,25", "0,255,0,127"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.rgba-percent.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.rgba-percent.js new file mode 100644 index 0000000..6167e85 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.rgba-percent.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgba(0%,100%,0%,0.499)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,127, "50,25", "0,255,0,127"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.rgba-solid-2.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.rgba-solid-2.js new file mode 100644 index 0000000..19df73e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.rgba-solid-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgba( 0 , 255 , 0 , 1.0 )'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.svg-1.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.svg-1.js new file mode 100644 index 0000000..9eba318 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.svg-1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'gray'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 128,128,128,255, "50,25", "128,128,128,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.svg-2.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.svg-2.js new file mode 100644 index 0000000..79c9612 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.svg-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'grey'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 128,128,128,255, "50,25", "128,128,128,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.system.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.system.js new file mode 100644 index 0000000..fd3d890 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.system.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'ThreeDDarkShadow'; +_assertMatch(ctx.fillStyle, /^#(?!(FF0000|ff0000|f00)$)/, "ctx.fillStyle", "/^#(?!(FF0000|ff0000|f00)$)/"); // test that it's not red + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.transparent-1.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.transparent-1.js new file mode 100644 index 0000000..c77a1bb --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.transparent-1.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'transparent'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.transparent-2.js b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.transparent-2.js new file mode 100644 index 0000000..6243082 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.fillStyle.parse.transparent-2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'TrAnSpArEnT'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.getcontext.exists.js b/platforms/ios/www/test/tests-todo/minimal.2d.getcontext.exists.js new file mode 100644 index 0000000..1576a66 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.getcontext.exists.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertDifferent(canvas.getContext('2d'), null, "canvas.getContext('2d')", "null"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.getcontext.shared.js b/platforms/ios/www/test/tests-todo/minimal.2d.getcontext.shared.js new file mode 100644 index 0000000..a18ef07 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.getcontext.shared.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +var ctx2 = canvas.getContext('2d'); +ctx.fillStyle = '#f00'; +ctx2.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.getcontext.unique.js b/platforms/ios/www/test/tests-todo/minimal.2d.getcontext.unique.js new file mode 100644 index 0000000..1d34c7a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.getcontext.unique.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.getContext('2d'), canvas.getContext('2d'), "canvas.getContext('2d')", "canvas.getContext('2d')"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.gradient.empty.js b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.empty.js new file mode 100644 index 0000000..f204d2b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.empty.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +var g = ctx.createLinearGradient(0, 0, 0, 50); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.gradient.interpolate.colouralpha.js b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.interpolate.colouralpha.js new file mode 100644 index 0000000..f6772c4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.interpolate.colouralpha.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +var g = ctx.createLinearGradient(0, 0, 100, 0); +g.addColorStop(0, 'rgba(255,255,0, 0)'); +g.addColorStop(1, 'rgba(0,0,255, 1)'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 25,25, 191,191,63,63, "25,25", "191,191,63,63", 3); +_assertPixelApprox(canvas, 50,25, 127,127,127,127, "50,25", "127,127,127,127", 3); +_assertPixelApprox(canvas, 75,25, 63,63,191,191, "75,25", "63,63,191,191", 3); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.gradient.interpolate.multiple.js b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.interpolate.multiple.js new file mode 100644 index 0000000..a2be77c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.interpolate.multiple.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 200; +var g = ctx.createLinearGradient(0, 0, 200, 0); +g.addColorStop(0, '#ff0'); +g.addColorStop(0.5, '#0ff'); +g.addColorStop(1, '#f0f'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 200, 50); +_assertPixelApprox(canvas, 50,25, 127,255,127,255, "50,25", "127,255,127,255", 3); +_assertPixelApprox(canvas, 100,25, 0,255,255,255, "100,25", "0,255,255,255", 3); +_assertPixelApprox(canvas, 150,25, 127,127,255,255, "150,25", "127,127,255,255", 3); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.gradient.interpolate.outside.js b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.interpolate.outside.js new file mode 100644 index 0000000..65e5053 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.interpolate.outside.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createLinearGradient(25, 0, 75, 0); +g.addColorStop(0.4, '#0f0'); +g.addColorStop(0.6, '#0f0'); + +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 20,25, 0,255,0,255, "20,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 80,25, 0,255,0,255, "80,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.gradient.interpolate.overlap.js b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.interpolate.overlap.js new file mode 100644 index 0000000..5cf8972 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.interpolate.overlap.js @@ -0,0 +1,31 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 200; +var g = ctx.createLinearGradient(0, 0, 200, 0); +g.addColorStop(0, '#f00'); +g.addColorStop(0, '#ff0'); +g.addColorStop(0.25, '#00f'); +g.addColorStop(0.25, '#0f0'); +g.addColorStop(0.25, '#0f0'); +g.addColorStop(0.25, '#0f0'); +g.addColorStop(0.25, '#ff0'); +g.addColorStop(0.5, '#00f'); +g.addColorStop(0.5, '#0f0'); +g.addColorStop(0.75, '#00f'); +g.addColorStop(0.75, '#f00'); +g.addColorStop(0.75, '#ff0'); +g.addColorStop(0.5, '#0f0'); +g.addColorStop(0.5, '#0f0'); +g.addColorStop(0.5, '#ff0'); +g.addColorStop(1, '#00f'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 200, 50); +_assertPixelApprox(canvas, 49,25, 0,0,255,255, "49,25", "0,0,255,255", 16); +_assertPixelApprox(canvas, 51,25, 255,255,0,255, "51,25", "255,255,0,255", 16); +_assertPixelApprox(canvas, 99,25, 0,0,255,255, "99,25", "0,0,255,255", 16); +_assertPixelApprox(canvas, 101,25, 255,255,0,255, "101,25", "255,255,0,255", 16); +_assertPixelApprox(canvas, 149,25, 0,0,255,255, "149,25", "0,0,255,255", 16); +_assertPixelApprox(canvas, 151,25, 255,255,0,255, "151,25", "255,255,0,255", 16); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.gradient.interpolate.overlap2.js b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.interpolate.overlap2.js new file mode 100644 index 0000000..62e0880 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.interpolate.overlap2.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +var g = ctx.createLinearGradient(0, 0, 100, 0); +var ps = [ 0, 1/10, 1/4, 1/3, 1/2, 3/4, 1 ]; +for (var p = 0; p < ps.length; ++p) +{ + g.addColorStop(ps[p], '#0f0'); + for (var i = 0; i < 15; ++i) + g.addColorStop(ps[p], '#f00'); + g.addColorStop(ps[p], '#0f0'); +} +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 30,25, 0,255,0,255, "30,25", "0,255,0,255"); +_assertPixel(canvas, 40,25, 0,255,0,255, "40,25", "0,255,0,255"); +_assertPixel(canvas, 60,25, 0,255,0,255, "60,25", "0,255,0,255"); +_assertPixel(canvas, 80,25, 0,255,0,255, "80,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.gradient.interpolate.solid.js b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.interpolate.solid.js new file mode 100644 index 0000000..1c73c04 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.interpolate.solid.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +var g = ctx.createLinearGradient(0, 0, 100, 0); +g.addColorStop(0, '#0f0'); +g.addColorStop(1, '#0f0'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.gradient.interpolate.vertical.js b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.interpolate.vertical.js new file mode 100644 index 0000000..30bdf8d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.interpolate.vertical.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +var g = ctx.createLinearGradient(0, 0, 0, 50); +g.addColorStop(0, '#ff0'); +g.addColorStop(1, '#00f'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,12, 191,191,63,255, "50,12", "191,191,63,255", 10); +_assertPixelApprox(canvas, 50,25, 127,127,127,255, "50,25", "127,127,127,255", 5); +_assertPixelApprox(canvas, 50,37, 63,63,191,255, "50,37", "63,63,191,255", 10); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.gradient.interpolate.zerosize.js b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.interpolate.zerosize.js new file mode 100644 index 0000000..fd39054 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.interpolate.zerosize.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createLinearGradient(50, 25, 50, 25); // zero-length line (undefined direction) +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 40,20, 0,255,0,255, "40,20", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.gradient.linear.nonfinite.js b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.linear.nonfinite.js new file mode 100644 index 0000000..696fe82 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.linear.nonfinite.js @@ -0,0 +1,74 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.createLinearGradient(Infinity, 0, 1, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, 0, 1, 0)"); } +try { var _thrown = false; + ctx.createLinearGradient(-Infinity, 0, 1, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(-Infinity, 0, 1, 0)"); } +try { var _thrown = false; + ctx.createLinearGradient(NaN, 0, 1, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(NaN, 0, 1, 0)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, Infinity, 1, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, Infinity, 1, 0)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, -Infinity, 1, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, -Infinity, 1, 0)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, NaN, 1, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, NaN, 1, 0)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, 0, Infinity, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, Infinity, 0)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, 0, -Infinity, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, -Infinity, 0)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, 0, NaN, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, NaN, 0)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, 0, 1, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, 1, Infinity)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, 0, 1, -Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, 1, -Infinity)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, 0, 1, NaN); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, 1, NaN)"); } +try { var _thrown = false; + ctx.createLinearGradient(Infinity, Infinity, 1, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, Infinity, 1, 0)"); } +try { var _thrown = false; + ctx.createLinearGradient(Infinity, Infinity, Infinity, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, Infinity, Infinity, 0)"); } +try { var _thrown = false; + ctx.createLinearGradient(Infinity, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.createLinearGradient(Infinity, Infinity, 1, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, Infinity, 1, Infinity)"); } +try { var _thrown = false; + ctx.createLinearGradient(Infinity, 0, Infinity, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, 0, Infinity, 0)"); } +try { var _thrown = false; + ctx.createLinearGradient(Infinity, 0, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, 0, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.createLinearGradient(Infinity, 0, 1, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, 0, 1, Infinity)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, Infinity, Infinity, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, Infinity, Infinity, 0)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, Infinity, 1, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, Infinity, 1, Infinity)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, 0, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, Infinity, Infinity)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.gradient.linear.transform.1.js b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.linear.transform.1.js new file mode 100644 index 0000000..297fdc5 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.linear.transform.1.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +var g = ctx.createLinearGradient(0, 0, 200, 0); +g.addColorStop(0, '#f00'); +g.addColorStop(0.25, '#0f0'); +g.addColorStop(0.75, '#0f0'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.translate(-50, 0); +ctx.fillRect(50, 0, 100, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.gradient.linear.transform.2.js b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.linear.transform.2.js new file mode 100644 index 0000000..d461074 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.linear.transform.2.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.translate(100, 0); +var g = ctx.createLinearGradient(0, 0, 200, 0); +g.addColorStop(0, '#f00'); +g.addColorStop(0.25, '#0f0'); +g.addColorStop(0.75, '#0f0'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.translate(-150, 0); +ctx.fillRect(50, 0, 100, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.gradient.linear.transform.3.js b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.linear.transform.3.js new file mode 100644 index 0000000..152ce92 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.linear.transform.3.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +var g = ctx.createLinearGradient(0, 0, 200, 0); +g.addColorStop(0, '#f00'); +g.addColorStop(0.25, '#0f0'); +g.addColorStop(0.75, '#0f0'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +ctx.translate(-50, 0); +ctx.fillRect(50, 0, 100, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.gradient.object.compare.js b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.object.compare.js new file mode 100644 index 0000000..d143b9c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.object.compare.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +var g1 = ctx.createLinearGradient(0, 0, 100, 0); +var g2 = ctx.createLinearGradient(0, 0, 100, 0); +_assertDifferent(g1, g2, "g1", "g2"); +ctx.fillStyle = g1; +_assertSame(ctx.fillStyle, g1, "ctx.fillStyle", "g1"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.gradient.object.crosscanvas.js b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.object.crosscanvas.js new file mode 100644 index 0000000..9a97619 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.object.crosscanvas.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +var g = document.createElement('canvas').getContext('2d').createLinearGradient(0, 0, 100, 0); +g.addColorStop(0, '#0f0'); +g.addColorStop(1, '#0f0'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.gradient.object.invalidcolour.js b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.object.invalidcolour.js new file mode 100644 index 0000000..609b069 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.object.invalidcolour.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +var g = ctx.createLinearGradient(0, 0, 100, 0); +try { var _thrown = false; + g.addColorStop(0, ""); +} catch (e) { if (e.code != DOMException.SYNTAX_ERR) _fail("Failed assertion: expected exception of type SYNTAX_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type SYNTAX_ERR: g.addColorStop(0, \"\")"); } +try { var _thrown = false; + g.addColorStop(0, 'undefined'); +} catch (e) { if (e.code != DOMException.SYNTAX_ERR) _fail("Failed assertion: expected exception of type SYNTAX_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type SYNTAX_ERR: g.addColorStop(0, 'undefined')"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.gradient.object.invalidoffset.js b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.object.invalidoffset.js new file mode 100644 index 0000000..447ba83 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.object.invalidoffset.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +var g = ctx.createLinearGradient(0, 0, 100, 0); +try { var _thrown = false; + g.addColorStop(-1, '#000'); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: g.addColorStop(-1, '#000')"); } +try { var _thrown = false; + g.addColorStop(2, '#000'); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: g.addColorStop(2, '#000')"); } +try { var _thrown = false; + g.addColorStop(Infinity, '#000'); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: g.addColorStop(Infinity, '#000')"); } +try { var _thrown = false; + g.addColorStop(-Infinity, '#000'); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: g.addColorStop(-Infinity, '#000')"); } +try { var _thrown = false; + g.addColorStop(NaN, '#000'); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: g.addColorStop(NaN, '#000')"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.gradient.object.return.js b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.object.return.js new file mode 100644 index 0000000..63870c5 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.object.return.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +window.CanvasGradient.prototype.thisImplementsCanvasGradient = true; + +var g1 = ctx.createLinearGradient(0, 0, 100, 0); +_assertDifferent(g1.addColorStop, undefined, "g1.addColorStop", "undefined"); +_assertSame(g1.thisImplementsCanvasGradient, true, "g1.thisImplementsCanvasGradient", "true"); + +var g2 = ctx.createRadialGradient(0, 0, 10, 0, 0, 20); +_assertDifferent(g2.addColorStop, undefined, "g2.addColorStop", "undefined"); +_assertSame(g2.thisImplementsCanvasGradient, true, "g2.thisImplementsCanvasGradient", "true"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.gradient.object.update.js b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.object.update.js new file mode 100644 index 0000000..fc3d299 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.object.update.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +var g = ctx.createLinearGradient(-100, 0, 200, 0); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +g.addColorStop(0.1, '#0f0'); +g.addColorStop(0.9, '#0f0'); +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.cone.behind.js b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.cone.behind.js new file mode 100644 index 0000000..6699a5c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.cone.behind.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(120, 25, 10, 211, 25, 100); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.cone.beside.js b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.cone.beside.js new file mode 100644 index 0000000..318df5b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.cone.beside.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(0, 100, 40, 100, 100, 50); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.cone.bottom.js b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.cone.bottom.js new file mode 100644 index 0000000..d4f3e09 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.cone.bottom.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(210, 25, 100, 230, 25, 101); +g.addColorStop(0, '#0f0'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.cone.cylinder.js b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.cone.cylinder.js new file mode 100644 index 0000000..5455012 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.cone.cylinder.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(210, 25, 100, 230, 25, 100); +g.addColorStop(0, '#0f0'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.cone.front.js b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.cone.front.js new file mode 100644 index 0000000..54bdcda --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.cone.front.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(311, 25, 10, 210, 25, 100); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#0f0'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.cone.shape1.js b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.cone.shape1.js new file mode 100644 index 0000000..065fd1a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.cone.shape1.js @@ -0,0 +1,32 @@ +_addTest(function(canvas, ctx) { + +var tol = 1; // tolerance to avoid antialiasing artifacts + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(30+tol, 40); +ctx.lineTo(110, -20+tol); +ctx.lineTo(110, 100-tol); +ctx.fill(); + +var g = ctx.createRadialGradient(30+10*5/2, 40, 10*3/2, 30+10*15/4, 40, 10*9/4); +g.addColorStop(0, '#0f0'); +g.addColorStop(1, '#0f0'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.cone.shape2.js b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.cone.shape2.js new file mode 100644 index 0000000..7d2f6e8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.cone.shape2.js @@ -0,0 +1,32 @@ +_addTest(function(canvas, ctx) { + +var tol = 1; // tolerance to avoid antialiasing artifacts + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(30+10*5/2, 40, 10*3/2, 30+10*15/4, 40, 10*9/4); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(30-tol, 40); +ctx.lineTo(110, -20-tol); +ctx.lineTo(110, 100+tol); +ctx.fill(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.cone.top.js b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.cone.top.js new file mode 100644 index 0000000..c1b4cd2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.cone.top.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(230, 25, 100, 100, 25, 101); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#0f0'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.equal.js b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.equal.js new file mode 100644 index 0000000..d30ffda --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.equal.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(50, 25, 20, 50, 25, 20); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.inside1.js b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.inside1.js new file mode 100644 index 0000000..40747e8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.inside1.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(50, 25, 100, 50, 25, 200); +g.addColorStop(0, '#0f0'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.inside2.js b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.inside2.js new file mode 100644 index 0000000..d290618 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.inside2.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(50, 25, 200, 50, 25, 100); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#0f0'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.inside3.js b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.inside3.js new file mode 100644 index 0000000..4f2a7ba --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.inside3.js @@ -0,0 +1,24 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(50, 25, 200, 50, 25, 100); +g.addColorStop(0, '#f00'); +g.addColorStop(0.993, '#f00'); +g.addColorStop(1, '#0f0'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.negative.js b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.negative.js new file mode 100644 index 0000000..ba805b1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.negative.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.createRadialGradient(0, 0, -0.1, 0, 0, 1); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.createRadialGradient(0, 0, -0.1, 0, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, 1, 0, 0, -0.1); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.createRadialGradient(0, 0, 1, 0, 0, -0.1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, -0.1, 0, 0, -0.1); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.createRadialGradient(0, 0, -0.1, 0, 0, -0.1)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.nonfinite.js b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.nonfinite.js new file mode 100644 index 0000000..6d1a1ab --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.nonfinite.js @@ -0,0 +1,230 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.createRadialGradient(Infinity, 0, 1, 0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, 0, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(-Infinity, 0, 1, 0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(-Infinity, 0, 1, 0, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(NaN, 0, 1, 0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(NaN, 0, 1, 0, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, Infinity, 1, 0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, 0, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, -Infinity, 1, 0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, -Infinity, 1, 0, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, NaN, 1, 0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, NaN, 1, 0, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, Infinity, 0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, 0, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, -Infinity, 0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, -Infinity, 0, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, NaN, 0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, NaN, 0, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, 1, Infinity, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, Infinity, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, 1, -Infinity, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, -Infinity, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, 1, NaN, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, NaN, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, 1, 0, Infinity, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, Infinity, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, 1, 0, -Infinity, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, -Infinity, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, 1, 0, NaN, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, NaN, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, 1, 0, 0, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, 0, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, 1, 0, 0, -Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, 0, -Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, 1, 0, 0, NaN); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, 0, NaN)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, Infinity, 1, 0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, 0, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, Infinity, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, Infinity, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, 0, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, 0, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, Infinity, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, Infinity, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, 0, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, 0, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, Infinity, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, Infinity, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, 0, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, 0, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, Infinity, 1, 0, Infinity, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, 0, Infinity, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, Infinity, 1, 0, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, 0, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, Infinity, 1, 0, 0, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, 0, 0, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, 0, Infinity, 0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, 0, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, Infinity, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, Infinity, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, 0, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, 0, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, 0, Infinity, 0, Infinity, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, 0, Infinity, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, 0, Infinity, 0, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, 0, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, 0, Infinity, 0, 0, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, 0, 0, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, 0, 1, Infinity, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, Infinity, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, 0, 1, Infinity, Infinity, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, Infinity, Infinity, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, 0, 1, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, 0, 1, Infinity, 0, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, Infinity, 0, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, 0, 1, 0, Infinity, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, 0, Infinity, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, 0, 1, 0, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, 0, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(Infinity, 0, 1, 0, 0, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, 0, 0, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, Infinity, Infinity, 0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, 0, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, Infinity, Infinity, Infinity, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, Infinity, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, Infinity, Infinity, Infinity, Infinity, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, Infinity, Infinity, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, Infinity, Infinity, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, Infinity, Infinity, Infinity, 0, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, Infinity, 0, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, Infinity, Infinity, 0, Infinity, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, 0, Infinity, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, Infinity, Infinity, 0, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, 0, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, Infinity, Infinity, 0, 0, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, 0, 0, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, Infinity, 1, Infinity, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, Infinity, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, Infinity, 1, Infinity, Infinity, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, Infinity, Infinity, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, Infinity, 1, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, Infinity, 1, Infinity, 0, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, Infinity, 0, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, Infinity, 1, 0, Infinity, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, 0, Infinity, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, Infinity, 1, 0, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, 0, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, Infinity, 1, 0, 0, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, 0, 0, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, Infinity, Infinity, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, Infinity, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, Infinity, Infinity, Infinity, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, Infinity, Infinity, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, Infinity, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, Infinity, Infinity, 0, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, Infinity, 0, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, Infinity, 0, Infinity, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, 0, Infinity, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, Infinity, 0, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, 0, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, Infinity, 0, 0, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, 0, 0, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, 1, Infinity, Infinity, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, Infinity, Infinity, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, 1, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, 1, Infinity, 0, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, Infinity, 0, Infinity)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, 1, 0, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, Infinity, Infinity)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.outside1.js b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.outside1.js new file mode 100644 index 0000000..365d957 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.outside1.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(200, 25, 10, 200, 25, 20); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#0f0'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.outside2.js b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.outside2.js new file mode 100644 index 0000000..9489a94 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.outside2.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(200, 25, 20, 200, 25, 10); +g.addColorStop(0, '#0f0'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.outside3.js b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.outside3.js new file mode 100644 index 0000000..2d63b00 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.outside3.js @@ -0,0 +1,24 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(200, 25, 20, 200, 25, 10); +g.addColorStop(0, '#0f0'); +g.addColorStop(0.001, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.touch1.js b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.touch1.js new file mode 100644 index 0000000..2761093 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.touch1.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(150, 25, 50, 200, 25, 100); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.touch2.js b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.touch2.js new file mode 100644 index 0000000..9c507c8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.touch2.js @@ -0,0 +1,25 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(-80, 25, 70, 0, 25, 150); +g.addColorStop(0, '#f00'); +g.addColorStop(0.01, '#0f0'); +g.addColorStop(0.99, '#0f0'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.touch3.js b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.touch3.js new file mode 100644 index 0000000..3c8a546 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.touch3.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(120, -15, 25, 140, -30, 50); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.transform.1.js b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.transform.1.js new file mode 100644 index 0000000..bfc0ebc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.transform.1.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +var g = ctx.createRadialGradient(0, 0, 0, 0, 0, 11.2); +g.addColorStop(0, '#0f0'); +g.addColorStop(0.5, '#0f0'); +g.addColorStop(0.51, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.translate(50, 25); +ctx.scale(10, 10); +ctx.fillRect(-5, -2.5, 10, 5); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.transform.2.js b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.transform.2.js new file mode 100644 index 0000000..1603b0b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.transform.2.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.translate(100, 0); +var g = ctx.createRadialGradient(0, 0, 0, 0, 0, 11.2); +g.addColorStop(0, '#0f0'); +g.addColorStop(0.5, '#0f0'); +g.addColorStop(0.51, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.translate(-50, 25); +ctx.scale(10, 10); +ctx.fillRect(-5, -2.5, 10, 5); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.transform.3.js b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.transform.3.js new file mode 100644 index 0000000..33acdd4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.gradient.radial.transform.3.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +var g = ctx.createRadialGradient(0, 0, 0, 0, 0, 11.2); +g.addColorStop(0, '#0f0'); +g.addColorStop(0.5, '#0f0'); +g.addColorStop(0.51, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +ctx.translate(50, 25); +ctx.scale(10, 10); +ctx.fillRect(-5, -2.5, 10, 5); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.create1.basic.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.create1.basic.js new file mode 100644 index 0000000..cca632c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.create1.basic.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertDifferent(ctx.createImageData(ctx.createImageData(1, 1)), null, "ctx.createImageData(ctx.createImageData(1, 1))", "null"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.create1.initial.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.create1.initial.js new file mode 100644 index 0000000..2c3bd2d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.create1.initial.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +var imgdata1 = ctx.getImageData(0, 0, 10, 20); +var imgdata2 = ctx.createImageData(imgdata1); +_assertEqual(imgdata2.data.length, imgdata1.data.length, "imgdata2.data.length", "imgdata1.data.length"); +_assertEqual(imgdata2.width, imgdata1.width, "imgdata2.width", "imgdata1.width"); +_assertEqual(imgdata2.height, imgdata1.height, "imgdata2.height", "imgdata1.height"); +var isTransparentBlack = true; +for (var i = 0; i < imgdata2.data.length; ++i) + if (imgdata2.data[i] !== 0) + isTransparentBlack = false; +_assert(isTransparentBlack, "isTransparentBlack"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.create1.type.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.create1.type.js new file mode 100644 index 0000000..d2fe511 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.create1.type.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +_assertDifferent(window.ImageData, undefined, "window.ImageData", "undefined"); +_assertDifferent(window.CanvasPixelArray, undefined, "window.CanvasPixelArray", "undefined"); +window.ImageData.prototype.thisImplementsImageData = true; +window.CanvasPixelArray.prototype.thisImplementsCanvasPixelArray = true; +var imgdata = ctx.createImageData(ctx.createImageData(1, 1)); +_assert(imgdata.thisImplementsImageData, "imgdata.thisImplementsImageData"); +_assert(imgdata.data.thisImplementsCanvasPixelArray, "imgdata.data.thisImplementsCanvasPixelArray"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.create1.zero.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.create1.zero.js new file mode 100644 index 0000000..4eb5d8f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.create1.zero.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.createImageData(null); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createImageData(null)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.create2.basic.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.create2.basic.js new file mode 100644 index 0000000..770dd91 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.create2.basic.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertDifferent(ctx.createImageData(1, 1), null, "ctx.createImageData(1, 1)", "null"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.create2.initial.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.create2.initial.js new file mode 100644 index 0000000..9d8645e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.create2.initial.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.createImageData(10, 20); +_assertEqual(imgdata.data.length, imgdata.width*imgdata.height*4, "imgdata.data.length", "imgdata.width*imgdata.height*4"); +_assert(imgdata.width < imgdata.height, "imgdata.width < imgdata.height"); +_assert(imgdata.width > 0, "imgdata.width > 0"); +var isTransparentBlack = true; +for (var i = 0; i < imgdata.data.length; ++i) + if (imgdata.data[i] !== 0) + isTransparentBlack = false; +_assert(isTransparentBlack, "isTransparentBlack"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.create2.large.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.create2.large.js new file mode 100644 index 0000000..45e2294 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.create2.large.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.createImageData(1000, 2000); +_assertEqual(imgdata.data.length, imgdata.width*imgdata.height*4, "imgdata.data.length", "imgdata.width*imgdata.height*4"); +_assert(imgdata.width < imgdata.height, "imgdata.width < imgdata.height"); +_assert(imgdata.width > 0, "imgdata.width > 0"); +var isTransparentBlack = true; +for (var i = 0; i < imgdata.data.length; i += 7813) // check ~1024 points (assuming normal scaling) + if (imgdata.data[i] !== 0) + isTransparentBlack = false; +_assert(isTransparentBlack, "isTransparentBlack"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.create2.negative.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.create2.negative.js new file mode 100644 index 0000000..4a1df28 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.create2.negative.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +var imgdata1 = ctx.createImageData(10, 20); +var imgdata2 = ctx.createImageData(-10, 20); +var imgdata3 = ctx.createImageData(10, -20); +var imgdata4 = ctx.createImageData(-10, -20); +_assertEqual(imgdata1.data.length, imgdata2.data.length, "imgdata1.data.length", "imgdata2.data.length"); +_assertEqual(imgdata2.data.length, imgdata3.data.length, "imgdata2.data.length", "imgdata3.data.length"); +_assertEqual(imgdata3.data.length, imgdata4.data.length, "imgdata3.data.length", "imgdata4.data.length"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.create2.nonfinite.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.create2.nonfinite.js new file mode 100644 index 0000000..b0c3eae --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.create2.nonfinite.js @@ -0,0 +1,26 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.createImageData(Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createImageData(Infinity, 10)"); } +try { var _thrown = false; + ctx.createImageData(-Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createImageData(-Infinity, 10)"); } +try { var _thrown = false; + ctx.createImageData(NaN, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createImageData(NaN, 10)"); } +try { var _thrown = false; + ctx.createImageData(10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createImageData(10, Infinity)"); } +try { var _thrown = false; + ctx.createImageData(10, -Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createImageData(10, -Infinity)"); } +try { var _thrown = false; + ctx.createImageData(10, NaN); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createImageData(10, NaN)"); } +try { var _thrown = false; + ctx.createImageData(Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createImageData(Infinity, Infinity)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.create2.round.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.create2.round.js new file mode 100644 index 0000000..5e97a65 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.create2.round.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +var imgdata1 = ctx.createImageData(10.01, 10.99); +var imgdata2 = ctx.getImageData(0, 0, 10.01, 10.99); +_assertEqual(imgdata1.width, imgdata2.width, "imgdata1.width", "imgdata2.width"); +_assertEqual(imgdata1.height, imgdata2.height, "imgdata1.height", "imgdata2.height"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.create2.tiny.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.create2.tiny.js new file mode 100644 index 0000000..adf0c25 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.create2.tiny.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.createImageData(0.0001, 0.0001); +_assertEqual(imgdata.data.length, imgdata.width*imgdata.height*4, "imgdata.data.length", "imgdata.width*imgdata.height*4"); +_assertEqual(imgdata.width, 1, "imgdata.width", "1"); +_assertEqual(imgdata.height, 1, "imgdata.height", "1"); +var isTransparentBlack = true; +for (var i = 0; i < imgdata.data.length; ++i) + if (imgdata.data[i] !== 0) + isTransparentBlack = false; +_assert(isTransparentBlack, "isTransparentBlack"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.create2.type.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.create2.type.js new file mode 100644 index 0000000..0c9d3d8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.create2.type.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +_assertDifferent(window.ImageData, undefined, "window.ImageData", "undefined"); +_assertDifferent(window.CanvasPixelArray, undefined, "window.CanvasPixelArray", "undefined"); +window.ImageData.prototype.thisImplementsImageData = true; +window.CanvasPixelArray.prototype.thisImplementsCanvasPixelArray = true; +var imgdata = ctx.createImageData(1, 1); +_assert(imgdata.thisImplementsImageData, "imgdata.thisImplementsImageData"); +_assert(imgdata.data.thisImplementsCanvasPixelArray, "imgdata.data.thisImplementsCanvasPixelArray"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.create2.zero.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.create2.zero.js new file mode 100644 index 0000000..2f9f61c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.create2.zero.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.createImageData(10, 0); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.createImageData(10, 0)"); } +try { var _thrown = false; + ctx.createImageData(0, 10); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.createImageData(0, 10)"); } +try { var _thrown = false; + ctx.createImageData(0, 0); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.createImageData(0, 0)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.basic.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.basic.js new file mode 100644 index 0000000..88070d6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.basic.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertDifferent(ctx.getImageData(0, 0, 100, 50), null, "ctx.getImageData(0, 0, 100, 50)", "null"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.clamp.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.clamp.js new file mode 100644 index 0000000..05345d6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.clamp.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = 'rgb(-100, -200, -300)'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = 'rgb(256, 300, 400)'; +ctx.fillRect(20, 10, 60, 10); +var imgdata1 = ctx.getImageData(10, 5, 1, 1); +_assertSame(imgdata1.data[0], 0, "imgdata1.data[\""+(0)+"\"]", "0"); +_assertSame(imgdata1.data[1], 0, "imgdata1.data[\""+(1)+"\"]", "0"); +_assertSame(imgdata1.data[2], 0, "imgdata1.data[\""+(2)+"\"]", "0"); +var imgdata2 = ctx.getImageData(30, 15, 1, 1); +_assertSame(imgdata2.data[0], 255, "imgdata2.data[\""+(0)+"\"]", "255"); +_assertSame(imgdata2.data[1], 255, "imgdata2.data[\""+(1)+"\"]", "255"); +_assertSame(imgdata2.data[2], 255, "imgdata2.data[\""+(2)+"\"]", "255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.length.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.length.js new file mode 100644 index 0000000..4ecc44e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.length.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.getImageData(0, 0, 10, 10); +_assertEqual(imgdata.data.length, imgdata.width*imgdata.height*4, "imgdata.data.length", "imgdata.width*imgdata.height*4"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.nonfinite.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.nonfinite.js new file mode 100644 index 0000000..81547ae --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.nonfinite.js @@ -0,0 +1,74 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.getImageData(Infinity, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(Infinity, 10, 10, 10)"); } +try { var _thrown = false; + ctx.getImageData(-Infinity, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(-Infinity, 10, 10, 10)"); } +try { var _thrown = false; + ctx.getImageData(NaN, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(NaN, 10, 10, 10)"); } +try { var _thrown = false; + ctx.getImageData(10, Infinity, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, Infinity, 10, 10)"); } +try { var _thrown = false; + ctx.getImageData(10, -Infinity, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, -Infinity, 10, 10)"); } +try { var _thrown = false; + ctx.getImageData(10, NaN, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, NaN, 10, 10)"); } +try { var _thrown = false; + ctx.getImageData(10, 10, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, 10, Infinity, 10)"); } +try { var _thrown = false; + ctx.getImageData(10, 10, -Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, 10, -Infinity, 10)"); } +try { var _thrown = false; + ctx.getImageData(10, 10, NaN, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, 10, NaN, 10)"); } +try { var _thrown = false; + ctx.getImageData(10, 10, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, 10, 10, Infinity)"); } +try { var _thrown = false; + ctx.getImageData(10, 10, 10, -Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, 10, 10, -Infinity)"); } +try { var _thrown = false; + ctx.getImageData(10, 10, 10, NaN); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, 10, 10, NaN)"); } +try { var _thrown = false; + ctx.getImageData(Infinity, Infinity, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(Infinity, Infinity, 10, 10)"); } +try { var _thrown = false; + ctx.getImageData(Infinity, Infinity, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(Infinity, Infinity, Infinity, 10)"); } +try { var _thrown = false; + ctx.getImageData(Infinity, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(Infinity, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.getImageData(Infinity, Infinity, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(Infinity, Infinity, 10, Infinity)"); } +try { var _thrown = false; + ctx.getImageData(Infinity, 10, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(Infinity, 10, Infinity, 10)"); } +try { var _thrown = false; + ctx.getImageData(Infinity, 10, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(Infinity, 10, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.getImageData(Infinity, 10, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(Infinity, 10, 10, Infinity)"); } +try { var _thrown = false; + ctx.getImageData(10, Infinity, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, Infinity, Infinity, 10)"); } +try { var _thrown = false; + ctx.getImageData(10, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.getImageData(10, Infinity, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, Infinity, 10, Infinity)"); } +try { var _thrown = false; + ctx.getImageData(10, 10, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, 10, Infinity, Infinity)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.nonpremul.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.nonpremul.js new file mode 100644 index 0000000..7fbe377 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.nonpremul.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = 'rgba(255, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +var imgdata = ctx.getImageData(10, 10, 10, 10); +_assert(imgdata.data[0] > 200, "imgdata.data[\""+(0)+"\"] > 200"); +_assert(imgdata.data[1] > 200, "imgdata.data[\""+(1)+"\"] > 200"); +_assert(imgdata.data[2] > 200, "imgdata.data[\""+(2)+"\"] > 200"); +_assert(imgdata.data[3] > 100, "imgdata.data[\""+(3)+"\"] > 100"); +_assert(imgdata.data[3] < 200, "imgdata.data[\""+(3)+"\"] < 200"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.order.alpha.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.order.alpha.js new file mode 100644 index 0000000..eebf106 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.order.alpha.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = 'rgba(0, 0, 0, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +var imgdata = ctx.getImageData(0, 0, 10, 10); +_assert(imgdata.data[3] < 200, "imgdata.data[\""+(3)+"\"] < 200"); +_assert(imgdata.data[3] > 100, "imgdata.data[\""+(3)+"\"] > 100"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.order.cols.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.order.cols.js new file mode 100644 index 0000000..b911b92 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.order.cols.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#fff'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#000'; +ctx.fillRect(0, 0, 2, 50); +var imgdata = ctx.getImageData(0, 0, 10, 10); +_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); +_assertSame(imgdata.data[Math.round(imgdata.width/2*4)], 255, "imgdata.data[Math.round(imgdata.width/2*4)]", "255"); +_assertSame(imgdata.data[Math.round((imgdata.height/2)*imgdata.width*4)], 0, "imgdata.data[Math.round((imgdata.height/2)*imgdata.width*4)]", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.order.rgb.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.order.rgb.js new file mode 100644 index 0000000..0a6bdd7 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.order.rgb.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#48c'; +ctx.fillRect(0, 0, 100, 50); +var imgdata = ctx.getImageData(0, 0, 10, 10); +_assertSame(imgdata.data[0], 0x44, "imgdata.data[\""+(0)+"\"]", "0x44"); +_assertSame(imgdata.data[1], 0x88, "imgdata.data[\""+(1)+"\"]", "0x88"); +_assertSame(imgdata.data[2], 0xCC, "imgdata.data[\""+(2)+"\"]", "0xCC"); +_assertSame(imgdata.data[3], 255, "imgdata.data[\""+(3)+"\"]", "255"); +_assertSame(imgdata.data[4], 0x44, "imgdata.data[\""+(4)+"\"]", "0x44"); +_assertSame(imgdata.data[5], 0x88, "imgdata.data[\""+(5)+"\"]", "0x88"); +_assertSame(imgdata.data[6], 0xCC, "imgdata.data[\""+(6)+"\"]", "0xCC"); +_assertSame(imgdata.data[7], 255, "imgdata.data[\""+(7)+"\"]", "255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.order.rows.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.order.rows.js new file mode 100644 index 0000000..493395a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.order.rows.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#fff'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#000'; +ctx.fillRect(0, 0, 100, 2); +var imgdata = ctx.getImageData(0, 0, 10, 10); +_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); +_assertSame(imgdata.data[Math.floor(imgdata.width/2*4)], 0, "imgdata.data[Math.floor(imgdata.width/2*4)]", "0"); +_assertSame(imgdata.data[(imgdata.height/2)*imgdata.width*4], 255, "imgdata.data[(imgdata.height/2)*imgdata.width*4]", "255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.range.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.range.js new file mode 100644 index 0000000..27614dd --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.range.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#000'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#fff'; +ctx.fillRect(20, 10, 60, 10); +var imgdata1 = ctx.getImageData(10, 5, 1, 1); +_assertSame(imgdata1.data[0], 0, "imgdata1.data[\""+(0)+"\"]", "0"); +var imgdata2 = ctx.getImageData(30, 15, 1, 1); +_assertSame(imgdata2.data[0], 255, "imgdata2.data[\""+(0)+"\"]", "255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.source.negative.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.source.negative.js new file mode 100644 index 0000000..ec9b28a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.source.negative.js @@ -0,0 +1,25 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#000'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#fff'; +ctx.fillRect(20, 10, 60, 10); + +var imgdata1 = ctx.getImageData(85, 25, -10, -10); +_assertSame(imgdata1.data[0], 255, "imgdata1.data[\""+(0)+"\"]", "255"); +_assertSame(imgdata1.data[1], 255, "imgdata1.data[\""+(1)+"\"]", "255"); +_assertSame(imgdata1.data[2], 255, "imgdata1.data[\""+(2)+"\"]", "255"); +_assertSame(imgdata1.data[3], 255, "imgdata1.data[\""+(3)+"\"]", "255"); +_assertSame(imgdata1.data[imgdata1.data.length-4+0], 0, "imgdata1.data[imgdata1.data.length-4+0]", "0"); +_assertSame(imgdata1.data[imgdata1.data.length-4+1], 0, "imgdata1.data[imgdata1.data.length-4+1]", "0"); +_assertSame(imgdata1.data[imgdata1.data.length-4+2], 0, "imgdata1.data[imgdata1.data.length-4+2]", "0"); +_assertSame(imgdata1.data[imgdata1.data.length-4+3], 255, "imgdata1.data[imgdata1.data.length-4+3]", "255"); + +var imgdata2 = ctx.getImageData(0, 0, -1, -1); +_assertSame(imgdata2.data[0], 0, "imgdata2.data[\""+(0)+"\"]", "0"); +_assertSame(imgdata2.data[1], 0, "imgdata2.data[\""+(1)+"\"]", "0"); +_assertSame(imgdata2.data[2], 0, "imgdata2.data[\""+(2)+"\"]", "0"); +_assertSame(imgdata2.data[3], 0, "imgdata2.data[\""+(3)+"\"]", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.source.outside.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.source.outside.js new file mode 100644 index 0000000..a915b82 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.source.outside.js @@ -0,0 +1,31 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#08f'; +ctx.fillRect(0, 0, 100, 50); + +var imgdata1 = ctx.getImageData(-10, 5, 1, 1); +_assertSame(imgdata1.data[0], 0, "imgdata1.data[\""+(0)+"\"]", "0"); +_assertSame(imgdata1.data[1], 0, "imgdata1.data[\""+(1)+"\"]", "0"); +_assertSame(imgdata1.data[2], 0, "imgdata1.data[\""+(2)+"\"]", "0"); +_assertSame(imgdata1.data[3], 0, "imgdata1.data[\""+(3)+"\"]", "0"); + +var imgdata2 = ctx.getImageData(10, -5, 1, 1); +_assertSame(imgdata2.data[0], 0, "imgdata2.data[\""+(0)+"\"]", "0"); +_assertSame(imgdata2.data[1], 0, "imgdata2.data[\""+(1)+"\"]", "0"); +_assertSame(imgdata2.data[2], 0, "imgdata2.data[\""+(2)+"\"]", "0"); +_assertSame(imgdata2.data[3], 0, "imgdata2.data[\""+(3)+"\"]", "0"); + +var imgdata3 = ctx.getImageData(200, 5, 1, 1); +_assertSame(imgdata3.data[0], 0, "imgdata3.data[\""+(0)+"\"]", "0"); +_assertSame(imgdata3.data[1], 0, "imgdata3.data[\""+(1)+"\"]", "0"); +_assertSame(imgdata3.data[2], 0, "imgdata3.data[\""+(2)+"\"]", "0"); +_assertSame(imgdata3.data[3], 0, "imgdata3.data[\""+(3)+"\"]", "0"); + +var imgdata4 = ctx.getImageData(10, 60, 1, 1); +_assertSame(imgdata4.data[0], 0, "imgdata4.data[\""+(0)+"\"]", "0"); +_assertSame(imgdata4.data[1], 0, "imgdata4.data[\""+(1)+"\"]", "0"); +_assertSame(imgdata4.data[2], 0, "imgdata4.data[\""+(2)+"\"]", "0"); +_assertSame(imgdata4.data[3], 0, "imgdata4.data[\""+(3)+"\"]", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.source.size.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.source.size.js new file mode 100644 index 0000000..0d9d8cc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.source.size.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +var imgdata1 = ctx.getImageData(0, 0, 10, 10); +var imgdata2 = ctx.getImageData(0, 0, 20, 20); +_assert(imgdata2.width > imgdata1.width, "imgdata2.width > imgdata1.width"); +_assert(imgdata2.height > imgdata1.height, "imgdata2.height > imgdata1.height"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.tiny.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.tiny.js new file mode 100644 index 0000000..d799357 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.tiny.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.getImageData(0, 0, 0.0001, 0.0001); +_assertEqual(imgdata.data.length, imgdata.width*imgdata.height*4, "imgdata.data.length", "imgdata.width*imgdata.height*4"); +_assertEqual(imgdata.width, 1, "imgdata.width", "1"); +_assertEqual(imgdata.height, 1, "imgdata.height", "1"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.type.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.type.js new file mode 100644 index 0000000..bf65e48 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.type.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +_assertDifferent(window.ImageData, undefined, "window.ImageData", "undefined"); +_assertDifferent(window.CanvasPixelArray, undefined, "window.CanvasPixelArray", "undefined"); +window.ImageData.prototype.thisImplementsImageData = true; +window.CanvasPixelArray.prototype.thisImplementsCanvasPixelArray = true; +var imgdata = ctx.getImageData(0, 0, 1, 1); +_assert(imgdata.thisImplementsImageData, "imgdata.thisImplementsImageData"); +_assert(imgdata.data.thisImplementsCanvasPixelArray, "imgdata.data.thisImplementsCanvasPixelArray"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.unaffected.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.unaffected.js new file mode 100644 index 0000000..36296a6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.unaffected.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 50, 50) +ctx.fillStyle = '#f00'; +ctx.fillRect(50, 0, 50, 50) +ctx.save(); +ctx.translate(50, 0); +ctx.globalAlpha = 0.1; +ctx.globalCompositeOperation = 'destination-atop'; +ctx.shadowColor = '#f00'; +ctx.rect(0, 0, 5, 5); +ctx.clip(); +var imgdata = ctx.getImageData(0, 0, 50, 50); +ctx.restore(); +ctx.putImageData(imgdata, 50, 0); +_assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.zero.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.zero.js new file mode 100644 index 0000000..278c388 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.get.zero.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.getImageData(1, 1, 10, 0); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.getImageData(1, 1, 10, 0)"); } +try { var _thrown = false; + ctx.getImageData(1, 1, 0, 10); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.getImageData(1, 1, 0, 10)"); } +try { var _thrown = false; + ctx.getImageData(1, 1, 0, 0); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.getImageData(1, 1, 0, 0)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.object.ctor.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.object.ctor.js new file mode 100644 index 0000000..7d761f6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.object.ctor.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +_assertDifferent(window.ImageData, undefined, "window.ImageData", "undefined"); +try { var _thrown = false; new window.ImageData(1,1); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: new window.ImageData(1,1)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.object.nan.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.object.nan.js new file mode 100644 index 0000000..ba38464 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.object.nan.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.getImageData(0, 0, 10, 10); +imgdata.data[0] = 100; +imgdata.data[0] = NaN; +_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); +imgdata.data[0] = 100; +imgdata.data[0] = "cheese"; +_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.object.properties.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.object.properties.js new file mode 100644 index 0000000..0aedd64 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.object.properties.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.getImageData(0, 0, 10, 10); +_assertEqual(typeof(imgdata.width), 'number', "typeof(imgdata.width)", "'number'"); +_assertEqual(typeof(imgdata.height), 'number', "typeof(imgdata.height)", "'number'"); +_assertEqual(typeof(imgdata.data), 'object', "typeof(imgdata.data)", "'object'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.object.readonly.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.object.readonly.js new file mode 100644 index 0000000..00b3854 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.object.readonly.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.getImageData(0, 0, 10, 10); +var w = imgdata.width; +var h = imgdata.height; +var d = imgdata.data; +imgdata.width = 123; +imgdata.height = 123; +imgdata.data = [100,100,100,100]; +_assertSame(imgdata.width, w, "imgdata.width", "w"); +_assertSame(imgdata.height, h, "imgdata.height", "h"); +_assertSame(imgdata.data, d, "imgdata.data", "d"); +_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); +_assertSame(imgdata.data[1], 0, "imgdata.data[\""+(1)+"\"]", "0"); +_assertSame(imgdata.data[2], 0, "imgdata.data[\""+(2)+"\"]", "0"); +_assertSame(imgdata.data[3], 0, "imgdata.data[\""+(3)+"\"]", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.object.round.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.object.round.js new file mode 100644 index 0000000..243171f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.object.round.js @@ -0,0 +1,34 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.getImageData(0, 0, 10, 10); +imgdata.data[0] = 0.499; +_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); +imgdata.data[0] = 0.5; +_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); +imgdata.data[0] = 0.501; +_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); +imgdata.data[0] = 1.499; +_assertSame(imgdata.data[0], 1, "imgdata.data[\""+(0)+"\"]", "1"); +imgdata.data[0] = 1.5; +_assertSame(imgdata.data[0], 1, "imgdata.data[\""+(0)+"\"]", "1"); +imgdata.data[0] = 1.501; +_assertSame(imgdata.data[0], 1, "imgdata.data[\""+(0)+"\"]", "1"); +imgdata.data[0] = 2.5; +_assertSame(imgdata.data[0], 2, "imgdata.data[\""+(0)+"\"]", "2"); +imgdata.data[0] = 3.5; +_assertSame(imgdata.data[0], 3, "imgdata.data[\""+(0)+"\"]", "3"); +imgdata.data[0] = 252.5; +_assertSame(imgdata.data[0], 252, "imgdata.data[\""+(0)+"\"]", "252"); +imgdata.data[0] = 253.5; +_assertSame(imgdata.data[0], 253, "imgdata.data[\""+(0)+"\"]", "253"); +imgdata.data[0] = 254.5; +_assertSame(imgdata.data[0], 254, "imgdata.data[\""+(0)+"\"]", "254"); +imgdata.data[0] = 256.5; +_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); +imgdata.data[0] = -0.5; +_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); +imgdata.data[0] = -1.5; +_assertSame(imgdata.data[0], 255, "imgdata.data[\""+(0)+"\"]", "255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.object.set.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.object.set.js new file mode 100644 index 0000000..ee3cd64 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.object.set.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.getImageData(0, 0, 10, 10); +imgdata.data[0] = 100; +_assertSame(imgdata.data[0], 100, "imgdata.data[\""+(0)+"\"]", "100"); +imgdata.data[0] = 200; +_assertSame(imgdata.data[0], 200, "imgdata.data[\""+(0)+"\"]", "200"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.object.string.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.object.string.js new file mode 100644 index 0000000..73b505a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.object.string.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.getImageData(0, 0, 10, 10); +imgdata.data[0] = 100; +imgdata.data[0] = "110"; +_assertSame(imgdata.data[0], 110, "imgdata.data[\""+(0)+"\"]", "110"); +imgdata.data[0] = 100; +imgdata.data[0] = "0x78"; +_assertSame(imgdata.data[0], 120, "imgdata.data[\""+(0)+"\"]", "120"); +imgdata.data[0] = 100; +imgdata.data[0] = " +130e0 "; +_assertSame(imgdata.data[0], 130, "imgdata.data[\""+(0)+"\"]", "130"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.object.undefined.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.object.undefined.js new file mode 100644 index 0000000..4b89fe5 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.object.undefined.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.getImageData(0, 0, 10, 10); +imgdata.data[0] = 100; +imgdata.data[0] = undefined; +_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.object.wrap.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.object.wrap.js new file mode 100644 index 0000000..937b359 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.object.wrap.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.getImageData(0, 0, 10, 10); + +imgdata.data[0] = 0; +_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); +imgdata.data[0] = 300; +_assertSame(imgdata.data[0], 44, "imgdata.data[\""+(0)+"\"]", "44"); +imgdata.data[0] = -100; +_assertSame(imgdata.data[0], 156, "imgdata.data[\""+(0)+"\"]", "156"); + +imgdata.data[0] = 200+Math.pow(2, 32); +_assertSame(imgdata.data[0], 200, "imgdata.data[\""+(0)+"\"]", "200"); +imgdata.data[0] = -200-Math.pow(2, 32); +_assertSame(imgdata.data[0], 56, "imgdata.data[\""+(0)+"\"]", "56"); + +imgdata.data[0] = -Infinity; +_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); +imgdata.data[0] = Infinity; +_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.alpha.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.alpha.js new file mode 100644 index 0000000..dfad33a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.alpha.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = 'rgba(0, 255, 0, 0.25)'; +ctx.fillRect(0, 0, 100, 50) +var imgdata = ctx.getImageData(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50) +ctx.putImageData(imgdata, 0, 0); +_assertPixelApprox(canvas, 50,25, 0,255,0,64, "50,25", "0,255,0,64", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.basic.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.basic.js new file mode 100644 index 0000000..ed3d93e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.basic.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50) +var imgdata = ctx.getImageData(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50) +ctx.putImageData(imgdata, 0, 0); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.clip.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.clip.js new file mode 100644 index 0000000..1075d24 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.clip.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50) +var imgdata = ctx.getImageData(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50) +ctx.beginPath(); +ctx.rect(0, 0, 50, 50); +ctx.clip(); +ctx.putImageData(imgdata, 0, 0); +_assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.created.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.created.js new file mode 100644 index 0000000..123f63a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.created.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.createImageData(100, 50); +for (var i = 0; i < imgdata.data.length; i += 4) { + imgdata.data[i] = 0; + imgdata.data[i+1] = 255; + imgdata.data[i+2] = 0; + imgdata.data[i+3] = 255; +} +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50) +ctx.putImageData(imgdata, 0, 0); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.cross.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.cross.js new file mode 100644 index 0000000..ae1c93e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.cross.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = '#0f0'; +ctx2.fillRect(0, 0, 100, 50) +var imgdata = ctx2.getImageData(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50) +ctx.putImageData(imgdata, 0, 0); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.dirty.negative.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.dirty.negative.js new file mode 100644 index 0000000..ab0d762 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.dirty.negative.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50) +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 20, 20) + +var imgdata = ctx.getImageData(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50) +ctx.fillStyle = '#f00'; +ctx.fillRect(40, 20, 20, 20) +ctx.putImageData(imgdata, 40, 20, 20, 20, -20, -20); + +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 35,25, 0,255,0,255, "35,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 65,25, 0,255,0,255, "65,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 50,15, 0,255,0,255, "50,15", "0,255,0,255", 2); +_assertPixelApprox(canvas, 50,45, 0,255,0,255, "50,45", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.dirty.outside.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.dirty.outside.js new file mode 100644 index 0000000..f2a6c98 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.dirty.outside.js @@ -0,0 +1,25 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50) + +var imgdata = ctx.getImageData(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50) + +ctx.putImageData(imgdata, 100, 20, 20, 20, -20, -20); +ctx.putImageData(imgdata, 200, 200, 0, 0, 100, 50); +ctx.putImageData(imgdata, 40, 20, -30, -20, 30, 20); +ctx.putImageData(imgdata, -30, 20, 0, 0, 30, 20); + +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 98,15, 0,255,0,255, "98,15", "0,255,0,255", 2); +_assertPixelApprox(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 98,45, 0,255,0,255, "98,45", "0,255,0,255", 2); +_assertPixelApprox(canvas, 1,5, 0,255,0,255, "1,5", "0,255,0,255", 2); +_assertPixelApprox(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 1,45, 0,255,0,255, "1,45", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.dirty.rect1.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.dirty.rect1.js new file mode 100644 index 0000000..ed4bb37 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.dirty.rect1.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50) +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 20, 20) + +var imgdata = ctx.getImageData(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50) +ctx.fillStyle = '#f00'; +ctx.fillRect(40, 20, 20, 20) +ctx.putImageData(imgdata, 40, 20, 0, 0, 20, 20); + +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 35,25, 0,255,0,255, "35,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 65,25, 0,255,0,255, "65,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 50,15, 0,255,0,255, "50,15", "0,255,0,255", 2); +_assertPixelApprox(canvas, 50,45, 0,255,0,255, "50,45", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.dirty.rect2.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.dirty.rect2.js new file mode 100644 index 0000000..c36924f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.dirty.rect2.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50) +ctx.fillStyle = '#0f0'; +ctx.fillRect(60, 30, 20, 20) + +var imgdata = ctx.getImageData(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50) +ctx.fillStyle = '#f00'; +ctx.fillRect(40, 20, 20, 20) +ctx.putImageData(imgdata, -20, -10, 60, 30, 20, 20); + +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 35,25, 0,255,0,255, "35,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 65,25, 0,255,0,255, "65,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 50,15, 0,255,0,255, "50,15", "0,255,0,255", 2); +_assertPixelApprox(canvas, 50,45, 0,255,0,255, "50,45", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.dirty.zero.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.dirty.zero.js new file mode 100644 index 0000000..a023cfb --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.dirty.zero.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50) +var imgdata = ctx.getImageData(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50) +ctx.putImageData(imgdata, 0, 0, 0, 0, 0, 0); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.modified.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.modified.js new file mode 100644 index 0000000..768867e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.modified.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50) +ctx.fillStyle = '#f00'; +ctx.fillRect(45, 20, 10, 10) +var imgdata = ctx.getImageData(45, 20, 10, 10); +for (var i = 0, len = imgdata.width*imgdata.height*4; i < len; i += 4) +{ + imgdata.data[i] = 0; + imgdata.data[i+1] = 255; +} +ctx.putImageData(imgdata, 45, 20); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.nonfinite.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.nonfinite.js new file mode 100644 index 0000000..773f349 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.nonfinite.js @@ -0,0 +1,252 @@ +_addTest(function(canvas, ctx) { + +var imgdata = ctx.getImageData(0, 0, 10, 10); +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, -Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, -Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, NaN, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, NaN, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, -Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, -Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, NaN); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, NaN)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, 10, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, 10, 10, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, -Infinity, 10, 10, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, -Infinity, 10, 10, 10, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, NaN, 10, 10, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, NaN, 10, 10, 10, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, 10, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, 10, 10, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, -Infinity, 10, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, -Infinity, 10, 10, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, NaN, 10, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, NaN, 10, 10, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, Infinity, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, 10, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, -Infinity, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, -Infinity, 10, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, NaN, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, NaN, 10, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, 10, Infinity, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, Infinity, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, 10, -Infinity, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, -Infinity, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, 10, NaN, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, NaN, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, 10, 10, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, 10, 10, -Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, -Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, 10, 10, NaN, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, NaN, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, 10, 10, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, 10, 10, 10, -Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, 10, -Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, 10, 10, 10, NaN); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, 10, NaN)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, 10, 10, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, 10, 10, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, 10, 10, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, 10, 10, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, Infinity, 10, 10, 10, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, 10, 10, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, 10, 10, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, 10, 10, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, 10, 10, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, 10, 10, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, Infinity, 10, 10, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, 10, 10, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, 10, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, 10, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, Infinity, 10, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, 10, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, Infinity, 10, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, 10, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, Infinity, 10, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, 10, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, 10, Infinity, Infinity, 10); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, Infinity, Infinity, 10)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, 10, Infinity, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, Infinity, Infinity, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, 10, Infinity, 10, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, Infinity, 10, Infinity)"); } +try { var _thrown = false; + ctx.putImageData(imgdata, 10, 10, 10, 10, Infinity, Infinity); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, Infinity, Infinity)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.null.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.null.js new file mode 100644 index 0000000..d4a46d0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.null.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.putImageData(null, 0, 0); +} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail("Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TYPE_MISMATCH_ERR: ctx.putImageData(null, 0, 0)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.path.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.path.js new file mode 100644 index 0000000..9b059de --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.path.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50) +ctx.rect(0, 0, 100, 50); +var imgdata = ctx.getImageData(0, 0, 100, 50); +ctx.putImageData(imgdata, 0, 0); +ctx.fillStyle = '#0f0'; +ctx.fill(); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.unaffected.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.unaffected.js new file mode 100644 index 0000000..1118844 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.unaffected.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50) +var imgdata = ctx.getImageData(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50) +ctx.globalAlpha = 0.1; +ctx.globalCompositeOperation = 'destination-atop'; +ctx.shadowColor = '#f00'; +ctx.shadowBlur = 1; +ctx.translate(100, 50); +ctx.scale(0.1, 0.1); +ctx.putImageData(imgdata, 0, 0); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.unchanged.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.unchanged.js new file mode 100644 index 0000000..5cbc72e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.unchanged.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +var i = 0; +for (var y = 0; y < 16; ++y) { + for (var x = 0; x < 16; ++x, ++i) { + ctx.fillStyle = 'rgba(' + i + ',' + (Math.floor(i*1.5) % 256) + ',' + (Math.floor(i*23.3) % 256) + ',' + (i/256) + ')'; + ctx.fillRect(x, y, 1, 1); + } +} +var imgdata1 = ctx.getImageData(0.1, 0.2, 15.8, 15.9); +var olddata = []; +for (var i = 0; i < imgdata1.data.length; ++i) + olddata[i] = imgdata1.data[i]; + +ctx.putImageData(imgdata1, 0.1, 0.2); + +var imgdata2 = ctx.getImageData(0.1, 0.2, 15.8, 15.9); +for (var i = 0; i < imgdata2.data.length; ++i) { + _assertSame(olddata[i], imgdata2.data[i], "olddata[\""+(i)+"\"]", "imgdata2.data[\""+(i)+"\"]"); +} + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.wrongtype.js b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.wrongtype.js new file mode 100644 index 0000000..4b84fff --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.imageData.put.wrongtype.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +var imgdata = { width: 1, height: 1, data: [255, 0, 0, 255] }; +try { var _thrown = false; + ctx.putImageData(imgdata, 0, 0); +} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail("Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TYPE_MISMATCH_ERR: ctx.putImageData(imgdata, 0, 0)"); } +try { var _thrown = false; + ctx.putImageData("cheese", 0, 0); +} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail("Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TYPE_MISMATCH_ERR: ctx.putImageData(\"cheese\", 0, 0)"); } +try { var _thrown = false; + ctx.putImageData(42, 0, 0); +} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail("Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TYPE_MISMATCH_ERR: ctx.putImageData(42, 0, 0)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.line.cap.butt.js b/platforms/ios/www/test/tests-todo/minimal.2d.line.cap.butt.js new file mode 100644 index 0000000..616ad1d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.line.cap.butt.js @@ -0,0 +1,40 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineCap = 'butt'; +ctx.lineWidth = 20; + +ctx.fillStyle = '#f00'; +ctx.strokeStyle = '#0f0'; +ctx.fillRect(15, 15, 20, 20); +ctx.beginPath(); +ctx.moveTo(25, 15); +ctx.lineTo(25, 35); +ctx.stroke(); + +ctx.fillStyle = '#0f0'; +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(75, 15); +ctx.lineTo(75, 35); +ctx.stroke(); +ctx.fillRect(65, 15, 20, 20); + +_assertPixel(canvas, 25,14, 0,255,0,255, "25,14", "0,255,0,255"); +_assertPixel(canvas, 25,15, 0,255,0,255, "25,15", "0,255,0,255"); +_assertPixel(canvas, 25,16, 0,255,0,255, "25,16", "0,255,0,255"); +_assertPixel(canvas, 25,34, 0,255,0,255, "25,34", "0,255,0,255"); +_assertPixel(canvas, 25,35, 0,255,0,255, "25,35", "0,255,0,255"); +_assertPixel(canvas, 25,36, 0,255,0,255, "25,36", "0,255,0,255"); + +_assertPixel(canvas, 75,14, 0,255,0,255, "75,14", "0,255,0,255"); +_assertPixel(canvas, 75,15, 0,255,0,255, "75,15", "0,255,0,255"); +_assertPixel(canvas, 75,16, 0,255,0,255, "75,16", "0,255,0,255"); +_assertPixel(canvas, 75,34, 0,255,0,255, "75,34", "0,255,0,255"); +_assertPixel(canvas, 75,35, 0,255,0,255, "75,35", "0,255,0,255"); +_assertPixel(canvas, 75,36, 0,255,0,255, "75,36", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.line.cap.closed.js b/platforms/ios/www/test/tests-todo/minimal.2d.line.cap.closed.js new file mode 100644 index 0000000..41f4747 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.line.cap.closed.js @@ -0,0 +1,25 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.strokeStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineJoin = 'bevel'; +ctx.lineCap = 'square'; +ctx.lineWidth = 400; + +ctx.beginPath(); +ctx.moveTo(200, 200); +ctx.lineTo(200, 1000); +ctx.lineTo(1000, 1000); +ctx.lineTo(1000, 200); +ctx.closePath(); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.line.cap.invalid.js b/platforms/ios/www/test/tests-todo/minimal.2d.line.cap.invalid.js new file mode 100644 index 0000000..488567d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.line.cap.invalid.js @@ -0,0 +1,31 @@ +_addTest(function(canvas, ctx) { + +ctx.lineCap = 'butt' +_assertSame(ctx.lineCap, 'butt', "ctx.lineCap", "'butt'"); + +ctx.lineCap = 'butt'; +ctx.lineCap = 'invalid'; +_assertSame(ctx.lineCap, 'butt', "ctx.lineCap", "'butt'"); + +ctx.lineCap = 'butt'; +ctx.lineCap = 'ROUND'; +_assertSame(ctx.lineCap, 'butt', "ctx.lineCap", "'butt'"); + +ctx.lineCap = 'butt'; +ctx.lineCap = 'round\0'; +_assertSame(ctx.lineCap, 'butt', "ctx.lineCap", "'butt'"); + +ctx.lineCap = 'butt'; +ctx.lineCap = 'round '; +_assertSame(ctx.lineCap, 'butt', "ctx.lineCap", "'butt'"); + +ctx.lineCap = 'butt'; +ctx.lineCap = ""; +_assertSame(ctx.lineCap, 'butt', "ctx.lineCap", "'butt'"); + +ctx.lineCap = 'butt'; +ctx.lineCap = 'bevel'; +_assertSame(ctx.lineCap, 'butt', "ctx.lineCap", "'butt'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.line.cap.open.js b/platforms/ios/www/test/tests-todo/minimal.2d.line.cap.open.js new file mode 100644 index 0000000..fd2bf62 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.line.cap.open.js @@ -0,0 +1,25 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.strokeStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineJoin = 'bevel'; +ctx.lineCap = 'square'; +ctx.lineWidth = 400; + +ctx.beginPath(); +ctx.moveTo(200, 200); +ctx.lineTo(200, 1000); +ctx.lineTo(1000, 1000); +ctx.lineTo(1000, 200); +ctx.lineTo(200, 200); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.line.cap.round.js b/platforms/ios/www/test/tests-todo/minimal.2d.line.cap.round.js new file mode 100644 index 0000000..5e1c7de --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.line.cap.round.js @@ -0,0 +1,56 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var tol = 1; // tolerance to avoid antialiasing artifacts + +ctx.lineCap = 'round'; +ctx.lineWidth = 20; + + +ctx.fillStyle = '#f00'; +ctx.strokeStyle = '#0f0'; + +ctx.beginPath(); +ctx.moveTo(35-tol, 15); +ctx.arc(25, 15, 10-tol, 0, Math.PI, true); +ctx.arc(25, 35, 10-tol, Math.PI, 0, true); +ctx.fill(); + +ctx.beginPath(); +ctx.moveTo(25, 15); +ctx.lineTo(25, 35); +ctx.stroke(); + + +ctx.fillStyle = '#0f0'; +ctx.strokeStyle = '#f00'; + +ctx.beginPath(); +ctx.moveTo(75, 15); +ctx.lineTo(75, 35); +ctx.stroke(); + +ctx.beginPath(); +ctx.moveTo(85+tol, 15); +ctx.arc(75, 15, 10+tol, 0, Math.PI, true); +ctx.arc(75, 35, 10+tol, Math.PI, 0, true); +ctx.fill(); + +_assertPixel(canvas, 17,6, 0,255,0,255, "17,6", "0,255,0,255"); +_assertPixel(canvas, 25,6, 0,255,0,255, "25,6", "0,255,0,255"); +_assertPixel(canvas, 32,6, 0,255,0,255, "32,6", "0,255,0,255"); +_assertPixel(canvas, 17,43, 0,255,0,255, "17,43", "0,255,0,255"); +_assertPixel(canvas, 25,43, 0,255,0,255, "25,43", "0,255,0,255"); +_assertPixel(canvas, 32,43, 0,255,0,255, "32,43", "0,255,0,255"); + +_assertPixel(canvas, 67,6, 0,255,0,255, "67,6", "0,255,0,255"); +_assertPixel(canvas, 75,6, 0,255,0,255, "75,6", "0,255,0,255"); +_assertPixel(canvas, 82,6, 0,255,0,255, "82,6", "0,255,0,255"); +_assertPixel(canvas, 67,43, 0,255,0,255, "67,43", "0,255,0,255"); +_assertPixel(canvas, 75,43, 0,255,0,255, "75,43", "0,255,0,255"); +_assertPixel(canvas, 82,43, 0,255,0,255, "82,43", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.line.cap.square.js b/platforms/ios/www/test/tests-todo/minimal.2d.line.cap.square.js new file mode 100644 index 0000000..992dc5c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.line.cap.square.js @@ -0,0 +1,40 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineCap = 'square'; +ctx.lineWidth = 20; + +ctx.fillStyle = '#f00'; +ctx.strokeStyle = '#0f0'; +ctx.fillRect(15, 5, 20, 40); +ctx.beginPath(); +ctx.moveTo(25, 15); +ctx.lineTo(25, 35); +ctx.stroke(); + +ctx.fillStyle = '#0f0'; +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(75, 15); +ctx.lineTo(75, 35); +ctx.stroke(); +ctx.fillRect(65, 5, 20, 40); + +_assertPixel(canvas, 25,4, 0,255,0,255, "25,4", "0,255,0,255"); +_assertPixel(canvas, 25,5, 0,255,0,255, "25,5", "0,255,0,255"); +_assertPixel(canvas, 25,6, 0,255,0,255, "25,6", "0,255,0,255"); +_assertPixel(canvas, 25,44, 0,255,0,255, "25,44", "0,255,0,255"); +_assertPixel(canvas, 25,45, 0,255,0,255, "25,45", "0,255,0,255"); +_assertPixel(canvas, 25,46, 0,255,0,255, "25,46", "0,255,0,255"); + +_assertPixel(canvas, 75,4, 0,255,0,255, "75,4", "0,255,0,255"); +_assertPixel(canvas, 75,5, 0,255,0,255, "75,5", "0,255,0,255"); +_assertPixel(canvas, 75,6, 0,255,0,255, "75,6", "0,255,0,255"); +_assertPixel(canvas, 75,44, 0,255,0,255, "75,44", "0,255,0,255"); +_assertPixel(canvas, 75,45, 0,255,0,255, "75,45", "0,255,0,255"); +_assertPixel(canvas, 75,46, 0,255,0,255, "75,46", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.line.cap.valid.js b/platforms/ios/www/test/tests-todo/minimal.2d.line.cap.valid.js new file mode 100644 index 0000000..25a5256 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.line.cap.valid.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.lineCap = 'butt' +_assertSame(ctx.lineCap, 'butt', "ctx.lineCap", "'butt'"); + +ctx.lineCap = 'round'; +_assertSame(ctx.lineCap, 'round', "ctx.lineCap", "'round'"); + +ctx.lineCap = 'square'; +_assertSame(ctx.lineCap, 'square', "ctx.lineCap", "'square'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.line.cross.js b/platforms/ios/www/test/tests-todo/minimal.2d.line.cross.js new file mode 100644 index 0000000..baaaa6a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.line.cross.js @@ -0,0 +1,22 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineWidth = 200; +ctx.lineJoin = 'bevel'; + +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(110, 50); +ctx.lineTo(110, 60); +ctx.lineTo(100, 60); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.line.defaults.js b/platforms/ios/www/test/tests-todo/minimal.2d.line.defaults.js new file mode 100644 index 0000000..3705322 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.line.defaults.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +_assertSame(ctx.lineWidth, 1, "ctx.lineWidth", "1"); +_assertSame(ctx.lineCap, 'butt', "ctx.lineCap", "'butt'"); +_assertSame(ctx.lineJoin, 'miter', "ctx.lineJoin", "'miter'"); +_assertSame(ctx.miterLimit, 10, "ctx.miterLimit", "10"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.line.join.bevel.js b/platforms/ios/www/test/tests-todo/minimal.2d.line.join.bevel.js new file mode 100644 index 0000000..5fc241d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.line.join.bevel.js @@ -0,0 +1,59 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var tol = 1; // tolerance to avoid antialiasing artifacts + +ctx.lineJoin = 'bevel'; +ctx.lineWidth = 20; + +ctx.fillStyle = '#f00'; +ctx.strokeStyle = '#0f0'; + +ctx.fillRect(10, 10, 20, 20); +ctx.fillRect(20, 20, 20, 20); +ctx.beginPath(); +ctx.moveTo(30, 20); +ctx.lineTo(40-tol, 20); +ctx.lineTo(30, 10+tol); +ctx.fill(); + +ctx.beginPath(); +ctx.moveTo(10, 20); +ctx.lineTo(30, 20); +ctx.lineTo(30, 40); +ctx.stroke(); + + +ctx.fillStyle = '#0f0'; +ctx.strokeStyle = '#f00'; + +ctx.beginPath(); +ctx.moveTo(60, 20); +ctx.lineTo(80, 20); +ctx.lineTo(80, 40); +ctx.stroke(); + +ctx.fillRect(60, 10, 20, 20); +ctx.fillRect(70, 20, 20, 20); +ctx.beginPath(); +ctx.moveTo(80, 20); +ctx.lineTo(90+tol, 20); +ctx.lineTo(80, 10-tol); +ctx.fill(); + +_assertPixel(canvas, 34,16, 0,255,0,255, "34,16", "0,255,0,255"); +_assertPixel(canvas, 34,15, 0,255,0,255, "34,15", "0,255,0,255"); +_assertPixel(canvas, 35,15, 0,255,0,255, "35,15", "0,255,0,255"); +_assertPixel(canvas, 36,15, 0,255,0,255, "36,15", "0,255,0,255"); +_assertPixel(canvas, 36,14, 0,255,0,255, "36,14", "0,255,0,255"); + +_assertPixel(canvas, 84,16, 0,255,0,255, "84,16", "0,255,0,255"); +_assertPixel(canvas, 84,15, 0,255,0,255, "84,15", "0,255,0,255"); +_assertPixel(canvas, 85,15, 0,255,0,255, "85,15", "0,255,0,255"); +_assertPixel(canvas, 86,15, 0,255,0,255, "86,15", "0,255,0,255"); +_assertPixel(canvas, 86,14, 0,255,0,255, "86,14", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.line.join.closed.js b/platforms/ios/www/test/tests-todo/minimal.2d.line.join.closed.js new file mode 100644 index 0000000..f835bf9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.line.join.closed.js @@ -0,0 +1,24 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.strokeStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineJoin = 'miter'; +ctx.lineWidth = 200; + +ctx.beginPath(); +ctx.moveTo(100, 50); +ctx.lineTo(100, 1000); +ctx.lineTo(1000, 1000); +ctx.lineTo(1000, 50); +ctx.closePath(); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.line.join.invalid.js b/platforms/ios/www/test/tests-todo/minimal.2d.line.join.invalid.js new file mode 100644 index 0000000..c60bec8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.line.join.invalid.js @@ -0,0 +1,31 @@ +_addTest(function(canvas, ctx) { + +ctx.lineJoin = 'bevel' +_assertSame(ctx.lineJoin, 'bevel', "ctx.lineJoin", "'bevel'"); + +ctx.lineJoin = 'bevel'; +ctx.lineJoin = 'invalid'; +_assertSame(ctx.lineJoin, 'bevel', "ctx.lineJoin", "'bevel'"); + +ctx.lineJoin = 'bevel'; +ctx.lineJoin = 'ROUND'; +_assertSame(ctx.lineJoin, 'bevel', "ctx.lineJoin", "'bevel'"); + +ctx.lineJoin = 'bevel'; +ctx.lineJoin = 'round\0'; +_assertSame(ctx.lineJoin, 'bevel', "ctx.lineJoin", "'bevel'"); + +ctx.lineJoin = 'bevel'; +ctx.lineJoin = 'round '; +_assertSame(ctx.lineJoin, 'bevel', "ctx.lineJoin", "'bevel'"); + +ctx.lineJoin = 'bevel'; +ctx.lineJoin = ""; +_assertSame(ctx.lineJoin, 'bevel', "ctx.lineJoin", "'bevel'"); + +ctx.lineJoin = 'bevel'; +ctx.lineJoin = 'butt'; +_assertSame(ctx.lineJoin, 'bevel', "ctx.lineJoin", "'bevel'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.line.join.miter.js b/platforms/ios/www/test/tests-todo/minimal.2d.line.join.miter.js new file mode 100644 index 0000000..bbcb340 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.line.join.miter.js @@ -0,0 +1,50 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineJoin = 'miter'; +ctx.lineWidth = 20; + +ctx.fillStyle = '#f00'; +ctx.strokeStyle = '#0f0'; + +ctx.fillStyle = '#f00'; +ctx.strokeStyle = '#0f0'; + +ctx.fillRect(10, 10, 30, 20); +ctx.fillRect(20, 10, 20, 30); + +ctx.beginPath(); +ctx.moveTo(10, 20); +ctx.lineTo(30, 20); +ctx.lineTo(30, 40); +ctx.stroke(); + + +ctx.fillStyle = '#0f0'; +ctx.strokeStyle = '#f00'; + +ctx.beginPath(); +ctx.moveTo(60, 20); +ctx.lineTo(80, 20); +ctx.lineTo(80, 40); +ctx.stroke(); + +ctx.fillRect(60, 10, 30, 20); +ctx.fillRect(70, 10, 20, 30); + +_assertPixel(canvas, 38,12, 0,255,0,255, "38,12", "0,255,0,255"); +_assertPixel(canvas, 39,11, 0,255,0,255, "39,11", "0,255,0,255"); +_assertPixel(canvas, 40,10, 0,255,0,255, "40,10", "0,255,0,255"); +_assertPixel(canvas, 41,9, 0,255,0,255, "41,9", "0,255,0,255"); +_assertPixel(canvas, 42,8, 0,255,0,255, "42,8", "0,255,0,255"); + +_assertPixel(canvas, 88,12, 0,255,0,255, "88,12", "0,255,0,255"); +_assertPixel(canvas, 89,11, 0,255,0,255, "89,11", "0,255,0,255"); +_assertPixel(canvas, 90,10, 0,255,0,255, "90,10", "0,255,0,255"); +_assertPixel(canvas, 91,9, 0,255,0,255, "91,9", "0,255,0,255"); +_assertPixel(canvas, 92,8, 0,255,0,255, "92,8", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.line.join.open.js b/platforms/ios/www/test/tests-todo/minimal.2d.line.join.open.js new file mode 100644 index 0000000..837c8c2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.line.join.open.js @@ -0,0 +1,24 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.strokeStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineJoin = 'miter'; +ctx.lineWidth = 200; + +ctx.beginPath(); +ctx.moveTo(100, 50); +ctx.lineTo(100, 1000); +ctx.lineTo(1000, 1000); +ctx.lineTo(1000, 50); +ctx.lineTo(100, 50); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.line.join.parallel.js b/platforms/ios/www/test/tests-todo/minimal.2d.line.join.parallel.js new file mode 100644 index 0000000..c041ecb --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.line.join.parallel.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 300; +ctx.lineJoin = 'round'; +ctx.beginPath(); +ctx.moveTo(-100, 25); +ctx.lineTo(0, 25); +ctx.lineTo(-100, 25); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.line.join.round.js b/platforms/ios/www/test/tests-todo/minimal.2d.line.join.round.js new file mode 100644 index 0000000..96ce608 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.line.join.round.js @@ -0,0 +1,57 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var tol = 1; // tolerance to avoid antialiasing artifacts + +ctx.lineJoin = 'round'; +ctx.lineWidth = 20; + +ctx.fillStyle = '#f00'; +ctx.strokeStyle = '#0f0'; + +ctx.fillRect(10, 10, 20, 20); +ctx.fillRect(20, 20, 20, 20); +ctx.beginPath(); +ctx.moveTo(30, 20); +ctx.arc(30, 20, 10-tol, 0, 2*Math.PI, true); +ctx.fill(); + +ctx.beginPath(); +ctx.moveTo(10, 20); +ctx.lineTo(30, 20); +ctx.lineTo(30, 40); +ctx.stroke(); + + +ctx.fillStyle = '#0f0'; +ctx.strokeStyle = '#f00'; + +ctx.beginPath(); +ctx.moveTo(60, 20); +ctx.lineTo(80, 20); +ctx.lineTo(80, 40); +ctx.stroke(); + +ctx.fillRect(60, 10, 20, 20); +ctx.fillRect(70, 20, 20, 20); +ctx.beginPath(); +ctx.moveTo(80, 20); +ctx.arc(80, 20, 10+tol, 0, 2*Math.PI, true); +ctx.fill(); + +_assertPixel(canvas, 36,14, 0,255,0,255, "36,14", "0,255,0,255"); +_assertPixel(canvas, 36,13, 0,255,0,255, "36,13", "0,255,0,255"); +_assertPixel(canvas, 37,13, 0,255,0,255, "37,13", "0,255,0,255"); +_assertPixel(canvas, 38,13, 0,255,0,255, "38,13", "0,255,0,255"); +_assertPixel(canvas, 38,12, 0,255,0,255, "38,12", "0,255,0,255"); + +_assertPixel(canvas, 86,14, 0,255,0,255, "86,14", "0,255,0,255"); +_assertPixel(canvas, 86,13, 0,255,0,255, "86,13", "0,255,0,255"); +_assertPixel(canvas, 87,13, 0,255,0,255, "87,13", "0,255,0,255"); +_assertPixel(canvas, 88,13, 0,255,0,255, "88,13", "0,255,0,255"); +_assertPixel(canvas, 88,12, 0,255,0,255, "88,12", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.line.join.valid.js b/platforms/ios/www/test/tests-todo/minimal.2d.line.join.valid.js new file mode 100644 index 0000000..2097661 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.line.join.valid.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.lineJoin = 'bevel' +_assertSame(ctx.lineJoin, 'bevel', "ctx.lineJoin", "'bevel'"); + +ctx.lineJoin = 'round'; +_assertSame(ctx.lineJoin, 'round', "ctx.lineJoin", "'round'"); + +ctx.lineJoin = 'miter'; +_assertSame(ctx.lineJoin, 'miter', "ctx.lineJoin", "'miter'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.line.miter.acute.js b/platforms/ios/www/test/tests-todo/minimal.2d.line.miter.acute.js new file mode 100644 index 0000000..e742f87 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.line.miter.acute.js @@ -0,0 +1,31 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineWidth = 200; +ctx.lineJoin = 'miter'; + +ctx.strokeStyle = '#0f0'; +ctx.miterLimit = 2.614; +ctx.beginPath(); +ctx.moveTo(100, 1000); +ctx.lineTo(100, 100); +ctx.lineTo(1000, 1000); +ctx.stroke(); + +ctx.strokeStyle = '#f00'; +ctx.miterLimit = 2.613; +ctx.beginPath(); +ctx.moveTo(100, 1000); +ctx.lineTo(100, 100); +ctx.lineTo(1000, 1000); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.line.miter.exceeded.js b/platforms/ios/www/test/tests-todo/minimal.2d.line.miter.exceeded.js new file mode 100644 index 0000000..c86ce52 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.line.miter.exceeded.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineWidth = 400; +ctx.lineJoin = 'miter'; + +ctx.strokeStyle = '#f00'; +ctx.miterLimit = 1.414; +ctx.beginPath(); +ctx.moveTo(200, 1000); +ctx.lineTo(200, 200); +ctx.lineTo(1000, 201); // slightly non-right-angle to avoid being a special case +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.line.miter.invalid.js b/platforms/ios/www/test/tests-todo/minimal.2d.line.miter.invalid.js new file mode 100644 index 0000000..e9982e0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.line.miter.invalid.js @@ -0,0 +1,27 @@ +_addTest(function(canvas, ctx) { + +ctx.miterLimit = 1.5; +_assertSame(ctx.miterLimit, 1.5, "ctx.miterLimit", "1.5"); + +ctx.miterLimit = 1.5; +ctx.miterLimit = 0; +_assertSame(ctx.miterLimit, 1.5, "ctx.miterLimit", "1.5"); + +ctx.miterLimit = 1.5; +ctx.miterLimit = -1; +_assertSame(ctx.miterLimit, 1.5, "ctx.miterLimit", "1.5"); + +ctx.miterLimit = 1.5; +ctx.miterLimit = Infinity; +_assertSame(ctx.miterLimit, 1.5, "ctx.miterLimit", "1.5"); + +ctx.miterLimit = 1.5; +ctx.miterLimit = -Infinity; +_assertSame(ctx.miterLimit, 1.5, "ctx.miterLimit", "1.5"); + +ctx.miterLimit = 1.5; +ctx.miterLimit = NaN; +_assertSame(ctx.miterLimit, 1.5, "ctx.miterLimit", "1.5"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.line.miter.lineedge.js b/platforms/ios/www/test/tests-todo/minimal.2d.line.miter.lineedge.js new file mode 100644 index 0000000..ef5f616 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.line.miter.lineedge.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineWidth = 200; +ctx.lineJoin = 'miter'; + +ctx.strokeStyle = '#f00'; +ctx.miterLimit = 1.414; +ctx.beginPath(); +ctx.strokeRect(100, 25, 200, 0); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.line.miter.obtuse.js b/platforms/ios/www/test/tests-todo/minimal.2d.line.miter.obtuse.js new file mode 100644 index 0000000..46e4a6b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.line.miter.obtuse.js @@ -0,0 +1,31 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineWidth = 1600; +ctx.lineJoin = 'miter'; + +ctx.strokeStyle = '#0f0'; +ctx.miterLimit = 1.083; +ctx.beginPath(); +ctx.moveTo(800, 10000); +ctx.lineTo(800, 300); +ctx.lineTo(10000, -8900); +ctx.stroke(); + +ctx.strokeStyle = '#f00'; +ctx.miterLimit = 1.082; +ctx.beginPath(); +ctx.moveTo(800, 10000); +ctx.lineTo(800, 300); +ctx.lineTo(10000, -8900); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.line.miter.rightangle.js b/platforms/ios/www/test/tests-todo/minimal.2d.line.miter.rightangle.js new file mode 100644 index 0000000..150bffb --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.line.miter.rightangle.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineWidth = 400; +ctx.lineJoin = 'miter'; + +ctx.strokeStyle = '#f00'; +ctx.miterLimit = 1.414; +ctx.beginPath(); +ctx.moveTo(200, 1000); +ctx.lineTo(200, 200); +ctx.lineTo(1000, 200); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.line.miter.valid.js b/platforms/ios/www/test/tests-todo/minimal.2d.line.miter.valid.js new file mode 100644 index 0000000..26a88b3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.line.miter.valid.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.miterLimit = 1.5; +_assertSame(ctx.miterLimit, 1.5, "ctx.miterLimit", "1.5"); + +ctx.miterLimit = "1e1"; +_assertSame(ctx.miterLimit, 10, "ctx.miterLimit", "10"); + +ctx.miterLimit = 1/1024; +_assertSame(ctx.miterLimit, 1/1024, "ctx.miterLimit", "1/1024"); + +ctx.miterLimit = 1000; +_assertSame(ctx.miterLimit, 1000, "ctx.miterLimit", "1000"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.line.miter.within.js b/platforms/ios/www/test/tests-todo/minimal.2d.line.miter.within.js new file mode 100644 index 0000000..09b3eb9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.line.miter.within.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineWidth = 400; +ctx.lineJoin = 'miter'; + +ctx.strokeStyle = '#0f0'; +ctx.miterLimit = 1.416; +ctx.beginPath(); +ctx.moveTo(200, 1000); +ctx.lineTo(200, 200); +ctx.lineTo(1000, 201); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.line.union.js b/platforms/ios/www/test/tests-todo/minimal.2d.line.union.js new file mode 100644 index 0000000..d2950b0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.line.union.js @@ -0,0 +1,25 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineWidth = 100; +ctx.lineCap = 'round'; + +ctx.strokeStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(0, 24); +ctx.lineTo(100, 25); +ctx.lineTo(0, 26); +ctx.closePath(); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 25,1, 0,255,0,255, "25,1", "0,255,0,255"); +_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 25,1, 0,255,0,255, "25,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.line.width.basic.js b/platforms/ios/www/test/tests-todo/minimal.2d.line.width.basic.js new file mode 100644 index 0000000..a6d46ea --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.line.width.basic.js @@ -0,0 +1,42 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineWidth = 20; +// Draw a green line over a red box, to check the line is not too small +ctx.fillStyle = '#f00'; +ctx.strokeStyle = '#0f0'; +ctx.fillRect(15, 15, 20, 20); +ctx.beginPath(); +ctx.moveTo(25, 15); +ctx.lineTo(25, 35); +ctx.stroke(); + +// Draw a green box over a red line, to check the line is not too large +ctx.fillStyle = '#0f0'; +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(75, 15); +ctx.lineTo(75, 35); +ctx.stroke(); +ctx.fillRect(65, 15, 20, 20); + +_assertPixel(canvas, 14,25, 0,255,0,255, "14,25", "0,255,0,255"); +_assertPixel(canvas, 15,25, 0,255,0,255, "15,25", "0,255,0,255"); +_assertPixel(canvas, 16,25, 0,255,0,255, "16,25", "0,255,0,255"); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 34,25, 0,255,0,255, "34,25", "0,255,0,255"); +_assertPixel(canvas, 35,25, 0,255,0,255, "35,25", "0,255,0,255"); +_assertPixel(canvas, 36,25, 0,255,0,255, "36,25", "0,255,0,255"); + +_assertPixel(canvas, 64,25, 0,255,0,255, "64,25", "0,255,0,255"); +_assertPixel(canvas, 65,25, 0,255,0,255, "65,25", "0,255,0,255"); +_assertPixel(canvas, 66,25, 0,255,0,255, "66,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); +_assertPixel(canvas, 84,25, 0,255,0,255, "84,25", "0,255,0,255"); +_assertPixel(canvas, 85,25, 0,255,0,255, "85,25", "0,255,0,255"); +_assertPixel(canvas, 86,25, 0,255,0,255, "86,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.line.width.invalid.js b/platforms/ios/www/test/tests-todo/minimal.2d.line.width.invalid.js new file mode 100644 index 0000000..f48f0d3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.line.width.invalid.js @@ -0,0 +1,27 @@ +_addTest(function(canvas, ctx) { + +ctx.lineWidth = 1.5; +_assertSame(ctx.lineWidth, 1.5, "ctx.lineWidth", "1.5"); + +ctx.lineWidth = 1.5; +ctx.lineWidth = 0; +_assertSame(ctx.lineWidth, 1.5, "ctx.lineWidth", "1.5"); + +ctx.lineWidth = 1.5; +ctx.lineWidth = -1; +_assertSame(ctx.lineWidth, 1.5, "ctx.lineWidth", "1.5"); + +ctx.lineWidth = 1.5; +ctx.lineWidth = Infinity; +_assertSame(ctx.lineWidth, 1.5, "ctx.lineWidth", "1.5"); + +ctx.lineWidth = 1.5; +ctx.lineWidth = -Infinity; +_assertSame(ctx.lineWidth, 1.5, "ctx.lineWidth", "1.5"); + +ctx.lineWidth = 1.5; +ctx.lineWidth = NaN; +_assertSame(ctx.lineWidth, 1.5, "ctx.lineWidth", "1.5"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.line.width.scaledefault.js b/platforms/ios/www/test/tests-todo/minimal.2d.line.width.scaledefault.js new file mode 100644 index 0000000..e52773c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.line.width.scaledefault.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.scale(50, 50); +ctx.strokeStyle = '#0f0'; +ctx.moveTo(0, 0.5); +ctx.lineTo(2, 0.5); +ctx.stroke(); + +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); +_assertPixel(canvas, 50,5, 0,255,0,255, "50,5", "0,255,0,255"); +_assertPixel(canvas, 50,45, 0,255,0,255, "50,45", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.line.width.transformed.js b/platforms/ios/www/test/tests-todo/minimal.2d.line.width.transformed.js new file mode 100644 index 0000000..981e884 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.line.width.transformed.js @@ -0,0 +1,48 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineWidth = 4; +// Draw a green line over a red box, to check the line is not too small +ctx.fillStyle = '#f00'; +ctx.strokeStyle = '#0f0'; +ctx.fillRect(15, 15, 20, 20); +ctx.save(); + ctx.scale(5, 1); + ctx.beginPath(); + ctx.moveTo(5, 15); + ctx.lineTo(5, 35); + ctx.stroke(); +ctx.restore(); + +// Draw a green box over a red line, to check the line is not too large +ctx.fillStyle = '#0f0'; +ctx.strokeStyle = '#f00'; +ctx.save(); + ctx.scale(-5, 1); + ctx.beginPath(); + ctx.moveTo(-15, 15); + ctx.lineTo(-15, 35); + ctx.stroke(); +ctx.restore(); +ctx.fillRect(65, 15, 20, 20); + +_assertPixel(canvas, 14,25, 0,255,0,255, "14,25", "0,255,0,255"); +_assertPixel(canvas, 15,25, 0,255,0,255, "15,25", "0,255,0,255"); +_assertPixel(canvas, 16,25, 0,255,0,255, "16,25", "0,255,0,255"); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 34,25, 0,255,0,255, "34,25", "0,255,0,255"); +_assertPixel(canvas, 35,25, 0,255,0,255, "35,25", "0,255,0,255"); +_assertPixel(canvas, 36,25, 0,255,0,255, "36,25", "0,255,0,255"); + +_assertPixel(canvas, 64,25, 0,255,0,255, "64,25", "0,255,0,255"); +_assertPixel(canvas, 65,25, 0,255,0,255, "65,25", "0,255,0,255"); +_assertPixel(canvas, 66,25, 0,255,0,255, "66,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); +_assertPixel(canvas, 84,25, 0,255,0,255, "84,25", "0,255,0,255"); +_assertPixel(canvas, 85,25, 0,255,0,255, "85,25", "0,255,0,255"); +_assertPixel(canvas, 86,25, 0,255,0,255, "86,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.line.width.valid.js b/platforms/ios/www/test/tests-todo/minimal.2d.line.width.valid.js new file mode 100644 index 0000000..2c5e700 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.line.width.valid.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.lineWidth = 1.5; +_assertSame(ctx.lineWidth, 1.5, "ctx.lineWidth", "1.5"); + +ctx.lineWidth = "1e1"; +_assertSame(ctx.lineWidth, 10, "ctx.lineWidth", "10"); + +ctx.lineWidth = 1/1024; +_assertSame(ctx.lineWidth, 1/1024, "ctx.lineWidth", "1/1024"); + +ctx.lineWidth = 1000; +_assertSame(ctx.lineWidth, 1000, "ctx.lineWidth", "1000"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.missingargs.js b/platforms/ios/www/test/tests-todo/minimal.2d.missingargs.js new file mode 100644 index 0000000..3140fba --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.missingargs.js @@ -0,0 +1,311 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.scale(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.scale()"); } +try { var _thrown = false; + ctx.scale(1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.scale(1)"); } +try { var _thrown = false; + ctx.rotate(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.rotate()"); } +try { var _thrown = false; + ctx.translate(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.translate()"); } +try { var _thrown = false; + ctx.translate(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.translate(0)"); } +if (ctx.transform) { // (avoid spurious failures, since the aim here is not to test that all features are supported) + try { var _thrown = false; + ctx.transform(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.transform()"); } + try { var _thrown = false; + ctx.transform(1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.transform(1)"); } + try { var _thrown = false; + ctx.transform(1, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.transform(1, 0)"); } + try { var _thrown = false; + ctx.transform(1, 0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.transform(1, 0, 0)"); } + try { var _thrown = false; + ctx.transform(1, 0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.transform(1, 0, 0, 1)"); } + try { var _thrown = false; + ctx.transform(1, 0, 0, 1, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.transform(1, 0, 0, 1, 0)"); } +} +if (ctx.setTransform) { + try { var _thrown = false; + ctx.setTransform(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.setTransform()"); } + try { var _thrown = false; + ctx.setTransform(1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.setTransform(1)"); } + try { var _thrown = false; + ctx.setTransform(1, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.setTransform(1, 0)"); } + try { var _thrown = false; + ctx.setTransform(1, 0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.setTransform(1, 0, 0)"); } + try { var _thrown = false; + ctx.setTransform(1, 0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.setTransform(1, 0, 0, 1)"); } + try { var _thrown = false; + ctx.setTransform(1, 0, 0, 1, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.setTransform(1, 0, 0, 1, 0)"); } +} +try { var _thrown = false; + ctx.createLinearGradient(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient()"); } +try { var _thrown = false; + ctx.createLinearGradient(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0)"); } +try { var _thrown = false; + ctx.createLinearGradient(0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient()"); } +try { var _thrown = false; + ctx.createRadialGradient(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, 1, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0)"); } +try { var _thrown = false; + ctx.createRadialGradient(0, 0, 1, 0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, 0)"); } +try { var _thrown = false; + ctx.createPattern(canvas); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createPattern(canvas)"); } +try { var _thrown = false; + ctx.clearRect(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.clearRect()"); } +try { var _thrown = false; + ctx.clearRect(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.clearRect(0)"); } +try { var _thrown = false; + ctx.clearRect(0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.clearRect(0, 0)"); } +try { var _thrown = false; + ctx.clearRect(0, 0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.clearRect(0, 0, 0)"); } +try { var _thrown = false; + ctx.fillRect(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.fillRect()"); } +try { var _thrown = false; + ctx.fillRect(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.fillRect(0)"); } +try { var _thrown = false; + ctx.fillRect(0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.fillRect(0, 0)"); } +try { var _thrown = false; + ctx.fillRect(0, 0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.fillRect(0, 0, 0)"); } +try { var _thrown = false; + ctx.strokeRect(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.strokeRect()"); } +try { var _thrown = false; + ctx.strokeRect(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.strokeRect(0)"); } +try { var _thrown = false; + ctx.strokeRect(0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.strokeRect(0, 0)"); } +try { var _thrown = false; + ctx.strokeRect(0, 0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.strokeRect(0, 0, 0)"); } +try { var _thrown = false; + ctx.moveTo(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.moveTo()"); } +try { var _thrown = false; + ctx.moveTo(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.moveTo(0)"); } +try { var _thrown = false; + ctx.lineTo(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.lineTo()"); } +try { var _thrown = false; + ctx.lineTo(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.lineTo(0)"); } +try { var _thrown = false; + ctx.quadraticCurveTo(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.quadraticCurveTo()"); } +try { var _thrown = false; + ctx.quadraticCurveTo(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.quadraticCurveTo(0)"); } +try { var _thrown = false; + ctx.quadraticCurveTo(0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.quadraticCurveTo(0, 0)"); } +try { var _thrown = false; + ctx.quadraticCurveTo(0, 0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.quadraticCurveTo(0, 0, 0)"); } +try { var _thrown = false; + ctx.bezierCurveTo(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.bezierCurveTo()"); } +try { var _thrown = false; + ctx.bezierCurveTo(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.bezierCurveTo(0)"); } +try { var _thrown = false; + ctx.bezierCurveTo(0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.bezierCurveTo(0, 0)"); } +try { var _thrown = false; + ctx.bezierCurveTo(0, 0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.bezierCurveTo(0, 0, 0)"); } +try { var _thrown = false; + ctx.bezierCurveTo(0, 0, 0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.bezierCurveTo(0, 0, 0, 0)"); } +try { var _thrown = false; + ctx.bezierCurveTo(0, 0, 0, 0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.bezierCurveTo(0, 0, 0, 0, 0)"); } +try { var _thrown = false; + ctx.arcTo(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arcTo()"); } +try { var _thrown = false; + ctx.arcTo(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arcTo(0)"); } +try { var _thrown = false; + ctx.arcTo(0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arcTo(0, 0)"); } +try { var _thrown = false; + ctx.arcTo(0, 0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arcTo(0, 0, 0)"); } +try { var _thrown = false; + ctx.arcTo(0, 0, 0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arcTo(0, 0, 0, 0)"); } +try { var _thrown = false; + ctx.rect(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.rect()"); } +try { var _thrown = false; + ctx.rect(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.rect(0)"); } +try { var _thrown = false; + ctx.rect(0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.rect(0, 0)"); } +try { var _thrown = false; + ctx.rect(0, 0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.rect(0, 0, 0)"); } +try { var _thrown = false; + ctx.arc(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arc()"); } +try { var _thrown = false; + ctx.arc(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arc(0)"); } +try { var _thrown = false; + ctx.arc(0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arc(0, 0)"); } +try { var _thrown = false; + ctx.arc(0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arc(0, 0, 1)"); } +try { var _thrown = false; + ctx.arc(0, 0, 1, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arc(0, 0, 1, 0)"); } +try { var _thrown = false; + ctx.arc(0, 0, 1, 0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arc(0, 0, 1, 0, 0)"); } +if (ctx.isPointInPath) { + try { var _thrown = false; + ctx.isPointInPath(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.isPointInPath()"); } + try { var _thrown = false; + ctx.isPointInPath(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.isPointInPath(0)"); } +} +if (ctx.drawFocusRing) { + try { var _thrown = false; + ctx.drawFocusRing(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.drawFocusRing()"); } + try { var _thrown = false; + ctx.drawFocusRing(canvas); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.drawFocusRing(canvas)"); } + try { var _thrown = false; + ctx.drawFocusRing(canvas, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.drawFocusRing(canvas, 0)"); } +} +if (ctx.fillText) { + try { var _thrown = false; + ctx.fillText(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.fillText()"); } + try { var _thrown = false; + ctx.fillText('test'); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.fillText('test')"); } + try { var _thrown = false; + ctx.fillText('test', 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.fillText('test', 0)"); } + try { var _thrown = false; + ctx.strokeText(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.strokeText()"); } + try { var _thrown = false; + ctx.strokeText('test'); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.strokeText('test')"); } + try { var _thrown = false; + ctx.strokeText('test', 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.strokeText('test', 0)"); } + try { var _thrown = false; + ctx.measureText(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.measureText()"); } +} +try { var _thrown = false; + ctx.drawImage(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.drawImage()"); } +try { var _thrown = false; + ctx.drawImage(canvas); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.drawImage(canvas)"); } +try { var _thrown = false; + ctx.drawImage(canvas, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.drawImage(canvas, 0)"); } +// TODO: n >= 3 args on drawImage could be either a valid overload, +// or too few for another overload, or too many for another +// overload - what should happen? +if (ctx.createImageData) { + try { var _thrown = false; + ctx.createImageData(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createImageData()"); } + try { var _thrown = false; + ctx.createImageData(1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createImageData(1)"); } +} +if (ctx.getImageData) { + try { var _thrown = false; + ctx.getImageData(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData()"); } + try { var _thrown = false; + ctx.getImageData(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(0)"); } + try { var _thrown = false; + ctx.getImageData(0, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(0, 0)"); } + try { var _thrown = false; + ctx.getImageData(0, 0, 1); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(0, 0, 1)"); } +} +if (ctx.putImageData) { + var imgdata = ctx.getImageData(0, 0, 1, 1); + try { var _thrown = false; + ctx.putImageData(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData()"); } + try { var _thrown = false; + ctx.putImageData(imgdata); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata)"); } + try { var _thrown = false; + ctx.putImageData(imgdata, 0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 0)"); } +} +var g = ctx.createLinearGradient(0, 0, 0, 0); +try { var _thrown = false; + g.addColorStop(); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: g.addColorStop()"); } +try { var _thrown = false; + g.addColorStop(0); +} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: g.addColorStop(0)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.angle.1.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.angle.1.js new file mode 100644 index 0000000..9216664 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.angle.1.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(100, 0); +ctx.arc(100, 0, 150, Math.PI/2, -Math.PI, true); +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.angle.2.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.angle.2.js new file mode 100644 index 0000000..f8306c0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.angle.2.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(100, 0); +ctx.arc(100, 0, 150, -3*Math.PI/2, -Math.PI, true); +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.angle.3.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.angle.3.js new file mode 100644 index 0000000..8b812a2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.angle.3.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(100, 0); +ctx.arc(100, 0, 150, (512+1/2)*Math.PI, (1024-1)*Math.PI, true); +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.angle.4.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.angle.4.js new file mode 100644 index 0000000..82b041a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.angle.4.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(50, 25); +ctx.arc(50, 25, 60, (512+1/2)*Math.PI, (1024-1)*Math.PI, false); +ctx.fill(); +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.angle.5.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.angle.5.js new file mode 100644 index 0000000..bbb0243 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.angle.5.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(100, 0); +ctx.arc(100, 0, 150, (1024-1)*Math.PI, (512+1/2)*Math.PI, false); +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.angle.6.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.angle.6.js new file mode 100644 index 0000000..be5c9ac --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.angle.6.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(50, 25); +ctx.arc(50, 25, 60, (1024-1)*Math.PI, (512+1/2)*Math.PI, true); +ctx.fill(); +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.empty.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.empty.js new file mode 100644 index 0000000..49e1b57 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.empty.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 50; +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.arc(200, 25, 5, 0, 2*Math.PI, true); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.end.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.end.js new file mode 100644 index 0000000..fec59f2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.end.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 50; +ctx.strokeStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(-100, 0); +ctx.arc(-100, 0, 25, -Math.PI/2, Math.PI/2, true); +ctx.lineTo(100, 25); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.negative.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.negative.js new file mode 100644 index 0000000..935a633 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.negative.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.arc(0, 0, -1, 0, 0, true); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.arc(0, 0, -1, 0, 0, true)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.nonempty.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.nonempty.js new file mode 100644 index 0000000..544f1a9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.nonempty.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 50; +ctx.strokeStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(0, 25); +ctx.arc(200, 25, 5, 0, 2*Math.PI, true); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.nonfinite.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.nonfinite.js new file mode 100644 index 0000000..2fed434 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.nonfinite.js @@ -0,0 +1,56 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.moveTo(0, 0); +ctx.lineTo(100, 0); +ctx.arc(Infinity, 0, 50, 0, 2*Math.PI, true); +ctx.arc(-Infinity, 0, 50, 0, 2*Math.PI, true); +ctx.arc(NaN, 0, 50, 0, 2*Math.PI, true); +ctx.arc(0, Infinity, 50, 0, 2*Math.PI, true); +ctx.arc(0, -Infinity, 50, 0, 2*Math.PI, true); +ctx.arc(0, NaN, 50, 0, 2*Math.PI, true); +ctx.arc(0, 0, Infinity, 0, 2*Math.PI, true); +ctx.arc(0, 0, -Infinity, 0, 2*Math.PI, true); +ctx.arc(0, 0, NaN, 0, 2*Math.PI, true); +ctx.arc(0, 0, 50, Infinity, 2*Math.PI, true); +ctx.arc(0, 0, 50, -Infinity, 2*Math.PI, true); +ctx.arc(0, 0, 50, NaN, 2*Math.PI, true); +ctx.arc(0, 0, 50, 0, Infinity, true); +ctx.arc(0, 0, 50, 0, -Infinity, true); +ctx.arc(0, 0, 50, 0, NaN, true); +ctx.arc(Infinity, Infinity, 50, 0, 2*Math.PI, true); +ctx.arc(Infinity, Infinity, Infinity, 0, 2*Math.PI, true); +ctx.arc(Infinity, Infinity, Infinity, Infinity, 2*Math.PI, true); +ctx.arc(Infinity, Infinity, Infinity, Infinity, Infinity, true); +ctx.arc(Infinity, Infinity, Infinity, 0, Infinity, true); +ctx.arc(Infinity, Infinity, 50, Infinity, 2*Math.PI, true); +ctx.arc(Infinity, Infinity, 50, Infinity, Infinity, true); +ctx.arc(Infinity, Infinity, 50, 0, Infinity, true); +ctx.arc(Infinity, 0, Infinity, 0, 2*Math.PI, true); +ctx.arc(Infinity, 0, Infinity, Infinity, 2*Math.PI, true); +ctx.arc(Infinity, 0, Infinity, Infinity, Infinity, true); +ctx.arc(Infinity, 0, Infinity, 0, Infinity, true); +ctx.arc(Infinity, 0, 50, Infinity, 2*Math.PI, true); +ctx.arc(Infinity, 0, 50, Infinity, Infinity, true); +ctx.arc(Infinity, 0, 50, 0, Infinity, true); +ctx.arc(0, Infinity, Infinity, 0, 2*Math.PI, true); +ctx.arc(0, Infinity, Infinity, Infinity, 2*Math.PI, true); +ctx.arc(0, Infinity, Infinity, Infinity, Infinity, true); +ctx.arc(0, Infinity, Infinity, 0, Infinity, true); +ctx.arc(0, Infinity, 50, Infinity, 2*Math.PI, true); +ctx.arc(0, Infinity, 50, Infinity, Infinity, true); +ctx.arc(0, Infinity, 50, 0, Infinity, true); +ctx.arc(0, 0, Infinity, Infinity, 2*Math.PI, true); +ctx.arc(0, 0, Infinity, Infinity, Infinity, true); +ctx.arc(0, 0, Infinity, 0, Infinity, true); +ctx.arc(0, 0, 50, Infinity, Infinity, true); +ctx.lineTo(100, 50); +ctx.lineTo(0, 50); +ctx.fillStyle = '#0f0'; +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 90,45, 0,255,0,255, "90,45", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.scale.1.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.scale.1.js new file mode 100644 index 0000000..8648fd9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.scale.1.js @@ -0,0 +1,33 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.scale(2, 0.5); +ctx.fillStyle = '#0f0'; +ctx.beginPath(); +ctx.arc(25, 50, 56, 0, 2*Math.PI, false); +ctx.fill(); +ctx.fillStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(-25, 50); +ctx.arc(-25, 50, 24, 0, 2*Math.PI, false); +ctx.moveTo(75, 50); +ctx.arc(75, 50, 24, 0, 2*Math.PI, false); +ctx.moveTo(25, -25); +ctx.arc(25, -25, 24, 0, 2*Math.PI, false); +ctx.moveTo(25, 125); +ctx.arc(25, 125, 24, 0, 2*Math.PI, false); +ctx.fill(); + +_assertPixel(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255"); +_assertPixel(canvas, 50,0, 0,255,0,255, "50,0", "0,255,0,255"); +_assertPixel(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255"); +_assertPixel(canvas, 0,25, 0,255,0,255, "0,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 99,25, 0,255,0,255, "99,25", "0,255,0,255"); +_assertPixel(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255"); +_assertPixel(canvas, 50,49, 0,255,0,255, "50,49", "0,255,0,255"); +_assertPixel(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.scale.2.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.scale.2.js new file mode 100644 index 0000000..e00a809 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.scale.2.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.scale(100, 100); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 1.2; +ctx.beginPath(); +ctx.arc(0, 0, 0.6, 0, Math.PI/2, false); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.selfintersect.1.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.selfintersect.1.js new file mode 100644 index 0000000..9a8ec74 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.selfintersect.1.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 200; +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.arc(100, 50, 25, 0, -Math.PI/2, true); +ctx.stroke(); +ctx.beginPath(); +ctx.arc(0, 0, 25, 0, -Math.PI/2, true); +ctx.stroke(); +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.selfintersect.2.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.selfintersect.2.js new file mode 100644 index 0000000..428f621 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.selfintersect.2.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 180; +ctx.strokeStyle = '#0f0'; +ctx.beginPath(); +ctx.arc(-50, 50, 25, 0, -Math.PI/2, true); +ctx.stroke(); +ctx.beginPath(); +ctx.arc(100, 0, 25, 0, -Math.PI/2, true); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 90,10, 0,255,0,255, "90,10", "0,255,0,255"); +_assertPixel(canvas, 97,1, 0,255,0,255, "97,1", "0,255,0,255"); +_assertPixel(canvas, 97,2, 0,255,0,255, "97,2", "0,255,0,255"); +_assertPixel(canvas, 97,3, 0,255,0,255, "97,3", "0,255,0,255"); +_assertPixel(canvas, 2,48, 0,255,0,255, "2,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.shape.1.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.shape.1.js new file mode 100644 index 0000000..549f509 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.shape.1.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 50; +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.arc(50, 50, 50, 0, Math.PI, false); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 20,48, 0,255,0,255, "20,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.shape.2.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.shape.2.js new file mode 100644 index 0000000..b852f1b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.shape.2.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 100; +ctx.strokeStyle = '#0f0'; +ctx.beginPath(); +ctx.arc(50, 50, 50, 0, Math.PI, true); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 20,48, 0,255,0,255, "20,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.shape.3.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.shape.3.js new file mode 100644 index 0000000..4df1161 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.shape.3.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 100; +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.arc(0, 50, 50, 0, -Math.PI/2, false); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.shape.4.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.shape.4.js new file mode 100644 index 0000000..7ba2bcf --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.shape.4.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 150; +ctx.strokeStyle = '#0f0'; +ctx.beginPath(); +ctx.arc(-50, 50, 100, 0, -Math.PI/2, true); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.shape.5.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.shape.5.js new file mode 100644 index 0000000..65e3384 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.shape.5.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 200; +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.arc(300, 0, 100, 0, 5*Math.PI, false); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.twopie.1.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.twopie.1.js new file mode 100644 index 0000000..a77ac0c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.twopie.1.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 100; +ctx.beginPath(); +ctx.arc(50, 25, 50, 0, 2*Math.PI - 1e-4, true); +ctx.stroke(); +_assertPixel(canvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.twopie.2.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.twopie.2.js new file mode 100644 index 0000000..284c167 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.twopie.2.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 100; +ctx.beginPath(); +ctx.arc(50, 25, 50, 0, 2*Math.PI - 1e-4, false); +ctx.stroke(); +_assertPixel(canvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.twopie.3.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.twopie.3.js new file mode 100644 index 0000000..17f86d6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.twopie.3.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 100; +ctx.beginPath(); +ctx.arc(50, 25, 50, 0, 2*Math.PI + 1e-4, true); +ctx.stroke(); +_assertPixel(canvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.twopie.4.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.twopie.4.js new file mode 100644 index 0000000..935f0b2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.twopie.4.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 100; +ctx.beginPath(); +ctx.arc(50, 25, 50, 0, 2*Math.PI + 1e-4, false); +ctx.stroke(); +_assertPixel(canvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.zero.1.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.zero.1.js new file mode 100644 index 0000000..ca1f43c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.zero.1.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 100; +ctx.beginPath(); +ctx.arc(50, 25, 50, 0, 0, true); +ctx.stroke(); +_assertPixel(canvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.zero.2.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.zero.2.js new file mode 100644 index 0000000..773ed0d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.zero.2.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 100; +ctx.beginPath(); +ctx.arc(50, 25, 50, 0, 0, false); +ctx.stroke(); +_assertPixel(canvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.zeroradius.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.zeroradius.js new file mode 100644 index 0000000..5466d13 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arc.zeroradius.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00' +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 50; +ctx.strokeStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(0, 25); +ctx.arc(200, 25, 0, 0, Math.PI, true); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.coincide.1.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.coincide.1.js new file mode 100644 index 0000000..3d53b5b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.coincide.1.js @@ -0,0 +1,25 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 50; + +ctx.strokeStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(0, 25); +ctx.arcTo(0, 25, 50, 1000, 1); +ctx.lineTo(100, 25); +ctx.stroke(); + +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(50, 25); +ctx.arcTo(50, 25, 100, 25, 1); +ctx.stroke(); + +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.coincide.2.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.coincide.2.js new file mode 100644 index 0000000..738bf08 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.coincide.2.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 50; +ctx.strokeStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(0, 25); +ctx.arcTo(100, 25, 100, 25, 1); +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.collinear.1.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.collinear.1.js new file mode 100644 index 0000000..dc0e740 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.collinear.1.js @@ -0,0 +1,22 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 50; + +ctx.strokeStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(0, 25); +ctx.arcTo(100, 25, 200, 25, 1); +ctx.stroke(); + +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(-100, 25); +ctx.arcTo(0, 25, 100, 25, 1); +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.collinear.2.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.collinear.2.js new file mode 100644 index 0000000..13579f4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.collinear.2.js @@ -0,0 +1,22 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 50; + +ctx.strokeStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(0, 25); +ctx.arcTo(100, 25, 10, 25, 1); +ctx.stroke(); + +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(100, 25); +ctx.arcTo(200, 25, 110, 25, 1); +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.collinear.3.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.collinear.3.js new file mode 100644 index 0000000..8f38117 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.collinear.3.js @@ -0,0 +1,27 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 50; + +ctx.strokeStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(0, 25); +ctx.arcTo(100, 25, -100, 25, 1); +ctx.stroke(); + +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(100, 25); +ctx.arcTo(200, 25, 0, 25, 1); +ctx.stroke(); + +ctx.beginPath(); +ctx.moveTo(-100, 25); +ctx.arcTo(0, 25, -200, 25, 1); +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.ensuresubpath.1.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.ensuresubpath.1.js new file mode 100644 index 0000000..2261e6d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.ensuresubpath.1.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 50; +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.arcTo(100, 50, 200, 50, 0.1); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.ensuresubpath.2.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.ensuresubpath.2.js new file mode 100644 index 0000000..14d2e2a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.ensuresubpath.2.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 50; +ctx.strokeStyle = '#0f0'; +ctx.beginPath(); +ctx.arcTo(0, 25, 50, 250, 0.1); // adds (x1,y1), draws nothing +ctx.lineTo(100, 25); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.negative.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.negative.js new file mode 100644 index 0000000..c57d2e3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.negative.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.arcTo(0, 0, 0, 0, -1); +} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.arcTo(0, 0, 0, 0, -1)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.nonfinite.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.nonfinite.js new file mode 100644 index 0000000..e580981 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.nonfinite.js @@ -0,0 +1,54 @@ +_addTest(function(canvas, ctx) { + +ctx.moveTo(0, 0); +ctx.lineTo(100, 0); +ctx.arcTo(Infinity, 50, 0, 50, 0); +ctx.arcTo(-Infinity, 50, 0, 50, 0); +ctx.arcTo(NaN, 50, 0, 50, 0); +ctx.arcTo(0, Infinity, 0, 50, 0); +ctx.arcTo(0, -Infinity, 0, 50, 0); +ctx.arcTo(0, NaN, 0, 50, 0); +ctx.arcTo(0, 50, Infinity, 50, 0); +ctx.arcTo(0, 50, -Infinity, 50, 0); +ctx.arcTo(0, 50, NaN, 50, 0); +ctx.arcTo(0, 50, 0, Infinity, 0); +ctx.arcTo(0, 50, 0, -Infinity, 0); +ctx.arcTo(0, 50, 0, NaN, 0); +ctx.arcTo(0, 50, 0, 50, Infinity); +ctx.arcTo(0, 50, 0, 50, -Infinity); +ctx.arcTo(0, 50, 0, 50, NaN); +ctx.arcTo(Infinity, Infinity, 0, 50, 0); +ctx.arcTo(Infinity, Infinity, Infinity, 50, 0); +ctx.arcTo(Infinity, Infinity, Infinity, Infinity, 0); +ctx.arcTo(Infinity, Infinity, Infinity, Infinity, Infinity); +ctx.arcTo(Infinity, Infinity, Infinity, 50, Infinity); +ctx.arcTo(Infinity, Infinity, 0, Infinity, 0); +ctx.arcTo(Infinity, Infinity, 0, Infinity, Infinity); +ctx.arcTo(Infinity, Infinity, 0, 50, Infinity); +ctx.arcTo(Infinity, 50, Infinity, 50, 0); +ctx.arcTo(Infinity, 50, Infinity, Infinity, 0); +ctx.arcTo(Infinity, 50, Infinity, Infinity, Infinity); +ctx.arcTo(Infinity, 50, Infinity, 50, Infinity); +ctx.arcTo(Infinity, 50, 0, Infinity, 0); +ctx.arcTo(Infinity, 50, 0, Infinity, Infinity); +ctx.arcTo(Infinity, 50, 0, 50, Infinity); +ctx.arcTo(0, Infinity, Infinity, 50, 0); +ctx.arcTo(0, Infinity, Infinity, Infinity, 0); +ctx.arcTo(0, Infinity, Infinity, Infinity, Infinity); +ctx.arcTo(0, Infinity, Infinity, 50, Infinity); +ctx.arcTo(0, Infinity, 0, Infinity, 0); +ctx.arcTo(0, Infinity, 0, Infinity, Infinity); +ctx.arcTo(0, Infinity, 0, 50, Infinity); +ctx.arcTo(0, 50, Infinity, Infinity, 0); +ctx.arcTo(0, 50, Infinity, Infinity, Infinity); +ctx.arcTo(0, 50, Infinity, 50, Infinity); +ctx.arcTo(0, 50, 0, Infinity, Infinity); +ctx.lineTo(100, 50); +ctx.lineTo(0, 50); +ctx.fillStyle = '#0f0'; +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 90,45, 0,255,0,255, "90,45", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.scale.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.scale.js new file mode 100644 index 0000000..48bdf0a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.scale.js @@ -0,0 +1,26 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(0, 50); +ctx.translate(100, 0); +ctx.scale(0.1, 1); +ctx.arcTo(50, 50, 50, 0, 50); +ctx.lineTo(-1000, 0); +ctx.fill(); + +_assertPixel(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255"); +_assertPixel(canvas, 50,0, 0,255,0,255, "50,0", "0,255,0,255"); +_assertPixel(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255"); +_assertPixel(canvas, 0,25, 0,255,0,255, "0,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 99,25, 0,255,0,255, "99,25", "0,255,0,255"); +_assertPixel(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255"); +_assertPixel(canvas, 50,49, 0,255,0,255, "50,49", "0,255,0,255"); +_assertPixel(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.shape.curve1.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.shape.curve1.js new file mode 100644 index 0000000..31a724a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.shape.curve1.js @@ -0,0 +1,39 @@ +_addTest(function(canvas, ctx) { + +var tol = 1.5; // tolerance to avoid antialiasing artifacts + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 10; +ctx.beginPath(); +ctx.moveTo(10, 25); +ctx.arcTo(75, 25, 75, 60, 20); +ctx.stroke(); + +ctx.fillStyle = '#0f0'; +ctx.beginPath(); +ctx.rect(10, 20, 45, 10); +ctx.moveTo(80, 45); +ctx.arc(55, 45, 25+tol, 0, -Math.PI/2, true); +ctx.arc(55, 45, 15-tol, -Math.PI/2, 0, false); +ctx.fill(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 55,19, 0,255,0,255, "55,19", "0,255,0,255"); +_assertPixel(canvas, 55,20, 0,255,0,255, "55,20", "0,255,0,255"); +_assertPixel(canvas, 55,21, 0,255,0,255, "55,21", "0,255,0,255"); +_assertPixel(canvas, 64,22, 0,255,0,255, "64,22", "0,255,0,255"); +_assertPixel(canvas, 65,21, 0,255,0,255, "65,21", "0,255,0,255"); +_assertPixel(canvas, 72,28, 0,255,0,255, "72,28", "0,255,0,255"); +_assertPixel(canvas, 73,27, 0,255,0,255, "73,27", "0,255,0,255"); +_assertPixel(canvas, 78,36, 0,255,0,255, "78,36", "0,255,0,255"); +_assertPixel(canvas, 79,35, 0,255,0,255, "79,35", "0,255,0,255"); +_assertPixel(canvas, 80,44, 0,255,0,255, "80,44", "0,255,0,255"); +_assertPixel(canvas, 80,45, 0,255,0,255, "80,45", "0,255,0,255"); +_assertPixel(canvas, 80,46, 0,255,0,255, "80,46", "0,255,0,255"); +_assertPixel(canvas, 65,45, 0,255,0,255, "65,45", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.shape.curve2.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.shape.curve2.js new file mode 100644 index 0000000..6e2e767 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.shape.curve2.js @@ -0,0 +1,38 @@ +_addTest(function(canvas, ctx) { + +var tol = 1.5; // tolerance to avoid antialiasing artifacts + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#f00'; +ctx.beginPath(); +ctx.rect(10, 20, 45, 10); +ctx.moveTo(80, 45); +ctx.arc(55, 45, 25-tol, 0, -Math.PI/2, true); +ctx.arc(55, 45, 15+tol, -Math.PI/2, 0, false); +ctx.fill(); + +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 10; +ctx.beginPath(); +ctx.moveTo(10, 25); +ctx.arcTo(75, 25, 75, 60, 20); +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 55,19, 0,255,0,255, "55,19", "0,255,0,255"); +_assertPixel(canvas, 55,20, 0,255,0,255, "55,20", "0,255,0,255"); +_assertPixel(canvas, 55,21, 0,255,0,255, "55,21", "0,255,0,255"); +_assertPixel(canvas, 64,22, 0,255,0,255, "64,22", "0,255,0,255"); +_assertPixel(canvas, 65,21, 0,255,0,255, "65,21", "0,255,0,255"); +_assertPixel(canvas, 72,28, 0,255,0,255, "72,28", "0,255,0,255"); +_assertPixel(canvas, 73,27, 0,255,0,255, "73,27", "0,255,0,255"); +_assertPixel(canvas, 78,36, 0,255,0,255, "78,36", "0,255,0,255"); +_assertPixel(canvas, 79,35, 0,255,0,255, "79,35", "0,255,0,255"); +_assertPixel(canvas, 80,44, 0,255,0,255, "80,44", "0,255,0,255"); +_assertPixel(canvas, 80,45, 0,255,0,255, "80,45", "0,255,0,255"); +_assertPixel(canvas, 80,46, 0,255,0,255, "80,46", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.shape.end.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.shape.end.js new file mode 100644 index 0000000..434fe1c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.shape.end.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 50; +ctx.beginPath(); +ctx.moveTo(-100, -100); +ctx.arcTo(-100, 25, 200, 25, 10); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.shape.start.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.shape.start.js new file mode 100644 index 0000000..d75b912 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.shape.start.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 50; +ctx.beginPath(); +ctx.moveTo(0, 25); +ctx.arcTo(200, 25, 200, 50, 10); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.transformation.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.transformation.js new file mode 100644 index 0000000..a4393b9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.transformation.js @@ -0,0 +1,25 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(0, 50); +ctx.translate(100, 0); +ctx.arcTo(50, 50, 50, 0, 50); +ctx.lineTo(-100, 0); +ctx.fill(); + +_assertPixel(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255"); +_assertPixel(canvas, 50,0, 0,255,0,255, "50,0", "0,255,0,255"); +_assertPixel(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255"); +_assertPixel(canvas, 0,25, 0,255,0,255, "0,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 99,25, 0,255,0,255, "99,25", "0,255,0,255"); +_assertPixel(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255"); +_assertPixel(canvas, 50,49, 0,255,0,255, "50,49", "0,255,0,255"); +_assertPixel(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.zero.1.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.zero.1.js new file mode 100644 index 0000000..6f9de58 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.zero.1.js @@ -0,0 +1,22 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 50; + +ctx.strokeStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(0, 25); +ctx.arcTo(100, 25, 100, 100, 0); +ctx.stroke(); + +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(0, -25); +ctx.arcTo(50, -25, 50, 50, 0); +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.zero.2.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.zero.2.js new file mode 100644 index 0000000..5131547 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.arcTo.zero.2.js @@ -0,0 +1,22 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.lineWidth = 50; + +ctx.strokeStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(0, 25); +ctx.arcTo(100, 25, -100, 25, 0); +ctx.stroke(); + +ctx.strokeStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(100, 25); +ctx.arcTo(200, 25, 50, 25, 0); +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.beginPath.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.beginPath.js new file mode 100644 index 0000000..863d90e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.beginPath.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.rect(0, 0, 100, 50); +ctx.beginPath(); +ctx.fillStyle = '#f00'; +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.bezierCurveTo.basic.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.bezierCurveTo.basic.js new file mode 100644 index 0000000..ed39006 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.bezierCurveTo.basic.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 50; +ctx.beginPath(); +ctx.moveTo(0, 25); +ctx.bezierCurveTo(100, 25, 100, 25, 100, 25); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.bezierCurveTo.ensuresubpath.1.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.bezierCurveTo.ensuresubpath.1.js new file mode 100644 index 0000000..2e043d2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.bezierCurveTo.ensuresubpath.1.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 50; +ctx.beginPath(); +ctx.bezierCurveTo(100, 50, 200, 50, 200, 50); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 95,45, 0,255,0,255, "95,45", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.bezierCurveTo.ensuresubpath.2.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.bezierCurveTo.ensuresubpath.2.js new file mode 100644 index 0000000..7526400 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.bezierCurveTo.ensuresubpath.2.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 50; +ctx.beginPath(); +ctx.bezierCurveTo(0, 25, 100, 25, 100, 25); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 5,45, 0,255,0,255, "5,45", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.bezierCurveTo.nonfinite.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.bezierCurveTo.nonfinite.js new file mode 100644 index 0000000..95e947d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.bezierCurveTo.nonfinite.js @@ -0,0 +1,88 @@ +_addTest(function(canvas, ctx) { + +ctx.moveTo(0, 0); +ctx.lineTo(100, 0); +ctx.bezierCurveTo(Infinity, 50, 0, 50, 0, 50); +ctx.bezierCurveTo(-Infinity, 50, 0, 50, 0, 50); +ctx.bezierCurveTo(NaN, 50, 0, 50, 0, 50); +ctx.bezierCurveTo(0, Infinity, 0, 50, 0, 50); +ctx.bezierCurveTo(0, -Infinity, 0, 50, 0, 50); +ctx.bezierCurveTo(0, NaN, 0, 50, 0, 50); +ctx.bezierCurveTo(0, 50, Infinity, 50, 0, 50); +ctx.bezierCurveTo(0, 50, -Infinity, 50, 0, 50); +ctx.bezierCurveTo(0, 50, NaN, 50, 0, 50); +ctx.bezierCurveTo(0, 50, 0, Infinity, 0, 50); +ctx.bezierCurveTo(0, 50, 0, -Infinity, 0, 50); +ctx.bezierCurveTo(0, 50, 0, NaN, 0, 50); +ctx.bezierCurveTo(0, 50, 0, 50, Infinity, 50); +ctx.bezierCurveTo(0, 50, 0, 50, -Infinity, 50); +ctx.bezierCurveTo(0, 50, 0, 50, NaN, 50); +ctx.bezierCurveTo(0, 50, 0, 50, 0, Infinity); +ctx.bezierCurveTo(0, 50, 0, 50, 0, -Infinity); +ctx.bezierCurveTo(0, 50, 0, 50, 0, NaN); +ctx.bezierCurveTo(Infinity, Infinity, 0, 50, 0, 50); +ctx.bezierCurveTo(Infinity, Infinity, Infinity, 50, 0, 50); +ctx.bezierCurveTo(Infinity, Infinity, Infinity, Infinity, 0, 50); +ctx.bezierCurveTo(Infinity, Infinity, Infinity, Infinity, Infinity, 50); +ctx.bezierCurveTo(Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); +ctx.bezierCurveTo(Infinity, Infinity, Infinity, Infinity, 0, Infinity); +ctx.bezierCurveTo(Infinity, Infinity, Infinity, 50, Infinity, 50); +ctx.bezierCurveTo(Infinity, Infinity, Infinity, 50, Infinity, Infinity); +ctx.bezierCurveTo(Infinity, Infinity, Infinity, 50, 0, Infinity); +ctx.bezierCurveTo(Infinity, Infinity, 0, Infinity, 0, 50); +ctx.bezierCurveTo(Infinity, Infinity, 0, Infinity, Infinity, 50); +ctx.bezierCurveTo(Infinity, Infinity, 0, Infinity, Infinity, Infinity); +ctx.bezierCurveTo(Infinity, Infinity, 0, Infinity, 0, Infinity); +ctx.bezierCurveTo(Infinity, Infinity, 0, 50, Infinity, 50); +ctx.bezierCurveTo(Infinity, Infinity, 0, 50, Infinity, Infinity); +ctx.bezierCurveTo(Infinity, Infinity, 0, 50, 0, Infinity); +ctx.bezierCurveTo(Infinity, 50, Infinity, 50, 0, 50); +ctx.bezierCurveTo(Infinity, 50, Infinity, Infinity, 0, 50); +ctx.bezierCurveTo(Infinity, 50, Infinity, Infinity, Infinity, 50); +ctx.bezierCurveTo(Infinity, 50, Infinity, Infinity, Infinity, Infinity); +ctx.bezierCurveTo(Infinity, 50, Infinity, Infinity, 0, Infinity); +ctx.bezierCurveTo(Infinity, 50, Infinity, 50, Infinity, 50); +ctx.bezierCurveTo(Infinity, 50, Infinity, 50, Infinity, Infinity); +ctx.bezierCurveTo(Infinity, 50, Infinity, 50, 0, Infinity); +ctx.bezierCurveTo(Infinity, 50, 0, Infinity, 0, 50); +ctx.bezierCurveTo(Infinity, 50, 0, Infinity, Infinity, 50); +ctx.bezierCurveTo(Infinity, 50, 0, Infinity, Infinity, Infinity); +ctx.bezierCurveTo(Infinity, 50, 0, Infinity, 0, Infinity); +ctx.bezierCurveTo(Infinity, 50, 0, 50, Infinity, 50); +ctx.bezierCurveTo(Infinity, 50, 0, 50, Infinity, Infinity); +ctx.bezierCurveTo(Infinity, 50, 0, 50, 0, Infinity); +ctx.bezierCurveTo(0, Infinity, Infinity, 50, 0, 50); +ctx.bezierCurveTo(0, Infinity, Infinity, Infinity, 0, 50); +ctx.bezierCurveTo(0, Infinity, Infinity, Infinity, Infinity, 50); +ctx.bezierCurveTo(0, Infinity, Infinity, Infinity, Infinity, Infinity); +ctx.bezierCurveTo(0, Infinity, Infinity, Infinity, 0, Infinity); +ctx.bezierCurveTo(0, Infinity, Infinity, 50, Infinity, 50); +ctx.bezierCurveTo(0, Infinity, Infinity, 50, Infinity, Infinity); +ctx.bezierCurveTo(0, Infinity, Infinity, 50, 0, Infinity); +ctx.bezierCurveTo(0, Infinity, 0, Infinity, 0, 50); +ctx.bezierCurveTo(0, Infinity, 0, Infinity, Infinity, 50); +ctx.bezierCurveTo(0, Infinity, 0, Infinity, Infinity, Infinity); +ctx.bezierCurveTo(0, Infinity, 0, Infinity, 0, Infinity); +ctx.bezierCurveTo(0, Infinity, 0, 50, Infinity, 50); +ctx.bezierCurveTo(0, Infinity, 0, 50, Infinity, Infinity); +ctx.bezierCurveTo(0, Infinity, 0, 50, 0, Infinity); +ctx.bezierCurveTo(0, 50, Infinity, Infinity, 0, 50); +ctx.bezierCurveTo(0, 50, Infinity, Infinity, Infinity, 50); +ctx.bezierCurveTo(0, 50, Infinity, Infinity, Infinity, Infinity); +ctx.bezierCurveTo(0, 50, Infinity, Infinity, 0, Infinity); +ctx.bezierCurveTo(0, 50, Infinity, 50, Infinity, 50); +ctx.bezierCurveTo(0, 50, Infinity, 50, Infinity, Infinity); +ctx.bezierCurveTo(0, 50, Infinity, 50, 0, Infinity); +ctx.bezierCurveTo(0, 50, 0, Infinity, Infinity, 50); +ctx.bezierCurveTo(0, 50, 0, Infinity, Infinity, Infinity); +ctx.bezierCurveTo(0, 50, 0, Infinity, 0, Infinity); +ctx.bezierCurveTo(0, 50, 0, 50, Infinity, Infinity); +ctx.lineTo(100, 50); +ctx.lineTo(0, 50); +ctx.fillStyle = '#0f0'; +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 90,45, 0,255,0,255, "90,45", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.bezierCurveTo.scaled.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.bezierCurveTo.scaled.js new file mode 100644 index 0000000..699d256 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.bezierCurveTo.scaled.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.scale(1000, 1000); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 0.055; +ctx.beginPath(); +ctx.moveTo(-2, 3.1); +ctx.bezierCurveTo(-2, -1, 2.1, -1, 2.1, 3.1); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.bezierCurveTo.shape.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.bezierCurveTo.shape.js new file mode 100644 index 0000000..fa96b5d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.bezierCurveTo.shape.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 55; +ctx.beginPath(); +ctx.moveTo(-2000, 3100); +ctx.bezierCurveTo(-2000, -1000, 2100, -1000, 2100, 3100); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.clip.basic.1.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.clip.basic.1.js new file mode 100644 index 0000000..45f643f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.clip.basic.1.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.beginPath(); +ctx.rect(0, 0, 100, 50); +ctx.clip(); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.clip.basic.2.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.clip.basic.2.js new file mode 100644 index 0000000..3ce3267 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.clip.basic.2.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.beginPath(); +ctx.rect(-100, 0, 100, 50); +ctx.clip(); + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.clip.empty.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.clip.empty.js new file mode 100644 index 0000000..9346e97 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.clip.empty.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.beginPath(); +ctx.clip(); + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.clip.intersect.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.clip.intersect.js new file mode 100644 index 0000000..bf0fcd8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.clip.intersect.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.beginPath(); +ctx.rect(0, 0, 50, 50); +ctx.clip(); +ctx.beginPath(); +ctx.rect(50, 0, 50, 50) +ctx.clip(); + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.clip.unaffected.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.clip.unaffected.js new file mode 100644 index 0000000..e13c60e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.clip.unaffected.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; + +ctx.beginPath(); +ctx.moveTo(0, 0); +ctx.lineTo(0, 50); +ctx.lineTo(100, 50); +ctx.lineTo(100, 0); +ctx.clip(); + +ctx.lineTo(0, 0); +ctx.fill(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.clip.winding.1.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.clip.winding.1.js new file mode 100644 index 0000000..e1f8cbc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.clip.winding.1.js @@ -0,0 +1,24 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.beginPath(); +ctx.moveTo(-10, -10); +ctx.lineTo(110, -10); +ctx.lineTo(110, 60); +ctx.lineTo(-10, 60); +ctx.lineTo(-10, -10); +ctx.lineTo(0, 0); +ctx.lineTo(0, 50); +ctx.lineTo(100, 50); +ctx.lineTo(100, 0); +ctx.clip(); + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.clip.winding.2.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.clip.winding.2.js new file mode 100644 index 0000000..57f3b99 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.clip.winding.2.js @@ -0,0 +1,28 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.beginPath(); +ctx.moveTo(-10, -10); +ctx.lineTo(110, -10); +ctx.lineTo(110, 60); +ctx.lineTo(-10, 60); +ctx.lineTo(-10, -10); +ctx.clip(); + +ctx.beginPath(); +ctx.moveTo(0, 0); +ctx.lineTo(0, 50); +ctx.lineTo(100, 50); +ctx.lineTo(100, 0); +ctx.lineTo(0, 0); +ctx.clip(); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.closePath.empty.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.closePath.empty.js new file mode 100644 index 0000000..9a679db --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.closePath.empty.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.closePath(); +ctx.fillStyle = '#f00'; +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.closePath.newline.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.closePath.newline.js new file mode 100644 index 0000000..8cc2aa5 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.closePath.newline.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 50; +ctx.moveTo(-100, 25); +ctx.lineTo(-100, -100); +ctx.lineTo(200, -100); +ctx.lineTo(200, 25); +ctx.closePath(); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.closePath.nextpoint.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.closePath.nextpoint.js new file mode 100644 index 0000000..7d56902 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.closePath.nextpoint.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 50; +ctx.moveTo(-100, 25); +ctx.lineTo(-100, -1000); +ctx.closePath(); +ctx.lineTo(1000, 25); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.fill.closed.basic.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.fill.closed.basic.js new file mode 100644 index 0000000..29c08ba --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.fill.closed.basic.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.moveTo(0, 0); +ctx.lineTo(100, 0); +ctx.lineTo(100, 50); +ctx.lineTo(0, 50); +ctx.fill(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.fill.closed.unaffected.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.fill.closed.unaffected.js new file mode 100644 index 0000000..6dccb77 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.fill.closed.unaffected.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#00f'; +ctx.fillRect(0, 0, 100, 50); + +ctx.moveTo(0, 0); +ctx.lineTo(100, 0); +ctx.lineTo(100, 50); +ctx.fillStyle = '#f00'; +ctx.fill(); +ctx.lineTo(0, 50); +ctx.fillStyle = '#0f0'; +ctx.fill(); + +_assertPixel(canvas, 90,10, 0,255,0,255, "90,10", "0,255,0,255"); +_assertPixel(canvas, 10,40, 0,255,0,255, "10,40", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.fill.overlap.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.fill.overlap.js new file mode 100644 index 0000000..8f0715c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.fill.overlap.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#000'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.rect(0, 0, 100, 50); +ctx.closePath(); +ctx.rect(10, 10, 80, 30); +ctx.fill(); + +_assertPixelApprox(canvas, 50,25, 0,127,0,255, "50,25", "0,127,0,255", 1); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.fill.winding.add.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.fill.winding.add.js new file mode 100644 index 0000000..fb5ae74 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.fill.winding.add.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.moveTo(-10, -10); +ctx.lineTo(110, -10); +ctx.lineTo(110, 60); +ctx.lineTo(-10, 60); +ctx.lineTo(-10, -10); +ctx.lineTo(0, 0); +ctx.lineTo(100, 0); +ctx.lineTo(100, 50); +ctx.lineTo(0, 50); +ctx.fill(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.fill.winding.subtract.1.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.fill.winding.subtract.1.js new file mode 100644 index 0000000..c2bec22 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.fill.winding.subtract.1.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#f00'; +ctx.moveTo(-10, -10); +ctx.lineTo(110, -10); +ctx.lineTo(110, 60); +ctx.lineTo(-10, 60); +ctx.lineTo(-10, -10); +ctx.lineTo(0, 0); +ctx.lineTo(0, 50); +ctx.lineTo(100, 50); +ctx.lineTo(100, 0); +ctx.fill(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.fill.winding.subtract.2.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.fill.winding.subtract.2.js new file mode 100644 index 0000000..b7e4bbd --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.fill.winding.subtract.2.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#f00'; +ctx.moveTo(-10, -10); +ctx.lineTo(110, -10); +ctx.lineTo(110, 60); +ctx.lineTo(-10, 60); +ctx.moveTo(0, 0); +ctx.lineTo(0, 50); +ctx.lineTo(100, 50); +ctx.lineTo(100, 0); +ctx.fill(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.fill.winding.subtract.3.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.fill.winding.subtract.3.js new file mode 100644 index 0000000..5b9ccda --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.fill.winding.subtract.3.js @@ -0,0 +1,26 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.moveTo(-10, -10); +ctx.lineTo(110, -10); +ctx.lineTo(110, 60); +ctx.lineTo(-10, 60); +ctx.lineTo(-10, -10); +ctx.lineTo(-20, -20); +ctx.lineTo(120, -20); +ctx.lineTo(120, 70); +ctx.lineTo(-20, 70); +ctx.lineTo(-20, -20); +ctx.lineTo(0, 0); +ctx.lineTo(0, 50); +ctx.lineTo(100, 50); +ctx.lineTo(100, 0); +ctx.fill(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.initial.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.initial.js new file mode 100644 index 0000000..9a679db --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.initial.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.closePath(); +ctx.fillStyle = '#f00'; +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.arc.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.arc.js new file mode 100644 index 0000000..68f1a92 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.arc.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.arc(50, 25, 10, 0, Math.PI, false); +_assertSame(ctx.isPointInPath(50, 10), false, "ctx.isPointInPath(50, 10)", "false"); +_assertSame(ctx.isPointInPath(50, 20), false, "ctx.isPointInPath(50, 20)", "false"); +_assertSame(ctx.isPointInPath(50, 30), true, "ctx.isPointInPath(50, 30)", "true"); +_assertSame(ctx.isPointInPath(50, 40), false, "ctx.isPointInPath(50, 40)", "false"); +_assertSame(ctx.isPointInPath(30, 20), false, "ctx.isPointInPath(30, 20)", "false"); +_assertSame(ctx.isPointInPath(70, 20), false, "ctx.isPointInPath(70, 20)", "false"); +_assertSame(ctx.isPointInPath(30, 30), false, "ctx.isPointInPath(30, 30)", "false"); +_assertSame(ctx.isPointInPath(70, 30), false, "ctx.isPointInPath(70, 30)", "false"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.basic.1.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.basic.1.js new file mode 100644 index 0000000..2924135 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.basic.1.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +ctx.rect(0, 0, 20, 20); +_assertSame(ctx.isPointInPath(10, 10), true, "ctx.isPointInPath(10, 10)", "true"); +_assertSame(ctx.isPointInPath(30, 10), false, "ctx.isPointInPath(30, 10)", "false"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.basic.2.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.basic.2.js new file mode 100644 index 0000000..98f540e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.basic.2.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +ctx.rect(20, 0, 20, 20); +_assertSame(ctx.isPointInPath(10, 10), false, "ctx.isPointInPath(10, 10)", "false"); +_assertSame(ctx.isPointInPath(30, 10), true, "ctx.isPointInPath(30, 10)", "true"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.bezier.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.bezier.js new file mode 100644 index 0000000..c71fd65 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.bezier.js @@ -0,0 +1,27 @@ +_addTest(function(canvas, ctx) { + +ctx.moveTo(25, 25); +ctx.bezierCurveTo(50, -50, 50, 100, 75, 25); +_assertEqual(ctx.isPointInPath(25, 20), false, "ctx.isPointInPath(25, 20)", "false"); +_assertEqual(ctx.isPointInPath(25, 30), false, "ctx.isPointInPath(25, 30)", "false"); +_assertEqual(ctx.isPointInPath(30, 20), true, "ctx.isPointInPath(30, 20)", "true"); +_assertEqual(ctx.isPointInPath(30, 30), false, "ctx.isPointInPath(30, 30)", "false"); +_assertEqual(ctx.isPointInPath(40, 2), false, "ctx.isPointInPath(40, 2)", "false"); +_assertEqual(ctx.isPointInPath(40, 20), true, "ctx.isPointInPath(40, 20)", "true"); +_assertEqual(ctx.isPointInPath(40, 30), false, "ctx.isPointInPath(40, 30)", "false"); +_assertEqual(ctx.isPointInPath(40, 47), false, "ctx.isPointInPath(40, 47)", "false"); +_assertEqual(ctx.isPointInPath(45, 20), true, "ctx.isPointInPath(45, 20)", "true"); +_assertEqual(ctx.isPointInPath(45, 30), false, "ctx.isPointInPath(45, 30)", "false"); +_assertEqual(ctx.isPointInPath(55, 20), false, "ctx.isPointInPath(55, 20)", "false"); +_assertEqual(ctx.isPointInPath(55, 30), true, "ctx.isPointInPath(55, 30)", "true"); +_assertEqual(ctx.isPointInPath(60, 2), false, "ctx.isPointInPath(60, 2)", "false"); +_assertEqual(ctx.isPointInPath(60, 20), false, "ctx.isPointInPath(60, 20)", "false"); +_assertEqual(ctx.isPointInPath(60, 30), true, "ctx.isPointInPath(60, 30)", "true"); +_assertEqual(ctx.isPointInPath(60, 47), false, "ctx.isPointInPath(60, 47)", "false"); +_assertEqual(ctx.isPointInPath(70, 20), false, "ctx.isPointInPath(70, 20)", "false"); +_assertEqual(ctx.isPointInPath(70, 30), true, "ctx.isPointInPath(70, 30)", "true"); +_assertEqual(ctx.isPointInPath(75, 20), false, "ctx.isPointInPath(75, 20)", "false"); +_assertEqual(ctx.isPointInPath(75, 30), false, "ctx.isPointInPath(75, 30)", "false"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.bigarc.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.bigarc.js new file mode 100644 index 0000000..badb306 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.bigarc.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.arc(50, 25, 10, 0, 7, false); +_assertSame(ctx.isPointInPath(50, 10), false, "ctx.isPointInPath(50, 10)", "false"); +_assertSame(ctx.isPointInPath(50, 20), true, "ctx.isPointInPath(50, 20)", "true"); +_assertSame(ctx.isPointInPath(50, 30), true, "ctx.isPointInPath(50, 30)", "true"); +_assertSame(ctx.isPointInPath(50, 40), false, "ctx.isPointInPath(50, 40)", "false"); +_assertSame(ctx.isPointInPath(30, 20), false, "ctx.isPointInPath(30, 20)", "false"); +_assertSame(ctx.isPointInPath(70, 20), false, "ctx.isPointInPath(70, 20)", "false"); +_assertSame(ctx.isPointInPath(30, 30), false, "ctx.isPointInPath(30, 30)", "false"); +_assertSame(ctx.isPointInPath(70, 30), false, "ctx.isPointInPath(70, 30)", "false"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.edge.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.edge.js new file mode 100644 index 0000000..3821726 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.edge.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.rect(0, 0, 20, 20); +_assertSame(ctx.isPointInPath(0, 0), true, "ctx.isPointInPath(0, 0)", "true"); +_assertSame(ctx.isPointInPath(10, 0), true, "ctx.isPointInPath(10, 0)", "true"); +_assertSame(ctx.isPointInPath(20, 0), true, "ctx.isPointInPath(20, 0)", "true"); +_assertSame(ctx.isPointInPath(20, 10), true, "ctx.isPointInPath(20, 10)", "true"); +_assertSame(ctx.isPointInPath(20, 20), true, "ctx.isPointInPath(20, 20)", "true"); +_assertSame(ctx.isPointInPath(10, 20), true, "ctx.isPointInPath(10, 20)", "true"); +_assertSame(ctx.isPointInPath(0, 20), true, "ctx.isPointInPath(0, 20)", "true"); +_assertSame(ctx.isPointInPath(0, 10), true, "ctx.isPointInPath(0, 10)", "true"); +_assertSame(ctx.isPointInPath(10, -0.01), false, "ctx.isPointInPath(10, -0.01)", "false"); +_assertSame(ctx.isPointInPath(10, 20.01), false, "ctx.isPointInPath(10, 20.01)", "false"); +_assertSame(ctx.isPointInPath(-0.01, 10), false, "ctx.isPointInPath(-0.01, 10)", "false"); +_assertSame(ctx.isPointInPath(20.01, 10), false, "ctx.isPointInPath(20.01, 10)", "false"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.empty.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.empty.js new file mode 100644 index 0000000..b55df31 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.empty.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(ctx.isPointInPath(0, 0), false, "ctx.isPointInPath(0, 0)", "false"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.nonfinite.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.nonfinite.js new file mode 100644 index 0000000..e3c1719 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.nonfinite.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.rect(-100, -50, 200, 100); +_assertSame(ctx.isPointInPath(Infinity, 0), false, "ctx.isPointInPath(Infinity, 0)", "false"); +_assertSame(ctx.isPointInPath(-Infinity, 0), false, "ctx.isPointInPath(-Infinity, 0)", "false"); +_assertSame(ctx.isPointInPath(NaN, 0), false, "ctx.isPointInPath(NaN, 0)", "false"); +_assertSame(ctx.isPointInPath(0, Infinity), false, "ctx.isPointInPath(0, Infinity)", "false"); +_assertSame(ctx.isPointInPath(0, -Infinity), false, "ctx.isPointInPath(0, -Infinity)", "false"); +_assertSame(ctx.isPointInPath(0, NaN), false, "ctx.isPointInPath(0, NaN)", "false"); +_assertSame(ctx.isPointInPath(NaN, NaN), false, "ctx.isPointInPath(NaN, NaN)", "false"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.outside.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.outside.js new file mode 100644 index 0000000..1afad01 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.outside.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.rect(0, -100, 20, 20); +ctx.rect(20, -10, 20, 20); +_assertSame(ctx.isPointInPath(10, -110), false, "ctx.isPointInPath(10, -110)", "false"); +_assertSame(ctx.isPointInPath(10, -90), true, "ctx.isPointInPath(10, -90)", "true"); +_assertSame(ctx.isPointInPath(10, -70), false, "ctx.isPointInPath(10, -70)", "false"); +_assertSame(ctx.isPointInPath(30, -20), false, "ctx.isPointInPath(30, -20)", "false"); +_assertSame(ctx.isPointInPath(30, 0), true, "ctx.isPointInPath(30, 0)", "true"); +_assertSame(ctx.isPointInPath(30, 20), false, "ctx.isPointInPath(30, 20)", "false"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.subpath.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.subpath.js new file mode 100644 index 0000000..8a75a30 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.subpath.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.rect(0, 0, 20, 20); +ctx.beginPath(); +ctx.rect(20, 0, 20, 20); +ctx.closePath(); +ctx.rect(40, 0, 20, 20); +_assertSame(ctx.isPointInPath(10, 10), false, "ctx.isPointInPath(10, 10)", "false"); +_assertSame(ctx.isPointInPath(30, 10), true, "ctx.isPointInPath(30, 10)", "true"); +_assertSame(ctx.isPointInPath(50, 10), true, "ctx.isPointInPath(50, 10)", "true"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.transform.1.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.transform.1.js new file mode 100644 index 0000000..ad91a4a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.transform.1.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.translate(50, 0); +ctx.rect(0, 0, 20, 20); +_assertSame(ctx.isPointInPath(-40, 10), false, "ctx.isPointInPath(-40, 10)", "false"); +_assertSame(ctx.isPointInPath(10, 10), false, "ctx.isPointInPath(10, 10)", "false"); +_assertSame(ctx.isPointInPath(49, 10), false, "ctx.isPointInPath(49, 10)", "false"); +_assertSame(ctx.isPointInPath(51, 10), true, "ctx.isPointInPath(51, 10)", "true"); +_assertSame(ctx.isPointInPath(69, 10), true, "ctx.isPointInPath(69, 10)", "true"); +_assertSame(ctx.isPointInPath(71, 10), false, "ctx.isPointInPath(71, 10)", "false"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.transform.2.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.transform.2.js new file mode 100644 index 0000000..b82c30b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.transform.2.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.rect(50, 0, 20, 20); +ctx.translate(50, 0); +_assertSame(ctx.isPointInPath(-40, 10), false, "ctx.isPointInPath(-40, 10)", "false"); +_assertSame(ctx.isPointInPath(10, 10), false, "ctx.isPointInPath(10, 10)", "false"); +_assertSame(ctx.isPointInPath(49, 10), false, "ctx.isPointInPath(49, 10)", "false"); +_assertSame(ctx.isPointInPath(51, 10), true, "ctx.isPointInPath(51, 10)", "true"); +_assertSame(ctx.isPointInPath(69, 10), true, "ctx.isPointInPath(69, 10)", "true"); +_assertSame(ctx.isPointInPath(71, 10), false, "ctx.isPointInPath(71, 10)", "false"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.transform.3.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.transform.3.js new file mode 100644 index 0000000..9513d3a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.transform.3.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.scale(-1, 1); +ctx.rect(-70, 0, 20, 20); +_assertSame(ctx.isPointInPath(-40, 10), false, "ctx.isPointInPath(-40, 10)", "false"); +_assertSame(ctx.isPointInPath(10, 10), false, "ctx.isPointInPath(10, 10)", "false"); +_assertSame(ctx.isPointInPath(49, 10), false, "ctx.isPointInPath(49, 10)", "false"); +_assertSame(ctx.isPointInPath(51, 10), true, "ctx.isPointInPath(51, 10)", "true"); +_assertSame(ctx.isPointInPath(69, 10), true, "ctx.isPointInPath(69, 10)", "true"); +_assertSame(ctx.isPointInPath(71, 10), false, "ctx.isPointInPath(71, 10)", "false"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.unclosed.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.unclosed.js new file mode 100644 index 0000000..38722b1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.unclosed.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.moveTo(0, 0); +ctx.lineTo(20, 0); +ctx.lineTo(20, 20); +ctx.lineTo(0, 20); +_assertSame(ctx.isPointInPath(10, 10), true, "ctx.isPointInPath(10, 10)", "true"); +_assertSame(ctx.isPointInPath(30, 10), false, "ctx.isPointInPath(30, 10)", "false"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.winding.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.winding.js new file mode 100644 index 0000000..5ca7f65 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.isPointInPath.winding.js @@ -0,0 +1,26 @@ +_addTest(function(canvas, ctx) { + +// Create a square ring, using opposite windings to make a hole in the centre +ctx.moveTo(0, 0); +ctx.lineTo(50, 0); +ctx.lineTo(50, 50); +ctx.lineTo(0, 50); +ctx.lineTo(0, 0); +ctx.lineTo(10, 10); +ctx.lineTo(10, 40); +ctx.lineTo(40, 40); +ctx.lineTo(40, 10); +ctx.lineTo(10, 10); + +_assertSame(ctx.isPointInPath(5, 5), true, "ctx.isPointInPath(5, 5)", "true"); +_assertSame(ctx.isPointInPath(25, 5), true, "ctx.isPointInPath(25, 5)", "true"); +_assertSame(ctx.isPointInPath(45, 5), true, "ctx.isPointInPath(45, 5)", "true"); +_assertSame(ctx.isPointInPath(5, 25), true, "ctx.isPointInPath(5, 25)", "true"); +_assertSame(ctx.isPointInPath(25, 25), false, "ctx.isPointInPath(25, 25)", "false"); +_assertSame(ctx.isPointInPath(45, 25), true, "ctx.isPointInPath(45, 25)", "true"); +_assertSame(ctx.isPointInPath(5, 45), true, "ctx.isPointInPath(5, 45)", "true"); +_assertSame(ctx.isPointInPath(25, 45), true, "ctx.isPointInPath(25, 45)", "true"); +_assertSame(ctx.isPointInPath(45, 45), true, "ctx.isPointInPath(45, 45)", "true"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.lineTo.basic.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.lineTo.basic.js new file mode 100644 index 0000000..1967cfc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.lineTo.basic.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 50; +ctx.beginPath(); +ctx.moveTo(0, 25); +ctx.lineTo(100, 25); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.lineTo.ensuresubpath.1.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.lineTo.ensuresubpath.1.js new file mode 100644 index 0000000..bb1037d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.lineTo.ensuresubpath.1.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 50; +ctx.beginPath(); +ctx.lineTo(100, 50); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.lineTo.ensuresubpath.2.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.lineTo.ensuresubpath.2.js new file mode 100644 index 0000000..b15887a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.lineTo.ensuresubpath.2.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 50; +ctx.beginPath(); +ctx.lineTo(0, 25); +ctx.lineTo(100, 25); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.lineTo.nextpoint.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.lineTo.nextpoint.js new file mode 100644 index 0000000..084edb0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.lineTo.nextpoint.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 50; +ctx.beginPath(); +ctx.moveTo(-100, -100); +ctx.lineTo(0, 25); +ctx.lineTo(100, 25); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.lineTo.nonfinite.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.lineTo.nonfinite.js new file mode 100644 index 0000000..b25e811 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.lineTo.nonfinite.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +ctx.moveTo(0, 0); +ctx.lineTo(100, 0); +ctx.lineTo(Infinity, 50); +ctx.lineTo(-Infinity, 50); +ctx.lineTo(NaN, 50); +ctx.lineTo(0, Infinity); +ctx.lineTo(0, -Infinity); +ctx.lineTo(0, NaN); +ctx.lineTo(Infinity, Infinity); +ctx.lineTo(100, 50); +ctx.lineTo(0, 50); +ctx.fillStyle = '#0f0'; +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 90,45, 0,255,0,255, "90,45", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.moveTo.basic.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.moveTo.basic.js new file mode 100644 index 0000000..8b6766e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.moveTo.basic.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.rect(0, 0, 10, 50); +ctx.moveTo(100, 0); +ctx.lineTo(10, 0); +ctx.lineTo(10, 50); +ctx.lineTo(100, 50); +ctx.fillStyle = '#0f0'; +ctx.fill(); +_assertPixel(canvas, 90,25, 0,255,0,255, "90,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.moveTo.multiple.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.moveTo.multiple.js new file mode 100644 index 0000000..46082e1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.moveTo.multiple.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.moveTo(0, 25); +ctx.moveTo(100, 25); +ctx.moveTo(0, 25); +ctx.lineTo(100, 25); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 50; +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.moveTo.newsubpath.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.moveTo.newsubpath.js new file mode 100644 index 0000000..5216d3d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.moveTo.newsubpath.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.beginPath(); +ctx.moveTo(0, 0); +ctx.moveTo(100, 0); +ctx.moveTo(100, 50); +ctx.moveTo(0, 50); +ctx.fillStyle = '#f00'; +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.moveTo.nonfinite.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.moveTo.nonfinite.js new file mode 100644 index 0000000..1925721 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.moveTo.nonfinite.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.moveTo(0, 0); +ctx.lineTo(100, 0); +ctx.moveTo(Infinity, 50); +ctx.moveTo(-Infinity, 50); +ctx.moveTo(NaN, 50); +ctx.moveTo(0, Infinity); +ctx.moveTo(0, -Infinity); +ctx.moveTo(0, NaN); +ctx.moveTo(Infinity, Infinity); +ctx.lineTo(100, 50); +ctx.lineTo(0, 50); +ctx.fillStyle = '#0f0'; +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.quadraticCurveTo.basic.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.quadraticCurveTo.basic.js new file mode 100644 index 0000000..bd962f2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.quadraticCurveTo.basic.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 50; +ctx.beginPath(); +ctx.moveTo(0, 25); +ctx.quadraticCurveTo(100, 25, 100, 25); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.quadraticCurveTo.ensuresubpath.1.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.quadraticCurveTo.ensuresubpath.1.js new file mode 100644 index 0000000..ac66e98 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.quadraticCurveTo.ensuresubpath.1.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 50; +ctx.beginPath(); +ctx.quadraticCurveTo(100, 50, 200, 50); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 95,45, 0,255,0,255, "95,45", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.quadraticCurveTo.ensuresubpath.2.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.quadraticCurveTo.ensuresubpath.2.js new file mode 100644 index 0000000..f9c0536 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.quadraticCurveTo.ensuresubpath.2.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 50; +ctx.beginPath(); +ctx.quadraticCurveTo(0, 25, 100, 25); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 5,45, 0,255,0,255, "5,45", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.quadraticCurveTo.nonfinite.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.quadraticCurveTo.nonfinite.js new file mode 100644 index 0000000..668cee8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.quadraticCurveTo.nonfinite.js @@ -0,0 +1,36 @@ +_addTest(function(canvas, ctx) { + +ctx.moveTo(0, 0); +ctx.lineTo(100, 0); +ctx.quadraticCurveTo(Infinity, 50, 0, 50); +ctx.quadraticCurveTo(-Infinity, 50, 0, 50); +ctx.quadraticCurveTo(NaN, 50, 0, 50); +ctx.quadraticCurveTo(0, Infinity, 0, 50); +ctx.quadraticCurveTo(0, -Infinity, 0, 50); +ctx.quadraticCurveTo(0, NaN, 0, 50); +ctx.quadraticCurveTo(0, 50, Infinity, 50); +ctx.quadraticCurveTo(0, 50, -Infinity, 50); +ctx.quadraticCurveTo(0, 50, NaN, 50); +ctx.quadraticCurveTo(0, 50, 0, Infinity); +ctx.quadraticCurveTo(0, 50, 0, -Infinity); +ctx.quadraticCurveTo(0, 50, 0, NaN); +ctx.quadraticCurveTo(Infinity, Infinity, 0, 50); +ctx.quadraticCurveTo(Infinity, Infinity, Infinity, 50); +ctx.quadraticCurveTo(Infinity, Infinity, Infinity, Infinity); +ctx.quadraticCurveTo(Infinity, Infinity, 0, Infinity); +ctx.quadraticCurveTo(Infinity, 50, Infinity, 50); +ctx.quadraticCurveTo(Infinity, 50, Infinity, Infinity); +ctx.quadraticCurveTo(Infinity, 50, 0, Infinity); +ctx.quadraticCurveTo(0, Infinity, Infinity, 50); +ctx.quadraticCurveTo(0, Infinity, Infinity, Infinity); +ctx.quadraticCurveTo(0, Infinity, 0, Infinity); +ctx.quadraticCurveTo(0, 50, Infinity, Infinity); +ctx.lineTo(100, 50); +ctx.lineTo(0, 50); +ctx.fillStyle = '#0f0'; +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 90,45, 0,255,0,255, "90,45", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.quadraticCurveTo.scaled.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.quadraticCurveTo.scaled.js new file mode 100644 index 0000000..4ba2c00 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.quadraticCurveTo.scaled.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.scale(1000, 1000); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 0.055; +ctx.beginPath(); +ctx.moveTo(-1, 1.05); +ctx.quadraticCurveTo(0, -1, 1.2, 1.05); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.quadraticCurveTo.shape.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.quadraticCurveTo.shape.js new file mode 100644 index 0000000..214f05a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.quadraticCurveTo.shape.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 55; +ctx.beginPath(); +ctx.moveTo(-1000, 1050); +ctx.quadraticCurveTo(0, -1000, 1200, 1050); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.basic.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.basic.js new file mode 100644 index 0000000..ff8909d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.basic.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.rect(0, 0, 100, 50); +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.closed.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.closed.js new file mode 100644 index 0000000..a045caa --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.closed.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 200; +ctx.lineJoin = 'miter'; +ctx.rect(100, 50, 100, 100); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.end.1.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.end.1.js new file mode 100644 index 0000000..933861b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.end.1.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 100; +ctx.rect(200, 100, 400, 1000); +ctx.lineTo(-2000, -1000); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.end.2.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.end.2.js new file mode 100644 index 0000000..6f01fc9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.end.2.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 450; +ctx.lineCap = 'round'; +ctx.lineJoin = 'bevel'; +ctx.rect(150, 150, 2000, 2000); +ctx.lineTo(160, 160); +ctx.stroke(); +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.negative.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.negative.js new file mode 100644 index 0000000..daf8eae --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.negative.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.beginPath(); +ctx.fillStyle = '#0f0'; +ctx.rect(0, 0, 50, 25); +ctx.rect(100, 0, -50, 25); +ctx.rect(0, 50, 50, -25); +ctx.rect(100, 50, -50, -25); +ctx.fill(); +_assertPixel(canvas, 25,12, 0,255,0,255, "25,12", "0,255,0,255"); +_assertPixel(canvas, 75,12, 0,255,0,255, "75,12", "0,255,0,255"); +_assertPixel(canvas, 25,37, 0,255,0,255, "25,37", "0,255,0,255"); +_assertPixel(canvas, 75,37, 0,255,0,255, "75,37", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.newsubpath.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.newsubpath.js new file mode 100644 index 0000000..edec4c6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.newsubpath.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.beginPath(); +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 50; +ctx.moveTo(-100, 25); +ctx.lineTo(-50, 25); +ctx.rect(200, 25, 1, 1); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.nonfinite.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.nonfinite.js new file mode 100644 index 0000000..f256cd2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.nonfinite.js @@ -0,0 +1,36 @@ +_addTest(function(canvas, ctx) { + +ctx.moveTo(0, 0); +ctx.lineTo(100, 0); +ctx.rect(Infinity, 50, 1, 1); +ctx.rect(-Infinity, 50, 1, 1); +ctx.rect(NaN, 50, 1, 1); +ctx.rect(0, Infinity, 1, 1); +ctx.rect(0, -Infinity, 1, 1); +ctx.rect(0, NaN, 1, 1); +ctx.rect(0, 50, Infinity, 1); +ctx.rect(0, 50, -Infinity, 1); +ctx.rect(0, 50, NaN, 1); +ctx.rect(0, 50, 1, Infinity); +ctx.rect(0, 50, 1, -Infinity); +ctx.rect(0, 50, 1, NaN); +ctx.rect(Infinity, Infinity, 1, 1); +ctx.rect(Infinity, Infinity, Infinity, 1); +ctx.rect(Infinity, Infinity, Infinity, Infinity); +ctx.rect(Infinity, Infinity, 1, Infinity); +ctx.rect(Infinity, 50, Infinity, 1); +ctx.rect(Infinity, 50, Infinity, Infinity); +ctx.rect(Infinity, 50, 1, Infinity); +ctx.rect(0, Infinity, Infinity, 1); +ctx.rect(0, Infinity, Infinity, Infinity); +ctx.rect(0, Infinity, 1, Infinity); +ctx.rect(0, 50, Infinity, Infinity); +ctx.lineTo(100, 50); +ctx.lineTo(0, 50); +ctx.fillStyle = '#0f0'; +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 90,45, 0,255,0,255, "90,45", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.selfintersect.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.selfintersect.js new file mode 100644 index 0000000..175749a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.selfintersect.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 90; +ctx.beginPath(); +ctx.rect(45, 20, 10, 10); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.winding.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.winding.js new file mode 100644 index 0000000..965bce2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.winding.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.beginPath(); +ctx.fillStyle = '#f00'; +ctx.rect(0, 0, 50, 50); +ctx.rect(100, 50, -50, -50); +ctx.rect(0, 25, 100, -25); +ctx.rect(100, 25, -100, 25); +ctx.fill(); +_assertPixel(canvas, 25,12, 0,255,0,255, "25,12", "0,255,0,255"); +_assertPixel(canvas, 75,12, 0,255,0,255, "75,12", "0,255,0,255"); +_assertPixel(canvas, 25,37, 0,255,0,255, "25,37", "0,255,0,255"); +_assertPixel(canvas, 75,37, 0,255,0,255, "75,37", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.zero.1.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.zero.1.js new file mode 100644 index 0000000..9bee74f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.zero.1.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 100; +ctx.beginPath(); +ctx.rect(0, 50, 100, 0); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.zero.2.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.zero.2.js new file mode 100644 index 0000000..eefaa2c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.zero.2.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 100; +ctx.beginPath(); +ctx.rect(50, -100, 0, 250); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.zero.3.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.zero.3.js new file mode 100644 index 0000000..720f299 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.zero.3.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 100; +ctx.beginPath(); +ctx.rect(50, 25, 0, 0); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.zero.4.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.zero.4.js new file mode 100644 index 0000000..bae9388 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.zero.4.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 50; +ctx.rect(100, 25, 0, 0); +ctx.lineTo(0, 25); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.zero.5.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.zero.5.js new file mode 100644 index 0000000..55c35cc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.zero.5.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 50; +ctx.moveTo(0, 0); +ctx.rect(100, 25, 0, 0); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.zero.6.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.zero.6.js new file mode 100644 index 0000000..a5f7d54 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.rect.zero.6.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.lineJoin = 'miter'; +ctx.miterLimit = 1.5; +ctx.lineWidth = 200; +ctx.beginPath(); +ctx.rect(100, 25, 1000, 0); +ctx.stroke(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.stroke.empty.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.stroke.empty.js new file mode 100644 index 0000000..4be7dbf --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.stroke.empty.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 100; +ctx.lineCap = 'round'; +ctx.lineJoin = 'round'; + +ctx.beginPath(); +ctx.moveTo(40, 25); +ctx.moveTo(60, 25); +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.stroke.overlap.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.stroke.overlap.js new file mode 100644 index 0000000..ba1dfee --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.stroke.overlap.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#000'; +ctx.fillRect(0, 0, 100, 50); + +ctx.strokeStyle = 'rgba(0, 255, 0, 0.5)'; +ctx.lineWidth = 50; +ctx.moveTo(0, 20); +ctx.lineTo(100, 20); +ctx.moveTo(0, 30); +ctx.lineTo(100, 30); +ctx.stroke(); + +_assertPixelApprox(canvas, 50,25, 0,127,0,255, "50,25", "0,127,0,255", 1); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.stroke.prune.arc.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.stroke.prune.arc.js new file mode 100644 index 0000000..5b0d46c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.stroke.prune.arc.js @@ -0,0 +1,24 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 100; +ctx.lineCap = 'round'; +ctx.lineJoin = 'round'; + +ctx.beginPath(); +ctx.moveTo(50, 25); +ctx.arcTo(50, 25, 150, 25, 10); +ctx.stroke(); + +ctx.beginPath(); +ctx.moveTo(50, 25); +ctx.arc(50, 25, 10, 0, 0, false); +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.stroke.prune.closed.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.stroke.prune.closed.js new file mode 100644 index 0000000..b90942c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.stroke.prune.closed.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 100; +ctx.lineCap = 'round'; +ctx.lineJoin = 'round'; + +ctx.beginPath(); +ctx.moveTo(50, 25); +ctx.lineTo(50, 25); +ctx.closePath(); +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.stroke.prune.corner.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.stroke.prune.corner.js new file mode 100644 index 0000000..53278d3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.stroke.prune.corner.js @@ -0,0 +1,22 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 400; +ctx.lineJoin = 'miter'; +ctx.miterLimit = 1.4; + +ctx.beginPath(); +ctx.moveTo(-1000, 200, 0, 0); +ctx.lineTo(-100, 200); +ctx.lineTo(-100, 200); +ctx.lineTo(-100, 200); +ctx.lineTo(-100, 1000); +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.stroke.prune.curve.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.stroke.prune.curve.js new file mode 100644 index 0000000..1638bb1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.stroke.prune.curve.js @@ -0,0 +1,24 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 100; +ctx.lineCap = 'round'; +ctx.lineJoin = 'round'; + +ctx.beginPath(); +ctx.moveTo(50, 25); +ctx.quadraticCurveTo(50, 25, 50, 25); +ctx.stroke(); + +ctx.beginPath(); +ctx.moveTo(50, 25); +ctx.bezierCurveTo(50, 25, 50, 25, 50, 25); +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.stroke.prune.line.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.stroke.prune.line.js new file mode 100644 index 0000000..08b92f4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.stroke.prune.line.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 100; +ctx.lineCap = 'round'; +ctx.lineJoin = 'round'; + +ctx.beginPath(); +ctx.moveTo(50, 25); +ctx.lineTo(50, 25); +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.stroke.prune.rect.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.stroke.prune.rect.js new file mode 100644 index 0000000..ba98361 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.stroke.prune.rect.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 100; +ctx.lineCap = 'round'; +ctx.lineJoin = 'round'; + +ctx.beginPath(); +ctx.rect(50, 25, 0, 0); +ctx.stroke(); + +ctx.strokeRect(50, 25, 0, 0); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.stroke.scale1.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.stroke.scale1.js new file mode 100644 index 0000000..87b2f2c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.stroke.scale1.js @@ -0,0 +1,33 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.beginPath(); +ctx.rect(25, 12.5, 50, 25); +ctx.save(); +ctx.scale(50, 25); +ctx.strokeStyle = '#0f0'; +ctx.stroke(); +ctx.restore(); + +ctx.beginPath(); +ctx.rect(-25, -12.5, 150, 75); +ctx.save(); +ctx.scale(50, 25); +ctx.strokeStyle = '#f00'; +ctx.stroke(); +ctx.restore(); + +_assertPixel(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255"); +_assertPixel(canvas, 50,0, 0,255,0,255, "50,0", "0,255,0,255"); +_assertPixel(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255"); +_assertPixel(canvas, 0,25, 0,255,0,255, "0,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 99,25, 0,255,0,255, "99,25", "0,255,0,255"); +_assertPixel(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255"); +_assertPixel(canvas, 50,49, 0,255,0,255, "50,49", "0,255,0,255"); +_assertPixel(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.stroke.scale2.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.stroke.scale2.js new file mode 100644 index 0000000..3a0f188 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.stroke.scale2.js @@ -0,0 +1,35 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.beginPath(); +ctx.rect(25, 12.5, 50, 25); +ctx.save(); +ctx.rotate(Math.PI/2); +ctx.scale(25, 50); +ctx.strokeStyle = '#0f0'; +ctx.stroke(); +ctx.restore(); + +ctx.beginPath(); +ctx.rect(-25, -12.5, 150, 75); +ctx.save(); +ctx.rotate(Math.PI/2); +ctx.scale(25, 50); +ctx.strokeStyle = '#f00'; +ctx.stroke(); +ctx.restore(); + +_assertPixel(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255"); +_assertPixel(canvas, 50,0, 0,255,0,255, "50,0", "0,255,0,255"); +_assertPixel(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255"); +_assertPixel(canvas, 0,25, 0,255,0,255, "0,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 99,25, 0,255,0,255, "99,25", "0,255,0,255"); +_assertPixel(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255"); +_assertPixel(canvas, 50,49, 0,255,0,255, "50,49", "0,255,0,255"); +_assertPixel(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.stroke.skew.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.stroke.skew.js new file mode 100644 index 0000000..acb4888 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.stroke.skew.js @@ -0,0 +1,49 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.save(); +ctx.beginPath(); +ctx.moveTo(49, -50); +ctx.lineTo(201, -50); +ctx.rotate(Math.PI/4); +ctx.scale(1, 283); +ctx.strokeStyle = '#0f0'; +ctx.stroke(); +ctx.restore(); + +ctx.save(); +ctx.beginPath(); +ctx.translate(-150, 0); +ctx.moveTo(49, -50); +ctx.lineTo(199, -50); +ctx.rotate(Math.PI/4); +ctx.scale(1, 142); +ctx.strokeStyle = '#f00'; +ctx.stroke(); +ctx.restore(); + +ctx.save(); +ctx.beginPath(); +ctx.translate(-150, 0); +ctx.moveTo(49, -50); +ctx.lineTo(199, -50); +ctx.rotate(Math.PI/4); +ctx.scale(1, 142); +ctx.strokeStyle = '#f00'; +ctx.stroke(); +ctx.restore(); + +_assertPixel(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255"); +_assertPixel(canvas, 50,0, 0,255,0,255, "50,0", "0,255,0,255"); +_assertPixel(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255"); +_assertPixel(canvas, 0,25, 0,255,0,255, "0,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 99,25, 0,255,0,255, "99,25", "0,255,0,255"); +_assertPixel(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255"); +_assertPixel(canvas, 50,49, 0,255,0,255, "50,49", "0,255,0,255"); +_assertPixel(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.stroke.unaffected.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.stroke.unaffected.js new file mode 100644 index 0000000..087c5a7 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.stroke.unaffected.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.lineWidth = 50; +ctx.moveTo(-100, 25); +ctx.lineTo(-100, -100); +ctx.lineTo(200, -100); +ctx.lineTo(200, 25); +ctx.strokeStyle = '#f00'; +ctx.stroke(); + +ctx.closePath(); +ctx.strokeStyle = '#0f0'; +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.stroke.union.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.stroke.union.js new file mode 100644 index 0000000..47fa81c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.stroke.union.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 40; +ctx.moveTo(0, 10); +ctx.lineTo(100, 10); +ctx.moveTo(100, 40); +ctx.lineTo(0, 40); +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.transformation.basic.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.transformation.basic.js new file mode 100644 index 0000000..faf5348 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.transformation.basic.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.translate(-100, 0); +ctx.rect(100, 0, 100, 50); +ctx.translate(0, -100); +ctx.fillStyle = '#0f0'; +ctx.fill(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.transformation.changing.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.transformation.changing.js new file mode 100644 index 0000000..4fe7bf4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.transformation.changing.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.moveTo(0, 0); +ctx.translate(100, 0); +ctx.lineTo(0, 0); +ctx.translate(0, 50); +ctx.lineTo(0, 0); +ctx.translate(-100, 0); +ctx.lineTo(0, 0); +ctx.translate(1000, 1000); +ctx.rotate(Math.PI/2); +ctx.scale(0.1, 0.1); +ctx.fill(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.path.transformation.multiple.js b/platforms/ios/www/test/tests-todo/minimal.2d.path.transformation.multiple.js new file mode 100644 index 0000000..601d25d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.path.transformation.multiple.js @@ -0,0 +1,26 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#f00'; +ctx.translate(-100, 0); +ctx.rect(0, 0, 100, 50); +ctx.fill(); +ctx.translate(100, 0); +ctx.fill(); + +ctx.beginPath(); +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 50; +ctx.translate(0, -50); +ctx.moveTo(0, 25); +ctx.lineTo(100, 25); +ctx.stroke(); +ctx.translate(0, 50); +ctx.stroke(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.pattern.animated.gif.js b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.animated.gif.js new file mode 100644 index 0000000..03c155f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.animated.gif.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +deferTest(); +setTimeout(function () { + var pattern = ctx.createPattern(document.getElementById('anim-gr.gif'), 'repeat'); + ctx.fillStyle = pattern; + ctx.fillRect(0, 0, 50, 50); + setTimeout(wrapFunction(function () { + ctx.fillRect(50, 0, 50, 50); + _assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2); + _assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2); + }), 250); +}, 250); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.pattern.basic.canvas.js b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.basic.canvas.js new file mode 100644 index 0000000..c19b8fc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.basic.canvas.js @@ -0,0 +1,28 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = '#0f0'; +ctx2.fillRect(0, 0, 100, 50); + +var pattern = ctx.createPattern(canvas2, 'no-repeat'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.pattern.basic.image.js b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.basic.image.js new file mode 100644 index 0000000..1049cb8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.basic.image.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +var img = document.getElementById('green.png'); +var pattern = ctx.createPattern(img, 'no-repeat'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.pattern.basic.nocontext.js b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.basic.nocontext.js new file mode 100644 index 0000000..f4eba65 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.basic.nocontext.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var pattern = ctx.createPattern(canvas2, 'no-repeat'); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.pattern.basic.type.js b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.basic.type.js new file mode 100644 index 0000000..4273479 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.basic.type.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +_assertDifferent(window.CanvasPattern, undefined, "window.CanvasPattern", "undefined"); + +window.CanvasPattern.prototype.thisImplementsCanvasPattern = true; + +var img = document.getElementById('green.png'); +var pattern = ctx.createPattern(img, 'no-repeat'); +_assert(pattern.thisImplementsCanvasPattern, "pattern.thisImplementsCanvasPattern"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.pattern.basic.zerocanvas.js b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.basic.zerocanvas.js new file mode 100644 index 0000000..e70aba7 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.basic.zerocanvas.js @@ -0,0 +1,28 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 0; +canvas.height = 10; +_assertSame(canvas.width, 0, "canvas.width", "0"); +_assertSame(canvas.height, 10, "canvas.height", "10"); +try { var _thrown = false; + ctx.createPattern(canvas, 'repeat'); +} catch (e) { if (e.code != DOMException.INVALID_STATE_ERR) _fail("Failed assertion: expected exception of type INVALID_STATE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INVALID_STATE_ERR: ctx.createPattern(canvas, 'repeat')"); } + +canvas.width = 10; +canvas.height = 0; +_assertSame(canvas.width, 10, "canvas.width", "10"); +_assertSame(canvas.height, 0, "canvas.height", "0"); +try { var _thrown = false; + ctx.createPattern(canvas, 'repeat'); +} catch (e) { if (e.code != DOMException.INVALID_STATE_ERR) _fail("Failed assertion: expected exception of type INVALID_STATE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INVALID_STATE_ERR: ctx.createPattern(canvas, 'repeat')"); } + +canvas.width = 0; +canvas.height = 0; +_assertSame(canvas.width, 0, "canvas.width", "0"); +_assertSame(canvas.height, 0, "canvas.height", "0"); +try { var _thrown = false; + ctx.createPattern(canvas, 'repeat'); +} catch (e) { if (e.code != DOMException.INVALID_STATE_ERR) _fail("Failed assertion: expected exception of type INVALID_STATE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INVALID_STATE_ERR: ctx.createPattern(canvas, 'repeat')"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.pattern.crosscanvas.js b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.crosscanvas.js new file mode 100644 index 0000000..c4251d3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.crosscanvas.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +var img = document.getElementById('green.png'); + +var pattern = document.createElement('canvas').getContext('2d').createPattern(img, 'no-repeat'); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.pattern.image.broken.js b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.image.broken.js new file mode 100644 index 0000000..422048a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.image.broken.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +var img = document.getElementById('broken.png'); +_assertSame(img.complete, false, "img.complete", "false"); +_assertSame(ctx.createPattern(img, 'repeat'), null, "ctx.createPattern(img, 'repeat')", "null"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.pattern.image.incomplete.js b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.image.incomplete.js new file mode 100644 index 0000000..3764e83 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.image.incomplete.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +var img = new Image(); +_assertSame(img.complete, false, "img.complete", "false"); +_assertSame(ctx.createPattern(img, 'repeat'), null, "ctx.createPattern(img, 'repeat')", "null"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.pattern.image.null.js b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.image.null.js new file mode 100644 index 0000000..75e4549 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.image.null.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.createPattern(null, 'repeat'); +} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail("Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TYPE_MISMATCH_ERR: ctx.createPattern(null, 'repeat')"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.pattern.image.string.js b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.image.string.js new file mode 100644 index 0000000..3f1d4a0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.image.string.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.createPattern('../images/red.png', 'repeat'); +} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail("Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TYPE_MISMATCH_ERR: ctx.createPattern('../images/red.png', 'repeat')"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.pattern.image.undefined.js b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.image.undefined.js new file mode 100644 index 0000000..052b250 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.image.undefined.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.createPattern(undefined, 'repeat'); +} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail("Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TYPE_MISMATCH_ERR: ctx.createPattern(undefined, 'repeat')"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.pattern.modify.canvas1.js b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.modify.canvas1.js new file mode 100644 index 0000000..2500755 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.modify.canvas1.js @@ -0,0 +1,24 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = '#0f0'; +ctx2.fillRect(0, 0, 100, 50); + +var pattern = ctx.createPattern(canvas2, 'no-repeat'); + +ctx2.fillStyle = '#f00'; +ctx2.fillRect(0, 0, 100, 50); + +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.pattern.modify.canvas2.js b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.modify.canvas2.js new file mode 100644 index 0000000..d6f8a67 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.modify.canvas2.js @@ -0,0 +1,28 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = '#0f0'; +ctx2.fillRect(0, 0, 100, 50); + +var pattern = ctx.createPattern(canvas2, 'no-repeat'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx2.fillStyle = '#f00'; +ctx2.fillRect(0, 0, 100, 50); + +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.pattern.modify.image1.js b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.modify.image1.js new file mode 100644 index 0000000..32fcb86 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.modify.image1.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +var img = document.getElementById('green.png'); +var pattern = ctx.createPattern(img, 'no-repeat'); +deferTest(); +img.onload = wrapFunction(function () +{ + ctx.fillStyle = pattern; + ctx.fillRect(0, 0, 100, 50); + + _assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); + _assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); + _assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + _assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); +}); +img.src = '../images/red.png'; + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.pattern.modify.image2.js b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.modify.image2.js new file mode 100644 index 0000000..26b5aa1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.modify.image2.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +var img = document.getElementById('green.png'); +var pattern = ctx.createPattern(img, 'no-repeat'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#00f'; +ctx.fillRect(0, 0, 100, 50); +deferTest(); +img.onload = wrapFunction(function () +{ + ctx.fillStyle = pattern; + ctx.fillRect(0, 0, 100, 50); + + _assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); + _assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); + _assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + _assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); +}); +img.src = '../images/red.png'; + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.norepeat.basic.js b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.norepeat.basic.js new file mode 100644 index 0000000..37d5310 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.norepeat.basic.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('green.png'); +var pattern = ctx.createPattern(img, 'no-repeat'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.norepeat.coord1.js b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.norepeat.coord1.js new file mode 100644 index 0000000..8e66bcd --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.norepeat.coord1.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 50, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(50, 0, 50, 50); + +var img = document.getElementById('green.png'); +var pattern = ctx.createPattern(img, 'no-repeat'); +ctx.fillStyle = pattern; +ctx.translate(50, 0); +ctx.fillRect(-50, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.norepeat.coord2.js b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.norepeat.coord2.js new file mode 100644 index 0000000..d09b6ed --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.norepeat.coord2.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +var img = document.getElementById('green.png'); +var pattern = ctx.createPattern(img, 'no-repeat'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 50, 50); + +ctx.fillStyle = '#f00'; +ctx.fillRect(50, 0, 50, 50); + +ctx.fillStyle = pattern; +ctx.translate(50, 0); +ctx.fillRect(-50, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.norepeat.coord3.js b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.norepeat.coord3.js new file mode 100644 index 0000000..b4b0cc8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.norepeat.coord3.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('red.png'); +var pattern = ctx.createPattern(img, 'no-repeat'); +ctx.fillStyle = pattern; +ctx.translate(50, 25); +ctx.fillRect(-50, -25, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 50, 25); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.norepeat.outside.js b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.norepeat.outside.js new file mode 100644 index 0000000..8dddb46 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.norepeat.outside.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('red.png'); +var pattern = ctx.createPattern(img, 'no-repeat'); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = pattern; +ctx.fillRect(0, -50, 100, 50); +ctx.fillRect(-100, 0, 100, 50); +ctx.fillRect(0, 50, 100, 50); +ctx.fillRect(100, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.orientation.canvas.js b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.orientation.canvas.js new file mode 100644 index 0000000..4492b71 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.orientation.canvas.js @@ -0,0 +1,27 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = '#f00'; +ctx2.fillRect(0, 0, 100, 25); +ctx2.fillStyle = '#0f0'; +ctx2.fillRect(0, 25, 100, 25); + +var pattern = ctx.createPattern(canvas2, 'no-repeat'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 25); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.orientation.image.js b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.orientation.image.js new file mode 100644 index 0000000..1f0f031 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.orientation.image.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('rrgg-256x256.png'); +var pattern = ctx.createPattern(img, 'no-repeat'); +ctx.fillStyle = pattern; +ctx.save(); +ctx.translate(0, -103); +ctx.fillRect(0, 103, 100, 50); +ctx.restore(); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 25); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.repeat.basic.js b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.repeat.basic.js new file mode 100644 index 0000000..ee19c77 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.repeat.basic.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('green-16x16.png'); +var pattern = ctx.createPattern(img, 'repeat'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.repeat.coord1.js b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.repeat.coord1.js new file mode 100644 index 0000000..d3c9c4d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.repeat.coord1.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('rgrg-256x256.png'); +var pattern = ctx.createPattern(img, 'repeat'); +ctx.fillStyle = pattern; +ctx.translate(-128, -78); +ctx.fillRect(128, 78, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.repeat.coord2.js b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.repeat.coord2.js new file mode 100644 index 0000000..2939568 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.repeat.coord2.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +var img = document.getElementById('ggrr-256x256.png'); +var pattern = ctx.createPattern(img, 'repeat'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.repeat.coord3.js b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.repeat.coord3.js new file mode 100644 index 0000000..0879ca3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.repeat.coord3.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +var img = document.getElementById('rgrg-256x256.png'); +var pattern = ctx.createPattern(img, 'repeat'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +ctx.translate(-128, -78); +ctx.fillRect(128, 78, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.repeat.outside.js b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.repeat.outside.js new file mode 100644 index 0000000..9727f0b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.repeat.outside.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('green-16x16.png'); +var pattern = ctx.createPattern(img, 'repeat'); +ctx.fillStyle = pattern; +ctx.translate(50, 25); +ctx.fillRect(-50, -25, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.repeatx.basic.js b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.repeatx.basic.js new file mode 100644 index 0000000..e113835 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.repeatx.basic.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 16); + +var img = document.getElementById('green-16x16.png'); +var pattern = ctx.createPattern(img, 'repeat-x'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.repeatx.coord1.js b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.repeatx.coord1.js new file mode 100644 index 0000000..b151153 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.repeatx.coord1.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('red-16x16.png'); +var pattern = ctx.createPattern(img, 'repeat-x'); +ctx.fillStyle = pattern; +ctx.translate(0, 16); +ctx.fillRect(0, -16, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 16); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.repeatx.outside.js b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.repeatx.outside.js new file mode 100644 index 0000000..d2ef7eb --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.repeatx.outside.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('red-16x16.png'); +var pattern = ctx.createPattern(img, 'repeat-x'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 16); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.repeaty.basic.js b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.repeaty.basic.js new file mode 100644 index 0000000..1b7feda --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.repeaty.basic.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 16, 50); + +var img = document.getElementById('green-16x16.png'); +var pattern = ctx.createPattern(img, 'repeat-y'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.repeaty.coord1.js b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.repeaty.coord1.js new file mode 100644 index 0000000..2d5eb80 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.repeaty.coord1.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('red-16x16.png'); +var pattern = ctx.createPattern(img, 'repeat-y'); +ctx.fillStyle = pattern; +ctx.translate(48, 0); +ctx.fillRect(-48, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 16, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.repeaty.outside.js b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.repeaty.outside.js new file mode 100644 index 0000000..8125837 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.paint.repeaty.outside.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('red-16x16.png'); +var pattern = ctx.createPattern(img, 'repeat-y'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 16, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.pattern.repeat.case.js b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.repeat.case.js new file mode 100644 index 0000000..ad45bed --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.repeat.case.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.createPattern(canvas, "Repeat"); +} catch (e) { if (e.code != DOMException.SYNTAX_ERR) _fail("Failed assertion: expected exception of type SYNTAX_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type SYNTAX_ERR: ctx.createPattern(canvas, \"Repeat\")"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.pattern.repeat.empty.js b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.repeat.empty.js new file mode 100644 index 0000000..f251ed4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.repeat.empty.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +var img = document.getElementById('green-1x1.png'); +var pattern = ctx.createPattern(img, ""); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 200, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.pattern.repeat.null.js b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.repeat.null.js new file mode 100644 index 0000000..6a13765 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.repeat.null.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +var img = document.getElementById('green-1x1.png'); +var pattern = ctx.createPattern(img, null); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.pattern.repeat.nullsuffix.js b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.repeat.nullsuffix.js new file mode 100644 index 0000000..adf6eae --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.repeat.nullsuffix.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.createPattern(canvas, "repeat\0"); +} catch (e) { if (e.code != DOMException.SYNTAX_ERR) _fail("Failed assertion: expected exception of type SYNTAX_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type SYNTAX_ERR: ctx.createPattern(canvas, \"repeat\\0\")"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.pattern.repeat.undefined.js b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.repeat.undefined.js new file mode 100644 index 0000000..661cd0d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.repeat.undefined.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.createPattern(canvas, undefined); +} catch (e) { if (e.code != DOMException.SYNTAX_ERR) _fail("Failed assertion: expected exception of type SYNTAX_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type SYNTAX_ERR: ctx.createPattern(canvas, undefined)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.pattern.repeat.unrecognised.js b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.repeat.unrecognised.js new file mode 100644 index 0000000..d24500b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.pattern.repeat.unrecognised.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +try { var _thrown = false; + ctx.createPattern(canvas, "invalid"); +} catch (e) { if (e.code != DOMException.SYNTAX_ERR) _fail("Failed assertion: expected exception of type SYNTAX_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type SYNTAX_ERR: ctx.createPattern(canvas, \"invalid\")"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.scaled.js b/platforms/ios/www/test/tests-todo/minimal.2d.scaled.js new file mode 100644 index 0000000..3ed3b0e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.scaled.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#00f'; +ctx.fillRect(0, 0, 50, 25); +ctx.fillStyle = '#0ff'; +ctx.fillRect(0, 0, 25, 10); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.alpha.1.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.alpha.1.js new file mode 100644 index 0000000..1aac375 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.alpha.1.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = 'rgba(255, 0, 0, 0.01)'; +ctx.shadowOffsetY = 50; +ctx.fillRect(0, -50, 100, 50); + +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 4); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.alpha.2.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.alpha.2.js new file mode 100644 index 0000000..536144b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.alpha.2.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = 'rgba(0, 0, 255, 0.5)'; +ctx.shadowOffsetY = 50; +ctx.fillRect(0, -50, 100, 50); + +_assertPixelApprox(canvas, 50,25, 127,0,127,255, "50,25", "127,0,127,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.alpha.3.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.alpha.3.js new file mode 100644 index 0000000..2b89a2b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.alpha.3.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; // (work around broken Firefox globalAlpha caching) +ctx.shadowColor = '#00f'; +ctx.shadowOffsetY = 50; +ctx.globalAlpha = 0.5; +ctx.fillRect(0, -50, 100, 50); + +_assertPixelApprox(canvas, 50,25, 127,0,127,255, "50,25", "127,0,127,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.alpha.4.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.alpha.4.js new file mode 100644 index 0000000..9b7ac01 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.alpha.4.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; // (work around broken Firefox globalAlpha caching) +ctx.shadowColor = 'rgba(0, 0, 255, 0.707)'; +ctx.shadowOffsetY = 50; +ctx.globalAlpha = 0.707; +ctx.fillRect(0, -50, 100, 50); + +_assertPixelApprox(canvas, 50,25, 127,0,127,255, "50,25", "127,0,127,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.alpha.5.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.alpha.5.js new file mode 100644 index 0000000..71c396f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.alpha.5.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = 'rgba(64, 0, 0, 0.5)'; +ctx.shadowColor = '#00f'; +ctx.shadowOffsetY = 50; +ctx.fillRect(0, -50, 100, 50); + +_assertPixelApprox(canvas, 50,25, 127,0,127,255, "50,25", "127,0,127,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.attributes.shadowBlur.initial.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.attributes.shadowBlur.initial.js new file mode 100644 index 0000000..6410228 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.attributes.shadowBlur.initial.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(ctx.shadowBlur, 0, "ctx.shadowBlur", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.attributes.shadowBlur.invalid.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.attributes.shadowBlur.invalid.js new file mode 100644 index 0000000..a0a823a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.attributes.shadowBlur.invalid.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +ctx.shadowBlur = 1; +ctx.shadowBlur = -2; +_assertSame(ctx.shadowBlur, 1, "ctx.shadowBlur", "1"); + +ctx.shadowBlur = 1; +ctx.shadowBlur = Infinity; +_assertSame(ctx.shadowBlur, 1, "ctx.shadowBlur", "1"); + +ctx.shadowBlur = 1; +ctx.shadowBlur = -Infinity; +_assertSame(ctx.shadowBlur, 1, "ctx.shadowBlur", "1"); + +ctx.shadowBlur = 1; +ctx.shadowBlur = NaN; +_assertSame(ctx.shadowBlur, 1, "ctx.shadowBlur", "1"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.attributes.shadowBlur.valid.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.attributes.shadowBlur.valid.js new file mode 100644 index 0000000..0a02f2e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.attributes.shadowBlur.valid.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.shadowBlur = 1; +_assertSame(ctx.shadowBlur, 1, "ctx.shadowBlur", "1"); + +ctx.shadowBlur = 0.5; +_assertSame(ctx.shadowBlur, 0.5, "ctx.shadowBlur", "0.5"); + +ctx.shadowBlur = 1e6; +_assertSame(ctx.shadowBlur, 1e6, "ctx.shadowBlur", "1e6"); + +ctx.shadowBlur = 0; +_assertSame(ctx.shadowBlur, 0, "ctx.shadowBlur", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.attributes.shadowColor.initial.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.attributes.shadowColor.initial.js new file mode 100644 index 0000000..1d8539b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.attributes.shadowColor.initial.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(ctx.shadowColor, 'rgba(0, 0, 0, 0.0)', "ctx.shadowColor", "'rgba(0, 0, 0, 0.0)'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.attributes.shadowColor.invalid.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.attributes.shadowColor.invalid.js new file mode 100644 index 0000000..f287f30 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.attributes.shadowColor.invalid.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +ctx.shadowColor = '#00ff00'; +ctx.shadowColor = 'bogus'; +_assertSame(ctx.shadowColor, '#00ff00', "ctx.shadowColor", "'#00ff00'"); + +ctx.shadowColor = '#00ff00'; +ctx.shadowColor = 'red bogus'; +_assertSame(ctx.shadowColor, '#00ff00', "ctx.shadowColor", "'#00ff00'"); + +ctx.shadowColor = '#00ff00'; +ctx.shadowColor = ctx; +_assertSame(ctx.shadowColor, '#00ff00', "ctx.shadowColor", "'#00ff00'"); + +ctx.shadowColor = '#00ff00'; +ctx.shadowColor = undefined; +_assertSame(ctx.shadowColor, '#00ff00', "ctx.shadowColor", "'#00ff00'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.attributes.shadowColor.valid.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.attributes.shadowColor.valid.js new file mode 100644 index 0000000..02a5f5c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.attributes.shadowColor.valid.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.shadowColor = 'lime'; +_assertSame(ctx.shadowColor, '#00ff00', "ctx.shadowColor", "'#00ff00'"); + +ctx.shadowColor = 'RGBA(0,255, 0,0)'; +_assertSame(ctx.shadowColor, 'rgba(0, 255, 0, 0.0)', "ctx.shadowColor", "'rgba(0, 255, 0, 0.0)'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.attributes.shadowOffset.initial.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.attributes.shadowOffset.initial.js new file mode 100644 index 0000000..48cf0ca --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.attributes.shadowOffset.initial.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +_assertSame(ctx.shadowOffsetX, 0, "ctx.shadowOffsetX", "0"); +_assertSame(ctx.shadowOffsetY, 0, "ctx.shadowOffsetY", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.attributes.shadowOffset.invalid.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.attributes.shadowOffset.invalid.js new file mode 100644 index 0000000..4b9c04e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.attributes.shadowOffset.invalid.js @@ -0,0 +1,25 @@ +_addTest(function(canvas, ctx) { + +ctx.shadowOffsetX = 1; +ctx.shadowOffsetY = 2; +ctx.shadowOffsetX = Infinity; +ctx.shadowOffsetY = Infinity; +_assertSame(ctx.shadowOffsetX, 1, "ctx.shadowOffsetX", "1"); +_assertSame(ctx.shadowOffsetY, 2, "ctx.shadowOffsetY", "2"); + +ctx.shadowOffsetX = 1; +ctx.shadowOffsetY = 2; +ctx.shadowOffsetX = -Infinity; +ctx.shadowOffsetY = -Infinity; +_assertSame(ctx.shadowOffsetX, 1, "ctx.shadowOffsetX", "1"); +_assertSame(ctx.shadowOffsetY, 2, "ctx.shadowOffsetY", "2"); + +ctx.shadowOffsetX = 1; +ctx.shadowOffsetY = 2; +ctx.shadowOffsetX = NaN; +ctx.shadowOffsetY = NaN; +_assertSame(ctx.shadowOffsetX, 1, "ctx.shadowOffsetX", "1"); +_assertSame(ctx.shadowOffsetY, 2, "ctx.shadowOffsetY", "2"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.attributes.shadowOffset.valid.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.attributes.shadowOffset.valid.js new file mode 100644 index 0000000..75937f0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.attributes.shadowOffset.valid.js @@ -0,0 +1,29 @@ +_addTest(function(canvas, ctx) { + +ctx.shadowOffsetX = 1; +ctx.shadowOffsetY = 2; +_assertSame(ctx.shadowOffsetX, 1, "ctx.shadowOffsetX", "1"); +_assertSame(ctx.shadowOffsetY, 2, "ctx.shadowOffsetY", "2"); + +ctx.shadowOffsetX = 0.5; +ctx.shadowOffsetY = 0.25; +_assertSame(ctx.shadowOffsetX, 0.5, "ctx.shadowOffsetX", "0.5"); +_assertSame(ctx.shadowOffsetY, 0.25, "ctx.shadowOffsetY", "0.25"); + +ctx.shadowOffsetX = -0.5; +ctx.shadowOffsetY = -0.25; +_assertSame(ctx.shadowOffsetX, -0.5, "ctx.shadowOffsetX", "-0.5"); +_assertSame(ctx.shadowOffsetY, -0.25, "ctx.shadowOffsetY", "-0.25"); + +ctx.shadowOffsetX = 0; +ctx.shadowOffsetY = 0; +_assertSame(ctx.shadowOffsetX, 0, "ctx.shadowOffsetX", "0"); +_assertSame(ctx.shadowOffsetY, 0, "ctx.shadowOffsetY", "0"); + +ctx.shadowOffsetX = 1e6; +ctx.shadowOffsetY = 1e6; +_assertSame(ctx.shadowOffsetX, 1e6, "ctx.shadowOffsetX", "1e6"); +_assertSame(ctx.shadowOffsetY, 1e6, "ctx.shadowOffsetY", "1e6"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.blur.high.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.blur.high.js new file mode 100644 index 0000000..b3c9e4f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.blur.high.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#ff0'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = '#00f'; +ctx.shadowOffsetY = 0; +ctx.shadowBlur = 555.6; +ctx.fillRect(-200, -200, 200, 400); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.blur.low.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.blur.low.js new file mode 100644 index 0000000..9703121 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.blur.low.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#ff0'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = '#00f'; +ctx.shadowOffsetY = 25; +for (var x = 0; x < 100; ++x) { + ctx.save(); + ctx.beginPath(); + ctx.rect(x, 0, 1, 50); + ctx.clip(); + ctx.shadowBlur = x; + ctx.fillRect(-200, -200, 500, 200); + ctx.restore(); +} + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.canvas.alpha.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.canvas.alpha.js new file mode 100644 index 0000000..7f9af4e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.canvas.alpha.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = 'rgba(255, 0, 0, 0.5)'; +ctx2.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowOffsetY = 50; +ctx.shadowColor = '#00f'; +ctx.drawImage(canvas2, 0, -50); + +_assertPixelApprox(canvas, 50,25, 127,0,127,255, "50,25", "127,0,127,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.canvas.basic.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.canvas.basic.js new file mode 100644 index 0000000..0b9b795 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.canvas.basic.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = '#f00'; +ctx2.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetY = 50; +ctx.drawImage(canvas2, 0, -50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.canvas.transparent.1.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.canvas.transparent.1.js new file mode 100644 index 0000000..00bf2c7 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.canvas.transparent.1.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = '#f00'; +ctx.shadowOffsetY = 50; +ctx.drawImage(canvas2, 0, -50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.canvas.transparent.2.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.canvas.transparent.2.js new file mode 100644 index 0000000..6e5f276 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.canvas.transparent.2.js @@ -0,0 +1,25 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = '#f00'; +ctx2.fillRect(0, 0, 50, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 50, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(50, 0, 50, 50); +ctx.shadowOffsetY = 50; +ctx.shadowColor = '#0f0'; +ctx.drawImage(canvas2, 50, -50); +ctx.shadowColor = '#f00'; +ctx.drawImage(canvas2, -50, -50); + +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.clip.1.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.clip.1.js new file mode 100644 index 0000000..d23e68c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.clip.1.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 50, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(50, 0, 50, 50); + +ctx.save(); +ctx.beginPath(); +ctx.rect(50, 0, 50, 50); +ctx.clip(); +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetX = 50; +ctx.fillRect(0, 0, 50, 50); +ctx.restore(); + +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.clip.2.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.clip.2.js new file mode 100644 index 0000000..7142fd0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.clip.2.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +ctx.fillStyle = '#0f0'; +ctx.fillRect(50, 0, 50, 50); + +ctx.save(); +ctx.beginPath(); +ctx.rect(0, 0, 50, 50); +ctx.clip(); +ctx.shadowColor = '#f00'; +ctx.shadowOffsetX = 50; +ctx.fillRect(0, 0, 50, 50); +ctx.restore(); + +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.clip.3.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.clip.3.js new file mode 100644 index 0000000..bfa775f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.clip.3.js @@ -0,0 +1,22 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +ctx.fillStyle = '#0f0'; +ctx.fillRect(50, 0, 50, 50); + +ctx.save(); +ctx.beginPath(); +ctx.rect(0, 0, 50, 50); +ctx.clip(); +ctx.fillStyle = '#f00'; +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetX = 50; +ctx.fillRect(-50, 0, 50, 50); +ctx.restore(); + +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.composite.1.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.composite.1.js new file mode 100644 index 0000000..855bca0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.composite.1.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'xor'; +ctx.shadowColor = '#f00'; +ctx.shadowOffsetX = 100; +ctx.fillStyle = '#0f0'; +ctx.fillRect(-100, 0, 200, 50); + +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.composite.2.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.composite.2.js new file mode 100644 index 0000000..da3b03f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.composite.2.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'xor'; +ctx.shadowColor = '#f00'; +ctx.shadowBlur = 1; +ctx.fillStyle = '#0f0'; +ctx.fillRect(-10, -10, 120, 70); + +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.composite.3.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.composite.3.js new file mode 100644 index 0000000..3a77b71 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.composite.3.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-out'; +ctx.shadowColor = '#f00'; +ctx.shadowBlur = 10; +ctx.fillStyle = '#f00'; +ctx.fillRect(200, 0, 100, 50); + +_assertPixelApprox(canvas, 5,5, 0,255,0,255, "5,5", "0,255,0,255", 2); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.enable.blur.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.enable.blur.js new file mode 100644 index 0000000..2f1127e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.enable.blur.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.globalCompositeOperation = 'destination-atop'; +ctx.shadowColor = '#0f0'; +ctx.shadowBlur = 0.1; +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.enable.off.1.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.enable.off.1.js new file mode 100644 index 0000000..9bb20b8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.enable.off.1.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +ctx.shadowColor = '#f00'; +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.enable.off.2.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.enable.off.2.js new file mode 100644 index 0000000..800c731 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.enable.off.2.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.globalCompositeOperation = 'destination-atop'; +ctx.shadowColor = '#f00'; +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.enable.x.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.enable.x.js new file mode 100644 index 0000000..bf80da6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.enable.x.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.globalCompositeOperation = 'destination-atop'; +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetX = 0.1; +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.enable.y.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.enable.y.js new file mode 100644 index 0000000..eda5f53 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.enable.y.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.globalCompositeOperation = 'destination-atop'; +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetY = 0.1; +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.gradient.alpha.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.gradient.alpha.js new file mode 100644 index 0000000..6174354 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.gradient.alpha.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +var gradient = ctx.createLinearGradient(0, 0, 100, 0); +gradient.addColorStop(0, 'rgba(255,0,0,0.5)'); +gradient.addColorStop(1, 'rgba(255,0,0,0.5)'); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowOffsetY = 50; +ctx.shadowColor = '#00f'; +ctx.fillStyle = gradient; +ctx.fillRect(0, -50, 100, 50); + +_assertPixelApprox(canvas, 50,25, 127,0,127,255, "50,25", "127,0,127,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.gradient.basic.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.gradient.basic.js new file mode 100644 index 0000000..ddb028a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.gradient.basic.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +var gradient = ctx.createLinearGradient(0, 0, 100, 0); +gradient.addColorStop(0, '#f00'); +gradient.addColorStop(1, '#f00'); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetY = 50; +ctx.fillStyle = gradient; +ctx.fillRect(0, -50, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.gradient.transparent.1.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.gradient.transparent.1.js new file mode 100644 index 0000000..9627019 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.gradient.transparent.1.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +var gradient = ctx.createLinearGradient(0, 0, 100, 0); +gradient.addColorStop(0, 'rgba(0,0,0,0)'); +gradient.addColorStop(1, 'rgba(0,0,0,0)'); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = '#f00'; +ctx.shadowOffsetY = 50; +ctx.fillStyle = gradient; +ctx.fillRect(0, -50, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.gradient.transparent.2.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.gradient.transparent.2.js new file mode 100644 index 0000000..f13ba5d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.gradient.transparent.2.js @@ -0,0 +1,22 @@ +_addTest(function(canvas, ctx) { + +var gradient = ctx.createLinearGradient(0, 0, 100, 0); +gradient.addColorStop(0, '#f00'); +gradient.addColorStop(0.499, '#f00'); +gradient.addColorStop(0.5, 'rgba(0,0,0,0)'); +gradient.addColorStop(1, 'rgba(0,0,0,0)'); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +ctx.fillStyle = '#0f0'; +ctx.fillRect(50, 0, 50, 50); +ctx.shadowOffsetY = 50; +ctx.shadowColor = '#0f0'; +ctx.fillStyle = gradient; +ctx.fillRect(0, -50, 100, 50); + +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.image.alpha.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.image.alpha.js new file mode 100644 index 0000000..67b935c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.image.alpha.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowOffsetY = 50; +ctx.shadowColor = '#00f'; +ctx.drawImage(document.getElementById('transparent50.png'), 0, -50); + +_assertPixelApprox(canvas, 50,25, 127,0,127,255, "50,25", "127,0,127,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.image.basic.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.image.basic.js new file mode 100644 index 0000000..46accfa --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.image.basic.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetY = 50; +ctx.drawImage(document.getElementById('red.png'), 0, -50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.image.scale.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.image.scale.js new file mode 100644 index 0000000..34ef1ea --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.image.scale.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowOffsetY = 50; +ctx.shadowColor = '#0f0'; +ctx.drawImage(document.getElementById('redtransparent.png'), 0, 0, 100, 50, -10, -50, 240, 50); + +_assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.image.section.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.image.section.js new file mode 100644 index 0000000..0da6055 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.image.section.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowOffsetY = 50; +ctx.shadowColor = '#f00'; +ctx.drawImage(document.getElementById('redtransparent.png'), 50, 0, 50, 50, 0, -50, 50, 50); + +_assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.image.transparent.1.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.image.transparent.1.js new file mode 100644 index 0000000..9397db6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.image.transparent.1.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = '#f00'; +ctx.shadowOffsetY = 50; +ctx.drawImage(document.getElementById('transparent.png'), 0, -50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.image.transparent.2.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.image.transparent.2.js new file mode 100644 index 0000000..7a5e570 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.image.transparent.2.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 50, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(50, 0, 50, 50); +ctx.shadowOffsetY = 50; +ctx.shadowColor = '#0f0'; +ctx.drawImage(document.getElementById('redtransparent.png'), 50, -50); +ctx.shadowColor = '#f00'; +ctx.drawImage(document.getElementById('redtransparent.png'), -50, -50); + +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.offset.negativeX.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.offset.negativeX.js new file mode 100644 index 0000000..fd0a4a0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.offset.negativeX.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetX = -50; +ctx.fillRect(50, 0, 50, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.offset.negativeY.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.offset.negativeY.js new file mode 100644 index 0000000..29054cc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.offset.negativeY.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetY = -25; +ctx.fillRect(0, 25, 100, 25); +_assertPixel(canvas, 50,12, 0,255,0,255, "50,12", "0,255,0,255"); +_assertPixel(canvas, 50,37, 0,255,0,255, "50,37", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.offset.positiveX.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.offset.positiveX.js new file mode 100644 index 0000000..c07b951 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.offset.positiveX.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetX = 50; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.offset.positiveY.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.offset.positiveY.js new file mode 100644 index 0000000..907c5ce --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.offset.positiveY.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetY = 25; +ctx.fillRect(0, 0, 100, 25); +_assertPixel(canvas, 50,12, 0,255,0,255, "50,12", "0,255,0,255"); +_assertPixel(canvas, 50,37, 0,255,0,255, "50,37", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.outside.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.outside.js new file mode 100644 index 0000000..b87a9c6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.outside.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetX = 100; +ctx.fillRect(-100, 0, 25, 50); +ctx.shadowOffsetX = -100; +ctx.fillRect(175, 0, 25, 50); +ctx.shadowOffsetX = 0; +ctx.shadowOffsetY = 100; +ctx.fillRect(25, -100, 50, 25); +ctx.shadowOffsetY = -100; +ctx.fillRect(25, 125, 50, 25); +_assertPixel(canvas, 12,25, 0,255,0,255, "12,25", "0,255,0,255"); +_assertPixel(canvas, 87,25, 0,255,0,255, "87,25", "0,255,0,255"); +_assertPixel(canvas, 50,12, 0,255,0,255, "50,12", "0,255,0,255"); +_assertPixel(canvas, 50,37, 0,255,0,255, "50,37", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.pattern.alpha.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.pattern.alpha.js new file mode 100644 index 0000000..b362073 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.pattern.alpha.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +var pattern = ctx.createPattern(document.getElementById('transparent50.png'), 'repeat'); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowOffsetY = 50; +ctx.shadowColor = '#00f'; +ctx.fillStyle = pattern; +ctx.fillRect(0, -50, 100, 50); + +_assertPixelApprox(canvas, 50,25, 127,0,127,255, "50,25", "127,0,127,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.pattern.basic.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.pattern.basic.js new file mode 100644 index 0000000..5c15887 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.pattern.basic.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +var pattern = ctx.createPattern(document.getElementById('red.png'), 'repeat'); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetY = 50; +ctx.fillStyle = pattern; +ctx.fillRect(0, -50, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.pattern.transparent.1.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.pattern.transparent.1.js new file mode 100644 index 0000000..721f77f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.pattern.transparent.1.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +var pattern = ctx.createPattern(document.getElementById('transparent.png'), 'repeat'); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowColor = '#f00'; +ctx.shadowOffsetY = 50; +ctx.fillStyle = pattern; +ctx.fillRect(0, -50, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.pattern.transparent.2.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.pattern.transparent.2.js new file mode 100644 index 0000000..acca923 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.pattern.transparent.2.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +var pattern = ctx.createPattern(document.getElementById('redtransparent.png'), 'repeat'); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +ctx.fillStyle = '#0f0'; +ctx.fillRect(50, 0, 50, 50); +ctx.shadowOffsetY = 50; +ctx.shadowColor = '#0f0'; +ctx.fillStyle = pattern; +ctx.fillRect(0, -50, 100, 50); + +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.stroke.basic.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.stroke.basic.js new file mode 100644 index 0000000..7f5b18b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.stroke.basic.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetY = 50; +ctx.beginPath(); +ctx.lineWidth = 50; +ctx.moveTo(0, -25); +ctx.lineTo(100, -25); +ctx.stroke(); + +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.stroke.cap.1.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.stroke.cap.1.js new file mode 100644 index 0000000..236e300 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.stroke.cap.1.js @@ -0,0 +1,22 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.shadowColor = '#f00'; +ctx.shadowOffsetY = 50; +ctx.beginPath(); +ctx.lineWidth = 50; +ctx.lineCap = 'butt'; +ctx.moveTo(-50, -25); +ctx.lineTo(0, -25); +ctx.moveTo(100, -25); +ctx.lineTo(150, -25); +ctx.stroke(); + +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.stroke.cap.2.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.stroke.cap.2.js new file mode 100644 index 0000000..175d0fb --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.stroke.cap.2.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetY = 50; +ctx.beginPath(); +ctx.lineWidth = 50; +ctx.lineCap = 'square'; +ctx.moveTo(25, -25); +ctx.lineTo(75, -25); +ctx.stroke(); + +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.stroke.join.1.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.stroke.join.1.js new file mode 100644 index 0000000..f719a77 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.stroke.join.1.js @@ -0,0 +1,22 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.shadowColor = '#f00'; +ctx.shadowOffsetX = 100; +ctx.lineWidth = 200; +ctx.lineJoin = 'bevel'; +ctx.beginPath(); +ctx.moveTo(-200, -50); +ctx.lineTo(-150, -50); +ctx.lineTo(-151, -100); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.stroke.join.2.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.stroke.join.2.js new file mode 100644 index 0000000..4c27ff3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.stroke.join.2.js @@ -0,0 +1,24 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +ctx.fillStyle = '#0f0'; +ctx.fillRect(50, 0, 50, 50); +ctx.strokeStyle = '#f00'; +ctx.shadowColor = '#0f0'; +ctx.shadowOffsetX = 100; +ctx.lineWidth = 200; +ctx.lineJoin = 'miter'; +ctx.beginPath(); +ctx.moveTo(-200, -50); +ctx.lineTo(-150, -50); +ctx.lineTo(-151, -100); +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.stroke.join.3.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.stroke.join.3.js new file mode 100644 index 0000000..304775b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.stroke.join.3.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.shadowColor = '#f00'; +ctx.shadowOffsetX = 100; +ctx.lineWidth = 200; +ctx.lineJoin = 'miter'; +ctx.miterLimit = 0.1; +ctx.beginPath(); +ctx.moveTo(-200, -50); +ctx.lineTo(-150, -50); +ctx.lineTo(-151, -100); // (not an exact right angle, to avoid some other bug in Firefox 3) +ctx.stroke(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.transform.1.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.transform.1.js new file mode 100644 index 0000000..55b51ec --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.transform.1.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowOffsetY = 50; +ctx.shadowColor = '#0f0'; +ctx.translate(100, 100); +ctx.fillRect(-100, -150, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.shadow.transform.2.js b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.transform.2.js new file mode 100644 index 0000000..fb3eece --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.shadow.transform.2.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.shadowOffsetY = 50; +ctx.shadowColor = '#0f0'; +ctx.rotate(Math.PI) +ctx.fillRect(-100, 0, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.bitmap.js b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.bitmap.js new file mode 100644 index 0000000..8f6f459 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.bitmap.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.save(); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.restore(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.clip.js b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.clip.js new file mode 100644 index 0000000..4375086 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.clip.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.save(); +ctx.rect(0, 0, 1, 1); +ctx.clip(); +ctx.restore(); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.fillStyle.js b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.fillStyle.js new file mode 100644 index 0000000..0e5d128 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.fillStyle.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.fillStyle; +ctx.save(); +ctx.fillStyle = "#ff0000"; +ctx.restore(); +_assertSame(ctx.fillStyle, old, "ctx.fillStyle", "old"); + +// Also test that save() doesn't modify the values +ctx.fillStyle = "#ff0000"; +old = ctx.fillStyle; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against "#ff0000" +ctx.save(); +_assertSame(ctx.fillStyle, old, "ctx.fillStyle", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.font.js b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.font.js new file mode 100644 index 0000000..c0d4e3a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.font.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.font; +ctx.save(); +ctx.font = "25px serif"; +ctx.restore(); +_assertSame(ctx.font, old, "ctx.font", "old"); + +// Also test that save() doesn't modify the values +ctx.font = "25px serif"; +old = ctx.font; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against "25px serif" +ctx.save(); +_assertSame(ctx.font, old, "ctx.font", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.globalAlpha.js b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.globalAlpha.js new file mode 100644 index 0000000..f3d6363 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.globalAlpha.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.globalAlpha; +ctx.save(); +ctx.globalAlpha = 0.5; +ctx.restore(); +_assertSame(ctx.globalAlpha, old, "ctx.globalAlpha", "old"); + +// Also test that save() doesn't modify the values +ctx.globalAlpha = 0.5; +old = ctx.globalAlpha; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against 0.5 +ctx.save(); +_assertSame(ctx.globalAlpha, old, "ctx.globalAlpha", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.globalCompositeOperation.js b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.globalCompositeOperation.js new file mode 100644 index 0000000..070093b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.globalCompositeOperation.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.globalCompositeOperation; +ctx.save(); +ctx.globalCompositeOperation = "copy"; +ctx.restore(); +_assertSame(ctx.globalCompositeOperation, old, "ctx.globalCompositeOperation", "old"); + +// Also test that save() doesn't modify the values +ctx.globalCompositeOperation = "copy"; +old = ctx.globalCompositeOperation; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against "copy" +ctx.save(); +_assertSame(ctx.globalCompositeOperation, old, "ctx.globalCompositeOperation", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.lineCap.js b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.lineCap.js new file mode 100644 index 0000000..c8c2cbd --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.lineCap.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.lineCap; +ctx.save(); +ctx.lineCap = "round"; +ctx.restore(); +_assertSame(ctx.lineCap, old, "ctx.lineCap", "old"); + +// Also test that save() doesn't modify the values +ctx.lineCap = "round"; +old = ctx.lineCap; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against "round" +ctx.save(); +_assertSame(ctx.lineCap, old, "ctx.lineCap", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.lineJoin.js b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.lineJoin.js new file mode 100644 index 0000000..fc1a51a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.lineJoin.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.lineJoin; +ctx.save(); +ctx.lineJoin = "round"; +ctx.restore(); +_assertSame(ctx.lineJoin, old, "ctx.lineJoin", "old"); + +// Also test that save() doesn't modify the values +ctx.lineJoin = "round"; +old = ctx.lineJoin; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against "round" +ctx.save(); +_assertSame(ctx.lineJoin, old, "ctx.lineJoin", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.lineWidth.js b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.lineWidth.js new file mode 100644 index 0000000..849a201 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.lineWidth.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.lineWidth; +ctx.save(); +ctx.lineWidth = 0.5; +ctx.restore(); +_assertSame(ctx.lineWidth, old, "ctx.lineWidth", "old"); + +// Also test that save() doesn't modify the values +ctx.lineWidth = 0.5; +old = ctx.lineWidth; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against 0.5 +ctx.save(); +_assertSame(ctx.lineWidth, old, "ctx.lineWidth", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.miterLimit.js b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.miterLimit.js new file mode 100644 index 0000000..9e27575 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.miterLimit.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.miterLimit; +ctx.save(); +ctx.miterLimit = 0.5; +ctx.restore(); +_assertSame(ctx.miterLimit, old, "ctx.miterLimit", "old"); + +// Also test that save() doesn't modify the values +ctx.miterLimit = 0.5; +old = ctx.miterLimit; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against 0.5 +ctx.save(); +_assertSame(ctx.miterLimit, old, "ctx.miterLimit", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.path.js b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.path.js new file mode 100644 index 0000000..cc7234b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.path.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.save(); +ctx.rect(0, 0, 100, 50); +ctx.restore(); +ctx.fillStyle = '#0f0'; +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.shadowBlur.js b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.shadowBlur.js new file mode 100644 index 0000000..e6b6345 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.shadowBlur.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.shadowBlur; +ctx.save(); +ctx.shadowBlur = 5; +ctx.restore(); +_assertSame(ctx.shadowBlur, old, "ctx.shadowBlur", "old"); + +// Also test that save() doesn't modify the values +ctx.shadowBlur = 5; +old = ctx.shadowBlur; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against 5 +ctx.save(); +_assertSame(ctx.shadowBlur, old, "ctx.shadowBlur", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.shadowColor.js b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.shadowColor.js new file mode 100644 index 0000000..ded4349 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.shadowColor.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.shadowColor; +ctx.save(); +ctx.shadowColor = "#ff0000"; +ctx.restore(); +_assertSame(ctx.shadowColor, old, "ctx.shadowColor", "old"); + +// Also test that save() doesn't modify the values +ctx.shadowColor = "#ff0000"; +old = ctx.shadowColor; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against "#ff0000" +ctx.save(); +_assertSame(ctx.shadowColor, old, "ctx.shadowColor", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.shadowOffsetX.js b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.shadowOffsetX.js new file mode 100644 index 0000000..e4eaf54 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.shadowOffsetX.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.shadowOffsetX; +ctx.save(); +ctx.shadowOffsetX = 5; +ctx.restore(); +_assertSame(ctx.shadowOffsetX, old, "ctx.shadowOffsetX", "old"); + +// Also test that save() doesn't modify the values +ctx.shadowOffsetX = 5; +old = ctx.shadowOffsetX; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against 5 +ctx.save(); +_assertSame(ctx.shadowOffsetX, old, "ctx.shadowOffsetX", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.shadowOffsetY.js b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.shadowOffsetY.js new file mode 100644 index 0000000..57066b8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.shadowOffsetY.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.shadowOffsetY; +ctx.save(); +ctx.shadowOffsetY = 5; +ctx.restore(); +_assertSame(ctx.shadowOffsetY, old, "ctx.shadowOffsetY", "old"); + +// Also test that save() doesn't modify the values +ctx.shadowOffsetY = 5; +old = ctx.shadowOffsetY; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against 5 +ctx.save(); +_assertSame(ctx.shadowOffsetY, old, "ctx.shadowOffsetY", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.stack.js b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.stack.js new file mode 100644 index 0000000..8847aa6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.stack.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.lineWidth = 1; +ctx.save(); +ctx.lineWidth = 2; +ctx.save(); +ctx.lineWidth = 3; +_assertEqual(ctx.lineWidth, 3, "ctx.lineWidth", "3"); +ctx.restore(); +_assertEqual(ctx.lineWidth, 2, "ctx.lineWidth", "2"); +ctx.restore(); +_assertEqual(ctx.lineWidth, 1, "ctx.lineWidth", "1"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.stackdepth.js b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.stackdepth.js new file mode 100644 index 0000000..5b38313 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.stackdepth.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +var limit = 512; +for (var i = 1; i < limit; ++i) +{ + ctx.save(); + ctx.lineWidth = i; +} +for (var i = limit-1; i > 0; --i) +{ + _assertEqual(ctx.lineWidth, i, "ctx.lineWidth", "i"); + ctx.restore(); +} + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.strokeStyle.js b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.strokeStyle.js new file mode 100644 index 0000000..22391e8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.strokeStyle.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.strokeStyle; +ctx.save(); +ctx.strokeStyle = "#ff0000"; +ctx.restore(); +_assertSame(ctx.strokeStyle, old, "ctx.strokeStyle", "old"); + +// Also test that save() doesn't modify the values +ctx.strokeStyle = "#ff0000"; +old = ctx.strokeStyle; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against "#ff0000" +ctx.save(); +_assertSame(ctx.strokeStyle, old, "ctx.strokeStyle", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.textAlign.js b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.textAlign.js new file mode 100644 index 0000000..9c88e00 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.textAlign.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.textAlign; +ctx.save(); +ctx.textAlign = "center"; +ctx.restore(); +_assertSame(ctx.textAlign, old, "ctx.textAlign", "old"); + +// Also test that save() doesn't modify the values +ctx.textAlign = "center"; +old = ctx.textAlign; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against "center" +ctx.save(); +_assertSame(ctx.textAlign, old, "ctx.textAlign", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.textBaseline.js b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.textBaseline.js new file mode 100644 index 0000000..0e2e64e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.textBaseline.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +// Test that restore() undoes any modifications +var old = ctx.textBaseline; +ctx.save(); +ctx.textBaseline = "bottom"; +ctx.restore(); +_assertSame(ctx.textBaseline, old, "ctx.textBaseline", "old"); + +// Also test that save() doesn't modify the values +ctx.textBaseline = "bottom"; +old = ctx.textBaseline; + // we're not interested in failures caused by get(set(x)) != x (e.g. + // from rounding), so compare against 'old' instead of against "bottom" +ctx.save(); +_assertSame(ctx.textBaseline, old, "ctx.textBaseline", "old"); +ctx.restore(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.transformation.js b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.transformation.js new file mode 100644 index 0000000..4050b9b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.transformation.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.save(); +ctx.translate(200, 0); +ctx.restore(); +ctx.fillStyle = '#f00'; +ctx.fillRect(-200, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.underflow.js b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.underflow.js new file mode 100644 index 0000000..64aff9c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.state.saverestore.underflow.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +for (var i = 0; i < 16; ++i) + ctx.restore(); +ctx.lineWidth = 0.5; +ctx.restore(); +_assertEqual(ctx.lineWidth, 0.5, "ctx.lineWidth", "0.5"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.strokeRect.basic.js b/platforms/ios/www/test/tests-todo/minimal.2d.strokeRect.basic.js new file mode 100644 index 0000000..e64fb73 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.strokeRect.basic.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 50; +ctx.strokeRect(25, 24, 50, 2); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.strokeRect.clip.js b/platforms/ios/www/test/tests-todo/minimal.2d.strokeRect.clip.js new file mode 100644 index 0000000..9315308 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.strokeRect.clip.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.beginPath(); +ctx.rect(0, 0, 16, 16); +ctx.clip(); + +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 50; +ctx.strokeRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 16, 16); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.strokeRect.globalalpha.js b/platforms/ios/www/test/tests-todo/minimal.2d.strokeRect.globalalpha.js new file mode 100644 index 0000000..faed405 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.strokeRect.globalalpha.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.globalAlpha = 0; +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 50; +ctx.strokeRect(25, 24, 50, 2); +_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.strokeRect.globalcomposite.js b/platforms/ios/www/test/tests-todo/minimal.2d.strokeRect.globalcomposite.js new file mode 100644 index 0000000..8c2f596 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.strokeRect.globalcomposite.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.globalCompositeOperation = 'source-in'; +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 50; +ctx.strokeRect(25, 24, 50, 2); +_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.strokeRect.negative.js b/platforms/ios/www/test/tests-todo/minimal.2d.strokeRect.negative.js new file mode 100644 index 0000000..337dbb3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.strokeRect.negative.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 25; +ctx.strokeRect(12, 12, 26, 1); +ctx.strokeRect(88, 12, -26, 1); +ctx.strokeRect(12, 38, 26, -1); +ctx.strokeRect(88, 38, -26, -1); +_assertPixel(canvas, 25,12, 0,255,0,255, "25,12", "0,255,0,255"); +_assertPixel(canvas, 75,12, 0,255,0,255, "75,12", "0,255,0,255"); +_assertPixel(canvas, 25,37, 0,255,0,255, "25,37", "0,255,0,255"); +_assertPixel(canvas, 75,37, 0,255,0,255, "75,37", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.strokeRect.nonfinite.js b/platforms/ios/www/test/tests-todo/minimal.2d.strokeRect.nonfinite.js new file mode 100644 index 0000000..334e9f6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.strokeRect.nonfinite.js @@ -0,0 +1,35 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 150; +ctx.strokeRect(Infinity, 0, 100, 50); +ctx.strokeRect(-Infinity, 0, 100, 50); +ctx.strokeRect(NaN, 0, 100, 50); +ctx.strokeRect(0, Infinity, 100, 50); +ctx.strokeRect(0, -Infinity, 100, 50); +ctx.strokeRect(0, NaN, 100, 50); +ctx.strokeRect(0, 0, Infinity, 50); +ctx.strokeRect(0, 0, -Infinity, 50); +ctx.strokeRect(0, 0, NaN, 50); +ctx.strokeRect(0, 0, 100, Infinity); +ctx.strokeRect(0, 0, 100, -Infinity); +ctx.strokeRect(0, 0, 100, NaN); +ctx.strokeRect(Infinity, Infinity, 100, 50); +ctx.strokeRect(Infinity, Infinity, Infinity, 50); +ctx.strokeRect(Infinity, Infinity, Infinity, Infinity); +ctx.strokeRect(Infinity, Infinity, 100, Infinity); +ctx.strokeRect(Infinity, 0, Infinity, 50); +ctx.strokeRect(Infinity, 0, Infinity, Infinity); +ctx.strokeRect(Infinity, 0, 100, Infinity); +ctx.strokeRect(0, Infinity, Infinity, 50); +ctx.strokeRect(0, Infinity, Infinity, Infinity); +ctx.strokeRect(0, Infinity, 100, Infinity); +ctx.strokeRect(0, 0, Infinity, Infinity); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.strokeRect.path.js b/platforms/ios/www/test/tests-todo/minimal.2d.strokeRect.path.js new file mode 100644 index 0000000..3ed7a86 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.strokeRect.path.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.beginPath(); +ctx.rect(0, 0, 100, 50); +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 5; +ctx.strokeRect(0, 0, 16, 16); +ctx.fillStyle = '#0f0'; +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.strokeRect.shadow.js b/platforms/ios/www/test/tests-todo/minimal.2d.strokeRect.shadow.js new file mode 100644 index 0000000..6e10988 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.strokeRect.shadow.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.shadowColor = '#0f0'; +ctx.shadowBlur = 0; +ctx.shadowOffsetX = 0; +ctx.shadowOffsetY = 50; +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 50; +ctx.strokeRect(0, -75, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.strokeRect.transform.js b/platforms/ios/www/test/tests-todo/minimal.2d.strokeRect.transform.js new file mode 100644 index 0000000..9835d7c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.strokeRect.transform.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.scale(10, 10); +ctx.translate(0, 5); +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 5; +ctx.strokeRect(2.5, -2.6, 5, 0.2); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.strokeRect.zero.1.js b/platforms/ios/www/test/tests-todo/minimal.2d.strokeRect.zero.1.js new file mode 100644 index 0000000..6ef2399 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.strokeRect.zero.1.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 250; +ctx.strokeRect(50, 25, 0, 0); +_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.strokeRect.zero.2.js b/platforms/ios/www/test/tests-todo/minimal.2d.strokeRect.zero.2.js new file mode 100644 index 0000000..14315e1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.strokeRect.zero.2.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 250; +ctx.lineCap = 'round'; +ctx.lineJoin = 'round'; +ctx.strokeRect(50, 25, 0, 0); +_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.strokeRect.zero.3.js b/platforms/ios/www/test/tests-todo/minimal.2d.strokeRect.zero.3.js new file mode 100644 index 0000000..759224f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.strokeRect.zero.3.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 50; +ctx.strokeRect(0, 25, 100, 0); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.strokeRect.zero.4.js b/platforms/ios/www/test/tests-todo/minimal.2d.strokeRect.zero.4.js new file mode 100644 index 0000000..11461dc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.strokeRect.zero.4.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 250; +ctx.lineCap = 'round'; +ctx.strokeRect(100, 25, 100, 0); +_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.strokeRect.zero.5.js b/platforms/ios/www/test/tests-todo/minimal.2d.strokeRect.zero.5.js new file mode 100644 index 0000000..5fb410d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.strokeRect.zero.5.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 250; +ctx.lineJoin = 'round'; +ctx.strokeRect(100, 25, 100, 0); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.strokeStyle.default.js b/platforms/ios/www/test/tests-todo/minimal.2d.strokeStyle.default.js new file mode 100644 index 0000000..7f80eb8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.strokeStyle.default.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertEqual(ctx.strokeStyle, '#000000', "ctx.strokeStyle", "'#000000'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.align.default.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.align.default.js new file mode 100644 index 0000000..172f8cb --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.align.default.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(ctx.textAlign, 'start', "ctx.textAlign", "'start'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.align.invalid.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.align.invalid.js new file mode 100644 index 0000000..95f9e13 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.align.invalid.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +ctx.textAlign = 'start'; +ctx.textAlign = 'bogus'; +_assertSame(ctx.textAlign, 'start', "ctx.textAlign", "'start'"); + +ctx.textAlign = 'start'; +ctx.textAlign = 'END'; +_assertSame(ctx.textAlign, 'start', "ctx.textAlign", "'start'"); + +ctx.textAlign = 'start'; +ctx.textAlign = 'end '; +_assertSame(ctx.textAlign, 'start', "ctx.textAlign", "'start'"); + +ctx.textAlign = 'start'; +ctx.textAlign = 'end\0'; +_assertSame(ctx.textAlign, 'start', "ctx.textAlign", "'start'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.align.valid.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.align.valid.js new file mode 100644 index 0000000..c59a065 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.align.valid.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.textAlign = 'start'; +_assertSame(ctx.textAlign, 'start', "ctx.textAlign", "'start'"); + +ctx.textAlign = 'end'; +_assertSame(ctx.textAlign, 'end', "ctx.textAlign", "'end'"); + +ctx.textAlign = 'left'; +_assertSame(ctx.textAlign, 'left', "ctx.textAlign", "'left'"); + +ctx.textAlign = 'right'; +_assertSame(ctx.textAlign, 'right', "ctx.textAlign", "'right'"); + +ctx.textAlign = 'center'; +_assertSame(ctx.textAlign, 'center', "ctx.textAlign", "'center'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.baseline.default.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.baseline.default.js new file mode 100644 index 0000000..c6b84c9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.baseline.default.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(ctx.textBaseline, 'alphabetic', "ctx.textBaseline", "'alphabetic'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.baseline.invalid.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.baseline.invalid.js new file mode 100644 index 0000000..3002e28 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.baseline.invalid.js @@ -0,0 +1,20 @@ +_addTest(function(canvas, ctx) { + +ctx.textBaseline = 'top'; +ctx.textBaseline = 'bogus'; +_assertSame(ctx.textBaseline, 'top', "ctx.textBaseline", "'top'"); + +ctx.textBaseline = 'top'; +ctx.textBaseline = 'MIDDLE'; +_assertSame(ctx.textBaseline, 'top', "ctx.textBaseline", "'top'"); + +ctx.textBaseline = 'top'; +ctx.textBaseline = 'middle '; +_assertSame(ctx.textBaseline, 'top', "ctx.textBaseline", "'top'"); + +ctx.textBaseline = 'top'; +ctx.textBaseline = 'middle\0'; +_assertSame(ctx.textBaseline, 'top', "ctx.textBaseline", "'top'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.baseline.valid.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.baseline.valid.js new file mode 100644 index 0000000..406d664 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.baseline.valid.js @@ -0,0 +1,22 @@ +_addTest(function(canvas, ctx) { + +ctx.textBaseline = 'top'; +_assertSame(ctx.textBaseline, 'top', "ctx.textBaseline", "'top'"); + +ctx.textBaseline = 'hanging'; +_assertSame(ctx.textBaseline, 'hanging', "ctx.textBaseline", "'hanging'"); + +ctx.textBaseline = 'middle'; +_assertSame(ctx.textBaseline, 'middle', "ctx.textBaseline", "'middle'"); + +ctx.textBaseline = 'alphabetic'; +_assertSame(ctx.textBaseline, 'alphabetic', "ctx.textBaseline", "'alphabetic'"); + +ctx.textBaseline = 'ideographic'; +_assertSame(ctx.textBaseline, 'ideographic', "ctx.textBaseline", "'ideographic'"); + +ctx.textBaseline = 'bottom'; +_assertSame(ctx.textBaseline, 'bottom', "ctx.textBaseline", "'bottom'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.align.center.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.align.center.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.align.center.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.align.end.ltr.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.align.end.ltr.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.align.end.ltr.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.align.end.rtl.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.align.end.rtl.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.align.end.rtl.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.align.left.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.align.left.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.align.left.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.align.right.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.align.right.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.align.right.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.align.start.ltr.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.align.start.ltr.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.align.start.ltr.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.align.start.rtl.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.align.start.rtl.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.align.start.rtl.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.baseline.alphabetic.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.baseline.alphabetic.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.baseline.alphabetic.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.baseline.bottom.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.baseline.bottom.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.baseline.bottom.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.baseline.hanging.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.baseline.hanging.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.baseline.hanging.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.baseline.ideographic.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.baseline.ideographic.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.baseline.ideographic.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.baseline.middle.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.baseline.middle.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.baseline.middle.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.baseline.top.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.baseline.top.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.baseline.top.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.fill.basic.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.fill.basic.js new file mode 100644 index 0000000..0319659 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.fill.basic.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#000'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.strokeStyle = '#f00'; +ctx.font = '35px Arial, sans-serif'; +ctx.fillText('PASS', 5, 35); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.fill.maxWidth.bound.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.fill.maxWidth.bound.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.fill.maxWidth.bound.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.fill.maxWidth.fontface.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.fill.maxWidth.fontface.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.fill.maxWidth.fontface.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.fill.maxWidth.large.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.fill.maxWidth.large.js new file mode 100644 index 0000000..e168e3e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.fill.maxWidth.large.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#000'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.font = '35px Arial, sans-serif'; +ctx.fillText('PASS', 5, 35, 200); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.fill.maxWidth.small.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.fill.maxWidth.small.js new file mode 100644 index 0000000..3d8cd0b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.fill.maxWidth.small.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.font = '35px Arial, sans-serif'; +ctx.fillText('fail fail fail fail fail', -100, 35, 90); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.fill.maxWidth.zero.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.fill.maxWidth.zero.js new file mode 100644 index 0000000..26c430d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.fill.maxWidth.zero.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.font = '35px Arial, sans-serif'; +ctx.fillText('fail fail fail fail fail', 5, 35, 0); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.fill.rtl.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.fill.rtl.js new file mode 100644 index 0000000..da865fb --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.fill.rtl.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#000'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.strokeStyle = '#f00'; +ctx.font = '35px Arial, sans-serif'; +ctx.fillText('\u202eFAIL \xa0 \xa0 SSAP', 5, 35); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.fill.unaffected.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.fill.unaffected.js new file mode 100644 index 0000000..10b63bd --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.fill.unaffected.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.moveTo(0, 0); +ctx.lineTo(100, 0); + +ctx.font = '35px Arial, sans-serif'; +ctx.fillText('FAIL', 5, 35); + +ctx.lineTo(100, 50); +ctx.lineTo(0, 50); +ctx.fillStyle = '#0f0'; +ctx.fill(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 5,45, 0,255,0,255, "5,45", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.fontface.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.fontface.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.fontface.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.fontface.notinpage.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.fontface.notinpage.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.fontface.notinpage.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.fontface.repeat.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.fontface.repeat.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.fontface.repeat.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.kern.consistent.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.kern.consistent.js new file mode 100644 index 0000000..678ad31 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.kern.consistent.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.strokeStyle = '#0f0'; +ctx.lineWidth = 3; +ctx.font = '20px Arial, sans-serif'; +ctx.fillText('VAVAVAVAVAVAVA', -50, 25); +ctx.fillText('ToToToToToToTo', -50, 45); +ctx.strokeText('VAVAVAVAVAVAVA', -50, 25); +ctx.strokeText('ToToToToToToTo', -50, 45); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.space.basic.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.space.basic.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.space.basic.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.space.collapse.end.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.space.collapse.end.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.space.collapse.end.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.space.collapse.nonspace.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.space.collapse.nonspace.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.space.collapse.nonspace.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.space.collapse.other.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.space.collapse.other.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.space.collapse.other.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.space.collapse.space.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.space.collapse.space.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.space.collapse.space.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.space.collapse.start.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.space.collapse.start.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.space.collapse.start.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.stroke.basic.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.stroke.basic.js new file mode 100644 index 0000000..e876dba --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.stroke.basic.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#000'; +ctx.fillRect(0, 0, 100, 50); +ctx.strokeStyle = '#0f0'; +ctx.fillStyle = '#f00'; +ctx.lineWidth = 1; +ctx.font = '35px Arial, sans-serif'; +ctx.strokeText('PASS', 5, 35); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.stroke.unaffected.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.stroke.unaffected.js new file mode 100644 index 0000000..ae555d6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.draw.stroke.unaffected.js @@ -0,0 +1,22 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.moveTo(0, 0); +ctx.lineTo(100, 0); + +ctx.font = '35px Arial, sans-serif'; +ctx.strokeStyle = '#f00'; +ctx.strokeText('FAIL', 5, 35); + +ctx.lineTo(100, 50); +ctx.lineTo(0, 50); +ctx.fillStyle = '#0f0'; +ctx.fill(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 5,45, 0,255,0,255, "5,45", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.font.default.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.font.default.js new file mode 100644 index 0000000..80821d0 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.font.default.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(ctx.font, '10px sans-serif', "ctx.font", "'10px sans-serif'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.font.parse.basic.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.font.parse.basic.js new file mode 100644 index 0000000..24d505a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.font.parse.basic.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.font = '20px serif'; +_assertSame(ctx.font, '20px serif', "ctx.font", "'20px serif'"); + +ctx.font = '20PX SERIF'; +_assertSame(ctx.font, '20px serif', "ctx.font", "'20px serif'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.font.parse.complex.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.font.parse.complex.js new file mode 100644 index 0000000..0d4449b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.font.parse.complex.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +ctx.font = 'small-caps italic 400 12px/2 Unknown Font, sans-serif'; +_assertSame(ctx.font, 'italic small-caps 12px "Unknown Font", sans-serif', "ctx.font", "'italic small-caps 12px \"Unknown Font\", sans-serif'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.font.parse.invalid.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.font.parse.invalid.js new file mode 100644 index 0000000..6e8a8c2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.font.parse.invalid.js @@ -0,0 +1,31 @@ +_addTest(function(canvas, ctx) { + +ctx.font = '20px serif'; +_assertSame(ctx.font, '20px serif', "ctx.font", "'20px serif'"); + +ctx.font = '20px serif'; +ctx.font = 'bogus'; +_assertSame(ctx.font, '20px serif', "ctx.font", "'20px serif'"); + +ctx.font = '20px serif'; +ctx.font = 'inherit'; +_assertSame(ctx.font, '20px serif', "ctx.font", "'20px serif'"); + +ctx.font = '20px serif'; +ctx.font = '10px {bogus}'; +_assertSame(ctx.font, '20px serif', "ctx.font", "'20px serif'"); + +ctx.font = '20px serif'; +ctx.font = '10px initial'; +_assertSame(ctx.font, '20px serif', "ctx.font", "'20px serif'"); + +ctx.font = '20px serif'; +ctx.font = '10px default'; +_assertSame(ctx.font, '20px serif', "ctx.font", "'20px serif'"); + +ctx.font = '20px serif'; +ctx.font = '10px inherit'; +_assertSame(ctx.font, '20px serif', "ctx.font", "'20px serif'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.font.parse.size.percentage.default.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.font.parse.size.percentage.default.js new file mode 100644 index 0000000..fcf9e9f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.font.parse.size.percentage.default.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +var ctx2 = canvas2.getContext('2d'); +ctx.font = '1000% serif'; +_assertSame(ctx.font, '100px serif', "ctx.font", "'100px serif'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.font.parse.size.percentage.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.font.parse.size.percentage.js new file mode 100644 index 0000000..9baeb5f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.font.parse.size.percentage.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +ctx.font = '50% serif'; +_assertSame(ctx.font, '72px serif', "ctx.font", "'72px serif'"); +canvas.setAttribute('style', 'font-size: 100px'); +_assertSame(ctx.font, '72px serif', "ctx.font", "'72px serif'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.font.parse.system.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.font.parse.system.js new file mode 100644 index 0000000..844742e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.font.parse.system.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +ctx.font = 'message-box'; +_assertDifferent(ctx.font, 'message-box', "ctx.font", "'message-box'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.measure.width.basic.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.measure.width.basic.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.measure.width.basic.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.measure.width.empty.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.measure.width.empty.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.measure.width.empty.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.text.measure.width.space.js b/platforms/ios/www/test/tests-todo/minimal.2d.text.measure.width.space.js new file mode 100644 index 0000000..b14db0f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.text.measure.width.space.js @@ -0,0 +1,4 @@ +}), 500); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.transformation.order.js b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.order.js new file mode 100644 index 0000000..0bc0790 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.order.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.scale(2, 1); +ctx.rotate(Math.PI / 2); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, -50, 50, 50); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.transformation.rotate.direction.js b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.rotate.direction.js new file mode 100644 index 0000000..e5e31aa --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.rotate.direction.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.rotate(Math.PI / 2); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, -100, 50, 100); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.transformation.rotate.nonfinite.js b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.rotate.nonfinite.js new file mode 100644 index 0000000..20ecf87 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.rotate.nonfinite.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.translate(100, 10); +ctx.rotate(Infinity); +ctx.rotate(-Infinity); +ctx.rotate(NaN); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(-100, -10, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.transformation.rotate.radians.js b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.rotate.radians.js new file mode 100644 index 0000000..6fe1650 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.rotate.radians.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.rotate(Math.PI); // should fail obviously if this is 3.1 degrees +ctx.fillStyle = '#0f0'; +ctx.fillRect(-100, -50, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.transformation.rotate.wrap.js b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.rotate.wrap.js new file mode 100644 index 0000000..a079b58 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.rotate.wrap.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.rotate(Math.PI * (1 + 4096)); // == pi (mod 2*pi) +// We need about pi +/- 0.001 in order to get correct-looking results +// 32-bit floats can store pi*4097 with precision 2^-10, so that should +// be safe enough on reasonable implementations +ctx.fillStyle = '#0f0'; +ctx.fillRect(-100, -50, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,2, 0,255,0,255, "98,2", "0,255,0,255"); +_assertPixel(canvas, 98,47, 0,255,0,255, "98,47", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.transformation.rotate.wrapnegative.js b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.rotate.wrapnegative.js new file mode 100644 index 0000000..58a6015 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.rotate.wrapnegative.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.rotate(-Math.PI * (1 + 4096)); +ctx.fillStyle = '#0f0'; +ctx.fillRect(-100, -50, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,2, 0,255,0,255, "98,2", "0,255,0,255"); +_assertPixel(canvas, 98,47, 0,255,0,255, "98,47", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.transformation.rotate.zero.js b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.rotate.zero.js new file mode 100644 index 0000000..d752131 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.rotate.zero.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.rotate(0); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.transformation.scale.basic.js b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.scale.basic.js new file mode 100644 index 0000000..7e7ef5b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.scale.basic.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.scale(2, 4); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 50, 12.5); +_assertPixel(canvas, 90,40, 0,255,0,255, "90,40", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.transformation.scale.large.js b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.scale.large.js new file mode 100644 index 0000000..8cdc2b3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.scale.large.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.scale(1e5, 1e5); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 1, 1); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.transformation.scale.multiple.js b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.scale.multiple.js new file mode 100644 index 0000000..4f2345f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.scale.multiple.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.scale(Math.sqrt(2), Math.sqrt(2)); +ctx.scale(Math.sqrt(2), Math.sqrt(2)); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 50, 25); +_assertPixel(canvas, 90,40, 0,255,0,255, "90,40", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.transformation.scale.negative.js b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.scale.negative.js new file mode 100644 index 0000000..c25972b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.scale.negative.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.save(); +ctx.scale(-1, 1); +ctx.fillStyle = '#0f0'; +ctx.fillRect(-50, 0, 50, 50); +ctx.restore(); + +ctx.save(); +ctx.scale(1, -1); +ctx.fillStyle = '#0f0'; +ctx.fillRect(50, -50, 50, 50); +ctx.restore(); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.transformation.scale.nonfinite.js b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.scale.nonfinite.js new file mode 100644 index 0000000..7cdc79f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.scale.nonfinite.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.translate(100, 10); +ctx.scale(Infinity, 0.1); +ctx.scale(-Infinity, 0.1); +ctx.scale(NaN, 0.1); +ctx.scale(0.1, Infinity); +ctx.scale(0.1, -Infinity); +ctx.scale(0.1, NaN); +ctx.scale(Infinity, Infinity); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(-100, -10, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.transformation.scale.zero.js b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.scale.zero.js new file mode 100644 index 0000000..2d7daf1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.scale.zero.js @@ -0,0 +1,26 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.save(); +ctx.translate(50, 0); +ctx.scale(0, 1); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.restore(); + +ctx.save(); +ctx.translate(0, 25); +ctx.scale(1, 0); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.restore(); + +// Firefox has a bug where it renders the canvas as empty and toDataURL throws an exception +canvas.toDataURL(); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.transformation.setTransform.multiple.js b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.setTransform.multiple.js new file mode 100644 index 0000000..28baaaf --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.setTransform.multiple.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.setTransform(1/2,0, 0,1/2, 0,0); +ctx.setTransform(2,0, 0,2, 0,0); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 50, 25); +_assertPixel(canvas, 75,35, 0,255,0,255, "75,35", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.transformation.setTransform.nonfinite.js b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.setTransform.nonfinite.js new file mode 100644 index 0000000..381afd7 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.setTransform.nonfinite.js @@ -0,0 +1,89 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.translate(100, 10); +ctx.setTransform(Infinity, 0, 0, 0, 0, 0); +ctx.setTransform(-Infinity, 0, 0, 0, 0, 0); +ctx.setTransform(NaN, 0, 0, 0, 0, 0); +ctx.setTransform(0, Infinity, 0, 0, 0, 0); +ctx.setTransform(0, -Infinity, 0, 0, 0, 0); +ctx.setTransform(0, NaN, 0, 0, 0, 0); +ctx.setTransform(0, 0, Infinity, 0, 0, 0); +ctx.setTransform(0, 0, -Infinity, 0, 0, 0); +ctx.setTransform(0, 0, NaN, 0, 0, 0); +ctx.setTransform(0, 0, 0, Infinity, 0, 0); +ctx.setTransform(0, 0, 0, -Infinity, 0, 0); +ctx.setTransform(0, 0, 0, NaN, 0, 0); +ctx.setTransform(0, 0, 0, 0, Infinity, 0); +ctx.setTransform(0, 0, 0, 0, -Infinity, 0); +ctx.setTransform(0, 0, 0, 0, NaN, 0); +ctx.setTransform(0, 0, 0, 0, 0, Infinity); +ctx.setTransform(0, 0, 0, 0, 0, -Infinity); +ctx.setTransform(0, 0, 0, 0, 0, NaN); +ctx.setTransform(Infinity, Infinity, 0, 0, 0, 0); +ctx.setTransform(Infinity, Infinity, Infinity, 0, 0, 0); +ctx.setTransform(Infinity, Infinity, Infinity, Infinity, 0, 0); +ctx.setTransform(Infinity, Infinity, Infinity, Infinity, Infinity, 0); +ctx.setTransform(Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); +ctx.setTransform(Infinity, Infinity, Infinity, Infinity, 0, Infinity); +ctx.setTransform(Infinity, Infinity, Infinity, 0, Infinity, 0); +ctx.setTransform(Infinity, Infinity, Infinity, 0, Infinity, Infinity); +ctx.setTransform(Infinity, Infinity, Infinity, 0, 0, Infinity); +ctx.setTransform(Infinity, Infinity, 0, Infinity, 0, 0); +ctx.setTransform(Infinity, Infinity, 0, Infinity, Infinity, 0); +ctx.setTransform(Infinity, Infinity, 0, Infinity, Infinity, Infinity); +ctx.setTransform(Infinity, Infinity, 0, Infinity, 0, Infinity); +ctx.setTransform(Infinity, Infinity, 0, 0, Infinity, 0); +ctx.setTransform(Infinity, Infinity, 0, 0, Infinity, Infinity); +ctx.setTransform(Infinity, Infinity, 0, 0, 0, Infinity); +ctx.setTransform(Infinity, 0, Infinity, 0, 0, 0); +ctx.setTransform(Infinity, 0, Infinity, Infinity, 0, 0); +ctx.setTransform(Infinity, 0, Infinity, Infinity, Infinity, 0); +ctx.setTransform(Infinity, 0, Infinity, Infinity, Infinity, Infinity); +ctx.setTransform(Infinity, 0, Infinity, Infinity, 0, Infinity); +ctx.setTransform(Infinity, 0, Infinity, 0, Infinity, 0); +ctx.setTransform(Infinity, 0, Infinity, 0, Infinity, Infinity); +ctx.setTransform(Infinity, 0, Infinity, 0, 0, Infinity); +ctx.setTransform(Infinity, 0, 0, Infinity, 0, 0); +ctx.setTransform(Infinity, 0, 0, Infinity, Infinity, 0); +ctx.setTransform(Infinity, 0, 0, Infinity, Infinity, Infinity); +ctx.setTransform(Infinity, 0, 0, Infinity, 0, Infinity); +ctx.setTransform(Infinity, 0, 0, 0, Infinity, 0); +ctx.setTransform(Infinity, 0, 0, 0, Infinity, Infinity); +ctx.setTransform(Infinity, 0, 0, 0, 0, Infinity); +ctx.setTransform(0, Infinity, Infinity, 0, 0, 0); +ctx.setTransform(0, Infinity, Infinity, Infinity, 0, 0); +ctx.setTransform(0, Infinity, Infinity, Infinity, Infinity, 0); +ctx.setTransform(0, Infinity, Infinity, Infinity, Infinity, Infinity); +ctx.setTransform(0, Infinity, Infinity, Infinity, 0, Infinity); +ctx.setTransform(0, Infinity, Infinity, 0, Infinity, 0); +ctx.setTransform(0, Infinity, Infinity, 0, Infinity, Infinity); +ctx.setTransform(0, Infinity, Infinity, 0, 0, Infinity); +ctx.setTransform(0, Infinity, 0, Infinity, 0, 0); +ctx.setTransform(0, Infinity, 0, Infinity, Infinity, 0); +ctx.setTransform(0, Infinity, 0, Infinity, Infinity, Infinity); +ctx.setTransform(0, Infinity, 0, Infinity, 0, Infinity); +ctx.setTransform(0, Infinity, 0, 0, Infinity, 0); +ctx.setTransform(0, Infinity, 0, 0, Infinity, Infinity); +ctx.setTransform(0, Infinity, 0, 0, 0, Infinity); +ctx.setTransform(0, 0, Infinity, Infinity, 0, 0); +ctx.setTransform(0, 0, Infinity, Infinity, Infinity, 0); +ctx.setTransform(0, 0, Infinity, Infinity, Infinity, Infinity); +ctx.setTransform(0, 0, Infinity, Infinity, 0, Infinity); +ctx.setTransform(0, 0, Infinity, 0, Infinity, 0); +ctx.setTransform(0, 0, Infinity, 0, Infinity, Infinity); +ctx.setTransform(0, 0, Infinity, 0, 0, Infinity); +ctx.setTransform(0, 0, 0, Infinity, Infinity, 0); +ctx.setTransform(0, 0, 0, Infinity, Infinity, Infinity); +ctx.setTransform(0, 0, 0, Infinity, 0, Infinity); +ctx.setTransform(0, 0, 0, 0, Infinity, Infinity); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(-100, -10, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.transformation.setTransform.skewed.js b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.setTransform.skewed.js new file mode 100644 index 0000000..325b5c6 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.setTransform.skewed.js @@ -0,0 +1,34 @@ +_addTest(function(canvas, ctx) { + +// Create green with a red square ring inside it +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(20, 10, 60, 30); +ctx.fillStyle = '#0f0'; +ctx.fillRect(40, 20, 20, 10); + +// Draw a skewed shape to fill that gap, to make sure it is aligned correctly +ctx.setTransform(1,4, 2,3, 5,6); +// Post-transform coordinates: +// [[20,10],[80,10],[80,40],[20,40],[20,10],[40,20],[40,30],[60,30],[60,20],[40,20],[20,10]]; +// Hence pre-transform coordinates: +var pts=[[-7.4,11.2],[-43.4,59.2],[-31.4,53.2],[4.6,5.2],[-7.4,11.2], + [-15.4,25.2],[-11.4,23.2],[-23.4,39.2],[-27.4,41.2],[-15.4,25.2], + [-7.4,11.2]]; +ctx.beginPath(); +ctx.moveTo(pts[0][0], pts[0][1]); +for (var i = 0; i < pts.length; ++i) + ctx.lineTo(pts[i][0], pts[i][1]); +ctx.fill(); +_assertPixel(canvas, 21,11, 0,255,0,255, "21,11", "0,255,0,255"); +_assertPixel(canvas, 79,11, 0,255,0,255, "79,11", "0,255,0,255"); +_assertPixel(canvas, 21,39, 0,255,0,255, "21,39", "0,255,0,255"); +_assertPixel(canvas, 79,39, 0,255,0,255, "79,39", "0,255,0,255"); +_assertPixel(canvas, 39,19, 0,255,0,255, "39,19", "0,255,0,255"); +_assertPixel(canvas, 61,19, 0,255,0,255, "61,19", "0,255,0,255"); +_assertPixel(canvas, 39,31, 0,255,0,255, "39,31", "0,255,0,255"); +_assertPixel(canvas, 61,31, 0,255,0,255, "61,31", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.transformation.transform.identity.js b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.transform.identity.js new file mode 100644 index 0000000..2b8e39f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.transform.identity.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.transform(1,0, 0,1, 0,0); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.transformation.transform.multiply.js b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.transform.multiply.js new file mode 100644 index 0000000..f91ed59 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.transform.multiply.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.transform(1,2, 3,4, 5,6); +ctx.transform(-2,1, 3/2,-1/2, 1,-2); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.transformation.transform.nonfinite.js b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.transform.nonfinite.js new file mode 100644 index 0000000..e8eaec2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.transform.nonfinite.js @@ -0,0 +1,89 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.translate(100, 10); +ctx.transform(Infinity, 0, 0, 0, 0, 0); +ctx.transform(-Infinity, 0, 0, 0, 0, 0); +ctx.transform(NaN, 0, 0, 0, 0, 0); +ctx.transform(0, Infinity, 0, 0, 0, 0); +ctx.transform(0, -Infinity, 0, 0, 0, 0); +ctx.transform(0, NaN, 0, 0, 0, 0); +ctx.transform(0, 0, Infinity, 0, 0, 0); +ctx.transform(0, 0, -Infinity, 0, 0, 0); +ctx.transform(0, 0, NaN, 0, 0, 0); +ctx.transform(0, 0, 0, Infinity, 0, 0); +ctx.transform(0, 0, 0, -Infinity, 0, 0); +ctx.transform(0, 0, 0, NaN, 0, 0); +ctx.transform(0, 0, 0, 0, Infinity, 0); +ctx.transform(0, 0, 0, 0, -Infinity, 0); +ctx.transform(0, 0, 0, 0, NaN, 0); +ctx.transform(0, 0, 0, 0, 0, Infinity); +ctx.transform(0, 0, 0, 0, 0, -Infinity); +ctx.transform(0, 0, 0, 0, 0, NaN); +ctx.transform(Infinity, Infinity, 0, 0, 0, 0); +ctx.transform(Infinity, Infinity, Infinity, 0, 0, 0); +ctx.transform(Infinity, Infinity, Infinity, Infinity, 0, 0); +ctx.transform(Infinity, Infinity, Infinity, Infinity, Infinity, 0); +ctx.transform(Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); +ctx.transform(Infinity, Infinity, Infinity, Infinity, 0, Infinity); +ctx.transform(Infinity, Infinity, Infinity, 0, Infinity, 0); +ctx.transform(Infinity, Infinity, Infinity, 0, Infinity, Infinity); +ctx.transform(Infinity, Infinity, Infinity, 0, 0, Infinity); +ctx.transform(Infinity, Infinity, 0, Infinity, 0, 0); +ctx.transform(Infinity, Infinity, 0, Infinity, Infinity, 0); +ctx.transform(Infinity, Infinity, 0, Infinity, Infinity, Infinity); +ctx.transform(Infinity, Infinity, 0, Infinity, 0, Infinity); +ctx.transform(Infinity, Infinity, 0, 0, Infinity, 0); +ctx.transform(Infinity, Infinity, 0, 0, Infinity, Infinity); +ctx.transform(Infinity, Infinity, 0, 0, 0, Infinity); +ctx.transform(Infinity, 0, Infinity, 0, 0, 0); +ctx.transform(Infinity, 0, Infinity, Infinity, 0, 0); +ctx.transform(Infinity, 0, Infinity, Infinity, Infinity, 0); +ctx.transform(Infinity, 0, Infinity, Infinity, Infinity, Infinity); +ctx.transform(Infinity, 0, Infinity, Infinity, 0, Infinity); +ctx.transform(Infinity, 0, Infinity, 0, Infinity, 0); +ctx.transform(Infinity, 0, Infinity, 0, Infinity, Infinity); +ctx.transform(Infinity, 0, Infinity, 0, 0, Infinity); +ctx.transform(Infinity, 0, 0, Infinity, 0, 0); +ctx.transform(Infinity, 0, 0, Infinity, Infinity, 0); +ctx.transform(Infinity, 0, 0, Infinity, Infinity, Infinity); +ctx.transform(Infinity, 0, 0, Infinity, 0, Infinity); +ctx.transform(Infinity, 0, 0, 0, Infinity, 0); +ctx.transform(Infinity, 0, 0, 0, Infinity, Infinity); +ctx.transform(Infinity, 0, 0, 0, 0, Infinity); +ctx.transform(0, Infinity, Infinity, 0, 0, 0); +ctx.transform(0, Infinity, Infinity, Infinity, 0, 0); +ctx.transform(0, Infinity, Infinity, Infinity, Infinity, 0); +ctx.transform(0, Infinity, Infinity, Infinity, Infinity, Infinity); +ctx.transform(0, Infinity, Infinity, Infinity, 0, Infinity); +ctx.transform(0, Infinity, Infinity, 0, Infinity, 0); +ctx.transform(0, Infinity, Infinity, 0, Infinity, Infinity); +ctx.transform(0, Infinity, Infinity, 0, 0, Infinity); +ctx.transform(0, Infinity, 0, Infinity, 0, 0); +ctx.transform(0, Infinity, 0, Infinity, Infinity, 0); +ctx.transform(0, Infinity, 0, Infinity, Infinity, Infinity); +ctx.transform(0, Infinity, 0, Infinity, 0, Infinity); +ctx.transform(0, Infinity, 0, 0, Infinity, 0); +ctx.transform(0, Infinity, 0, 0, Infinity, Infinity); +ctx.transform(0, Infinity, 0, 0, 0, Infinity); +ctx.transform(0, 0, Infinity, Infinity, 0, 0); +ctx.transform(0, 0, Infinity, Infinity, Infinity, 0); +ctx.transform(0, 0, Infinity, Infinity, Infinity, Infinity); +ctx.transform(0, 0, Infinity, Infinity, 0, Infinity); +ctx.transform(0, 0, Infinity, 0, Infinity, 0); +ctx.transform(0, 0, Infinity, 0, Infinity, Infinity); +ctx.transform(0, 0, Infinity, 0, 0, Infinity); +ctx.transform(0, 0, 0, Infinity, Infinity, 0); +ctx.transform(0, 0, 0, Infinity, Infinity, Infinity); +ctx.transform(0, 0, 0, Infinity, 0, Infinity); +ctx.transform(0, 0, 0, 0, Infinity, Infinity); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(-100, -10, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.transformation.transform.skewed.js b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.transform.skewed.js new file mode 100644 index 0000000..b1d8424 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.transform.skewed.js @@ -0,0 +1,34 @@ +_addTest(function(canvas, ctx) { + +// Create green with a red square ring inside it +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(20, 10, 60, 30); +ctx.fillStyle = '#0f0'; +ctx.fillRect(40, 20, 20, 10); + +// Draw a skewed shape to fill that gap, to make sure it is aligned correctly +ctx.transform(1,4, 2,3, 5,6); +// Post-transform coordinates: +// [[20,10],[80,10],[80,40],[20,40],[20,10],[40,20],[40,30],[60,30],[60,20],[40,20],[20,10]]; +// Hence pre-transform coordinates: +var pts=[[-7.4,11.2],[-43.4,59.2],[-31.4,53.2],[4.6,5.2],[-7.4,11.2], + [-15.4,25.2],[-11.4,23.2],[-23.4,39.2],[-27.4,41.2],[-15.4,25.2], + [-7.4,11.2]]; +ctx.beginPath(); +ctx.moveTo(pts[0][0], pts[0][1]); +for (var i = 0; i < pts.length; ++i) + ctx.lineTo(pts[i][0], pts[i][1]); +ctx.fill(); +_assertPixel(canvas, 21,11, 0,255,0,255, "21,11", "0,255,0,255"); +_assertPixel(canvas, 79,11, 0,255,0,255, "79,11", "0,255,0,255"); +_assertPixel(canvas, 21,39, 0,255,0,255, "21,39", "0,255,0,255"); +_assertPixel(canvas, 79,39, 0,255,0,255, "79,39", "0,255,0,255"); +_assertPixel(canvas, 39,19, 0,255,0,255, "39,19", "0,255,0,255"); +_assertPixel(canvas, 61,19, 0,255,0,255, "61,19", "0,255,0,255"); +_assertPixel(canvas, 39,31, 0,255,0,255, "39,31", "0,255,0,255"); +_assertPixel(canvas, 61,31, 0,255,0,255, "61,31", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.transformation.translate.basic.js b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.translate.basic.js new file mode 100644 index 0000000..5ab55cc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.translate.basic.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.translate(100, 50); +ctx.fillStyle = '#0f0'; +ctx.fillRect(-100, -50, 100, 50); +_assertPixel(canvas, 90,40, 0,255,0,255, "90,40", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.transformation.translate.nonfinite.js b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.translate.nonfinite.js new file mode 100644 index 0000000..616d328 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.transformation.translate.nonfinite.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.translate(100, 10); +ctx.translate(Infinity, 0.1); +ctx.translate(-Infinity, 0.1); +ctx.translate(NaN, 0.1); +ctx.translate(0.1, Infinity); +ctx.translate(0.1, -Infinity); +ctx.translate(0.1, NaN); +ctx.translate(Infinity, Infinity); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(-100, -10, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.2d.voidreturn.js b/platforms/ios/www/test/tests-todo/minimal.2d.voidreturn.js new file mode 100644 index 0000000..b419b77 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.2d.voidreturn.js @@ -0,0 +1,41 @@ +_addTest(function(canvas, ctx) { + +_assertSame(ctx.save(), undefined, "ctx.save()", "undefined"); +_assertSame(ctx.restore(), undefined, "ctx.restore()", "undefined"); +_assertSame(ctx.scale(1, 1), undefined, "ctx.scale(1, 1)", "undefined"); +_assertSame(ctx.rotate(0), undefined, "ctx.rotate(0)", "undefined"); +_assertSame(ctx.translate(0, 0), undefined, "ctx.translate(0, 0)", "undefined"); +if (ctx.transform) { // (avoid spurious failures, since the aim here is not to test that all features are supported) + _assertSame(ctx.transform(1, 0, 0, 1, 0, 0), undefined, "ctx.transform(1, 0, 0, 1, 0, 0)", "undefined"); +} +if (ctx.setTransform) { + _assertSame(ctx.setTransform(1, 0, 0, 1, 0, 0), undefined, "ctx.setTransform(1, 0, 0, 1, 0, 0)", "undefined"); +} +_assertSame(ctx.clearRect(0, 0, 0, 0), undefined, "ctx.clearRect(0, 0, 0, 0)", "undefined"); +_assertSame(ctx.fillRect(0, 0, 0, 0), undefined, "ctx.fillRect(0, 0, 0, 0)", "undefined"); +_assertSame(ctx.strokeRect(0, 0, 0, 0), undefined, "ctx.strokeRect(0, 0, 0, 0)", "undefined"); +_assertSame(ctx.beginPath(), undefined, "ctx.beginPath()", "undefined"); +_assertSame(ctx.closePath(), undefined, "ctx.closePath()", "undefined"); +_assertSame(ctx.moveTo(0, 0), undefined, "ctx.moveTo(0, 0)", "undefined"); +_assertSame(ctx.lineTo(0, 0), undefined, "ctx.lineTo(0, 0)", "undefined"); +_assertSame(ctx.quadraticCurveTo(0, 0, 0, 0), undefined, "ctx.quadraticCurveTo(0, 0, 0, 0)", "undefined"); +_assertSame(ctx.bezierCurveTo(0, 0, 0, 0, 0, 0), undefined, "ctx.bezierCurveTo(0, 0, 0, 0, 0, 0)", "undefined"); +_assertSame(ctx.arcTo(0, 0, 0, 0, 1), undefined, "ctx.arcTo(0, 0, 0, 0, 1)", "undefined"); +_assertSame(ctx.rect(0, 0, 0, 0), undefined, "ctx.rect(0, 0, 0, 0)", "undefined"); +_assertSame(ctx.arc(0, 0, 1, 0, 0, true), undefined, "ctx.arc(0, 0, 1, 0, 0, true)", "undefined"); +_assertSame(ctx.fill(), undefined, "ctx.fill()", "undefined"); +_assertSame(ctx.stroke(), undefined, "ctx.stroke()", "undefined"); +_assertSame(ctx.clip(), undefined, "ctx.clip()", "undefined"); +if (ctx.fillText) { + _assertSame(ctx.fillText('test', 0, 0), undefined, "ctx.fillText('test', 0, 0)", "undefined"); + _assertSame(ctx.strokeText('test', 0, 0), undefined, "ctx.strokeText('test', 0, 0)", "undefined"); +} +if (ctx.putImageData) { + _assertSame(ctx.putImageData(ctx.getImageData(0, 0, 1, 1), 0, 0), undefined, "ctx.putImageData(ctx.getImageData(0, 0, 1, 1), 0, 0)", "undefined"); +} +_assertSame(ctx.drawImage(document.getElementById('yellow.png'), 0, 0, 1, 1, 0, 0, 0, 0), undefined, "ctx.drawImage(document.getElementById('yellow.png'), 0, 0, 1, 1, 0, 0, 0, 0)", "undefined"); +_assertSame(ctx.drawImage(canvas, 0, 0, 1, 1, 0, 0, 0, 0), undefined, "ctx.drawImage(canvas, 0, 0, 1, 1, 0, 0, 0, 0)", "undefined"); +_assertSame(ctx.createLinearGradient(0, 0, 0, 0).addColorStop(0, 'white'), undefined, "ctx.createLinearGradient(0, 0, 0, 0).addColorStop(0, 'white')", "undefined"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.context.casesensitive.js b/platforms/ios/www/test/tests-todo/minimal.context.casesensitive.js new file mode 100644 index 0000000..8ab0ef8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.context.casesensitive.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.getContext('2D'), null, "canvas.getContext('2D')", "null"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.context.emptystring.js b/platforms/ios/www/test/tests-todo/minimal.context.emptystring.js new file mode 100644 index 0000000..742a111 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.context.emptystring.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.getContext(""), null, "canvas.getContext(\"\")", "null"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.context.unrecognised.badname.js b/platforms/ios/www/test/tests-todo/minimal.context.unrecognised.badname.js new file mode 100644 index 0000000..941a0b8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.context.unrecognised.badname.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.getContext('This is not an implemented context in any real browser'), null, "canvas.getContext('This is not an implemented context in any real browser')", "null"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.context.unrecognised.badsuffix.js b/platforms/ios/www/test/tests-todo/minimal.context.unrecognised.badsuffix.js new file mode 100644 index 0000000..c56623c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.context.unrecognised.badsuffix.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.getContext("2d#"), null, "canvas.getContext(\"2d#\")", "null"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.context.unrecognised.nullsuffix.js b/platforms/ios/www/test/tests-todo/minimal.context.unrecognised.nullsuffix.js new file mode 100644 index 0000000..121a5ca --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.context.unrecognised.nullsuffix.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.getContext("2d\0"), null, "canvas.getContext(\"2d\\0\")", "null"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.context.unrecognised.unicode.js b/platforms/ios/www/test/tests-todo/minimal.context.unrecognised.unicode.js new file mode 100644 index 0000000..1bf51ef --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.context.unrecognised.unicode.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.getContext("2\uFF44"), null, "canvas.getContext(\"2\\uFF44\")", "null"); // Fullwidth Latin Small Letter D + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.fallback.basic.js b/platforms/ios/www/test/tests-todo/minimal.fallback.basic.js new file mode 100644 index 0000000..9753080 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.fallback.basic.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertEqual(canvas.childNodes.length, 1, "canvas.childNodes.length", "1"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.fallback.multiple.js b/platforms/ios/www/test/tests-todo/minimal.fallback.multiple.js new file mode 100644 index 0000000..6eddbe1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.fallback.multiple.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertEqual(canvas.childNodes.length, 2, "canvas.childNodes.length", "2"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.fallback.nested.js b/platforms/ios/www/test/tests-todo/minimal.fallback.nested.js new file mode 100644 index 0000000..6eddbe1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.fallback.nested.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertEqual(canvas.childNodes.length, 2, "canvas.childNodes.length", "2"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.initial.colour.js b/platforms/ios/www/test/tests-todo/minimal.initial.colour.js new file mode 100644 index 0000000..be87769 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.initial.colour.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertPixel(canvas, 20,20, 0,0,0,0, "20,20", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.initial.reset.2dstate.js b/platforms/ios/www/test/tests-todo/minimal.initial.reset.2dstate.js new file mode 100644 index 0000000..c3a970b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.initial.reset.2dstate.js @@ -0,0 +1,82 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 100; +var default_val; + +default_val = ctx.strokeStyle; +ctx.strokeStyle = "#ff0000"; +canvas.width = 100; +_assertSame(ctx.strokeStyle, default_val, "ctx.strokeStyle", "default_val"); + +default_val = ctx.fillStyle; +ctx.fillStyle = "#ff0000"; +canvas.width = 100; +_assertSame(ctx.fillStyle, default_val, "ctx.fillStyle", "default_val"); + +default_val = ctx.globalAlpha; +ctx.globalAlpha = 0.5; +canvas.width = 100; +_assertSame(ctx.globalAlpha, default_val, "ctx.globalAlpha", "default_val"); + +default_val = ctx.lineWidth; +ctx.lineWidth = 0.5; +canvas.width = 100; +_assertSame(ctx.lineWidth, default_val, "ctx.lineWidth", "default_val"); + +default_val = ctx.lineCap; +ctx.lineCap = "round"; +canvas.width = 100; +_assertSame(ctx.lineCap, default_val, "ctx.lineCap", "default_val"); + +default_val = ctx.lineJoin; +ctx.lineJoin = "round"; +canvas.width = 100; +_assertSame(ctx.lineJoin, default_val, "ctx.lineJoin", "default_val"); + +default_val = ctx.miterLimit; +ctx.miterLimit = 0.5; +canvas.width = 100; +_assertSame(ctx.miterLimit, default_val, "ctx.miterLimit", "default_val"); + +default_val = ctx.shadowOffsetX; +ctx.shadowOffsetX = 5; +canvas.width = 100; +_assertSame(ctx.shadowOffsetX, default_val, "ctx.shadowOffsetX", "default_val"); + +default_val = ctx.shadowOffsetY; +ctx.shadowOffsetY = 5; +canvas.width = 100; +_assertSame(ctx.shadowOffsetY, default_val, "ctx.shadowOffsetY", "default_val"); + +default_val = ctx.shadowBlur; +ctx.shadowBlur = 5; +canvas.width = 100; +_assertSame(ctx.shadowBlur, default_val, "ctx.shadowBlur", "default_val"); + +default_val = ctx.shadowColor; +ctx.shadowColor = "#ff0000"; +canvas.width = 100; +_assertSame(ctx.shadowColor, default_val, "ctx.shadowColor", "default_val"); + +default_val = ctx.globalCompositeOperation; +ctx.globalCompositeOperation = "copy"; +canvas.width = 100; +_assertSame(ctx.globalCompositeOperation, default_val, "ctx.globalCompositeOperation", "default_val"); + +default_val = ctx.font; +ctx.font = "25px serif"; +canvas.width = 100; +_assertSame(ctx.font, default_val, "ctx.font", "default_val"); + +default_val = ctx.textAlign; +ctx.textAlign = "center"; +canvas.width = 100; +_assertSame(ctx.textAlign, default_val, "ctx.textAlign", "default_val"); + +default_val = ctx.textBaseline; +ctx.textBaseline = "bottom"; +canvas.width = 100; +_assertSame(ctx.textBaseline, default_val, "ctx.textBaseline", "default_val"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.initial.reset.clip.js b/platforms/ios/www/test/tests-todo/minimal.initial.reset.clip.js new file mode 100644 index 0000000..3c86bd3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.initial.reset.clip.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 100; +ctx.rect(0, 0, 1, 1); +ctx.clip(); +canvas.width = 100; +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 20,20, 0,255,0,255, "20,20", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.initial.reset.different.js b/platforms/ios/www/test/tests-todo/minimal.initial.reset.different.js new file mode 100644 index 0000000..032822c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.initial.reset.different.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 20,20, 255,0,0,255, "20,20", "255,0,0,255"); +canvas.width = 50; +_assertPixel(canvas, 20,20, 0,0,0,0, "20,20", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.initial.reset.gradient.js b/platforms/ios/www/test/tests-todo/minimal.initial.reset.gradient.js new file mode 100644 index 0000000..54e141e --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.initial.reset.gradient.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 50; +var g = ctx.createLinearGradient(0, 0, 100, 0); +g.addColorStop(0, '#0f0'); +g.addColorStop(1, '#0f0'); +canvas.width = 100; +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.initial.reset.path.js b/platforms/ios/www/test/tests-todo/minimal.initial.reset.path.js new file mode 100644 index 0000000..2b8b948 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.initial.reset.path.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 100; +ctx.rect(0, 0, 100, 50); +canvas.width = 100; +ctx.fillStyle = '#f00'; +ctx.fill(); +_assertPixel(canvas, 20,20, 0,0,0,0, "20,20", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.initial.reset.pattern.js b/platforms/ios/www/test/tests-todo/minimal.initial.reset.pattern.js new file mode 100644 index 0000000..12b78fb --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.initial.reset.pattern.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 30; +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 30, 50); +var p = ctx.createPattern(canvas, 'repeat-x'); +canvas.width = 100; +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = p; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.initial.reset.same.js b/platforms/ios/www/test/tests-todo/minimal.initial.reset.same.js new file mode 100644 index 0000000..14deafb --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.initial.reset.same.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 100; +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 20,20, 255,0,0,255, "20,20", "255,0,0,255"); +canvas.width = 100; +_assertPixel(canvas, 20,20, 0,0,0,0, "20,20", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.initial.reset.transform.js b/platforms/ios/www/test/tests-todo/minimal.initial.reset.transform.js new file mode 100644 index 0000000..5a3f98b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.initial.reset.transform.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 100; +ctx.scale(0.1, 0.1); +canvas.width = 100; +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 20,20, 0,255,0,255, "20,20", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.security.dataURI.js b/platforms/ios/www/test/tests-todo/minimal.security.dataURI.js new file mode 100644 index 0000000..4a31daa --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.security.dataURI.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +var data = canvas.toDataURL(); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +var img = new Image(); +deferTest(); +img.onload = wrapFunction(function () +{ + ctx.drawImage(img, 0, 0); + canvas.toDataURL(); // should be permitted + _assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +}); +img.src = data; + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.security.drawImage.canvas.js b/platforms/ios/www/test/tests-todo/minimal.security.drawImage.canvas.js new file mode 100644 index 0000000..c000ef4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.security.drawImage.canvas.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.drawImage(document.getElementById('yellow.png'), 0, 0); +ctx.drawImage(canvas2, 0, 0); +try { var _thrown = false; canvas.toDataURL(); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: canvas.toDataURL()"); } +try { var _thrown = false; ctx.getImageData(0, 0, 1, 1); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: ctx.getImageData(0, 0, 1, 1)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.security.drawImage.image.js b/platforms/ios/www/test/tests-todo/minimal.security.drawImage.image.js new file mode 100644 index 0000000..8f29754 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.security.drawImage.image.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +ctx.drawImage(document.getElementById('yellow.png'), 0, 0); +try { var _thrown = false; canvas.toDataURL(); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: canvas.toDataURL()"); } +try { var _thrown = false; ctx.getImageData(0, 0, 1, 1); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: ctx.getImageData(0, 0, 1, 1)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.security.pattern.canvas.fillStyle.js b/platforms/ios/www/test/tests-todo/minimal.security.pattern.canvas.fillStyle.js new file mode 100644 index 0000000..32c9d57 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.security.pattern.canvas.fillStyle.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.drawImage(document.getElementById('yellow.png'), 0, 0); +var p = ctx.createPattern(canvas2, 'repeat'); +ctx.fillStyle = p; +ctx.fillStyle = 'red'; +try { var _thrown = false; canvas.toDataURL(); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: canvas.toDataURL()"); } +try { var _thrown = false; ctx.getImageData(0, 0, 1, 1); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: ctx.getImageData(0, 0, 1, 1)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.security.pattern.canvas.strokeStyle.js b/platforms/ios/www/test/tests-todo/minimal.security.pattern.canvas.strokeStyle.js new file mode 100644 index 0000000..9c14a15 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.security.pattern.canvas.strokeStyle.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.drawImage(document.getElementById('yellow.png'), 0, 0); +var p = ctx.createPattern(canvas2, 'repeat'); +ctx.strokeStyle = p; +ctx.strokeStyle = 'red'; +try { var _thrown = false; canvas.toDataURL(); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: canvas.toDataURL()"); } +try { var _thrown = false; ctx.getImageData(0, 0, 1, 1); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: ctx.getImageData(0, 0, 1, 1)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.security.pattern.canvas.timing.js b/platforms/ios/www/test/tests-todo/minimal.security.pattern.canvas.timing.js new file mode 100644 index 0000000..76ed28a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.security.pattern.canvas.timing.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = '#0f0'; +ctx2.fillRect(0, 0, 100, 50); +var p = ctx.createPattern(canvas2, 'repeat'); +ctx2.drawImage(document.getElementById('yellow.png'), 0, 0); // make canvas2 origin-unclean +ctx.fillStyle = p; +ctx.fillRect(0, 0, 100, 50); +canvas.toDataURL(); +ctx.getImageData(0, 0, 1, 1); +_assert(true, "true"); // okay if there was no exception + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.security.pattern.create.js b/platforms/ios/www/test/tests-todo/minimal.security.pattern.create.js new file mode 100644 index 0000000..a45b354 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.security.pattern.create.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +var p = ctx.createPattern(document.getElementById('yellow.png'), 'repeat'); +canvas.toDataURL(); +ctx.getImageData(0, 0, 1, 1); +_assert(true, "true"); // okay if there was no exception + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.security.pattern.cross.js b/platforms/ios/www/test/tests-todo/minimal.security.pattern.cross.js new file mode 100644 index 0000000..81be569 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.security.pattern.cross.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +var p = ctx2.createPattern(document.getElementById('yellow.png'), 'repeat'); +ctx.fillStyle = p; +ctx.fillRect(0, 0, 100, 50); +try { var _thrown = false; canvas.toDataURL(); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: canvas.toDataURL()"); } +try { var _thrown = false; ctx.getImageData(0, 0, 1, 1); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: ctx.getImageData(0, 0, 1, 1)"); } +canvas2.toDataURL(); +ctx2.getImageData(0, 0, 1, 1); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.security.pattern.image.fillStyle.js b/platforms/ios/www/test/tests-todo/minimal.security.pattern.image.fillStyle.js new file mode 100644 index 0000000..9818f60 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.security.pattern.image.fillStyle.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +var p = ctx.createPattern(document.getElementById('yellow.png'), 'repeat'); +ctx.fillStyle = p; +ctx.fillStyle = 'red'; +try { var _thrown = false; canvas.toDataURL(); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: canvas.toDataURL()"); } +try { var _thrown = false; ctx.getImageData(0, 0, 1, 1); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: ctx.getImageData(0, 0, 1, 1)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.security.pattern.image.strokeStyle.js b/platforms/ios/www/test/tests-todo/minimal.security.pattern.image.strokeStyle.js new file mode 100644 index 0000000..89e7561 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.security.pattern.image.strokeStyle.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +var p = ctx.createPattern(document.getElementById('yellow.png'), 'repeat'); +ctx.strokeStyle = p; +ctx.strokeStyle = 'red'; +try { var _thrown = false; canvas.toDataURL(); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: canvas.toDataURL()"); } +try { var _thrown = false; ctx.getImageData(0, 0, 1, 1); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: ctx.getImageData(0, 0, 1, 1)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.security.reset.js b/platforms/ios/www/test/tests-todo/minimal.security.reset.js new file mode 100644 index 0000000..22cd77c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.security.reset.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 50; +ctx.drawImage(document.getElementById('yellow.png'), 0, 0); +try { var _thrown = false; canvas.toDataURL(); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: canvas.toDataURL()"); } +canvas.width = 100; +try { var _thrown = false; canvas.toDataURL(); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: canvas.toDataURL()"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.size.attributes.default.js b/platforms/ios/www/test/tests-todo/minimal.size.attributes.default.js new file mode 100644 index 0000000..7f32024 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.size.attributes.default.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 300, "canvas.width", "300"); +_assertSame(canvas.height, 150, "canvas.height", "150"); +_assert(!canvas.hasAttribute('width'), "!canvas.hasAttribute('width')"); +_assert(!canvas.hasAttribute('height'), "!canvas.hasAttribute('height')"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.size.attributes.get.js b/platforms/ios/www/test/tests-todo/minimal.size.attributes.get.js new file mode 100644 index 0000000..47eef4f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.size.attributes.get.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 120, "canvas.width", "120"); +_assertSame(canvas.height, 60, "canvas.height", "60"); +_assertSame(canvas.getAttribute('width'), '120', "canvas.getAttribute('width')", "'120'"); +_assertSame(canvas.getAttribute('height'), '60', "canvas.getAttribute('height')", "'60'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.size.attributes.idl.js b/platforms/ios/www/test/tests-todo/minimal.size.attributes.idl.js new file mode 100644 index 0000000..edd0f4b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.size.attributes.idl.js @@ -0,0 +1,29 @@ +_addTest(function(canvas, ctx) { + +canvas.width = "100"; +canvas.height = "100"; +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); + +canvas.width = "+1.5e2"; +canvas.height = "0x96"; +_assertSame(canvas.width, 150, "canvas.width", "150"); +_assertSame(canvas.height, 150, "canvas.height", "150"); + +canvas.width = 200 - Math.pow(2, 32); +canvas.height = 200 - Math.pow(2, 32); +_assertSame(canvas.width, 200, "canvas.width", "200"); +_assertSame(canvas.height, 200, "canvas.height", "200"); + +canvas.width = 301.999; +canvas.height = 301.001; +_assertSame(canvas.width, 301, "canvas.width", "301"); +_assertSame(canvas.height, 301, "canvas.height", "301"); + +canvas.width = "400x"; +canvas.height = "foo"; +_assertSame(canvas.width, 0, "canvas.width", "0"); +_assertSame(canvas.height, 0, "canvas.height", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.size.attributes.idl.set.zero.js b/platforms/ios/www/test/tests-todo/minimal.size.attributes.idl.set.zero.js new file mode 100644 index 0000000..5952df1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.size.attributes.idl.set.zero.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 0; +canvas.height = 0; +_assertSame(canvas.width, 0, "canvas.width", "0"); +_assertSame(canvas.height, 0, "canvas.height", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.decimal.js b/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.decimal.js new file mode 100644 index 0000000..044156b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.decimal.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.em.js b/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.em.js new file mode 100644 index 0000000..044156b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.em.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.empty.js b/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.empty.js new file mode 100644 index 0000000..78b3641 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.empty.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 300, "canvas.width", "300"); +_assertSame(canvas.height, 150, "canvas.height", "150"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.exp.js b/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.exp.js new file mode 100644 index 0000000..044156b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.exp.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.hex.js b/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.hex.js new file mode 100644 index 0000000..7d69957 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.hex.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 0, "canvas.width", "0"); +_assertSame(canvas.height, 0, "canvas.height", "0"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "0px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"0px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.junk.js b/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.junk.js new file mode 100644 index 0000000..78b3641 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.junk.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 300, "canvas.width", "300"); +_assertSame(canvas.height, 150, "canvas.height", "150"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.minus.js b/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.minus.js new file mode 100644 index 0000000..78b3641 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.minus.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 300, "canvas.width", "300"); +_assertSame(canvas.height, 150, "canvas.height", "150"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.octal.js b/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.octal.js new file mode 100644 index 0000000..044156b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.octal.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.onlyspace.js b/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.onlyspace.js new file mode 100644 index 0000000..78b3641 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.onlyspace.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 300, "canvas.width", "300"); +_assertSame(canvas.height, 150, "canvas.height", "150"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.percent.js b/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.percent.js new file mode 100644 index 0000000..044156b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.percent.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.plus.js b/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.plus.js new file mode 100644 index 0000000..044156b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.plus.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.space.js b/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.space.js new file mode 100644 index 0000000..044156b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.space.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.trailingjunk.js b/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.trailingjunk.js new file mode 100644 index 0000000..044156b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.trailingjunk.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.whitespace.js b/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.whitespace.js new file mode 100644 index 0000000..044156b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.whitespace.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.zero.js b/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.zero.js new file mode 100644 index 0000000..7d69957 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.size.attributes.parse.zero.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 0, "canvas.width", "0"); +_assertSame(canvas.height, 0, "canvas.height", "0"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "0px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"0px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.size.attributes.reflect.setcontent.js b/platforms/ios/www/test/tests-todo/minimal.size.attributes.reflect.setcontent.js new file mode 100644 index 0000000..adfcc79 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.size.attributes.reflect.setcontent.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', '120'); +canvas.setAttribute('height', '60'); +_assertSame(canvas.getAttribute('width'), '120', "canvas.getAttribute('width')", "'120'"); +_assertSame(canvas.getAttribute('height'), '60', "canvas.getAttribute('height')", "'60'"); +_assertSame(canvas.width, 120, "canvas.width", "120"); +_assertSame(canvas.height, 60, "canvas.height", "60"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.size.attributes.reflect.setidl.js b/platforms/ios/www/test/tests-todo/minimal.size.attributes.reflect.setidl.js new file mode 100644 index 0000000..0e295e2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.size.attributes.reflect.setidl.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 120; +canvas.height = 60; +_assertSame(canvas.getAttribute('width'), '120', "canvas.getAttribute('width')", "'120'"); +_assertSame(canvas.getAttribute('height'), '60', "canvas.getAttribute('height')", "'60'"); +_assertSame(canvas.width, 120, "canvas.width", "120"); +_assertSame(canvas.height, 60, "canvas.height", "60"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.size.attributes.reflect.setidlzero.js b/platforms/ios/www/test/tests-todo/minimal.size.attributes.reflect.setidlzero.js new file mode 100644 index 0000000..015bfa7 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.size.attributes.reflect.setidlzero.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 0; +canvas.height = 0; +_assertSame(canvas.getAttribute('width'), '0', "canvas.getAttribute('width')", "'0'"); +_assertSame(canvas.getAttribute('height'), '0', "canvas.getAttribute('height')", "'0'"); +_assertSame(canvas.width, 0, "canvas.width", "0"); +_assertSame(canvas.height, 0, "canvas.height", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.size.attributes.removed.js b/platforms/ios/www/test/tests-todo/minimal.size.attributes.removed.js new file mode 100644 index 0000000..3840046 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.size.attributes.removed.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 120, "canvas.width", "120"); +canvas.removeAttribute('width'); +_assertSame(canvas.width, 300, "canvas.width", "300"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.size.attributes.set.js b/platforms/ios/www/test/tests-todo/minimal.size.attributes.set.js new file mode 100644 index 0000000..f150b97 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.size.attributes.set.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 120; +canvas.height = 60; +_assertSame(canvas.width, 120, "canvas.width", "120"); +_assertSame(canvas.height, 60, "canvas.height", "60"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.decimal.js b/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.decimal.js new file mode 100644 index 0000000..682ed15 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.decimal.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', '100.999'); +canvas.setAttribute('height', '100.999'); +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.em.js b/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.em.js new file mode 100644 index 0000000..97f9d6b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.em.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', '100em'); +canvas.setAttribute('height', '100em'); +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.empty.js b/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.empty.js new file mode 100644 index 0000000..44c9ca2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.empty.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', ''); +canvas.setAttribute('height', ''); +_assertSame(canvas.width, 300, "canvas.width", "300"); +_assertSame(canvas.height, 150, "canvas.height", "150"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.exp.js b/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.exp.js new file mode 100644 index 0000000..ded7cee --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.exp.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', '100e1'); +canvas.setAttribute('height', '100e1'); +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.hex.js b/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.hex.js new file mode 100644 index 0000000..55f4fd3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.hex.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', '0x100'); +canvas.setAttribute('height', '0x100'); +_assertSame(canvas.width, 0, "canvas.width", "0"); +_assertSame(canvas.height, 0, "canvas.height", "0"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "0px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"0px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.junk.js b/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.junk.js new file mode 100644 index 0000000..04830d5 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.junk.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', '#!?'); +canvas.setAttribute('height', '#!?'); +_assertSame(canvas.width, 300, "canvas.width", "300"); +_assertSame(canvas.height, 150, "canvas.height", "150"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.minus.js b/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.minus.js new file mode 100644 index 0000000..f16c035 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.minus.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', '-100'); +canvas.setAttribute('height', '-100'); +_assertSame(canvas.width, 300, "canvas.width", "300"); +_assertSame(canvas.height, 150, "canvas.height", "150"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.octal.js b/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.octal.js new file mode 100644 index 0000000..d84eba9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.octal.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', '0100'); +canvas.setAttribute('height', '0100'); +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.onlyspace.js b/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.onlyspace.js new file mode 100644 index 0000000..259a0c8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.onlyspace.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', ' '); +canvas.setAttribute('height', ' '); +_assertSame(canvas.width, 300, "canvas.width", "300"); +_assertSame(canvas.height, 150, "canvas.height", "150"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.percent.js b/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.percent.js new file mode 100644 index 0000000..411d4fc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.percent.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', '100%'); +canvas.setAttribute('height', '100%'); +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.plus.js b/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.plus.js new file mode 100644 index 0000000..a512583 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.plus.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', '+100'); +canvas.setAttribute('height', '+100'); +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.space.js b/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.space.js new file mode 100644 index 0000000..56880e5 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.space.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', ' 100'); +canvas.setAttribute('height', ' 100'); +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.trailingjunk.js b/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.trailingjunk.js new file mode 100644 index 0000000..826a3ac --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.trailingjunk.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', '100#!?'); +canvas.setAttribute('height', '100#!?'); +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.whitespace.js b/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.whitespace.js new file mode 100644 index 0000000..e0db93d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.whitespace.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', '\r\n\t\x0c100'); +canvas.setAttribute('height', '\r\n\t\x0c100'); +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.zero.js b/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.zero.js new file mode 100644 index 0000000..d2f7160 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.size.attributes.setAttribute.zero.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', '0'); +canvas.setAttribute('height', '0'); +_assertSame(canvas.width, 0, "canvas.width", "0"); +_assertSame(canvas.height, 0, "canvas.height", "0"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "0px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"0px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.size.attributes.style.js b/platforms/ios/www/test/tests-todo/minimal.size.attributes.style.js new file mode 100644 index 0000000..1d91d9a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.size.attributes.style.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +_assertEqual(canvas.width, 50, "canvas.width", "50"); +_assertEqual(canvas.height, 30, "canvas.height", "30"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.toDataURL.arguments.1.js b/platforms/ios/www/test/tests-todo/minimal.toDataURL.arguments.1.js new file mode 100644 index 0000000..a174352 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.toDataURL.arguments.1.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +var data = canvas.toDataURL('image/png', 'another argument that should not raise an exception'); +_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.toDataURL.arguments.2.js b/platforms/ios/www/test/tests-todo/minimal.toDataURL.arguments.2.js new file mode 100644 index 0000000..f03e416 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.toDataURL.arguments.2.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +var data = canvas.toDataURL('image/png', 'another argument that should not raise an exception', 'and another'); +_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.toDataURL.arguments.3.js b/platforms/ios/www/test/tests-todo/minimal.toDataURL.arguments.3.js new file mode 100644 index 0000000..3725aa9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.toDataURL.arguments.3.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +// More arguments that should not raise exceptions +var data = canvas.toDataURL('image/png', null, null, null); +_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.toDataURL.bogustype.js b/platforms/ios/www/test/tests-todo/minimal.toDataURL.bogustype.js new file mode 100644 index 0000000..6cf5d2b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.toDataURL.bogustype.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +var data = canvas.toDataURL('bogus'); +_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.toDataURL.default.js b/platforms/ios/www/test/tests-todo/minimal.toDataURL.default.js new file mode 100644 index 0000000..49bc0a1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.toDataURL.default.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +var data = canvas.toDataURL(); +_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.toDataURL.jpeg.alpha.js b/platforms/ios/www/test/tests-todo/minimal.toDataURL.jpeg.alpha.js new file mode 100644 index 0000000..25d12d7 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.toDataURL.jpeg.alpha.js @@ -0,0 +1,25 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = 'rgba(128, 255, 128, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-over'; // should be ignored by toDataURL +var data = canvas.toDataURL('image/jpeg'); +ctx.globalCompositeOperation = 'source-over'; +if (!data.match(/^data:image\/jpeg[;,]/)) { + _assert(true, "true"); +} else { + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + var img = new Image(); + deferTest(); + img.onload = wrapFunction(function () + { + ctx.drawImage(img, 0, 0); + + _assertPixelApprox(canvas, 50,25, 63,127,63,255, "50,25", "63,127,63,255", 8); + }); + img.src = data; +} + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.toDataURL.jpeg.primarycolours.js b/platforms/ios/www/test/tests-todo/minimal.toDataURL.jpeg.primarycolours.js new file mode 100644 index 0000000..a41f973 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.toDataURL.jpeg.primarycolours.js @@ -0,0 +1,28 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#ff0'; +ctx.fillRect(0, 0, 25, 40); +ctx.fillStyle = '#0ff'; +ctx.fillRect(25, 0, 50, 40); +ctx.fillStyle = '#00f'; +ctx.fillRect(75, 0, 25, 40); +ctx.fillStyle = '#fff'; +ctx.fillRect(0, 40, 100, 10); +var data = canvas.toDataURL('image/jpeg'); // it is okay if this returns a PNG instead +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +var img = new Image(); +deferTest(); +img.onload = wrapFunction(function () +{ + ctx.drawImage(img, 0, 0); + + _assertPixelApprox(canvas, 12,20, 255,255,0,255, "12,20", "255,255,0,255", 8); + _assertPixelApprox(canvas, 50,20, 0,255,255,255, "50,20", "0,255,255,255", 8); + _assertPixelApprox(canvas, 87,20, 0,0,255,255, "87,20", "0,0,255,255", 8); + _assertPixelApprox(canvas, 50,45, 255,255,255,255, "50,45", "255,255,255,255", 8); +}); +img.src = data; + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.toDataURL.jpeg.quality.basic.js b/platforms/ios/www/test/tests-todo/minimal.toDataURL.jpeg.quality.basic.js new file mode 100644 index 0000000..ca1fdfa --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.toDataURL.jpeg.quality.basic.js @@ -0,0 +1,36 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#00f'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0ff'; +ctx.fillRect(0, 3, 100, 1); +// Check for JPEG support first +var data = canvas.toDataURL('image/jpeg'); +if (!data.match(/^data:image\/jpeg[;,]/)) { + _assert(true, "true"); +} else { + var data_hi = canvas.toDataURL('image/jpeg', 0.99); + var data_lo = canvas.toDataURL('image/jpeg', 0.01); + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + deferTest(); + var img_hi = new Image(); + img_hi.onload = function () + { + var img_lo = new Image(); + img_lo.onload = wrapFunction(function () + { + ctx.drawImage(img_hi, 0, 0, 50, 50, 0, 0, 50, 50); + ctx.drawImage(img_lo, 0, 0, 50, 50, 50, 0, 50, 50); + + _assert(data_hi.length > data_lo.length, "data_hi.length > data_lo.length"); + _assertPixelApprox(canvas, 25,25, 0,0,255,255, "25,25", "0,0,255,255", 8); + _assertPixelApprox(canvas, 75,25, 0,0,255,255, "75,25", "0,0,255,255", 8); + }); + img_lo.src = data_lo; + }; + img_hi.src = data_hi; +} + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.toDataURL.jpeg.quality.notnumber.js b/platforms/ios/www/test/tests-todo/minimal.toDataURL.jpeg.quality.notnumber.js new file mode 100644 index 0000000..0585361 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.toDataURL.jpeg.quality.notnumber.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#00f'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0ff'; +ctx.fillRect(0, 3, 100, 1); +// Check for JPEG support first +var data = canvas.toDataURL('image/jpeg'); +if (!data.match(/^data:image\/jpeg[;,]/)) { + _assert(true, "true"); +} else { + _assertSame(canvas.toDataURL('image/jpeg', 'bogus'), data, "canvas.toDataURL('image/jpeg', 'bogus')", "data"); + _assertSame(canvas.toDataURL('image/jpeg', {}), data, "canvas.toDataURL('image/jpeg', {})", "data"); + _assertSame(canvas.toDataURL('image/jpeg', null), data, "canvas.toDataURL('image/jpeg', null)", "data"); + _assertSame(canvas.toDataURL('image/jpeg', undefined), data, "canvas.toDataURL('image/jpeg', undefined)", "data"); + _assertSame(canvas.toDataURL('image/jpeg', true), data, "canvas.toDataURL('image/jpeg', true)", "data"); + _assertSame(canvas.toDataURL('image/jpeg', '0.01'), data, "canvas.toDataURL('image/jpeg', '0.01')", "data"); +} + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.toDataURL.jpeg.quality.outsiderange.js b/platforms/ios/www/test/tests-todo/minimal.toDataURL.jpeg.quality.outsiderange.js new file mode 100644 index 0000000..7b07bfc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.toDataURL.jpeg.quality.outsiderange.js @@ -0,0 +1,22 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#00f'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0ff'; +ctx.fillRect(0, 3, 100, 1); +// Check for JPEG support first +var data = canvas.toDataURL('image/jpeg'); +if (!data.match(/^data:image\/jpeg[;,]/)) { + _assert(true, "true"); +} else { + _assertSame(canvas.toDataURL('image/jpeg', 10), data, "canvas.toDataURL('image/jpeg', 10)", "data"); + _assertSame(canvas.toDataURL('image/jpeg', -10), data, "canvas.toDataURL('image/jpeg', -10)", "data"); + _assertSame(canvas.toDataURL('image/jpeg', 1.01), data, "canvas.toDataURL('image/jpeg', 1.01)", "data"); + _assertSame(canvas.toDataURL('image/jpeg', -0.01), data, "canvas.toDataURL('image/jpeg', -0.01)", "data"); + + _assert(canvas.toDataURL('image/jpeg', 1).length >= canvas.toDataURL('image/jpeg', 0.9).length, "canvas.toDataURL('image/jpeg', 1).length >= canvas.toDataURL('image/jpeg', 0.9).length"); + _assert(canvas.toDataURL('image/jpeg', 0).length <= canvas.toDataURL('image/jpeg', 0.1).length, "canvas.toDataURL('image/jpeg', 0).length <= canvas.toDataURL('image/jpeg', 0.1).length"); +} + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.toDataURL.lowercase.ascii.js b/platforms/ios/www/test/tests-todo/minimal.toDataURL.lowercase.ascii.js new file mode 100644 index 0000000..4b2fbea --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.toDataURL.lowercase.ascii.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +var data = canvas.toDataURL('ImAgE/PnG'); +_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/"); + +// If JPEG is supported at all, it must be supported case-insensitively +data = canvas.toDataURL('image/jpeg'); +if (data.match(/^data:image\/jpeg[;,]/)) { + data = canvas.toDataURL('ImAgE/JpEg'); + _assertMatch(data, /^data:image\/jpeg[;,]/, "data", "/^data:image\\/jpeg[;,]/"); +} + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.toDataURL.lowercase.unicode.js b/platforms/ios/www/test/tests-todo/minimal.toDataURL.lowercase.unicode.js new file mode 100644 index 0000000..321e122 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.toDataURL.lowercase.unicode.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +// Use LATIN CAPITAL LETTER I WITH DOT ABOVE (Unicode lowercase is "i") +var data = canvas.toDataURL('\u0130mage/png'); +_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/"); + +var data = canvas.toDataURL('\u0130mage/jpeg'); +_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.toDataURL.nocontext.js b/platforms/ios/www/test/tests-todo/minimal.toDataURL.nocontext.js new file mode 100644 index 0000000..2a7585d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.toDataURL.nocontext.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +var data = canvas2.toDataURL(); +_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.toDataURL.png.complexcolours.js b/platforms/ios/www/test/tests-todo/minimal.toDataURL.png.complexcolours.js new file mode 100644 index 0000000..f3b9a0d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.toDataURL.png.complexcolours.js @@ -0,0 +1,28 @@ +_addTest(function(canvas, ctx) { + +// (These values are chosen to survive relatively alright through being premultiplied) +ctx.fillStyle = 'rgba(1, 3, 254, 1)'; +ctx.fillRect(0, 0, 25, 25); +ctx.fillStyle = 'rgba(8, 252, 248, 0.75)'; +ctx.fillRect(25, 0, 25, 25); +ctx.fillStyle = 'rgba(6, 10, 250, 0.502)'; +ctx.fillRect(50, 0, 25, 25); +ctx.fillStyle = 'rgba(12, 16, 244, 0.25)'; +ctx.fillRect(75, 0, 25, 25); +var img = new Image(); +deferTest(); +img.onload = wrapFunction(function () +{ + ctx.drawImage(img, 0, 25); + // (The alpha values do not really survive float->int conversion, so just + // do approximate comparisons) + + _assertPixel(canvas, 12,40, 1,3,254,255, "12,40", "1,3,254,255"); + _assertPixelApprox(canvas, 37,40, 8,252,248,191, "37,40", "8,252,248,191", 2); + _assertPixelApprox(canvas, 62,40, 6,10,250,127, "62,40", "6,10,250,127", 4); + _assertPixelApprox(canvas, 87,40, 12,16,244,63, "87,40", "12,16,244,63", 8); +}); +img.src = canvas.toDataURL(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.toDataURL.png.js b/platforms/ios/www/test/tests-todo/minimal.toDataURL.png.js new file mode 100644 index 0000000..f4266c1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.toDataURL.png.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +var data = canvas.toDataURL('image/png'); +_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.toDataURL.png.primarycolours.js b/platforms/ios/www/test/tests-todo/minimal.toDataURL.png.primarycolours.js new file mode 100644 index 0000000..cd42cf3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.toDataURL.png.primarycolours.js @@ -0,0 +1,28 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#ff0'; +ctx.fillRect(0, 0, 25, 40); +ctx.fillStyle = '#0ff'; +ctx.fillRect(25, 0, 50, 40); +ctx.fillStyle = '#00f'; +ctx.fillRect(75, 0, 25, 40); +ctx.fillStyle = '#fff'; +ctx.fillRect(0, 40, 100, 10); +var data = canvas.toDataURL(); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +var img = new Image(); +deferTest(); +img.onload = wrapFunction(function () +{ + ctx.drawImage(img, 0, 0); + + _assertPixel(canvas, 12,20, 255,255,0,255, "12,20", "255,255,0,255"); + _assertPixel(canvas, 50,20, 0,255,255,255, "50,20", "0,255,255,255"); + _assertPixel(canvas, 87,20, 0,0,255,255, "87,20", "0,0,255,255"); + _assertPixel(canvas, 50,45, 255,255,255,255, "50,45", "255,255,255,255"); +}); +img.src = data; + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.toDataURL.unrecognised.js b/platforms/ios/www/test/tests-todo/minimal.toDataURL.unrecognised.js new file mode 100644 index 0000000..684af7a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.toDataURL.unrecognised.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +var data = canvas.toDataURL('image/example'); +_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.toDataURL.zerosize.js b/platforms/ios/www/test/tests-todo/minimal.toDataURL.zerosize.js new file mode 100644 index 0000000..1b0a157 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.toDataURL.zerosize.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +var data = canvas.toDataURL(); +_assertSame(data, 'data:,', "data", "'data:,'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.type.delete.js b/platforms/ios/www/test/tests-todo/minimal.type.delete.js new file mode 100644 index 0000000..9989ae9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.type.delete.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +delete window.HTMLCanvasElement; +_assert(window.HTMLCanvasElement, "window.HTMLCanvasElement"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.type.exists.js b/platforms/ios/www/test/tests-todo/minimal.type.exists.js new file mode 100644 index 0000000..0934d14 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.type.exists.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assert(window.HTMLCanvasElement, "window.HTMLCanvasElement"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.type.extend.js b/platforms/ios/www/test/tests-todo/minimal.type.extend.js new file mode 100644 index 0000000..a1be02b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.type.extend.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +window.HTMLCanvasElement.prototype.getZero = function () { return 0; }; +_assertSame(canvas.getZero(), 0, "canvas.getZero()", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.type.name.js b/platforms/ios/www/test/tests-todo/minimal.type.name.js new file mode 100644 index 0000000..9a31490 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.type.name.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(Object.prototype.toString.call(canvas), '[object HTMLCanvasElement]', "Object.prototype.toString.call(canvas)", "'[object HTMLCanvasElement]'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.type.prototype.js b/platforms/ios/www/test/tests-todo/minimal.type.prototype.js new file mode 100644 index 0000000..3eb73b4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.type.prototype.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +_assert(window.HTMLCanvasElement.prototype, "window.HTMLCanvasElement.prototype"); +_assert(window.HTMLCanvasElement.prototype.getContext, "window.HTMLCanvasElement.prototype.getContext"); +window.HTMLCanvasElement.prototype = null; +_assert(window.HTMLCanvasElement.prototype, "window.HTMLCanvasElement.prototype"); +delete window.HTMLCanvasElement.prototype; +_assert(window.HTMLCanvasElement.prototype, "window.HTMLCanvasElement.prototype"); +window.HTMLCanvasElement.prototype.getContext = 1; +_assertSame(window.HTMLCanvasElement.prototype.getContext, 1, "window.HTMLCanvasElement.prototype.getContext", "1"); +delete window.HTMLCanvasElement.prototype.getContext; +_assertSame(window.HTMLCanvasElement.prototype.getContext, undefined, "window.HTMLCanvasElement.prototype.getContext", "undefined"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/minimal.type.replace.js b/platforms/ios/www/test/tests-todo/minimal.type.replace.js new file mode 100644 index 0000000..0f67cc1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/minimal.type.replace.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +window.HTMLCanvasElement.prototype.getContext = function (name) { return 0; }; +_assertSame(canvas.getContext('2d'), 0, "canvas.getContext('2d')", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/reportgen.js b/platforms/ios/www/test/tests-todo/reportgen.js new file mode 100644 index 0000000..e69de29 diff --git a/platforms/ios/www/test/tests-todo/results.js b/platforms/ios/www/test/tests-todo/results.js new file mode 100644 index 0000000..3fb73f5 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/results.js @@ -0,0 +1,4753 @@ + +Canvas tests - results + + ++ +
    Test +Firefox 3.7 alpha (20100227; Linux) +Opera 10.50 alpha (6234; Linux) +Chromium 5.0.308.0 (Linux) +Konqueror 4.3.3 (Linux) +IE9 Preview 3 (Windows) +
    # fallback.basic +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # fallback.multiple +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # fallback.nested +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # type.name +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion Object.prototype.toString.call(canvas) === '[object HTMLCanvasElement]' (got [object Object][string], expected [object HTMLCanvasElement][string])
    +
    # type.exists +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # type.delete +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # type.prototype +
    • Failed assertion window.HTMLCanvasElement.prototype.getContext === undefined (got function getContext() { [native code] }[function], expected [undefined])
    +
    • Passed
    +
    • Failed assertion: window.HTMLCanvasElement.prototype
    • Failed assertion: window.HTMLCanvasElement.prototype
    • Aborted with exception: Cannot set property 'getContext' of null
    +
    • Failed assertion window.HTMLCanvasElement.prototype.getContext === undefined (got 1[number], expected [undefined])
    +
    • Aborted with exception: Object doesn't support this property or method
    +
    # type.replace +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # type.extend +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # size.attributes.get +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # size.attributes.set +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # size.attributes.idl.set.zero +
    • Passed
    +
    • Failed assertion canvas.width === 0 (got 300[number], expected 0[number])
    • Failed assertion canvas.height === 0 (got 150[number], expected 0[number])
    +
    • Passed
    +
    • Failed assertion canvas.width === 0 (got 300[number], expected 0[number])
    • Failed assertion canvas.height === 0 (got 150[number], expected 0[number])
    +
    • Passed
    +
    # size.attributes.idl +
    • Passed
    +
    • Failed assertion canvas.width === 200 (got 300[number], expected 200[number])
    • Failed assertion canvas.height === 200 (got 150[number], expected 200[number])
    • Failed assertion canvas.width === 0 (got 300[number], expected 0[number])
    • Failed assertion canvas.height === 0 (got 150[number], expected 0[number])
    +
    • Passed
    +
    • Failed assertion canvas.width === 150 (got 1[number], expected 150[number])
    • Failed assertion canvas.width === 200 (got 300[number], expected 200[number])
    • Failed assertion canvas.height === 200 (got 150[number], expected 200[number])
    • Failed assertion canvas.width === 0 (got 400[number], expected 0[number])
    • Failed assertion canvas.height === 0 (got 150[number], expected 0[number])
    +
    • Passed
    +
    # size.attributes.default +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # size.attributes.reflect.setidl +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # size.attributes.reflect.setidlzero +
    • Passed
    +
    • Failed assertion canvas.getAttribute('width') === '0' (got 300[string], expected 0[string])
    • Failed assertion canvas.getAttribute('height') === '0' (got 150[string], expected 0[string])
    • Failed assertion canvas.width === 0 (got 300[number], expected 0[number])
    • Failed assertion canvas.height === 0 (got 150[number], expected 0[number])
    +
    • Passed
    +
    • Failed assertion canvas.width === 0 (got 300[number], expected 0[number])
    • Failed assertion canvas.height === 0 (got 150[number], expected 0[number])
    +
    • Passed
    +
    # size.attributes.reflect.setcontent +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # size.attributes.removed +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # size.attributes.parse.zero +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "0px" (got auto[string], expected 0px[string])
    +
    • Passed
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "0px" (got auto[string], expected 0px[string])
    +
    • Failed assertion canvas.width === 0 (got 300[number], expected 0[number])
    • Failed assertion canvas.height === 0 (got 150[number], expected 0[number])
    +
    • Passed
    +
    # size.attributes.parse.empty +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # size.attributes.parse.onlyspace +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # size.attributes.parse.space +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got auto[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got auto[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    # size.attributes.parse.whitespace +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got auto[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got auto[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    # size.attributes.parse.plus +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got auto[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got auto[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    # size.attributes.parse.minus +
    • Failed assertion canvas.width === 300 (got 0[number], expected 300[number])
    • Failed assertion canvas.height === 150 (got 0[number], expected 150[number])
    +
    • Passed
    +
    • Failed assertion canvas.width === 300 (got -100[number], expected 300[number])
    • Failed assertion canvas.height === 150 (got -100[number], expected 150[number])
    +
    • Passed
    +
    • Failed assertion canvas.width === 300 (got -100[number], expected 300[number])
    • Failed assertion canvas.height === 150 (got -100[number], expected 150[number])
    +
    # size.attributes.parse.octal +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got auto[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got auto[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    # size.attributes.parse.hex +
    • Failed assertion canvas.width === 0 (got 100[number], expected 0[number])
    • Failed assertion canvas.height === 0 (got 100[number], expected 0[number])
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "0px" (got auto[string], expected 0px[string])
    +
    • Passed
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "0px" (got auto[string], expected 0px[string])
    +
    • Failed assertion canvas.width === 0 (got 300[number], expected 0[number])
    • Failed assertion canvas.height === 0 (got 150[number], expected 0[number])
    +
    • Passed
    +
    # size.attributes.parse.exp +
    • Failed assertion canvas.width === 100 (got 300[number], expected 100[number])
    • Failed assertion canvas.height === 100 (got 150[number], expected 100[number])
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got auto[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got auto[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    • Failed assertion canvas.width === 100 (got 1000[number], expected 100[number])
    • Failed assertion canvas.height === 100 (got 1000[number], expected 100[number])
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    # size.attributes.parse.decimal +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got auto[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got auto[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    # size.attributes.parse.percent +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got auto[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got auto[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    # size.attributes.parse.em +
    • Failed assertion canvas.width === 100 (got 300[number], expected 100[number])
    • Failed assertion canvas.height === 100 (got 150[number], expected 100[number])
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got auto[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got auto[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    # size.attributes.parse.junk +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # size.attributes.parse.trailingjunk +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got auto[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got auto[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    # size.attributes.setAttribute.zero +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "0px" (got auto[string], expected 0px[string])
    +
    • Failed assertion canvas.width === 0 (got 300[number], expected 0[number])
    • Failed assertion canvas.height === 0 (got 150[number], expected 0[number])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "0px" (got auto[string], expected 0px[string])
    +
    • Failed assertion canvas.width === 0 (got 300[number], expected 0[number])
    • Failed assertion canvas.height === 0 (got 150[number], expected 0[number])
    +
    • Passed
    +
    # size.attributes.setAttribute.empty +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # size.attributes.setAttribute.onlyspace +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # size.attributes.setAttribute.space +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got auto[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got auto[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    # size.attributes.setAttribute.whitespace +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got auto[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got auto[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    # size.attributes.setAttribute.plus +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got auto[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got auto[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    # size.attributes.setAttribute.minus +
    • Failed assertion canvas.width === 300 (got 0[number], expected 300[number])
    • Failed assertion canvas.height === 150 (got 0[number], expected 150[number])
    +
    • Passed
    +
    • Failed assertion canvas.width === 300 (got -100[number], expected 300[number])
    • Failed assertion canvas.height === 150 (got -100[number], expected 150[number])
    +
    • Passed
    +
    • Failed assertion canvas.width === 300 (got -100[number], expected 300[number])
    • Failed assertion canvas.height === 150 (got -100[number], expected 150[number])
    +
    # size.attributes.setAttribute.octal +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got auto[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got auto[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    # size.attributes.setAttribute.hex +
    • Failed assertion canvas.width === 0 (got 100[number], expected 0[number])
    • Failed assertion canvas.height === 0 (got 100[number], expected 0[number])
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "0px" (got auto[string], expected 0px[string])
    +
    • Failed assertion canvas.width === 0 (got 300[number], expected 0[number])
    • Failed assertion canvas.height === 0 (got 150[number], expected 0[number])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "0px" (got auto[string], expected 0px[string])
    +
    • Failed assertion canvas.width === 0 (got 300[number], expected 0[number])
    • Failed assertion canvas.height === 0 (got 150[number], expected 0[number])
    +
    • Passed
    +
    # size.attributes.setAttribute.exp +
    • Failed assertion canvas.width === 100 (got 300[number], expected 100[number])
    • Failed assertion canvas.height === 100 (got 150[number], expected 100[number])
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got auto[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got auto[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    • Failed assertion canvas.width === 100 (got 1000[number], expected 100[number])
    • Failed assertion canvas.height === 100 (got 1000[number], expected 100[number])
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    # size.attributes.setAttribute.decimal +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got auto[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got auto[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    # size.attributes.setAttribute.percent +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got auto[string], expected 100px[string])
    +
    • Failed assertion canvas.width === 100 (got 300[number], expected 100[number])
    • Failed assertion canvas.height === 100 (got 150[number], expected 100[number])
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got auto[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    # size.attributes.setAttribute.em +
    • Failed assertion canvas.width === 100 (got 300[number], expected 100[number])
    • Failed assertion canvas.height === 100 (got 150[number], expected 100[number])
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got auto[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got auto[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    # size.attributes.setAttribute.junk +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # size.attributes.setAttribute.trailingjunk +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got auto[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got auto[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    • Failed assertion window.getComputedStyle(canvas, null).getPropertyValue("width") == "100px" (got 0px[string], expected 100px[string])
    +
    # size.attributes.style +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # initial.colour +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # initial.reset.different +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # initial.reset.same +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # initial.reset.path +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (20,20), expected [0,0,0,0]
    +
    • Passed
    +
    • Passed
    +
    # initial.reset.clip +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # initial.reset.transform +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # initial.reset.gradient +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # initial.reset.pattern +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # context.emptystring +
    • Aborted with exception: Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIDOMHTMLCanvasElement.getContext]
    +
    • Passed
    +
    • Failed assertion canvas.getContext("") === null (got [undefined], expected [object])
    +
    • Passed
    +
    • Passed
    +
    # context.unrecognised.badname +
    • Aborted with exception: Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIDOMHTMLCanvasElement.getContext]
    +
    • Passed
    +
    • Failed assertion canvas.getContext('This is not an implemented context in any real browser') === null (got [undefined], expected [object])
    +
    • Passed
    +
    • Passed
    +
    # context.unrecognised.badsuffix +
    • Aborted with exception: Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIDOMHTMLCanvasElement.getContext]
    +
    • Passed
    +
    • Failed assertion canvas.getContext("2d#") === null (got [undefined], expected [object])
    +
    • Passed
    +
    • Passed
    +
    # context.unrecognised.nullsuffix +
    • Aborted with exception: Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIDOMHTMLCanvasElement.getContext]
    +
    • Failed assertion canvas.getContext("2d\0") === null (got [object CanvasRenderingContext2D][object], expected [object])
    +
    • Failed assertion canvas.getContext("2d\0") === null (got [undefined], expected [object])
    +
    • Passed
    +
    • Aborted with exception: Object doesn't support this property or method
    +
    # context.unrecognised.unicode +
    • Aborted with exception: Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIDOMHTMLCanvasElement.getContext]
    +
    • Passed
    +
    • Failed assertion canvas.getContext("2\uFF44") === null (got [undefined], expected [object])
    +
    • Passed
    +
    • Passed
    +
    # context.casesensitive +
    • Aborted with exception: Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIDOMHTMLCanvasElement.getContext]
    +
    • Passed
    +
    • Failed assertion canvas.getContext('2D') === null (got [undefined], expected [object])
    +
    • Passed
    +
    • Passed
    +
    # toDataURL.default +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # toDataURL.png +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # toDataURL.bogustype +
    • Aborted with exception: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMHTMLCanvasElement.toDataURL]
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # toDataURL.unrecognised +
    • Aborted with exception: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMHTMLCanvasElement.toDataURL]
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # toDataURL.lowercase.ascii +
    • Aborted with exception: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMHTMLCanvasElement.toDataURL]
    +
    • Failed assertion data matches /^data:image\/jpeg[;,]/ (got data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAyCAYAAACqNX6+AAAAKklEQVR42u3BAQ0AAADCoPdPbQ43oAAAAAAAAAAAAAAAAAAAAAAAAAD4NE5SAAG30DXzAAAAAElFTkSuQmCC[string])
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # toDataURL.lowercase.unicode +
    • Aborted with exception: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMHTMLCanvasElement.toDataURL]
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # toDataURL.arguments.1 +
    • Aborted with exception: Security error
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # toDataURL.arguments.2 +
    • Aborted with exception: Security error
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # toDataURL.arguments.3 +
    • Aborted with exception: Security error
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # toDataURL.nocontext +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # toDataURL.zerosize +
    • Failed assertion data === 'data:,' (got data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAACWCAYAAABkW7XSAAAAxUlEQVR4nO3BMQEAAADCoPVPbQhfoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOA1v9QAATX68/0AAAAASUVORK5CYII=[string], expected data:,[string])
    +
    • Failed assertion data === 'data:,' (got data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAACWCAYAAABkW7XSAAAAxUlEQVR42u3BMQEAAADCoPVPbQhfoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOA1v9QAAS9p4J4AAAAASUVORK5CYII=[string], expected data:,[string])
    +
    • Passed
    +
    • Failed assertion data === 'data:,' (got data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAACWCAYAAABkW7XSAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAxUlEQVR4nO3BMQEAAADCoPVPbQhfoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOA1v9QAATX68/0AAAAASUVORK5CYII=[string], expected data:,[string])
    +
    • Passed
    +
    # toDataURL.png.primarycolours +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Cannot automatically verify result
    +
    • Passed
    +
    # toDataURL.png.complexcolours +
    • Passed
    +
    • Failed assertion: got pixel [4,8,14,128] at (62,40), expected [6,10,250,127] +/- 4
    • Failed assertion: got pixel [8,12,171,64] at (87,40), expected [12,16,244,63] +/- 8
    +
    • Failed assertion: got pixel [5,188,185,191] at (37,40), expected [8,252,248,191] +/- 2
    • Failed assertion: got pixel [1,3,123,128] at (62,40), expected [6,10,250,127] +/- 4
    • Failed assertion: got pixel [0,0,60,63] at (87,40), expected [12,16,244,63] +/- 8
    +
    • Cannot automatically verify result
    +
    • Passed
    +
    # toDataURL.jpeg.primarycolours +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Cannot automatically verify result
    +
    • Passed
    +
    # toDataURL.jpeg.alpha +
    • Failed assertion: got pixel [129,255,129,255] at (50,25), expected [63,127,63,255] +/- 8
    +
    • Failed assertion: got pixel [127,254,122,255] at (50,25), expected [63,127,63,255] +/- 8
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [126,255,128,255] at (50,25), expected [63,127,63,255] +/- 8
    +
    # toDataURL.jpeg.quality.basic +
    • Aborted with exception: Security error
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,11,255,255] at (75,25), expected [0,0,255,255] +/- 8
    +
    # toDataURL.jpeg.quality.notnumber +
    • Aborted with exception: Security error
    +
    • Failed assertion canvas.toDataURL('image/jpeg', null) === data (got data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/2wCEAAH//wGwAf8B//8BAf8BAQEBAQGwAQH/AQEBTP///gEcAUwBAf//HgGwAQGAAVD///+AAf4eAQEB//8BAf8BHgEBAQGw/wEBAQEBGv/kAQEBAbD/AQEBAQEB/+QBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/EAaIAAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKCxAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6AQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgsRAAIBAgQEAwQHBQQEAAECdwABAgMRBAUhMQYSQVEHYXETIjKBCBRCkaGxwQkjM1LwFWJy0QoWJDThJfEXGBkaJicoKSo1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoKDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uLj5OXm5+jp6vLz9PX29/j5+v/AABEIADIAZAMBIgACEQEDEQH/2gAMAwEAAhEDEQA/AP5fP+MPf+rlf/Er/hf/APQY0f8AGHv/AFcr/wCJX/C//wCgxr5qor/vO/r/AJLrjb/6IT+Ivn/50nxF/wDopPpX/jD3/q5X/wASv+F//wBBjR/xh7/1cr/4lf8AC/8A+gxr5qoo/r/kuuNv/ohD5/8AnSfEX/6KT6V/4w9/6uV/8Sv+F/8A9BjR/wAYe/8AVyv/AIlf8L//AKDGvmqij+v+S642/wDohD5/+dJ8Rf8A6KT6V/4w9/6uV/8AEr/hf/8AQY0f8Ye/9XK/+JX/AAv/APoMa+aqKP6/5Lrjb/6IQ+f/AJ0nxF/+ik+lf+MPf+rlf/Er/hf/APQY0f8AGHv/AFcr/wCJX/C//wCgxr5qoo/r/kuuNv8A6IQ+f/nSfEX/AOik+lf+MPf+rlf/ABK/4X//AEGNH/GHv/Vyv/iV/wAL/wD6DGvmqij+v+S642/+iEPn/wCdJ8Rf/opPpX/jD3/q5X/xK/4X/wD0GNH/ABh7/wBXK/8AiV/wv/8AoMa+aqKP6/5Lrjb/AOiEPn/50nxF/wDopCiiivqj7UKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAP/Z[string], expected data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/2wCEAAUDAwUHDA8SBAQEBggREhEEBAUHDBEVEQQFBwkPGhgTBQcLERQhHxcHCxETGB8iHA8TFxofJCQeFhwdHSIeHx4BBQUHDh4eHh4FBggUHh4eHgcIER4eHh4eDhQeHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHv/EAaIAAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKCxAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6AQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgsRAAIBAgQEAwQHBQQEAAECdwABAgMRBAUhMQYSQVEHYXETIjKBCBRCkaGxwQkjM1LwFWJy0QoWJDThJfEXGBkaJicoKSo1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoKDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uLj5OXm5+jp6vLz9PX29/j5+v/AABEIADIAZAMBIgACEQEDEQH/2gAMAwEAAhEDEQA/APn77d4Y/wCgF4l/8D4v/kOj7d4Y/wCgF4l/8D4v/kOsKiv7D9hH+ar/AOBS/wAz5P6tH+av/wCBS/zN37d4Y/6AXiX/AMD4v/kOj7d4Y/6AXiX/AMD4v/kOsKij2Ef5qv8A4FL/ADD6tH+av/4FL/M3ft3hj/oBeJf/AAPi/wDkOj7d4Y/6AXiX/wAD4v8A5DrCoo9hH+ar/wCBS/zD6tH+av8A+BS/zN37d4Y/6AXiX/wPi/8AkOj7d4Y/6AXiX/wPi/8AkOsKij2Ef5qv/gUv8w+rR/mr/wDgUv8AM3ft3hj/AKAXiX/wPi/+Q6Pt3hj/AKAXiX/wPi/+Q6wqKPYR/mq/+BS/zD6tH+av/wCBS/zN37d4Y/6AXiX/AMD4v/kOj7d4Y/6AXiX/AMD4v/kOsKij2Ef5qv8A4FL/ADD6tH+av/4FL/M3ft3hj/oBeJf/AAPi/wDkOj7d4Y/6AXiX/wAD4v8A5DrCoo9hH+ar/wCBS/zD6tH+av8A+BS/zCiiiug6gooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKAA/9k=[string])
    • Failed assertion canvas.toDataURL('image/jpeg', true) === data (got data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/EAaIAAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKCxAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6AQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgsRAAIBAgQEAwQHBQQEAAECdwABAgMRBAUhMQYSQVEHYXETIjKBCBRCkaGxwQkjM1LwFWJy0QoWJDThJfEXGBkaJicoKSo1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoKDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uLj5OXm5+jp6vLz9PX29/j5+v/AABEIADIAZAMBIgACEQEDEQH/2gAMAwEAAhEDEQA/AP5fP+Ep/Y9/6IV+0r/4lf8AC/8A+gxo/wCEp/Y9/wCiFftK/wDiV/wv/wDoMa+aqK/7zv8AU7Kf+gvin/xOuNv/AKIT+Iv9Qcj/AOg7jX/xZPiL/wDRSfSv/CU/se/9EK/aV/8AEr/hf/8AQY0f8JT+x7/0Qr9pX/xK/wCF/wD9BjXzVRR/qdlP/QXxT/4nXG3/ANEIf6g5H/0Hca/+LJ8Rf/opPpX/AISn9j3/AKIV+0r/AOJX/C//AOgxo/4Sn9j3/ohX7Sv/AIlf8L//AKDGvmqij/U7Kf8AoL4p/wDE642/+iEP9Qcj/wCg7jX/AMWT4i//AEUn0r/wlP7Hv/RCv2lf/Er/AIX/AP0GNH/CU/se/wDRCv2lf/Er/hf/APQY181UUf6nZT/0F8U/+J1xt/8ARCH+oOR/9B3Gv/iyfEX/AOik+lf+Ep/Y9/6IV+0r/wCJX/C//wCgxo/4Sn9j3/ohX7Sv/iV/wv8A/oMa+aqKP9Tsp/6C+Kf/ABOuNv8A6IQ/1ByP/oO41/8AFk+Iv/0Un0r/AMJT+x7/ANEK/aV/8Sv+F/8A9BjR/wAJT+x7/wBEK/aV/wDEr/hf/wDQY181UUf6nZT/ANBfFP8A4nXG3/0Qh/qDkf8A0Hca/wDiyfEX/wCik+lf+Ep/Y9/6IV+0r/4lf8L/AP6DGj/hKf2Pf+iFftK/+JX/AAv/APoMa+aqKP8AU7Kf+gvin/xOuNv/AKIQ/wBQcj/6DuNf/Fk+Iv8A9FIUUUV9UfahRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAD/2Q==[string], expected data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/2wCEAAUDAwUHDA8SBAQEBggREhEEBAUHDBEVEQQFBwkPGhgTBQcLERQhHxcHCxETGB8iHA8TFxofJCQeFhwdHSIeHx4BBQUHDh4eHh4FBggUHh4eHgcIER4eHh4eDhQeHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHv/EAaIAAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKCxAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6AQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgsRAAIBAgQEAwQHBQQEAAECdwABAgMRBAUhMQYSQVEHYXETIjKBCBRCkaGxwQkjM1LwFWJy0QoWJDThJfEXGBkaJicoKSo1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoKDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uLj5OXm5+jp6vLz9PX29/j5+v/AABEIADIAZAMBIgACEQEDEQH/2gAMAwEAAhEDEQA/APn77d4Y/wCgF4l/8D4v/kOj7d4Y/wCgF4l/8D4v/kOsKiv7D9hH+ar/AOBS/wAz5P6tH+av/wCBS/zN37d4Y/6AXiX/AMD4v/kOj7d4Y/6AXiX/AMD4v/kOsKij2Ef5qv8A4FL/ADD6tH+av/4FL/M3ft3hj/oBeJf/AAPi/wDkOj7d4Y/6AXiX/wAD4v8A5DrCoo9hH+ar/wCBS/zD6tH+av8A+BS/zN37d4Y/6AXiX/wPi/8AkOj7d4Y/6AXiX/wPi/8AkOsKij2Ef5qv/gUv8w+rR/mr/wDgUv8AM3ft3hj/AKAXiX/wPi/+Q6Pt3hj/AKAXiX/wPi/+Q6wqKPYR/mq/+BS/zD6tH+av/wCBS/zN37d4Y/6AXiX/AMD4v/kOj7d4Y/6AXiX/AMD4v/kOsKij2Ef5qv8A4FL/ADD6tH+av/4FL/M3ft3hj/oBeJf/AAPi/wDkOj7d4Y/6AXiX/wAD4v8A5DrCoo9hH+ar/wCBS/zD6tH+av8A+BS/zCiiiug6gooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKAA/9k=[string])
    • Failed assertion canvas.toDataURL('image/jpeg', '0.01') === data (got data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/2wCEAAH//wGwAf8B//8BAf8BAQEBAQGwAQH/AQEBTP///gEcAUwBAf//HgGwAQGAAVD///+AAf4eAQEB//8BAf8BHgEBAQGw/wEBAQEBGv/kAQEBAbD/AQEBAQEB/+QBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/EAaIAAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKCxAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6AQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgsRAAIBAgQEAwQHBQQEAAECdwABAgMRBAUhMQYSQVEHYXETIjKBCBRCkaGxwQkjM1LwFWJy0QoWJDThJfEXGBkaJicoKSo1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoKDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uLj5OXm5+jp6vLz9PX29/j5+v/AABEIADIAZAMBIgACEQEDEQH/2gAMAwEAAhEDEQA/AP5fP+MPf+rlf/Er/hf/APQY0f8AGHv/AFcr/wCJX/C//wCgxr5qor/vO/r/AJLrjb/6IT+Ivn/50nxF/wDopPpX/jD3/q5X/wASv+F//wBBjR/xh7/1cr/4lf8AC/8A+gxr5qoo/r/kuuNv/ohD5/8AnSfEX/6KT6V/4w9/6uV/8Sv+F/8A9BjR/wAYe/8AVyv/AIlf8L//AKDGvmqij+v+S642/wDohD5/+dJ8Rf8A6KT6V/4w9/6uV/8AEr/hf/8AQY0f8Ye/9XK/+JX/AAv/APoMa+aqKP6/5Lrjb/6IQ+f/AJ0nxF/+ik+lf+MPf+rlf/Er/hf/APQY0f8AGHv/AFcr/wCJX/C//wCgxr5qoo/r/kuuNv8A6IQ+f/nSfEX/AOik+lf+MPf+rlf/ABK/4X//AEGNH/GHv/Vyv/iV/wAL/wD6DGvmqij+v+S642/+iEPn/wCdJ8Rf/opPpX/jD3/q5X/xK/4X/wD0GNH/ABh7/wBXK/8AiV/wv/8AoMa+aqKP6/5Lrjb/AOiEPn/50nxF/wDopCiiivqj7UKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAP/Z[string], expected data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/2wCEAAUDAwUHDA8SBAQEBggREhEEBAUHDBEVEQQFBwkPGhgTBQcLERQhHxcHCxETGB8iHA8TFxofJCQeFhwdHSIeHx4BBQUHDh4eHh4FBggUHh4eHgcIER4eHh4eDhQeHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHv/EAaIAAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKCxAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6AQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgsRAAIBAgQEAwQHBQQEAAECdwABAgMRBAUhMQYSQVEHYXETIjKBCBRCkaGxwQkjM1LwFWJy0QoWJDThJfEXGBkaJicoKSo1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoKDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uLj5OXm5+jp6vLz9PX29/j5+v/AABEIADIAZAMBIgACEQEDEQH/2gAMAwEAAhEDEQA/APn77d4Y/wCgF4l/8D4v/kOj7d4Y/wCgF4l/8D4v/kOsKiv7D9hH+ar/AOBS/wAz5P6tH+av/wCBS/zN37d4Y/6AXiX/AMD4v/kOj7d4Y/6AXiX/AMD4v/kOsKij2Ef5qv8A4FL/ADD6tH+av/4FL/M3ft3hj/oBeJf/AAPi/wDkOj7d4Y/6AXiX/wAD4v8A5DrCoo9hH+ar/wCBS/zD6tH+av8A+BS/zN37d4Y/6AXiX/wPi/8AkOj7d4Y/6AXiX/wPi/8AkOsKij2Ef5qv/gUv8w+rR/mr/wDgUv8AM3ft3hj/AKAXiX/wPi/+Q6Pt3hj/AKAXiX/wPi/+Q6wqKPYR/mq/+BS/zD6tH+av/wCBS/zN37d4Y/6AXiX/AMD4v/kOj7d4Y/6AXiX/AMD4v/kOsKij2Ef5qv8A4FL/ADD6tH+av/4FL/M3ft3hj/oBeJf/AAPi/wDkOj7d4Y/6AXiX/wAD4v8A5DrCoo9hH+ar/wCBS/zD6tH+av8A+BS/zCiiiug6gooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKAA/9k=[string])
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion canvas.toDataURL('image/jpeg', '0.01') === data (got data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAAAAAAAD/2wBDAP//////////////////////////////////////////////////////////////////////////////////////2wBDAf//////////////////////////////////////////////////////////////////////////////////////wAARCAAyAGQDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwBnHv8An/8AWo49/wA//rUUVoIOPf8AP/61HHv+f/1qKKADj3/P/wCtRx7/AJ//AFqKKADj3/P/AOtRx7/n/wDWoooAOPf8/wD61HHv+f8A9aiigA49/wA//rUce/5//WoooAOPf8//AK1FFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFAH/9k=[string], expected data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAAAAAAAD/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcHBw8LCwkMEQ8SEhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7/2wBDAQUFBQcGBw4ICA4eFBEUHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh7/wAARCAAyAGQDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD5/wDtXg7/AKAOvf8Ag5i/+RqPtXg7/oA69/4OYv8A5GrBor+w/qsO7/8AApf5nyf1Kn3l/wCBS/zN77V4O/6AOvf+DmL/AORqPtXg7/oA69/4OYv/AJGrBoo+qw7v/wACl/mH1Kn3l/4FL/M3vtXg7/oA69/4OYv/AJGo+1eDv+gDr3/g5i/+RqwaKPqsO7/8Cl/mH1Kn3l/4FL/M3vtXg7/oA69/4OYv/kaj7V4O/wCgDr3/AIOYv/kasGij6rDu/wDwKX+YfUqfeX/gUv8AM3vtXg7/AKAOvf8Ag5i/+RqPtXg7/oA69/4OYv8A5GrBoo+qw7v/AMCl/mH1Kn3l/wCBS/zN77V4O/6AOvf+DmL/AORqPtXg7/oA69/4OYv/AJGrBoo+qw7v/wACl/mH1Kn3l/4FL/M3vtXg7/oA69/4OYv/AJGorBoo+qw7v/wKX+YfUqfeX/gUv8woooroOoKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigD//Z[string])
    +
    # toDataURL.jpeg.quality.outsiderange +
    • Aborted with exception: Security error
    +
    • Failed assertion: canvas.toDataURL('image/jpeg', 0).length <= canvas.toDataURL('image/jpeg', 0.1).length
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # security.drawImage.image +
    • Passed
    +
    • Passed
    +
    • Failed assertion: should throw exception: canvas.toDataURL()
    • Failed assertion: should throw exception: ctx.getImageData(0, 0, 1, 1)
    +
    • Aborted with exception: INVALID_STATE_ERR
    +
    • Passed
    +
    # security.drawImage.canvas +
    • Passed
    +
    • Passed
    +
    • Failed assertion: should throw exception: canvas.toDataURL()
    • Failed assertion: should throw exception: ctx.getImageData(0, 0, 1, 1)
    +
    • Passed
    +
    • Passed
    +
    # security.pattern.create +
    • Passed
    +
    • Passed
    +
    • Aborted with exception: INVALID_STATE_ERR: DOM Exception 11
    +
    • Aborted with exception: INVALID_STATE_ERR
    +
    • Passed
    +
    # security.pattern.cross +
    • Passed
    +
    • Passed
    +
    • Aborted with exception: INVALID_STATE_ERR: DOM Exception 11
    +
    • Aborted with exception: INVALID_STATE_ERR
    +
    • Passed
    +
    # security.pattern.canvas.timing +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Aborted with exception: INVALID_STATE_ERR
    +
    • Passed
    +
    # security.pattern.image.fillStyle +
    • Failed assertion: should throw exception: canvas.toDataURL()
    • Failed assertion: should throw exception: ctx.getImageData(0, 0, 1, 1)
    +
    • Passed
    +
    • Aborted with exception: INVALID_STATE_ERR: DOM Exception 11
    +
    • Aborted with exception: INVALID_STATE_ERR
    +
    • Passed
    +
    # security.pattern.canvas.fillStyle +
    • Failed assertion: should throw exception: canvas.toDataURL()
    • Failed assertion: should throw exception: ctx.getImageData(0, 0, 1, 1)
    +
    • Passed
    +
    • Failed assertion: should throw exception: canvas.toDataURL()
    • Failed assertion: should throw exception: ctx.getImageData(0, 0, 1, 1)
    +
    • Aborted with exception: INVALID_STATE_ERR
    +
    • Passed
    +
    # security.pattern.image.strokeStyle +
    • Failed assertion: should throw exception: canvas.toDataURL()
    • Failed assertion: should throw exception: ctx.getImageData(0, 0, 1, 1)
    +
    • Passed
    +
    • Aborted with exception: INVALID_STATE_ERR: DOM Exception 11
    +
    • Aborted with exception: INVALID_STATE_ERR
    +
    • Passed
    +
    # security.pattern.canvas.strokeStyle +
    • Failed assertion: should throw exception: canvas.toDataURL()
    • Failed assertion: should throw exception: ctx.getImageData(0, 0, 1, 1)
    +
    • Passed
    +
    • Failed assertion: should throw exception: canvas.toDataURL()
    • Failed assertion: should throw exception: ctx.getImageData(0, 0, 1, 1)
    +
    • Aborted with exception: INVALID_STATE_ERR
    +
    • Passed
    +
    # security.dataURI +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Aborted with exception: INVALID_ACCESS_ERR
    +
    • Passed
    +
    # security.reset +
    • Passed
    +
    • Passed
    +
    • Failed assertion: should throw exception: canvas.toDataURL()
    • Failed assertion: should throw exception: canvas.toDataURL()
    +
    • Aborted with exception: INVALID_STATE_ERR
    +
    • Passed
    +
    # 2d.getcontext.exists +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.getcontext.unique +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.getcontext.shared +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.voidreturn +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.missingargs +
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments [nsIDOMCanvasGradient.addColorStop]
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: Not enough arguments [nsIDOMCanvasGradient.addColorStop]
    +
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.drawImage()
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.drawImage(canvas)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.drawImage(canvas, 0)
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: WRONG_ARGUMENTS_ERR
    +
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.scale()
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.scale(1)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.rotate()
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.translate()
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.translate(0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.transform()
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.transform(1)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.transform(1, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.transform(1, 0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.transform(1, 0, 0, 1)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.transform(1, 0, 0, 1, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.setTransform()
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.setTransform(1)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.setTransform(1, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.setTransform(1, 0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.setTransform(1, 0, 0, 1)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.setTransform(1, 0, 0, 1, 0)
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: SYNTAX_ERR: DOM Exception 12
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.clearRect()
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.clearRect(0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.clearRect(0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.clearRect(0, 0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.fillRect()
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.fillRect(0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.fillRect(0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.fillRect(0, 0, 0)
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.moveTo()
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.moveTo(0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.lineTo()
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.lineTo(0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.quadraticCurveTo()
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.quadraticCurveTo(0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.quadraticCurveTo(0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.quadraticCurveTo(0, 0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.bezierCurveTo()
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.bezierCurveTo(0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.bezierCurveTo(0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.bezierCurveTo(0, 0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.bezierCurveTo(0, 0, 0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.bezierCurveTo(0, 0, 0, 0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.arcTo()
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.arcTo(0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.arcTo(0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.arcTo(0, 0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.arcTo(0, 0, 0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.rect()
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.rect(0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.rect(0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.rect(0, 0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.arc()
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.arc(0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.arc(0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.arc(0, 0, 1)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.arc(0, 0, 1, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.arc(0, 0, 1, 0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.isPointInPath()
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.isPointInPath(0)
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: SYNTAX_ERR: DOM Exception 12
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: SYNTAX_ERR: DOM Exception 12
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: SYNTAX_ERR: DOM Exception 12
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: SYNTAX_ERR: DOM Exception 12
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: SYNTAX_ERR: DOM Exception 12
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: SYNTAX_ERR: DOM Exception 12
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.measureText()
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: TYPE_MISMATCH_ERR: DOM Exception 17
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: drawImage: Invalid number of arguments
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: drawImage: Invalid number of arguments
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData()
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(0, 0, 1)
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: SYNTAX_ERR: DOM Exception 12
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: SYNTAX_ERR: DOM Exception 12
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: SYNTAX_ERR: DOM Exception 12
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: SYNTAX_ERR: DOM Exception 12
    +
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: TYPE_MISMATCH_ERR
    +
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.scale()
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.scale(1)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.rotate()
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.translate()
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.translate(0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.transform()
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.transform(1)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.transform(1, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.transform(1, 0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.transform(1, 0, 0, 1)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.transform(1, 0, 0, 1, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.setTransform()
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.setTransform(1)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.setTransform(1, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.setTransform(1, 0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.setTransform(1, 0, 0, 1)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.setTransform(1, 0, 0, 1, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient()
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, 1)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient()
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.createPattern(canvas)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.clearRect()
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.clearRect(0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.clearRect(0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.clearRect(0, 0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.fillRect()
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.fillRect(0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.fillRect(0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.fillRect(0, 0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.strokeRect()
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.strokeRect(0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.strokeRect(0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.strokeRect(0, 0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.moveTo()
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.moveTo(0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.lineTo()
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.lineTo(0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.quadraticCurveTo()
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.quadraticCurveTo(0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.quadraticCurveTo(0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.quadraticCurveTo(0, 0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.bezierCurveTo()
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.bezierCurveTo(0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.bezierCurveTo(0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.bezierCurveTo(0, 0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.bezierCurveTo(0, 0, 0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.bezierCurveTo(0, 0, 0, 0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.arcTo()
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.arcTo(0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.arcTo(0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.arcTo(0, 0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.arcTo(0, 0, 0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.rect()
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.rect(0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.rect(0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.rect(0, 0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.arc()
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.arc(0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.arc(0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.arc(0, 0, 1)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.arc(0, 0, 1, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.arc(0, 0, 1, 0, 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.isPointInPath()
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.isPointInPath(0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.fillText()
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.fillText('test')
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.fillText('test', 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.strokeText()
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.strokeText('test')
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.strokeText('test', 0)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.measureText()
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.drawImage()
    • Aborted with exception: 'DOMException' is undefined
    +
    # 2d.coordinatespace +
    • Cannot automatically verify result
    +
    • Cannot automatically verify result
    +
    • Cannot automatically verify result
    +
    • Cannot automatically verify result
    +
    • Cannot automatically verify result
    +
    # 2d.scaled +
    • Cannot automatically verify result
    +
    • Cannot automatically verify result
    +
    • Cannot automatically verify result
    +
    • Cannot automatically verify result
    +
    • Cannot automatically verify result
    +
    # 2d.canvas.reference +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.canvas.readonly +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.state.saverestore.strokeStyle +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.state.saverestore.fillStyle +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.state.saverestore.globalAlpha +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.state.saverestore.lineWidth +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.state.saverestore.lineCap +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.state.saverestore.lineJoin +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.state.saverestore.miterLimit +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.state.saverestore.shadowOffsetX +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.state.saverestore.shadowOffsetY +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.state.saverestore.shadowBlur +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.state.saverestore.shadowColor +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.state.saverestore.globalCompositeOperation +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.state.saverestore.font +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion ctx.font === old (got 25px serif[string], expected [undefined])
    +
    • Passed
    +
    # 2d.state.saverestore.textAlign +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion ctx.textAlign === old (got center[string], expected [undefined])
    +
    • Passed
    +
    # 2d.state.saverestore.textBaseline +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion ctx.textBaseline === old (got bottom[string], expected [undefined])
    +
    • Passed
    +
    # initial.reset.2dstate +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion ctx.font === default_val (got 25px serif[string], expected [undefined])
    • Failed assertion ctx.textAlign === default_val (got center[string], expected [undefined])
    • Failed assertion ctx.textBaseline === default_val (got bottom[string], expected [undefined])
    +
    • Passed
    +
    # 2d.state.saverestore.transformation +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.state.saverestore.clip +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.state.saverestore.path +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.state.saverestore.bitmap +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.state.saverestore.stack +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.state.saverestore.stackdepth +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.state.saverestore.underflow +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.transformation.order +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.transformation.scale.basic +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.transformation.scale.zero +
    • Aborted with exception: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMHTMLCanvasElement.toDataURL]
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.transformation.scale.negative +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.transformation.scale.large +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.transformation.scale.nonfinite +
    • Aborted with exception: An invalid or illegal string was specified
    +
    • Passed
    +
    • Passed
    +
    • Aborted with exception: NOT_SUPPORTED_ERR
    +
    • Passed
    +
    # 2d.transformation.scale.multiple +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.transformation.rotate.zero +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.transformation.rotate.radians +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.transformation.rotate.direction +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.transformation.rotate.wrap +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.transformation.rotate.wrapnegative +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.transformation.rotate.nonfinite +
    • Aborted with exception: An invalid or illegal string was specified
    +
    • Passed
    +
    • Passed
    +
    • Aborted with exception: NOT_SUPPORTED_ERR
    +
    • Passed
    +
    # 2d.transformation.translate.basic +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.transformation.translate.nonfinite +
    • Aborted with exception: An invalid or illegal string was specified
    +
    • Passed
    +
    • Passed
    +
    • Aborted with exception: NOT_SUPPORTED_ERR
    +
    • Passed
    +
    # 2d.transformation.transform.identity +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.transformation.transform.skewed +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,255,0,254] at (39,19), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [3,252,0,255] at (21,39), expected [0,255,0,255]
    +
    • Passed
    +
    # 2d.transformation.transform.multiply +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.transformation.transform.nonfinite +
    • Aborted with exception: An invalid or illegal string was specified
    +
    • Passed
    +
    • Passed
    +
    • Aborted with exception: NOT_SUPPORTED_ERR
    +
    • Passed
    +
    # 2d.transformation.setTransform.skewed +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,255,0,254] at (39,19), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [3,252,0,255] at (21,39), expected [0,255,0,255]
    +
    • Passed
    +
    # 2d.transformation.setTransform.multiple +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.transformation.setTransform.nonfinite +
    • Aborted with exception: An invalid or illegal string was specified
    +
    • Passed
    +
    • Passed
    +
    • Aborted with exception: NOT_SUPPORTED_ERR
    +
    • Passed
    +
    # 2d.composite.globalAlpha.range +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.composite.globalAlpha.invalid +
    • Aborted with exception: An invalid or illegal string was specified
    +
    • Passed
    +
    • Passed
    +
    • Aborted with exception: NOT_SUPPORTED_ERR
    +
    • Passed
    +
    # 2d.composite.globalAlpha.default +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.composite.globalAlpha.fill +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.composite.globalAlpha.image +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.composite.globalAlpha.canvas +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.composite.globalAlpha.imagepattern +
    • Passed
    +
    • Passed
    +
    • Aborted with exception: INVALID_STATE_ERR: DOM Exception 11
    +
    • Aborted with exception: INVALID_STATE_ERR
    +
    • Passed
    +
    # 2d.composite.globalAlpha.canvaspattern +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.composite.solid.source-over +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.composite.solid.destination-over +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,255,0,255] at (50,25), expected [0,255,255,255] +/- 5
    +
    # 2d.composite.solid.source-in +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.composite.solid.destination-in +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,255,0,255] at (50,25), expected [0,255,255,255] +/- 5
    +
    # 2d.composite.solid.source-out +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,255,0,255] at (50,25), expected [0,0,0,0] +/- 5
    +
    # 2d.composite.solid.destination-out +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,255,0,255] at (50,25), expected [0,0,0,0] +/- 5
    +
    # 2d.composite.solid.source-atop +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.composite.solid.destination-atop +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,255,0,255] at (50,25), expected [0,255,255,255] +/- 5
    +
    # 2d.composite.solid.xor +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,255,0,255] at (50,25), expected [0,0,0,0] +/- 5
    +
    # 2d.composite.solid.copy +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.composite.solid.lighter +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,255,0,255] at (50,25), expected [255,255,255,255] +/- 5
    +
    # 2d.composite.transparent.source-over +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.composite.transparent.destination-over +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,36,218,223] at (50,25), expected [0,145,109,223] +/- 5
    +
    # 2d.composite.transparent.source-in +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,36,218,223] at (50,25), expected [0,0,255,95] +/- 5
    +
    # 2d.composite.transparent.destination-in +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,36,218,223] at (50,25), expected [0,255,0,95] +/- 5
    +
    # 2d.composite.transparent.source-out +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,36,218,223] at (50,25), expected [0,0,255,95] +/- 5
    +
    # 2d.composite.transparent.destination-out +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,247,0,32] at (50,25), expected [0,255,0,31] +/- 5
    +
    • Failed assertion: got pixel [0,36,218,223] at (50,25), expected [0,255,0,31] +/- 5
    +
    # 2d.composite.transparent.source-atop +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,36,218,223] at (50,25), expected [0,63,191,127] +/- 5
    +
    # 2d.composite.transparent.destination-atop +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,36,218,223] at (50,25), expected [0,127,127,191] +/- 5
    +
    # 2d.composite.transparent.xor +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,36,218,223] at (50,25), expected [0,63,191,127] +/- 5
    +
    # 2d.composite.transparent.copy +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,36,218,223] at (50,25), expected [0,0,255,191] +/- 5
    +
    # 2d.composite.transparent.lighter +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,36,218,223] at (50,25), expected [0,127,191,255] +/- 5
    +
    # 2d.composite.image.source-over +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.composite.image.destination-over +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [218,255,36,223] at (50,25), expected [109,255,145,223] +/- 5
    +
    # 2d.composite.image.source-in +
    • Failed assertion: got pixel [0,0,0,0] at (50,25), expected [255,255,0,95] +/- 5
    +
    • Passed
    +
    • Failed assertion: got pixel [0,255,255,127] at (50,25), expected [255,255,0,95] +/- 5
    +
    • Passed
    +
    • Failed assertion: got pixel [218,255,36,223] at (50,25), expected [255,255,0,95] +/- 5
    +
    # 2d.composite.image.destination-in +
    • Failed assertion: got pixel [0,0,0,0] at (50,25), expected [0,255,255,95] +/- 5
    +
    • Passed
    +
    • Failed assertion: got pixel [0,255,255,127] at (50,25), expected [0,255,255,95] +/- 5
    +
    • Passed
    +
    • Failed assertion: got pixel [218,255,36,223] at (50,25), expected [0,255,255,95] +/- 5
    +
    # 2d.composite.image.source-out +
    • Failed assertion: got pixel [0,0,0,0] at (50,25), expected [255,255,0,95] +/- 5
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [218,255,36,223] at (50,25), expected [255,255,0,95] +/- 5
    +
    # 2d.composite.image.destination-out +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,247,247,32] at (50,25), expected [0,255,255,31] +/- 5
    +
    • Failed assertion: got pixel [218,255,36,223] at (50,25), expected [0,255,255,31] +/- 5
    +
    # 2d.composite.image.source-atop +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [218,255,36,223] at (50,25), expected [191,255,63,127] +/- 5
    +
    # 2d.composite.image.destination-atop +
    • Failed assertion: got pixel [0,0,0,0] at (50,25), expected [127,255,127,191] +/- 5
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [218,255,36,223] at (50,25), expected [127,255,127,191] +/- 5
    +
    # 2d.composite.image.xor +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [218,255,36,223] at (50,25), expected [191,255,63,127] +/- 5
    +
    # 2d.composite.image.copy +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [218,255,36,223] at (50,25), expected [255,255,0,191] +/- 5
    +
    # 2d.composite.image.lighter +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [218,255,36,223] at (50,25), expected [191,255,127,255] +/- 5
    +
    # 2d.composite.canvas.source-over +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.composite.canvas.destination-over +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [218,255,36,223] at (50,25), expected [109,255,145,223] +/- 5
    +
    # 2d.composite.canvas.source-in +
    • Failed assertion: got pixel [0,0,0,0] at (50,25), expected [255,255,0,95] +/- 5
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [218,255,36,223] at (50,25), expected [255,255,0,95] +/- 5
    +
    # 2d.composite.canvas.destination-in +
    • Failed assertion: got pixel [0,0,0,0] at (50,25), expected [0,255,255,95] +/- 5
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [218,255,36,223] at (50,25), expected [0,255,255,95] +/- 5
    +
    # 2d.composite.canvas.source-out +
    • Failed assertion: got pixel [0,0,0,0] at (50,25), expected [255,255,0,95] +/- 5
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [218,255,36,223] at (50,25), expected [255,255,0,95] +/- 5
    +
    # 2d.composite.canvas.destination-out +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,247,247,32] at (50,25), expected [0,255,255,31] +/- 5
    +
    • Failed assertion: got pixel [218,255,36,223] at (50,25), expected [0,255,255,31] +/- 5
    +
    # 2d.composite.canvas.source-atop +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [218,255,36,223] at (50,25), expected [191,255,63,127] +/- 5
    +
    # 2d.composite.canvas.destination-atop +
    • Failed assertion: got pixel [0,0,0,0] at (50,25), expected [127,255,127,191] +/- 5
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [218,255,36,223] at (50,25), expected [127,255,127,191] +/- 5
    +
    # 2d.composite.canvas.xor +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [218,255,36,223] at (50,25), expected [191,255,63,127] +/- 5
    +
    # 2d.composite.canvas.copy +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [218,255,36,223] at (50,25), expected [255,255,0,191] +/- 5
    +
    # 2d.composite.canvas.lighter +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [218,255,36,223] at (50,25), expected [191,255,127,255] +/- 5
    +
    # 2d.composite.uncovered.fill.source-in +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,255,0,127] at (50,25), expected [0,0,0,0] +/- 5
    +
    • Failed assertion: got pixel [0,253,0,127] at (50,25), expected [0,0,0,0] +/- 5
    +
    • Failed assertion: got pixel [0,255,0,128] at (50,25), expected [0,0,0,0] +/- 5
    +
    # 2d.composite.uncovered.fill.destination-in +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,255,0,127] at (50,25), expected [0,0,0,0] +/- 5
    +
    • Failed assertion: got pixel [0,253,0,127] at (50,25), expected [0,0,0,0] +/- 5
    +
    • Failed assertion: got pixel [0,255,0,128] at (50,25), expected [0,0,0,0] +/- 5
    +
    # 2d.composite.uncovered.fill.source-out +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,255,0,127] at (50,25), expected [0,0,0,0] +/- 5
    +
    • Failed assertion: got pixel [0,253,0,127] at (50,25), expected [0,0,0,0] +/- 5
    +
    • Failed assertion: got pixel [0,255,0,128] at (50,25), expected [0,0,0,0] +/- 5
    +
    # 2d.composite.uncovered.fill.destination-atop +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,255,0,127] at (50,25), expected [0,0,0,0] +/- 5
    +
    • Failed assertion: got pixel [0,253,0,127] at (50,25), expected [0,0,0,0] +/- 5
    +
    • Failed assertion: got pixel [0,255,0,128] at (50,25), expected [0,0,0,0] +/- 5
    +
    # 2d.composite.uncovered.fill.copy +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,255,0,127] at (50,25), expected [0,0,0,0] +/- 5
    +
    • Failed assertion: got pixel [0,253,0,127] at (50,25), expected [0,0,0,0] +/- 5
    +
    • Failed assertion: got pixel [0,255,0,128] at (50,25), expected [0,0,0,0] +/- 5
    +
    # 2d.composite.uncovered.image.source-in +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,255,255,127] at (15,15), expected [0,0,0,0] +/- 5
    • Failed assertion: got pixel [0,255,255,127] at (50,25), expected [0,0,0,0] +/- 5
    +
    • Failed assertion: got pixel [0,253,253,127] at (15,15), expected [0,0,0,0] +/- 5
    • Failed assertion: got pixel [0,253,253,127] at (50,25), expected [0,0,0,0] +/- 5
    +
    • Failed assertion: got pixel [0,255,255,128] at (15,15), expected [0,0,0,0] +/- 5
    • Failed assertion: got pixel [0,255,255,128] at (50,25), expected [0,0,0,0] +/- 5
    +
    # 2d.composite.uncovered.image.destination-in +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,255,255,127] at (15,15), expected [0,0,0,0] +/- 5
    • Failed assertion: got pixel [0,255,255,127] at (50,25), expected [0,0,0,0] +/- 5
    +
    • Failed assertion: got pixel [0,253,253,127] at (15,15), expected [0,0,0,0] +/- 5
    • Failed assertion: got pixel [0,253,253,127] at (50,25), expected [0,0,0,0] +/- 5
    +
    • Failed assertion: got pixel [0,255,255,128] at (15,15), expected [0,0,0,0] +/- 5
    • Failed assertion: got pixel [0,255,255,128] at (50,25), expected [0,0,0,0] +/- 5
    +
    # 2d.composite.uncovered.image.source-out +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,255,255,127] at (15,15), expected [0,0,0,0] +/- 5
    • Failed assertion: got pixel [0,255,255,127] at (50,25), expected [0,0,0,0] +/- 5
    +
    • Failed assertion: got pixel [0,253,253,127] at (15,15), expected [0,0,0,0] +/- 5
    • Failed assertion: got pixel [0,253,253,127] at (50,25), expected [0,0,0,0] +/- 5
    +
    • Failed assertion: got pixel [0,255,255,128] at (15,15), expected [0,0,0,0] +/- 5
    • Failed assertion: got pixel [0,255,255,128] at (50,25), expected [0,0,0,0] +/- 5
    +
    # 2d.composite.uncovered.image.destination-atop +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,255,255,127] at (15,15), expected [0,0,0,0] +/- 5
    • Failed assertion: got pixel [0,255,255,127] at (50,25), expected [0,0,0,0] +/- 5
    +
    • Failed assertion: got pixel [0,253,253,127] at (15,15), expected [0,0,0,0] +/- 5
    • Failed assertion: got pixel [0,253,253,127] at (50,25), expected [0,0,0,0] +/- 5
    +
    • Failed assertion: got pixel [0,255,255,128] at (15,15), expected [0,0,0,0] +/- 5
    • Failed assertion: got pixel [0,255,255,128] at (50,25), expected [0,0,0,0] +/- 5
    +
    # 2d.composite.uncovered.image.copy +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,255,255,127] at (15,15), expected [0,0,0,0] +/- 5
    • Failed assertion: got pixel [0,255,255,127] at (50,25), expected [0,0,0,0] +/- 5
    +
    • Failed assertion: got pixel [0,253,253,127] at (15,15), expected [0,0,0,0] +/- 5
    • Failed assertion: got pixel [0,253,253,127] at (50,25), expected [0,0,0,0] +/- 5
    +
    • Failed assertion: got pixel [0,255,255,128] at (15,15), expected [0,0,0,0] +/- 5
    • Failed assertion: got pixel [0,255,255,128] at (50,25), expected [0,0,0,0] +/- 5
    +
    # 2d.composite.uncovered.nocontext.source-in +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,255,255,128] at (50,25), expected [0,0,0,0] +/- 5
    +
    # 2d.composite.uncovered.nocontext.destination-in +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,255,255,128] at (50,25), expected [0,0,0,0] +/- 5
    +
    # 2d.composite.uncovered.nocontext.source-out +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,255,255,128] at (50,25), expected [0,0,0,0] +/- 5
    +
    # 2d.composite.uncovered.nocontext.destination-atop +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,255,255,128] at (50,25), expected [0,0,0,0] +/- 5
    +
    # 2d.composite.uncovered.nocontext.copy +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,255,255,128] at (50,25), expected [0,0,0,0] +/- 5
    +
    # 2d.composite.uncovered.pattern.source-in +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,255,255,127] at (50,25), expected [0,0,0,0] +/- 5
    +
    • Failed assertion: got pixel [0,253,253,127] at (50,25), expected [0,0,0,0] +/- 5
    +
    • Failed assertion: got pixel [0,255,255,128] at (50,25), expected [0,0,0,0] +/- 5
    +
    # 2d.composite.uncovered.pattern.destination-in +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,255,255,127] at (50,25), expected [0,0,0,0] +/- 5
    +
    • Failed assertion: got pixel [0,253,253,127] at (50,25), expected [0,0,0,0] +/- 5
    +
    • Failed assertion: got pixel [0,255,255,128] at (50,25), expected [0,0,0,0] +/- 5
    +
    # 2d.composite.uncovered.pattern.source-out +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,255,255,127] at (50,25), expected [0,0,0,0] +/- 5
    +
    • Failed assertion: got pixel [0,253,253,127] at (50,25), expected [0,0,0,0] +/- 5
    +
    • Failed assertion: got pixel [0,255,255,128] at (50,25), expected [0,0,0,0] +/- 5
    +
    # 2d.composite.uncovered.pattern.destination-atop +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,255,255,127] at (50,25), expected [0,0,0,0] +/- 5
    +
    • Failed assertion: got pixel [0,253,253,127] at (50,25), expected [0,0,0,0] +/- 5
    +
    • Failed assertion: got pixel [0,255,255,128] at (50,25), expected [0,0,0,0] +/- 5
    +
    # 2d.composite.uncovered.pattern.copy +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,255,255,127] at (50,25), expected [0,0,0,0] +/- 5
    +
    • Failed assertion: got pixel [0,253,253,127] at (50,25), expected [0,0,0,0] +/- 5
    +
    • Failed assertion: got pixel [0,255,255,128] at (50,25), expected [0,0,0,0] +/- 5
    +
    # 2d.composite.clip.source-over +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.composite.clip.destination-over +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.composite.clip.source-in +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.composite.clip.destination-in +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.composite.clip.source-out +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.composite.clip.destination-out +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.composite.clip.source-atop +
    • Passed
    +
    • Failed assertion: got pixel [0,254,0,255] at (25,25), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.composite.clip.destination-atop +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.composite.clip.xor +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.composite.clip.copy +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.composite.clip.lighter +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.composite.operation.get +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion ctx.globalCompositeOperation == modes["0"] (got [string], expected source-atop[string])
    • Failed assertion ctx.globalCompositeOperation == modes["1"] (got [string], expected source-in[string])
    • Failed assertion ctx.globalCompositeOperation == modes["2"] (got [string], expected source-out[string])
    • Failed assertion ctx.globalCompositeOperation == modes["3"] (got [string], expected source-over[string])
    • Failed assertion ctx.globalCompositeOperation == modes["4"] (got [string], expected destination-atop[string])
    • Failed assertion ctx.globalCompositeOperation == modes["5"] (got [string], expected destination-in[string])
    • Failed assertion ctx.globalCompositeOperation == modes["6"] (got [string], expected destination-out[string])
    • Failed assertion ctx.globalCompositeOperation == modes["7"] (got [string], expected destination-over[string])
    • Failed assertion ctx.globalCompositeOperation == modes["8"] (got [string], expected lighter[string])
    • Failed assertion ctx.globalCompositeOperation == modes["9"] (got [string], expected copy[string])
    • Failed assertion ctx.globalCompositeOperation == modes["10"] (got [string], expected xor[string])
    +
    # 2d.composite.operation.unrecognised +
    • Aborted with exception: Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMCanvasRenderingContext2D.globalCompositeOperation]
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion ctx.globalCompositeOperation == 'xor' (got [string], expected xor[string])
    +
    # 2d.composite.operation.darker +
    • Failed assertion ctx.globalCompositeOperation == 'xor' (got darker[string], expected xor[string])
    +
    • Passed
    +
    • Failed assertion ctx.globalCompositeOperation == 'xor' (got darker[string], expected xor[string])
    +
    • Passed
    +
    • Failed assertion ctx.globalCompositeOperation == 'xor' (got [string], expected xor[string])
    +
    # 2d.composite.operation.over +
    • Failed assertion ctx.globalCompositeOperation == 'xor' (got source-over[string], expected xor[string])
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion ctx.globalCompositeOperation == 'xor' (got [string], expected xor[string])
    +
    # 2d.composite.operation.clear +
    • Failed assertion ctx.globalCompositeOperation == 'xor' (got clear[string], expected xor[string])
    +
    • Passed
    +
    • Failed assertion ctx.globalCompositeOperation == 'xor' (got clear[string], expected xor[string])
    +
    • Passed
    +
    • Failed assertion ctx.globalCompositeOperation == 'xor' (got [string], expected xor[string])
    +
    # 2d.composite.operation.highlight +
    • Aborted with exception: Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMCanvasRenderingContext2D.globalCompositeOperation]
    +
    • Passed
    +
    • Failed assertion ctx.globalCompositeOperation == 'xor' (got highlight[string], expected xor[string])
    +
    • Passed
    +
    • Failed assertion ctx.globalCompositeOperation == 'xor' (got [string], expected xor[string])
    +
    # 2d.composite.operation.nullsuffix +
    • Aborted with exception: Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMCanvasRenderingContext2D.globalCompositeOperation]
    +
    • Failed assertion ctx.globalCompositeOperation == 'xor' (got source-over[string], expected xor[string])
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion ctx.globalCompositeOperation == 'xor' (got [string], expected xor[string])
    +
    # 2d.composite.operation.casesensitive +
    • Aborted with exception: Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMCanvasRenderingContext2D.globalCompositeOperation]
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion ctx.globalCompositeOperation == 'xor' (got [string], expected xor[string])
    +
    # 2d.composite.operation.default +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion ctx.globalCompositeOperation == 'source-over' (got [string], expected source-over[string])
    +
    # 2d.fillStyle.parse.html4 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.hex3 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.hex6 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.rgb-num +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.rgb-clamp-1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.rgb-clamp-2 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.rgb-clamp-3 +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [0,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Passed
    +
    # 2d.fillStyle.parse.rgb-clamp-4 +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [0,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Passed
    +
    # 2d.fillStyle.parse.rgb-clamp-5 +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [0,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Passed
    +
    # 2d.fillStyle.parse.rgb-percent +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.rgba-solid-1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.rgba-solid-2 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.rgba-num-1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,253,0,127] at (50,25), expected [0,255,0,127]
    +
    • Passed
    +
    # 2d.fillStyle.parse.rgba-num-2 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,253,0,127] at (50,25), expected [0,255,0,127]
    +
    • Passed
    +
    # 2d.fillStyle.parse.rgba-percent +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,253,0,127] at (50,25), expected [0,255,0,127]
    +
    • Passed
    +
    # 2d.fillStyle.parse.rgba-clamp-1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.rgba-clamp-2 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.transparent-1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.transparent-2 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.hsl-1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.hsl-2 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.hsl-3 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.hsl-4 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.hsl-5 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Passed
    +
    # 2d.fillStyle.parse.hsl-clamp-1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.hsl-clamp-2 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [128,128,128,255] at (50,25), expected [127,127,127,255]
    +
    # 2d.fillStyle.parse.hsl-clamp-3 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.hsl-clamp-4 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.hsla-1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,253,0,127] at (50,25), expected [0,255,0,127]
    +
    • Passed
    +
    # 2d.fillStyle.parse.hsla-2 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Passed
    +
    # 2d.fillStyle.parse.hsla-clamp-1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.hsla-clamp-2 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [128,128,128,255] at (50,25), expected [127,127,127,255]
    +
    # 2d.fillStyle.parse.hsla-clamp-3 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.hsla-clamp-4 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.hsla-clamp-5 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.hsla-clamp-6 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.svg-1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.svg-2 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.invalid.hex1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.invalid.hex2 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.invalid.hex3 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.invalid.hex4 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.invalid.hex5 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.invalid.hex6 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.invalid.hex7 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.invalid.hex8 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.invalid.rgb-1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.invalid.rgb-2 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.invalid.rgb-3 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.invalid.rgb-4 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.invalid.rgb-5 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    # 2d.fillStyle.parse.invalid.rgb-6 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.invalid.rgb-7 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.invalid.rgba-1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.invalid.rgba-2 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.invalid.rgba-3 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.invalid.rgba-4 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.invalid.rgba-5 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.invalid.hsl-1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.invalid.hsl-2 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.invalid.hsl-3 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.invalid.hsl-4 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.invalid.hsl-5 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.invalid.hsla-1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.invalid.hsla-2 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.invalid.name-1 +
    • Passed
    +
    • Failed assertion: got pixel [92,64,51,255] at (50,25), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.invalid.name-2 +
    • Passed
    +
    • Failed assertion: got pixel [255,48,48,255] at (50,25), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.invalid.name-3 +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.system +
    • Passed
    +
    • Failed assertion ctx.fillStyle matches /^#(?!(FF0000|ff0000|f00)$)/ (got #ff0000[string])
    +
    • Failed assertion ctx.fillStyle matches /^#(?!(FF0000|ff0000|f00)$)/ (got ThreeDDarkShadow[string])
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.parse.current.basic +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [0,0,0,0] at (50,25), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,255,255,255] at (50,25), expected [0,255,0,255]
    +
    # 2d.fillStyle.parse.current.changed +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [0,0,0,0] at (50,25), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,255,255,255] at (50,25), expected [0,255,0,255]
    +
    # 2d.fillStyle.parse.current.removed +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,0,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,0,0,255]
    +
    • Failed assertion: got pixel [0,0,0,0] at (50,25), expected [0,0,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,0,0,255]
    +
    • Failed assertion: got pixel [255,255,255,255] at (50,25), expected [0,0,0,255]
    +
    # 2d.fillStyle.invalidstring +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.invalidtype +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.get.solid +
    • Passed
    +
    • Passed
    +
    • Failed assertion ctx.fillStyle === '#ffaa00' (got #fa0[string], expected #ffaa00[string])
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillStyle.get.semitransparent +
    • Passed
    +
    • Passed
    +
    • Failed assertion ctx.fillStyle matches /^rgba\(255, 255, 255, 0\.4\d+\)$/ (got rgba(255,255,255,0.45)[string])
    +
    • Passed
    +
    • Failed assertion ctx.fillStyle matches /^rgba\(255, 255, 255, 0\.4\d+\)$/ (got rgba(255,255,255,0.45)[string])
    +
    # 2d.fillStyle.get.transparent +
    • Passed
    +
    • Passed
    +
    • Failed assertion ctx.fillStyle == 'rgba(0, 0, 0, 0.0)' (got rgba(0,0,0,0)[string], expected rgba(0, 0, 0, 0.0)[string])
    +
    • Passed
    +
    • Failed assertion ctx.fillStyle == 'rgba(0, 0, 0, 0.0)' (got rgba(0,0,0,0)[string], expected rgba(0, 0, 0, 0.0)[string])
    +
    # 2d.fillStyle.default +
    • Passed
    +
    • Passed
    +
    • Failed assertion ctx.fillStyle == '#000000' (got black[string], expected #000000[string])
    +
    • Passed
    +
    • Passed
    +
    # 2d.strokeStyle.default +
    • Passed
    +
    • Passed
    +
    • Failed assertion ctx.strokeStyle == '#000000' (got black[string], expected #000000[string])
    +
    • Passed
    +
    • Passed
    +
    # 2d.gradient.object.return +
    • Passed
    +
    • Passed
    +
    • Aborted with exception: Cannot read property 'prototype' of undefined
    +
    • Aborted with exception: Undefined value
    +
    • Aborted with exception: 'undefined' is null or not an object
    +
    # 2d.gradient.interpolate.solid +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.gradient.interpolate.colour +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.gradient.interpolate.alpha +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.gradient.interpolate.colouralpha +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,0,251,64] at (25,25), expected [191,191,63,63] +/- 3
    • Failed assertion: got pixel [0,0,253,128] at (50,25), expected [127,127,127,127] +/- 3
    • Failed assertion: got pixel [0,0,255,192] at (75,25), expected [63,63,191,191] +/- 3
    +
    • Passed
    +
    # 2d.gradient.interpolate.outside +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.gradient.interpolate.zerosize +
    • Failed assertion: got pixel [255,0,0,255] at (40,20), expected [0,255,0,255] +/- 2
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (40,20), expected [0,255,0,255] +/- 2
    +
    • Failed assertion: got pixel [255,0,0,255] at (40,20), expected [0,255,0,255] +/- 2
    +
    • Passed
    +
    # 2d.gradient.interpolate.vertical +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.gradient.interpolate.multiple +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.gradient.interpolate.overlap +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [48,48,205,255] at (49,25), expected [0,0,255,255] +/- 16
    • Failed assertion: got pixel [48,48,205,255] at (149,25), expected [0,0,255,255] +/- 16
    +
    # 2d.gradient.interpolate.overlap2 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.gradient.empty +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [130,130,130,255] at (50,25), expected [0,255,0,255] +/- 2
    +
    • Passed
    +
    # 2d.gradient.object.update +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255] +/- 2
    +
    • Passed
    +
    • Passed
    +
    # 2d.gradient.object.compare +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.gradient.object.crosscanvas +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.gradient.object.invalidoffset +
    • Failed assertion: expected exception of type INDEX_SIZE_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type INDEX_SIZE_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type INDEX_SIZE_ERR, got: An invalid or illegal string was specified
    +
    • Failed assertion: expected exception of type INDEX_SIZE_ERR, got: NOT_SUPPORTED_ERR
    • Failed assertion: expected exception of type INDEX_SIZE_ERR, got: NOT_SUPPORTED_ERR
    • Failed assertion: expected exception of type INDEX_SIZE_ERR, got: NOT_SUPPORTED_ERR
    +
    • Passed
    +
    • Failed assertion: should throw exception of type INDEX_SIZE_ERR: g.addColorStop(NaN, '#000')
    +
    • Failed assertion: should throw exception of type INDEX_SIZE_ERR: g.addColorStop(-1, '#000')
    • Aborted with exception: 'DOMException' is undefined
    +
    # 2d.gradient.object.invalidcolour +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: should throw exception of type SYNTAX_ERR: g.addColorStop(0, "")
    • Failed assertion: should throw exception of type SYNTAX_ERR: g.addColorStop(0, 'undefined')
    • Aborted with exception: 'DOMException' is undefined
    +
    # 2d.gradient.linear.nonfinite +
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, 0, 1, 0)
    • Aborted with exception: 'DOMException' is undefined
    +
    # 2d.gradient.linear.transform.1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.gradient.linear.transform.2 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.gradient.linear.transform.3 +
    • Failed assertion: got pixel [125,129,0,255] at (25,25), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.gradient.radial.negative +
    • Failed assertion: should throw exception of type INDEX_SIZE_ERR: ctx.createRadialGradient(0, 0, -0.1, 0, 0, 1)
    • Failed assertion: should throw exception of type INDEX_SIZE_ERR: ctx.createRadialGradient(0, 0, 1, 0, 0, -0.1)
    • Failed assertion: should throw exception of type INDEX_SIZE_ERR: ctx.createRadialGradient(0, 0, -0.1, 0, 0, -0.1)
    +
    • Passed
    +
    • Failed assertion: should throw exception of type INDEX_SIZE_ERR: ctx.createRadialGradient(0, 0, -0.1, 0, 0, 1)
    • Failed assertion: should throw exception of type INDEX_SIZE_ERR: ctx.createRadialGradient(0, 0, 1, 0, 0, -0.1)
    • Failed assertion: should throw exception of type INDEX_SIZE_ERR: ctx.createRadialGradient(0, 0, -0.1, 0, 0, -0.1)
    +
    • Passed
    +
    • Failed assertion: should throw exception of type INDEX_SIZE_ERR: ctx.createRadialGradient(0, 0, -0.1, 0, 0, 1)
    • Aborted with exception: 'DOMException' is undefined
    +
    # 2d.gradient.radial.nonfinite +
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, 0, 0, 1)
    • Aborted with exception: 'DOMException' is undefined
    +
    # 2d.gradient.radial.inside1 +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [69,186,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [30,225,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [67,188,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [62,193,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [60,195,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [69,186,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [29,226,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [67,188,0,255] at (98,48), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    # 2d.gradient.radial.inside2 +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [116,139,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [194,61,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [119,136,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [130,125,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [133,122,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [117,138,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [197,58,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [120,135,0,255] at (98,48), expected [0,255,0,255]
    +
    • Passed
    +
    • Failed assertion: got pixel [0,254,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (98,48), expected [0,255,0,255]
    +
    # 2d.gradient.radial.inside3 +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,48), expected [0,255,0,255]
    +
    • Passed
    +
    • Failed assertion: got pixel [45,209,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [45,209,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [45,209,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [45,209,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [45,209,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [45,209,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [45,209,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [45,209,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [45,209,0,255] at (98,48), expected [0,255,0,255]
    +
    # 2d.gradient.radial.outside1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.gradient.radial.outside2 +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,48), expected [0,255,0,255]
    +
    • Passed
    +
    • Failed assertion: got pixel [0,254,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (98,48), expected [0,255,0,255]
    +
    # 2d.gradient.radial.outside3 +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,48), expected [0,255,0,255]
    +
    • Passed
    +
    • Failed assertion: got pixel [198,56,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [198,56,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [198,56,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [198,56,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [198,56,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [198,56,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [198,56,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [198,56,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [198,56,0,255] at (98,48), expected [0,255,0,255]
    +
    # 2d.gradient.radial.touch1 +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,48), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,48), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,48), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,48), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,48), expected [0,255,0,255]
    +
    # 2d.gradient.radial.touch2 +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,48), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [223,31,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [223,31,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [223,31,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [223,31,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [223,31,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [223,31,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [223,31,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [223,31,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [223,31,0,255] at (98,48), expected [0,255,0,255]
    +
    # 2d.gradient.radial.touch3 +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,48), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,48), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,48), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,48), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,48), expected [0,255,0,255]
    +
    # 2d.gradient.radial.equal +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,48), expected [0,255,0,255]
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,48), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,48), expected [0,255,0,255]
    +
    • Passed
    +
    # 2d.gradient.radial.cone.behind +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,48), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,48), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,48), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,48), expected [0,255,0,255]
    +
    • Aborted with exception: Unexpected call to method or property access.
    +
    # 2d.gradient.radial.cone.front +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,254,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (98,48), expected [0,255,0,255]
    +
    # 2d.gradient.radial.cone.bottom +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,48), expected [0,255,0,255]
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,48), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [0,254,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (98,48), expected [0,255,0,255]
    +
    # 2d.gradient.radial.cone.top +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,48), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,48), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,48), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [0,254,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (98,48), expected [0,255,0,255]
    +
    # 2d.gradient.radial.cone.beside +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,48), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,48), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,48), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,48), expected [0,255,0,255]
    +
    • Passed
    +
    # 2d.gradient.radial.cone.cylinder +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,48), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [0,0,0,0] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [0,0,0,0] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [0,0,0,0] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [0,0,0,0] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [0,0,0,0] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [0,0,0,0] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [0,0,0,0] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [0,0,0,0] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [0,0,0,0] at (98,48), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,48), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [0,254,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (98,25), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (50,48), expected [0,255,0,255]
    • Failed assertion: got pixel [0,254,0,255] at (98,48), expected [0,255,0,255]
    +
    # 2d.gradient.radial.cone.shape1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [72,183,0,255] at (50,25), expected [0,255,0,255]
    +
    # 2d.gradient.radial.cone.shape2 +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    +
    • Passed
    +
    # 2d.gradient.radial.transform.1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.gradient.radial.transform.2 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.gradient.radial.transform.3 +
    • Failed assertion: got pixel [255,0,0,255] at (25,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (75,25), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.pattern.basic.type +
    • Passed
    +
    • Passed
    +
    • Failed assertion window.CanvasPattern !== undefined (got [undefined], expected not [undefined])
    • Aborted with exception: Cannot read property 'prototype' of undefined
    +
    • Failed assertion window.CanvasPattern !== undefined (got [undefined], expected not [undefined])
    • Aborted with exception: Undefined value
    +
    • Failed assertion window.CanvasPattern !== undefined (got [undefined], expected not [undefined])
    • Aborted with exception: 'undefined' is null or not an object
    +
    # 2d.pattern.basic.image +
    • Passed
    +
    • Passed
    +
    • Aborted with exception: INVALID_STATE_ERR: DOM Exception 11
    +
    • Passed
    +
    • Passed
    +
    # 2d.pattern.basic.canvas +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.pattern.basic.zerocanvas +
    • Failed assertion: should throw exception of type INVALID_STATE_ERR: ctx.createPattern(canvas, 'repeat')
    • Failed assertion: should throw exception of type INVALID_STATE_ERR: ctx.createPattern(canvas, 'repeat')
    • Failed assertion: should throw exception of type INVALID_STATE_ERR: ctx.createPattern(canvas, 'repeat')
    +
    • Failed assertion canvas.width === 0 (got 300[number], expected 0[number])
    • Failed assertion: should throw exception of type INVALID_STATE_ERR: ctx.createPattern(canvas, 'repeat')
    • Failed assertion canvas.height === 0 (got 150[number], expected 0[number])
    • Failed assertion: should throw exception of type INVALID_STATE_ERR: ctx.createPattern(canvas, 'repeat')
    • Failed assertion canvas.width === 0 (got 300[number], expected 0[number])
    • Failed assertion canvas.height === 0 (got 150[number], expected 0[number])
    • Failed assertion: should throw exception of type INVALID_STATE_ERR: ctx.createPattern(canvas, 'repeat')
    +
    • Passed
    +
    • Failed assertion canvas.width === 0 (got 300[number], expected 0[number])
    • Failed assertion: should throw exception of type INVALID_STATE_ERR: ctx.createPattern(canvas, 'repeat')
    • Failed assertion canvas.height === 0 (got 150[number], expected 0[number])
    • Failed assertion: should throw exception of type INVALID_STATE_ERR: ctx.createPattern(canvas, 'repeat')
    • Failed assertion canvas.width === 0 (got 300[number], expected 0[number])
    • Failed assertion canvas.height === 0 (got 150[number], expected 0[number])
    • Failed assertion: should throw exception of type INVALID_STATE_ERR: ctx.createPattern(canvas, 'repeat')
    +
    • Failed assertion: should throw exception of type INVALID_STATE_ERR: ctx.createPattern(canvas, 'repeat')
    • Aborted with exception: 'DOMException' is undefined
    +
    # 2d.pattern.basic.nocontext +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.pattern.image.undefined +
    • Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIDOMCanvasRenderingContext2D.createPattern]
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: should throw exception of type TYPE_MISMATCH_ERR: ctx.createPattern(undefined, 'repeat')
    • Aborted with exception: 'DOMException' is undefined
    +
    # 2d.pattern.image.null +
    • Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIDOMCanvasRenderingContext2D.createPattern]
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: should throw exception of type TYPE_MISMATCH_ERR: ctx.createPattern(null, 'repeat')
    • Aborted with exception: 'DOMException' is undefined
    +
    # 2d.pattern.image.string +
    • Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: Could not convert JavaScript argument arg 0 [nsIDOMCanvasRenderingContext2D.createPattern]
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: should throw exception of type TYPE_MISMATCH_ERR: ctx.createPattern('../images/red.png', 'repeat')
    • Aborted with exception: 'DOMException' is undefined
    +
    # 2d.pattern.image.incomplete +
    • Failed assertion img.complete === false (got true[boolean], expected false[boolean])
    • Aborted with exception: Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIDOMCanvasRenderingContext2D.createPattern]
    +
    • Failed assertion img.complete === false (got true[boolean], expected false[boolean])
    • Aborted with exception: TYPE_MISMATCH_ERR
    +
    • Failed assertion img.complete === false (got true[boolean], expected false[boolean])
    • Aborted with exception: NULL is not defined
    +
    • Aborted with exception: INVALID_STATE_ERR
    +
    • Aborted with exception: Unexpected call to method or property access.
    +
    # 2d.pattern.image.broken +
    • Failed assertion img.complete === false (got true[boolean], expected false[boolean])
    • Aborted with exception: Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIDOMCanvasRenderingContext2D.createPattern]
    +
    • Failed assertion img.complete === false (got true[boolean], expected false[boolean])
    • Aborted with exception: Undefined variable: NULL
    +
    • Failed assertion img.complete === false (got true[boolean], expected false[boolean])
    • Aborted with exception: NULL is not defined
    +
    • Aborted with exception: INVALID_STATE_ERR
    +
    • Failed assertion img.complete === false (got true[boolean], expected false[boolean])
    • Aborted with exception: 'NULL' is undefined
    +
    # 2d.pattern.repeat.empty +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.pattern.repeat.null +
    • Passed
    +
    • Passed
    +
    • Aborted with exception: INVALID_STATE_ERR: DOM Exception 11
    +
    • Aborted with exception: INVALID_STATE_ERR
    +
    • Passed
    +
    # 2d.pattern.repeat.undefined +
    • Passed
    +
    • Failed assertion: should throw exception of type SYNTAX_ERR: ctx.createPattern(canvas, undefined)
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: should throw exception of type SYNTAX_ERR: ctx.createPattern(canvas, undefined)
    • Aborted with exception: 'DOMException' is undefined
    +
    # 2d.pattern.repeat.unrecognised +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: should throw exception of type SYNTAX_ERR: ctx.createPattern(canvas, "invalid")
    • Aborted with exception: 'DOMException' is undefined
    +
    # 2d.pattern.repeat.case +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: should throw exception of type SYNTAX_ERR: ctx.createPattern(canvas, "Repeat")
    • Aborted with exception: 'DOMException' is undefined
    +
    # 2d.pattern.repeat.nullsuffix +
    • Passed
    +
    • Failed assertion: should throw exception of type SYNTAX_ERR: ctx.createPattern(canvas, "repeat\0")
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: should throw exception of type SYNTAX_ERR: ctx.createPattern(canvas, "repeat\0")
    +
    # 2d.pattern.modify.image1 +
    • Passed
    +
    • Passed
    +
    • Aborted with exception: INVALID_STATE_ERR: DOM Exception 11
    +
    • Passed
    +
    • Passed
    +
    # 2d.pattern.modify.image2 +
    • Passed
    +
    • Passed
    +
    • Aborted with exception: INVALID_STATE_ERR: DOM Exception 11
    +
    • Aborted with exception: INVALID_STATE_ERR
    +
    • Passed
    +
    # 2d.pattern.modify.canvas1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.pattern.modify.canvas2 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.pattern.crosscanvas +
    • Passed
    +
    • Passed
    +
    • Aborted with exception: INVALID_STATE_ERR: DOM Exception 11
    +
    • Aborted with exception: INVALID_STATE_ERR
    +
    • Passed
    +
    # 2d.pattern.paint.norepeat.basic +
    • Passed
    +
    • Passed
    +
    • Aborted with exception: INVALID_STATE_ERR: DOM Exception 11
    +
    • Aborted with exception: INVALID_STATE_ERR
    +
    • Passed
    +
    # 2d.pattern.paint.norepeat.outside +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.pattern.paint.norepeat.coord1 +
    • Passed
    +
    • Passed
    +
    • Aborted with exception: INVALID_STATE_ERR: DOM Exception 11
    +
    • Aborted with exception: INVALID_STATE_ERR
    +
    • Passed
    +
    # 2d.pattern.paint.norepeat.coord2 +
    • Passed
    +
    • Passed
    +
    • Aborted with exception: INVALID_STATE_ERR: DOM Exception 11
    +
    • Aborted with exception: INVALID_STATE_ERR
    +
    • Passed
    +
    # 2d.pattern.paint.norepeat.coord3 +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    # 2d.pattern.paint.repeat.basic +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.pattern.paint.repeat.outside +
    • Passed
    +
    • Passed
    +
    • Aborted with exception: INVALID_STATE_ERR: DOM Exception 11
    +
    • Passed
    +
    • Passed
    +
    # 2d.pattern.paint.repeat.coord1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.pattern.paint.repeat.coord2 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.pattern.paint.repeat.coord3 +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,48), expected [0,255,0,255]
    +
    • Passed
    +
    • Aborted with exception: INVALID_STATE_ERR: DOM Exception 11
    +
    • Aborted with exception: INVALID_STATE_ERR
    +
    • Passed
    +
    # 2d.pattern.paint.repeatx.basic +
    • Passed
    +
    • Passed
    +
    • Aborted with exception: INVALID_STATE_ERR: DOM Exception 11
    +
    • Passed
    +
    • Passed
    +
    # 2d.pattern.paint.repeatx.outside +
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,48), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.pattern.paint.repeatx.coord1 +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,48), expected [0,255,0,255]
    +
    • Passed
    +
    • Aborted with exception: INVALID_STATE_ERR: DOM Exception 11
    +
    • Passed
    +
    • Passed
    +
    # 2d.pattern.paint.repeaty.basic +
    • Passed
    +
    • Passed
    +
    • Aborted with exception: INVALID_STATE_ERR: DOM Exception 11
    +
    • Passed
    +
    • Passed
    +
    # 2d.pattern.paint.repeaty.outside +
    • Failed assertion: got pixel [255,0,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,48), expected [0,255,0,255]
    +
    • Passed
    +
    • Aborted with exception: INVALID_STATE_ERR: DOM Exception 11
    +
    • Passed
    +
    • Passed
    +
    # 2d.pattern.paint.repeaty.coord1 +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,48), expected [0,255,0,255]
    +
    • Passed
    +
    • Aborted with exception: INVALID_STATE_ERR: DOM Exception 11
    +
    • Passed
    +
    • Passed
    +
    # 2d.pattern.paint.orientation.image +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.pattern.paint.orientation.canvas +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.pattern.animated.gif +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.line.defaults +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.line.width.basic +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [7,248,0,255] at (15,25), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    # 2d.line.width.transformed +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [7,248,0,255] at (15,25), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    # 2d.line.width.scaledefault +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.line.width.valid +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.line.width.invalid +
    • Failed assertion ctx.lineWidth === 1.5 (got 0[number], expected 1.5[number])
    • Failed assertion ctx.lineWidth === 1.5 (got 0[number], expected 1.5[number])
    • Aborted with exception: An invalid or illegal string was specified
    +
    • Passed
    +
    • Failed assertion ctx.lineWidth === 1.5 (got Infinity[number], expected 1.5[number])
    +
    • Aborted with exception: NOT_SUPPORTED_ERR
    +
    • Passed
    +
    # 2d.line.cap.butt +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.line.cap.round +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.line.cap.square +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.line.cap.open +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (48,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (48,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    +
    • Passed
    +
    # 2d.line.cap.closed +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.line.cap.valid +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.line.cap.invalid +
    • Aborted with exception: Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMCanvasRenderingContext2D.lineCap]
    +
    • Failed assertion ctx.lineCap === 'butt' (got round[string], expected butt[string])
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion ctx.lineCap === 'butt' (got round[string], expected butt[string])
    +
    # 2d.line.join.bevel +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.line.join.round +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.line.join.miter +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.line.join.open +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (48,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (48,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    +
    • Passed
    +
    # 2d.line.join.closed +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.line.join.parallel +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.line.join.valid +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.line.join.invalid +
    • Aborted with exception: Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMCanvasRenderingContext2D.lineJoin]
    +
    • Failed assertion ctx.lineJoin === 'bevel' (got round[string], expected bevel[string])
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion ctx.lineJoin === 'bevel' (got round[string], expected bevel[string])
    +
    # 2d.line.miter.exceeded +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (48,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (48,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    +
    # 2d.line.miter.acute +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (48,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (48,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    +
    # 2d.line.miter.obtuse +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (48,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (48,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (48,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (48,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    +
    # 2d.line.miter.rightangle +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (48,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (48,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    +
    # 2d.line.miter.lineedge +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (48,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (48,48), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (48,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (48,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    +
    # 2d.line.miter.within +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.line.miter.valid +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.line.miter.invalid +
    • Failed assertion ctx.miterLimit === 1.5 (got 0[number], expected 1.5[number])
    • Failed assertion ctx.miterLimit === 1.5 (got -1[number], expected 1.5[number])
    • Aborted with exception: An invalid or illegal string was specified
    +
    • Passed
    +
    • Failed assertion ctx.miterLimit === 1.5 (got Infinity[number], expected 1.5[number])
    +
    • Aborted with exception: NOT_SUPPORTED_ERR
    +
    • Passed
    +
    # 2d.line.cross +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (48,48), expected [0,255,0,255]
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (48,48), expected [0,255,0,255]
    +
    • Passed
    +
    # 2d.line.union +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [77,178,0,255] at (25,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [77,178,0,255] at (25,1), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.attributes.shadowBlur.initial +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.attributes.shadowBlur.valid +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.attributes.shadowBlur.invalid +
    • Aborted with exception: An invalid or illegal string was specified
    +
    • Passed
    +
    • Failed assertion ctx.shadowBlur === 1 (got -2[number], expected 1[number])
    • Failed assertion ctx.shadowBlur === 1 (got Infinity[number], expected 1[number])
    • Failed assertion ctx.shadowBlur === 1 (got -Infinity[number], expected 1[number])
    • Failed assertion ctx.shadowBlur === 1 (got NaN[number], expected 1[number])
    +
    • Aborted with exception: NOT_SUPPORTED_ERR
    +
    • Passed
    +
    # 2d.shadow.attributes.shadowOffset.initial +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.attributes.shadowOffset.valid +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.attributes.shadowOffset.invalid +
    • Aborted with exception: An invalid or illegal string was specified
    +
    • Passed
    +
    • Failed assertion ctx.shadowOffsetX === 1 (got Infinity[number], expected 1[number])
    • Failed assertion ctx.shadowOffsetY === 2 (got Infinity[number], expected 2[number])
    • Failed assertion ctx.shadowOffsetX === 1 (got -Infinity[number], expected 1[number])
    • Failed assertion ctx.shadowOffsetY === 2 (got -Infinity[number], expected 2[number])
    • Failed assertion ctx.shadowOffsetX === 1 (got NaN[number], expected 1[number])
    • Failed assertion ctx.shadowOffsetY === 2 (got NaN[number], expected 2[number])
    +
    • Aborted with exception: NOT_SUPPORTED_ERR
    +
    • Passed
    +
    # 2d.shadow.attributes.shadowColor.initial +
    • Passed
    +
    • Passed
    +
    • Failed assertion ctx.shadowColor === 'rgba(0, 0, 0, 0.0)' (got black[string], expected rgba(0, 0, 0, 0.0)[string])
    +
    • Passed
    +
    • Failed assertion ctx.shadowColor === 'rgba(0, 0, 0, 0.0)' (got rgba(0,0,0,0)[string], expected rgba(0, 0, 0, 0.0)[string])
    +
    # 2d.shadow.attributes.shadowColor.valid +
    • Passed
    +
    • Passed
    +
    • Failed assertion ctx.shadowColor === '#00ff00' (got lime[string], expected #00ff00[string])
    • Failed assertion ctx.shadowColor === 'rgba(0, 255, 0, 0.0)' (got RGBA(0,255, 0,0)[string], expected rgba(0, 255, 0, 0.0)[string])
    +
    • Passed
    +
    • Failed assertion ctx.shadowColor === 'rgba(0, 255, 0, 0.0)' (got rgba(0,255,0,0)[string], expected rgba(0, 255, 0, 0.0)[string])
    +
    # 2d.shadow.attributes.shadowColor.invalid +
    • Failed assertion ctx.shadowColor === '#00ff00' (got #ff0000[string], expected #00ff00[string])
    +
    • Passed
    +
    • Failed assertion ctx.shadowColor === '#00ff00' (got bogus[string], expected #00ff00[string])
    • Failed assertion ctx.shadowColor === '#00ff00' (got red bogus[string], expected #00ff00[string])
    • Failed assertion ctx.shadowColor === '#00ff00' (got [object CanvasRenderingContext2D][string], expected #00ff00[string])
    • Failed assertion ctx.shadowColor === '#00ff00' (got undefined[string], expected #00ff00[string])
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.enable.off.1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.enable.off.2 +
    • Passed
    +
    • Failed assertion: got pixel [253,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Passed
    +
    # 2d.shadow.enable.blur +
    • Passed
    +
    • Failed assertion: got pixel [0,253,0,255] at (50,25), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    # 2d.shadow.enable.x +
    • Passed
    +
    • Failed assertion: got pixel [0,253,0,255] at (50,25), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    # 2d.shadow.enable.y +
    • Passed
    +
    • Failed assertion: got pixel [0,253,0,255] at (50,25), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    # 2d.shadow.offset.positiveX +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.offset.negativeX +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.offset.positiveY +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.offset.negativeY +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.outside +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.clip.1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.clip.2 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.clip.3 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.stroke.basic +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.stroke.cap.1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.stroke.cap.2 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.stroke.join.1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.stroke.join.2 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.stroke.join.3 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    +
    # 2d.shadow.image.basic +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.image.transparent.1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.image.transparent.2 +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (75,25), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.image.alpha +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [127,0,127,255] +/- 2
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.image.section +
    • Passed
    +
    • Passed
    +
    • Aborted with exception: INDEX_SIZE_ERR: DOM Exception 1
    +
    • Aborted with exception: INVALID_STATE_ERR
    +
    • Passed
    +
    # 2d.shadow.image.scale +
    • Passed
    +
    • Passed
    +
    • Aborted with exception: INDEX_SIZE_ERR: DOM Exception 1
    +
    • Aborted with exception: INVALID_STATE_ERR
    +
    • Passed
    +
    # 2d.shadow.canvas.basic +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.canvas.transparent.1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.canvas.transparent.2 +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (75,25), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.canvas.alpha +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [127,0,127,255] +/- 2
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.pattern.basic +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.pattern.transparent.1 +
    • Passed
    +
    • Passed
    +
    • Aborted with exception: INVALID_STATE_ERR: DOM Exception 11
    +
    • Aborted with exception: INVALID_STATE_ERR
    +
    • Passed
    +
    # 2d.shadow.pattern.transparent.2 +
    • Passed
    +
    • Passed
    +
    • Aborted with exception: INVALID_STATE_ERR: DOM Exception 11
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.pattern.alpha +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [127,0,127,255] +/- 2
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.gradient.basic +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.gradient.transparent.1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.gradient.transparent.2 +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (25,25), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.gradient.alpha +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [127,0,127,255] +/- 2
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.transform.1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.transform.2 +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.blur.low +
    • Cannot automatically verify result
    +
    • Cannot automatically verify result
    +
    • Cannot automatically verify result
    +
    • Cannot automatically verify result
    +
    • Cannot automatically verify result
    +
    # 2d.shadow.blur.high +
    • Cannot automatically verify result
    +
    • Cannot automatically verify result
    +
    • Cannot automatically verify result
    +
    • Cannot automatically verify result
    +
    • Cannot automatically verify result
    +
    # 2d.shadow.alpha.1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.alpha.2 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.alpha.3 +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,0,255,255] at (50,25), expected [127,0,127,255] +/- 2
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.alpha.4 +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [74,0,180,254] at (50,25), expected [127,0,127,255] +/- 2
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.alpha.5 +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,0,255,255] at (50,25), expected [127,0,127,255] +/- 2
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.composite.1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.composite.2 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.shadow.composite.3 +
    • Passed
    +
    • Failed assertion: got pixel [0,0,0,0] at (5,5), expected [0,255,0,255] +/- 2
    • Failed assertion: got pixel [0,0,0,0] at (50,25), expected [0,255,0,255] +/- 2
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.clearRect.basic +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.clearRect.path +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.clearRect.zero +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.clearRect.negative +
    • Passed
    +
    • Aborted with exception: INDEX_SIZE_ERR
    +
    • Passed
    +
    • Aborted with exception: INDEX_SIZE_ERR
    +
    • Passed
    +
    # 2d.clearRect.transform +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,0,0,0]
    +
    • Passed
    +
    # 2d.clearRect.globalalpha +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.clearRect.globalcomposite +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.clearRect.clip +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.clearRect.shadow +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,0,0,0] at (50,25), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    # 2d.clearRect.nonfinite +
    • Aborted with exception: An invalid or illegal string was specified
    +
    • Aborted with exception: NOT_SUPPORTED_ERR
    +
    • Passed
    +
    • Aborted with exception: NOT_SUPPORTED_ERR
    +
    • Passed
    +
    # 2d.fillRect.basic +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillRect.path +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillRect.zero +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillRect.negative +
    • Passed
    +
    • Aborted with exception: INDEX_SIZE_ERR
    +
    • Passed
    +
    • Aborted with exception: INDEX_SIZE_ERR
    +
    • Passed
    +
    # 2d.fillRect.transform +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillRect.clip +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillRect.shadow +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.fillRect.nonfinite +
    • Aborted with exception: An invalid or illegal string was specified
    +
    • Aborted with exception: NOT_SUPPORTED_ERR
    +
    • Passed
    +
    • Aborted with exception: NOT_SUPPORTED_ERR
    +
    • Passed
    +
    # 2d.strokeRect.basic +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.strokeRect.path +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.strokeRect.zero.1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.strokeRect.zero.2 +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,0,0,0]
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.strokeRect.zero.3 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.strokeRect.zero.4 +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,0,0,0]
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,0,0,0]
    +
    # 2d.strokeRect.zero.5 +
    • Passed
    +
    • Failed assertion: got pixel [0,0,0,0] at (50,25), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.strokeRect.negative +
    • Passed
    +
    • Aborted with exception: INDEX_SIZE_ERR
    +
    • Passed
    +
    • Aborted with exception: INDEX_SIZE_ERR
    +
    • Passed
    +
    # 2d.strokeRect.transform +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.strokeRect.globalalpha +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.strokeRect.globalcomposite +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,0,0,0]
    +
    # 2d.strokeRect.clip +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.strokeRect.shadow +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.strokeRect.nonfinite +
    • Aborted with exception: An invalid or illegal string was specified
    +
    • Aborted with exception: NOT_SUPPORTED_ERR
    +
    • Passed
    +
    • Aborted with exception: NOT_SUPPORTED_ERR
    +
    • Passed
    +
    # 2d.path.initial +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.beginPath +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.moveTo.basic +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.moveTo.newsubpath +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.moveTo.multiple +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.moveTo.nonfinite +
    • Aborted with exception: An invalid or illegal string was specified
    +
    • Aborted with exception: NOT_SUPPORTED_ERR
    +
    • Passed
    +
    • Aborted with exception: NOT_SUPPORTED_ERR
    +
    • Passed
    +
    # 2d.path.closePath.empty +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.closePath.newline +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.closePath.nextpoint +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.lineTo.ensuresubpath.1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.lineTo.ensuresubpath.2 +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Passed
    +
    # 2d.path.lineTo.basic +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.lineTo.nextpoint +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.lineTo.nonfinite +
    • Aborted with exception: An invalid or illegal string was specified
    +
    • Aborted with exception: NOT_SUPPORTED_ERR
    +
    • Passed
    +
    • Aborted with exception: NOT_SUPPORTED_ERR
    +
    • Passed
    +
    # 2d.path.quadraticCurveTo.ensuresubpath.1 +
    • Failed assertion: got pixel [255,0,0,255] at (95,45), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.quadraticCurveTo.ensuresubpath.2 +
    • Failed assertion: got pixel [255,0,0,255] at (5,45), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (5,45), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (5,45), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (5,45), expected [0,255,0,255]
    +
    • Passed
    +
    # 2d.path.quadraticCurveTo.basic +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.quadraticCurveTo.shape +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,1), expected [0,255,0,255]
    +
    • Passed
    +
    # 2d.path.quadraticCurveTo.scaled +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,1), expected [0,255,0,255]
    +
    • Passed
    +
    # 2d.path.quadraticCurveTo.nonfinite +
    • Aborted with exception: An invalid or illegal string was specified
    +
    • Aborted with exception: NOT_SUPPORTED_ERR
    +
    • Passed
    +
    • Aborted with exception: NOT_SUPPORTED_ERR
    +
    • Passed
    +
    # 2d.path.bezierCurveTo.ensuresubpath.1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.bezierCurveTo.ensuresubpath.2 +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (5,45), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (5,45), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (5,45), expected [0,255,0,255]
    +
    • Passed
    +
    # 2d.path.bezierCurveTo.basic +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.bezierCurveTo.shape +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.bezierCurveTo.scaled +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.bezierCurveTo.nonfinite +
    • Aborted with exception: An invalid or illegal string was specified
    +
    • Aborted with exception: NOT_SUPPORTED_ERR
    +
    • Passed
    +
    • Aborted with exception: NOT_SUPPORTED_ERR
    +
    • Passed
    +
    # 2d.path.arcTo.ensuresubpath.1 +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.arcTo.ensuresubpath.2 +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Passed
    +
    # 2d.path.arcTo.coincide.1 +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,48), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,48), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.arcTo.coincide.2 +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.arcTo.collinear.1 +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.arcTo.collinear.2 +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Passed
    +
    # 2d.path.arcTo.collinear.3 +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Passed
    +
    # 2d.path.arcTo.shape.curve1 +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (65,45), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [0,255,0,254] at (79,35), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.arcTo.shape.curve2 +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [116,139,0,255] at (55,21), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [0,255,0,254] at (73,27), expected [0,255,0,255]
    • Failed assertion: got pixel [0,255,0,254] at (78,36), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.arcTo.shape.start +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,1), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (98,48), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.arcTo.shape.end +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.arcTo.negative +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: should throw exception of type INDEX_SIZE_ERR: ctx.arcTo(0, 0, 0, 0, -1)
    • Aborted with exception: 'DOMException' is undefined
    +
    # 2d.path.arcTo.zero.1 +
    • Passed
    +
    • Aborted with exception: INDEX_SIZE_ERR
    +
    • Passed
    +
    • Aborted with exception: INDEX_SIZE_ERR
    +
    • Passed
    +
    # 2d.path.arcTo.zero.2 +
    • Passed
    +
    • Aborted with exception: INDEX_SIZE_ERR
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Aborted with exception: INDEX_SIZE_ERR
    +
    • Passed
    +
    # 2d.path.arcTo.transformation +
    • Passed
    +
    • Failed assertion: got pixel [215,40,0,255] at (0,0), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (0,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (0,49), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,49), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (99,49), expected [0,255,0,255]
    +
    • Passed
    +
    • Failed assertion: got pixel [2,253,0,255] at (50,49), expected [0,255,0,255]
    • Failed assertion: got pixel [3,252,0,255] at (99,49), expected [0,255,0,255]
    +
    • Passed
    +
    # 2d.path.arcTo.scale +
    • Passed
    +
    • Failed assertion: got pixel [194,61,0,255] at (0,0), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (0,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (0,49), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (50,49), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (99,49), expected [0,255,0,255]
    +
    • Passed
    +
    • Failed assertion: got pixel [2,253,0,255] at (50,49), expected [0,255,0,255]
    • Failed assertion: got pixel [3,252,0,255] at (99,49), expected [0,255,0,255]
    +
    • Passed
    +
    # 2d.path.arcTo.nonfinite +
    • Aborted with exception: An invalid or illegal string was specified
    +
    • Aborted with exception: NOT_SUPPORTED_ERR
    +
    • Passed
    +
    • Aborted with exception: NOT_SUPPORTED_ERR
    +
    • Passed
    +
    # 2d.path.arc.empty +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.arc.nonempty +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.arc.end +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.arc.angle.1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.arc.angle.2 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.arc.angle.3 +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.arc.angle.4 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.arc.angle.5 +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.arc.angle.6 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.arc.zero.1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.arc.zero.2 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.arc.twopie.1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,20), expected [0,255,0,255]
    +
    # 2d.path.arc.twopie.2 +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,20), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.arc.twopie.3 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.arc.twopie.4 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.arc.shape.1 +
    • Passed
    +
    • Failed assertion: got pixel [9,246,0,255] at (20,48), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.arc.shape.2 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.arc.shape.3 +
    • Failed assertion: got pixel [42,213,0,255] at (1,48), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255]
    +
    # 2d.path.arc.shape.4 +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (98,48), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.arc.shape.5 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.arc.selfintersect.1 +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255]
    +
    # 2d.path.arc.selfintersect.2 +
    • Passed
    +
    • Failed assertion: got pixel [79,176,0,255] at (97,1), expected [0,255,0,255]
    • Failed assertion: got pixel [104,151,0,255] at (97,2), expected [0,255,0,255]
    • Failed assertion: got pixel [223,32,0,255] at (97,3), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (2,48), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.arc.negative +
    • Failed assertion: should throw exception of type INDEX_SIZE_ERR: ctx.arc(0, 0, -1, 0, 0, true)
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: should throw exception of type INDEX_SIZE_ERR: ctx.arc(0, 0, -1, 0, 0, true)
    • Aborted with exception: 'DOMException' is undefined
    +
    # 2d.path.arc.zeroradius +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    • Aborted with exception: INDEX_SIZE_ERR
    +
    • Passed
    +
    # 2d.path.arc.scale.1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.arc.scale.2 +
    • Passed
    +
    • Failed assertion: got pixel [239,16,0,255] at (98,1), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.arc.nonfinite +
    • Aborted with exception: Not enough arguments
    +
    • Aborted with exception: NOT_SUPPORTED_ERR
    +
    • Passed
    +
    • Aborted with exception: NOT_SUPPORTED_ERR
    +
    • Passed
    +
    # 2d.path.rect.basic +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.rect.newsubpath +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.rect.closed +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.rect.end.1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.rect.end.2 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.rect.zero.1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Passed
    +
    # 2d.path.rect.zero.2 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.rect.zero.3 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    # 2d.path.rect.zero.4 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.rect.zero.5 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.rect.zero.6 +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    # 2d.path.rect.negative +
    • Passed
    +
    • Aborted with exception: INDEX_SIZE_ERR
    +
    • Passed
    +
    • Aborted with exception: INDEX_SIZE_ERR
    +
    • Passed
    +
    # 2d.path.rect.winding +
    • Passed
    +
    • Aborted with exception: INDEX_SIZE_ERR
    +
    • Failed assertion: got pixel [255,0,0,255] at (25,12), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (75,12), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (25,37), expected [0,255,0,255]
    • Failed assertion: got pixel [255,0,0,255] at (75,37), expected [0,255,0,255]
    +
    • Aborted with exception: INDEX_SIZE_ERR
    +
    • Passed
    +
    # 2d.path.rect.selfintersect +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Passed
    +
    # 2d.path.rect.nonfinite +
    • Aborted with exception: An invalid or illegal string was specified
    +
    • Aborted with exception: NOT_SUPPORTED_ERR
    +
    • Passed
    +
    • Aborted with exception: NOT_SUPPORTED_ERR
    +
    • Passed
    +
    # 2d.path.fill.overlap +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.fill.winding.add +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.fill.winding.subtract.1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.fill.winding.subtract.2 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.fill.winding.subtract.3 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.fill.closed.basic +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.fill.closed.unaffected +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.stroke.overlap +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.stroke.union +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.stroke.unaffected +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.stroke.scale1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.stroke.scale2 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [3,252,0,255] at (99,0), expected [0,255,0,255]
    • Failed assertion: got pixel [3,252,0,255] at (99,25), expected [0,255,0,255]
    • Failed assertion: got pixel [4,251,0,255] at (0,49), expected [0,255,0,255]
    • Failed assertion: got pixel [4,251,0,255] at (50,49), expected [0,255,0,255]
    • Failed assertion: got pixel [7,248,0,255] at (99,49), expected [0,255,0,255]
    +
    • Passed
    +
    # 2d.path.stroke.skew +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.stroke.empty +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.stroke.prune.line +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    # 2d.path.stroke.prune.closed +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    # 2d.path.stroke.prune.curve +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    # 2d.path.stroke.prune.arc +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    # 2d.path.stroke.prune.rect +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255]
    +
    # 2d.path.stroke.prune.corner +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.transformation.basic +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.transformation.multiple +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.transformation.changing +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.clip.empty +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.clip.basic.1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.clip.basic.2 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.clip.intersect +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.clip.winding.1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.clip.winding.2 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.clip.unaffected +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.isPointInPath.basic.1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.isPointInPath.basic.2 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.isPointInPath.edge +
    • Passed
    +
    • Failed assertion ctx.isPointInPath(0, 0) === true (got false[boolean], expected true[boolean])
    • Failed assertion ctx.isPointInPath(10, 0) === true (got false[boolean], expected true[boolean])
    • Failed assertion ctx.isPointInPath(20, 0) === true (got false[boolean], expected true[boolean])
    • Failed assertion ctx.isPointInPath(0, 20) === true (got false[boolean], expected true[boolean])
    • Failed assertion ctx.isPointInPath(0, 10) === true (got false[boolean], expected true[boolean])
    +
    • Passed
    +
    • Failed assertion ctx.isPointInPath(20, 0) === true (got false[boolean], expected true[boolean])
    • Failed assertion ctx.isPointInPath(20, 10) === true (got false[boolean], expected true[boolean])
    • Failed assertion ctx.isPointInPath(20, 20) === true (got false[boolean], expected true[boolean])
    • Failed assertion ctx.isPointInPath(10, 20) === true (got false[boolean], expected true[boolean])
    • Failed assertion ctx.isPointInPath(0, 20) === true (got false[boolean], expected true[boolean])
    +
    • Passed
    +
    # 2d.path.isPointInPath.empty +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.isPointInPath.subpath +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.isPointInPath.outside +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.isPointInPath.unclosed +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.isPointInPath.arc +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.isPointInPath.bigarc +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.isPointInPath.bezier +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.isPointInPath.winding +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.isPointInPath.transform.1 +
    • Failed assertion ctx.isPointInPath(10, 10) === false (got true[boolean], expected false[boolean])
    • Failed assertion ctx.isPointInPath(51, 10) === true (got false[boolean], expected true[boolean])
    • Failed assertion ctx.isPointInPath(69, 10) === true (got false[boolean], expected true[boolean])
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.isPointInPath.transform.2 +
    • Failed assertion ctx.isPointInPath(10, 10) === false (got true[boolean], expected false[boolean])
    • Failed assertion ctx.isPointInPath(51, 10) === true (got false[boolean], expected true[boolean])
    • Failed assertion ctx.isPointInPath(69, 10) === true (got false[boolean], expected true[boolean])
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.isPointInPath.transform.3 +
    • Failed assertion ctx.isPointInPath(51, 10) === true (got false[boolean], expected true[boolean])
    • Failed assertion ctx.isPointInPath(69, 10) === true (got false[boolean], expected true[boolean])
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.path.isPointInPath.nonfinite +
    • Aborted with exception: An invalid or illegal string was specified
    +
    • Passed
    +
    • Passed
    +
    • Aborted with exception: NOT_SUPPORTED_ERR
    +
    • Passed
    +
    # 2d.drawImage.3arg +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.drawImage.5arg +
    • Failed assertion: got pixel [4,251,0,255] at (99,0), expected [0,255,0,255] +/- 2
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.drawImage.9arg.basic +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.drawImage.9arg.sourcepos +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.drawImage.9arg.sourcesize +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.drawImage.9arg.destpos +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.drawImage.9arg.destsize +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.drawImage.canvas +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.drawImage.self.1 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.drawImage.self.2 +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.drawImage.null +
    • Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIDOMCanvasRenderingContext2D.drawImage]
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: should throw exception of type TYPE_MISMATCH_ERR: ctx.drawImage(null, 0, 0)
    • Aborted with exception: 'DOMException' is undefined
    +
    # 2d.drawImage.wrongtype +
    • Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIDOMCanvasRenderingContext2D.drawImage]
    • Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: Could not convert JavaScript argument - 0 was passed, expected object. Did you mean null? arg 0 [nsIDOMCanvasRenderingContext2D.drawImage]
    • Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: Could not convert JavaScript argument arg 0 [nsIDOMCanvasRenderingContext2D.drawImage]
    • Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIDOMCanvasRenderingContext2D.drawImage]
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: should throw exception of type TYPE_MISMATCH_ERR: ctx.drawImage(undefined, 0, 0)
    • Aborted with exception: 'DOMException' is undefined
    +
    # 2d.drawImage.floatsource +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.drawImage.zerosource +
    • Failed assertion: should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 10, 10, 0, 1, 0, 0, 100, 50)
    • Failed assertion: should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 10, 10, 1, 0, 0, 0, 100, 50)
    • Failed assertion: should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 10, 10, 0, 0, 0, 0, 100, 50)
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 10, 10, 0, 1, 0, 0, 100, 50)
    • Failed assertion: should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 10, 10, 1, 0, 0, 0, 100, 50)
    • Failed assertion: should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 10, 10, 0, 0, 0, 0, 100, 50)
    +
    • Failed assertion: should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 10, 10, 0, 1, 0, 0, 100, 50)
    • Failed assertion: should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 10, 10, 1, 0, 0, 0, 100, 50)
    • Failed assertion: should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 10, 10, 0, 0, 0, 0, 100, 50)
    +
    # 2d.drawImage.negativesource +
    • Aborted with exception: Index or size is negative or greater than the allowed amount
    +
    • Aborted with exception: INDEX_SIZE_ERR
    +
    • Passed
    +
    • Aborted with exception: INDEX_SIZE_ERR
    +
    • Passed
    +
    # 2d.drawImage.negativedest +
    • Aborted with exception: Index or size is negative or greater than the allowed amount
    +
    • Aborted with exception: INDEX_SIZE_ERR
    +
    • Passed
    +
    • Aborted with exception: INDEX_SIZE_ERR
    +
    • Passed
    +
    # 2d.drawImage.negativedir +
    • Aborted with exception: Index or size is negative or greater than the allowed amount
    +
    • Aborted with exception: INDEX_SIZE_ERR
    +
    • Passed
    +
    • Aborted with exception: INDEX_SIZE_ERR
    +
    • Failed assertion: got pixel [255,0,0,255] at (1,1), expected [0,255,0,255] +/- 2
    • Failed assertion: got pixel [255,0,0,255] at (1,48), expected [0,255,0,255] +/- 2
    • Failed assertion: got pixel [255,0,0,255] at (98,1), expected [0,255,0,255] +/- 2
    • Failed assertion: got pixel [255,0,0,255] at (98,48), expected [0,255,0,255] +/- 2
    • Failed assertion: got pixel [255,0,0,255] at (48,1), expected [0,255,0,255] +/- 2
    • Failed assertion: got pixel [255,0,0,255] at (48,48), expected [0,255,0,255] +/- 2
    • Failed assertion: got pixel [255,0,0,255] at (51,1), expected [0,255,0,255] +/- 2
    • Failed assertion: got pixel [255,0,0,255] at (51,48), expected [0,255,0,255] +/- 2
    • Failed assertion: got pixel [255,0,0,255] at (25,25), expected [0,255,0,255] +/- 2
    • Failed assertion: got pixel [255,0,0,255] at (75,25), expected [0,255,0,255] +/- 2
    +
    # 2d.drawImage.outsidesource +
    • Aborted with exception: Index or size is negative or greater than the allowed amount
    +
    • Aborted with exception: INDEX_SIZE_ERR
    +
    • Passed
    +
    • Aborted with exception: INDEX_SIZE_ERR
    +
    • Failed assertion: should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), -0.001, 0, 100, 50, 0, 0, 100, 50)
    • Aborted with exception: 'DOMException' is undefined
    +
    # 2d.drawImage.incomplete +
    • Failed assertion img.complete === false (got true[boolean], expected false[boolean])
    • Aborted with exception: Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIDOMCanvasRenderingContext2D.drawImage]
    +
    • Failed assertion img.complete === false (got true[boolean], expected false[boolean])
    • Aborted with exception: TYPE_MISMATCH_ERR
    +
    • Failed assertion img.complete === false (got true[boolean], expected false[boolean])
    +
    • Aborted with exception: INVALID_STATE_ERR
    +
    • Aborted with exception: Unexpected call to method or property access.
    +
    # 2d.drawImage.broken +
    • Failed assertion img.complete === false (got true[boolean], expected false[boolean])
    • Aborted with exception: Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIDOMCanvasRenderingContext2D.drawImage]
    +
    • Failed assertion img.complete === false (got true[boolean], expected false[boolean])
    +
    • Failed assertion img.complete === false (got true[boolean], expected false[boolean])
    +
    • Aborted with exception: INVALID_STATE_ERR
    +
    • Failed assertion img.complete === false (got true[boolean], expected false[boolean])
    +
    # 2d.drawImage.zerocanvas +
    • Failed assertion: should throw exception of type INVALID_STATE_ERR: ctx.drawImage(canvas2, 0, 0)
    • Failed assertion: should throw exception of type INVALID_STATE_ERR: ctx.drawImage(canvas2, 0, 0)
    • Failed assertion: should throw exception of type INVALID_STATE_ERR: ctx.drawImage(canvas2, 0, 0)
    +
    • Failed assertion: should throw exception of type INVALID_STATE_ERR: ctx.drawImage(canvas2, 0, 0)
    • Failed assertion: should throw exception of type INVALID_STATE_ERR: ctx.drawImage(canvas2, 0, 0)
    • Failed assertion: should throw exception of type INVALID_STATE_ERR: ctx.drawImage(canvas2, 0, 0)
    +
    • Failed assertion: should throw exception of type INVALID_STATE_ERR: ctx.drawImage(canvas2, 0, 0)
    • Failed assertion: should throw exception of type INVALID_STATE_ERR: ctx.drawImage(canvas2, 0, 0)
    • Failed assertion: should throw exception of type INVALID_STATE_ERR: ctx.drawImage(canvas2, 0, 0)
    +
    • Failed assertion: should throw exception of type INVALID_STATE_ERR: ctx.drawImage(canvas2, 0, 0)
    • Failed assertion: should throw exception of type INVALID_STATE_ERR: ctx.drawImage(canvas2, 0, 0)
    • Failed assertion: should throw exception of type INVALID_STATE_ERR: ctx.drawImage(canvas2, 0, 0)
    +
    • Failed assertion: should throw exception of type INVALID_STATE_ERR: ctx.drawImage(canvas2, 0, 0)
    • Aborted with exception: 'DOMException' is undefined
    +
    # 2d.drawImage.animated.gif +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.drawImage.animated.apng +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.drawImage.animated.poster +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255] +/- 2
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255] +/- 2
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.drawImage.path +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.drawImage.transform +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.drawImage.alpha +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.drawImage.clip +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.drawImage.composite +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255] +/- 2
    +
    # 2d.drawImage.nowrap +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.drawImage.nonfinite +
    • Aborted with exception: An invalid or illegal string was specified
    +
    • Aborted with exception: NOT_SUPPORTED_ERR
    +
    • Aborted with exception: INDEX_SIZE_ERR: DOM Exception 1
    +
    • Aborted with exception: NOT_SUPPORTED_ERR
    +
    • Aborted with exception: Could not complete the operation due to error 8070000c.
    +
    # 2d.imageData.create2.basic +
    • Passed
    +
    • Aborted with exception: 'ctx.createImageData' is not a function
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.imageData.create1.basic +
    • Aborted with exception: An invalid or illegal string was specified
    +
    • Aborted with exception: 'ctx.createImageData' is not a function
    +
    • Aborted with exception: NOT_SUPPORTED_ERR: DOM Exception 9
    +
    • Aborted with exception: NOT_SUPPORTED_ERR
    +
    • Passed
    +
    # 2d.imageData.create2.type +
    • Failed assertion window.ImageData !== undefined (got [undefined], expected not [undefined])
    • Failed assertion window.CanvasPixelArray !== undefined (got [undefined], expected not [undefined])
    • Aborted with exception: window.ImageData is undefined
    +
    • Failed assertion window.CanvasPixelArray !== undefined (got [undefined], expected not [undefined])
    • Aborted with exception: Cannot convert 'window.ImageData.prototype' to object
    +
    • Failed assertion window.ImageData !== undefined (got [undefined], expected not [undefined])
    • Failed assertion window.CanvasPixelArray !== undefined (got [undefined], expected not [undefined])
    • Aborted with exception: Cannot read property 'prototype' of undefined
    +
    • Failed assertion window.ImageData !== undefined (got [undefined], expected not [undefined])
    • Failed assertion window.CanvasPixelArray !== undefined (got [undefined], expected not [undefined])
    • Aborted with exception: Undefined value
    +
    • Failed assertion window.ImageData !== undefined (got [undefined], expected not [undefined])
    • Failed assertion window.CanvasPixelArray !== undefined (got [undefined], expected not [undefined])
    • Aborted with exception: 'undefined' is null or not an object
    +
    # 2d.imageData.create1.type +
    • Failed assertion window.ImageData !== undefined (got [undefined], expected not [undefined])
    • Failed assertion window.CanvasPixelArray !== undefined (got [undefined], expected not [undefined])
    • Aborted with exception: window.ImageData is undefined
    +
    • Failed assertion window.CanvasPixelArray !== undefined (got [undefined], expected not [undefined])
    • Aborted with exception: Cannot convert 'window.ImageData.prototype' to object
    +
    • Failed assertion window.ImageData !== undefined (got [undefined], expected not [undefined])
    • Failed assertion window.CanvasPixelArray !== undefined (got [undefined], expected not [undefined])
    • Aborted with exception: Cannot read property 'prototype' of undefined
    +
    • Failed assertion window.ImageData !== undefined (got [undefined], expected not [undefined])
    • Failed assertion window.CanvasPixelArray !== undefined (got [undefined], expected not [undefined])
    • Aborted with exception: Undefined value
    +
    • Failed assertion window.ImageData !== undefined (got [undefined], expected not [undefined])
    • Failed assertion window.CanvasPixelArray !== undefined (got [undefined], expected not [undefined])
    • Aborted with exception: 'undefined' is null or not an object
    +
    # 2d.imageData.create2.initial +
    • Passed
    +
    • Aborted with exception: 'ctx.createImageData' is not a function
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.imageData.create1.initial +
    • Aborted with exception: An invalid or illegal string was specified
    +
    • Aborted with exception: 'ctx.createImageData' is not a function
    +
    • Aborted with exception: NOT_SUPPORTED_ERR: DOM Exception 9
    +
    • Aborted with exception: NOT_SUPPORTED_ERR
    +
    • Passed
    +
    # 2d.imageData.create2.large +
    • Passed
    +
    • Aborted with exception: 'ctx.createImageData' is not a function
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.imageData.create2.tiny +
    • Aborted with exception: Index or size is negative or greater than the allowed amount
    +
    • Aborted with exception: 'ctx.createImageData' is not a function
    +
    • Passed
    +
    • Aborted with exception: INDEX_SIZE_ERR
    +
    • Passed
    +
    # 2d.imageData.create2.negative +
    • Aborted with exception: Index or size is negative or greater than the allowed amount
    +
    • Aborted with exception: 'ctx.createImageData' is not a function
    +
    • Failed assertion imgdata1.data.length == imgdata2.data.length (got 800[number], expected 4[number])
    +
    • Passed
    +
    • Passed
    +
    # 2d.imageData.create2.zero +
    • Passed
    +
    • Failed assertion: expected exception of type INDEX_SIZE_ERR, got: 'ctx.createImageData' is not a function
    • Failed assertion: expected exception of type INDEX_SIZE_ERR, got: 'ctx.createImageData' is not a function
    • Failed assertion: expected exception of type INDEX_SIZE_ERR, got: 'ctx.createImageData' is not a function
    +
    • Failed assertion: should throw exception of type INDEX_SIZE_ERR: ctx.createImageData(10, 0)
    • Failed assertion: should throw exception of type INDEX_SIZE_ERR: ctx.createImageData(0, 10)
    • Failed assertion: should throw exception of type INDEX_SIZE_ERR: ctx.createImageData(0, 0)
    +
    • Passed
    +
    • Failed assertion: should throw exception of type INDEX_SIZE_ERR: ctx.createImageData(10, 0)
    • Aborted with exception: 'DOMException' is undefined
    +
    # 2d.imageData.create2.nonfinite +
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    +
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: 'ctx.createImageData' is not a function
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: 'ctx.createImageData' is not a function
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: 'ctx.createImageData' is not a function
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: 'ctx.createImageData' is not a function
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: 'ctx.createImageData' is not a function
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: 'ctx.createImageData' is not a function
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: 'ctx.createImageData' is not a function
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.createImageData(Infinity, 10)
    • Aborted with exception: 'DOMException' is undefined
    +
    # 2d.imageData.create1.zero +
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    +
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: 'ctx.createImageData' is not a function
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.createImageData(null)
    • Aborted with exception: 'DOMException' is undefined
    +
    # 2d.imageData.create2.round +
    • Passed
    +
    • Aborted with exception: 'ctx.createImageData' is not a function
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.imageData.get.basic +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.imageData.get.type +
    • Failed assertion window.ImageData !== undefined (got [undefined], expected not [undefined])
    • Failed assertion window.CanvasPixelArray !== undefined (got [undefined], expected not [undefined])
    • Aborted with exception: window.ImageData is undefined
    +
    • Failed assertion window.CanvasPixelArray !== undefined (got [undefined], expected not [undefined])
    • Aborted with exception: Cannot convert 'window.ImageData.prototype' to object
    +
    • Failed assertion window.ImageData !== undefined (got [undefined], expected not [undefined])
    • Failed assertion window.CanvasPixelArray !== undefined (got [undefined], expected not [undefined])
    • Aborted with exception: Cannot read property 'prototype' of undefined
    +
    • Failed assertion window.ImageData !== undefined (got [undefined], expected not [undefined])
    • Failed assertion window.CanvasPixelArray !== undefined (got [undefined], expected not [undefined])
    • Aborted with exception: Undefined value
    +
    • Failed assertion window.ImageData !== undefined (got [undefined], expected not [undefined])
    • Failed assertion window.CanvasPixelArray !== undefined (got [undefined], expected not [undefined])
    • Aborted with exception: 'undefined' is null or not an object
    +
    # 2d.imageData.get.zero +
    • Failed assertion: expected exception of type INDEX_SIZE_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type INDEX_SIZE_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type INDEX_SIZE_ERR, got: An invalid or illegal string was specified
    +
    • Passed
    +
    • Failed assertion: should throw exception of type INDEX_SIZE_ERR: ctx.getImageData(1, 1, 10, 0)
    • Failed assertion: should throw exception of type INDEX_SIZE_ERR: ctx.getImageData(1, 1, 0, 10)
    • Failed assertion: should throw exception of type INDEX_SIZE_ERR: ctx.getImageData(1, 1, 0, 0)
    +
    • Passed
    +
    • Failed assertion: should throw exception of type INDEX_SIZE_ERR: ctx.getImageData(1, 1, 10, 0)
    • Aborted with exception: 'DOMException' is undefined
    +
    # 2d.imageData.get.nonfinite +
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    +
    • Passed
    +
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(Infinity, 10, 10, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(-Infinity, 10, 10, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(NaN, 10, 10, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, Infinity, 10, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, -Infinity, 10, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, NaN, 10, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, 10, Infinity, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, 10, -Infinity, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, 10, NaN, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, 10, 10, Infinity)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, 10, 10, -Infinity)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, 10, 10, NaN)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(Infinity, Infinity, 10, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(Infinity, Infinity, Infinity, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(Infinity, Infinity, Infinity, Infinity)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(Infinity, Infinity, 10, Infinity)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(Infinity, 10, Infinity, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(Infinity, 10, Infinity, Infinity)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(Infinity, 10, 10, Infinity)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, Infinity, Infinity, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, Infinity, Infinity, Infinity)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, Infinity, 10, Infinity)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, 10, Infinity, Infinity)
    +
    • Passed
    +
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(Infinity, 10, 10, 10)
    • Aborted with exception: 'DOMException' is undefined
    +
    # 2d.imageData.get.source.outside +
    • Aborted with exception: An invalid or illegal string was specified
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.imageData.get.source.negative +
    • Aborted with exception: An invalid or illegal string was specified
    +
    • Aborted with exception: INDEX_SIZE_ERR
    +
    • Failed assertion imgdata1.data["0"] === 255 (got 0[number], expected 255[number])
    • Failed assertion imgdata1.data["1"] === 255 (got 0[number], expected 255[number])
    • Failed assertion imgdata1.data["2"] === 255 (got 0[number], expected 255[number])
    • Failed assertion imgdata2.data["3"] === 0 (got 255[number], expected 0[number])
    +
    • Aborted with exception: INDEX_SIZE_ERR
    +
    • Passed
    +
    # 2d.imageData.get.source.size +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.imageData.get.tiny +
    • Aborted with exception: An invalid or illegal string was specified
    +
    • Aborted with exception: INDEX_SIZE_ERR
    +
    • Passed
    +
    • Aborted with exception: INDEX_SIZE_ERR
    +
    • Passed
    +
    # 2d.imageData.get.nonpremul +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.imageData.get.range +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.imageData.get.clamp +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.imageData.get.length +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.imageData.get.order.cols +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.imageData.get.order.rows +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.imageData.get.order.rgb +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.imageData.get.order.alpha +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.imageData.get.unaffected +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.imageData.object.properties +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.imageData.object.readonly +
    • Failed assertion imgdata.width === w (got 123[number], expected 10[number])
    • Failed assertion imgdata.height === h (got 123[number], expected 10[number])
    • Failed assertion imgdata.data === d (got 100,100,100,100[object], expected 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0[object])
    • Failed assertion imgdata.data["0"] === 0 (got 100[number], expected 0[number])
    • Failed assertion imgdata.data["1"] === 0 (got 100[number], expected 0[number])
    • Failed assertion imgdata.data["2"] === 0 (got 100[number], expected 0[number])
    • Failed assertion imgdata.data["3"] === 0 (got 100[number], expected 0[number])
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Aborted with exception: Object doesn't support this action
    +
    # 2d.imageData.object.ctor +
    • Failed assertion window.ImageData !== undefined (got [undefined], expected not [undefined])
    +
    • Failed assertion: should throw exception: new window.ImageData(1,1)
    +
    • Failed assertion window.ImageData !== undefined (got [undefined], expected not [undefined])
    +
    • Failed assertion window.ImageData !== undefined (got [undefined], expected not [undefined])
    +
    • Failed assertion window.ImageData !== undefined (got [undefined], expected not [undefined])
    +
    # 2d.imageData.object.set +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion imgdata.data["0"] === 100 (got 0[number], expected 100[number])
    • Failed assertion imgdata.data["0"] === 200 (got 0[number], expected 200[number])
    +
    • Passed
    +
    # 2d.imageData.object.undefined +
    • Failed assertion imgdata.data["0"] === 0 (got [undefined], expected 0[number])
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.imageData.object.nan +
    • Failed assertion imgdata.data["0"] === 0 (got NaN[number], expected 0[number])
    • Failed assertion imgdata.data["0"] === 0 (got cheese[string], expected 0[number])
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.imageData.object.string +
    • Failed assertion imgdata.data["0"] === 110 (got 110[string], expected 110[number])
    • Failed assertion imgdata.data["0"] === 120 (got 0x78[string], expected 120[number])
    • Failed assertion imgdata.data["0"] === 130 (got +130e0 [string], expected 130[number])
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion imgdata.data["0"] === 110 (got 0[number], expected 110[number])
    • Failed assertion imgdata.data["0"] === 120 (got 0[number], expected 120[number])
    • Failed assertion imgdata.data["0"] === 130 (got 0[number], expected 130[number])
    +
    • Passed
    +
    # 2d.imageData.object.wrap +
    • Failed assertion imgdata.data["0"] === 44 (got 300[number], expected 44[number])
    • Failed assertion imgdata.data["0"] === 156 (got -100[number], expected 156[number])
    • Failed assertion imgdata.data["0"] === 200 (got 4294967496[number], expected 200[number])
    • Failed assertion imgdata.data["0"] === 56 (got -4294967496[number], expected 56[number])
    • Failed assertion imgdata.data["0"] === 0 (got -Infinity[number], expected 0[number])
    • Failed assertion imgdata.data["0"] === 0 (got Infinity[number], expected 0[number])
    +
    • Passed
    +
    • Failed assertion imgdata.data["0"] === 44 (got 255[number], expected 44[number])
    • Failed assertion imgdata.data["0"] === 156 (got 0[number], expected 156[number])
    • Failed assertion imgdata.data["0"] === 200 (got 255[number], expected 200[number])
    • Failed assertion imgdata.data["0"] === 56 (got 0[number], expected 56[number])
    • Failed assertion imgdata.data["0"] === 0 (got 255[number], expected 0[number])
    +
    • Failed assertion imgdata.data["0"] === 44 (got 0[number], expected 44[number])
    • Failed assertion imgdata.data["0"] === 156 (got 0[number], expected 156[number])
    • Failed assertion imgdata.data["0"] === 200 (got 0[number], expected 200[number])
    • Failed assertion imgdata.data["0"] === 56 (got 0[number], expected 56[number])
    +
    • Failed assertion imgdata.data["0"] === 44 (got 255[number], expected 44[number])
    • Failed assertion imgdata.data["0"] === 156 (got 0[number], expected 156[number])
    • Failed assertion imgdata.data["0"] === 200 (got 0[number], expected 200[number])
    • Failed assertion imgdata.data["0"] === 56 (got 0[number], expected 56[number])
    +
    # 2d.imageData.object.round +
    • Failed assertion imgdata.data["0"] === 0 (got 0.499[number], expected 0[number])
    • Failed assertion imgdata.data["0"] === 0 (got 0.5[number], expected 0[number])
    • Failed assertion imgdata.data["0"] === 0 (got 0.501[number], expected 0[number])
    • Failed assertion imgdata.data["0"] === 1 (got 1.499[number], expected 1[number])
    • Failed assertion imgdata.data["0"] === 2 (got 1.5[number], expected 2[number])
    • Failed assertion imgdata.data["0"] === 2 (got 1.501[number], expected 2[number])
    • Failed assertion imgdata.data["0"] === 2 (got 2.5[number], expected 2[number])
    • Failed assertion imgdata.data["0"] === 4 (got 3.5[number], expected 4[number])
    • Failed assertion imgdata.data["0"] === 252 (got 252.5[number], expected 252[number])
    • Failed assertion imgdata.data["0"] === 253 (got 253.5[number], expected 253[number])
    • Failed assertion imgdata.data["0"] === 254 (got 254.5[number], expected 254[number])
    • Failed assertion imgdata.data["0"] === 0 (got 256.5[number], expected 0[number])
    • Failed assertion imgdata.data["0"] === 0 (got -0.5[number], expected 0[number])
    • Failed assertion imgdata.data["0"] === 255 (got -1.5[number], expected 255[number])
    +
    • Failed assertion imgdata.data["0"] === 2 (got 1[number], expected 2[number])
    • Failed assertion imgdata.data["0"] === 2 (got 1[number], expected 2[number])
    • Failed assertion imgdata.data["0"] === 4 (got 3[number], expected 4[number])
    +
    • Failed assertion imgdata.data["0"] === 0 (got 1[number], expected 0[number])
    • Failed assertion imgdata.data["0"] === 0 (got 1[number], expected 0[number])
    • Failed assertion imgdata.data["0"] === 2 (got 3[number], expected 2[number])
    • Failed assertion imgdata.data["0"] === 252 (got 253[number], expected 252[number])
    • Failed assertion imgdata.data["0"] === 253 (got 254[number], expected 253[number])
    • Failed assertion imgdata.data["0"] === 254 (got 255[number], expected 254[number])
    • Failed assertion imgdata.data["0"] === 0 (got 255[number], expected 0[number])
    • Failed assertion imgdata.data["0"] === 255 (got 0[number], expected 255[number])
    +
    • Failed assertion imgdata.data["0"] === 1 (got 0[number], expected 1[number])
    • Failed assertion imgdata.data["0"] === 2 (got 0[number], expected 2[number])
    • Failed assertion imgdata.data["0"] === 2 (got 0[number], expected 2[number])
    • Failed assertion imgdata.data["0"] === 2 (got 0[number], expected 2[number])
    • Failed assertion imgdata.data["0"] === 4 (got 0[number], expected 4[number])
    • Failed assertion imgdata.data["0"] === 252 (got 0[number], expected 252[number])
    • Failed assertion imgdata.data["0"] === 253 (got 0[number], expected 253[number])
    • Failed assertion imgdata.data["0"] === 254 (got 0[number], expected 254[number])
    • Failed assertion imgdata.data["0"] === 255 (got 0[number], expected 255[number])
    +
    • Failed assertion imgdata.data["0"] === 0 (got 1[number], expected 0[number])
    • Failed assertion imgdata.data["0"] === 253 (got 254[number], expected 253[number])
    • Failed assertion imgdata.data["0"] === 0 (got 255[number], expected 0[number])
    • Failed assertion imgdata.data["0"] === 255 (got 0[number], expected 255[number])
    +
    # 2d.imageData.put.null +
    • Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: An invalid or illegal string was specified
    +
    • Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: WRONG_ARGUMENTS_ERR
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: should throw exception of type TYPE_MISMATCH_ERR: ctx.putImageData(null, 0, 0)
    • Aborted with exception: 'DOMException' is undefined
    +
    # 2d.imageData.put.nonfinite +
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, 10, 10, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, -Infinity, 10, 10, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, NaN, 10, 10, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, Infinity, 10, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, -Infinity, 10, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, NaN, 10, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, Infinity, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, -Infinity, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, NaN, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, 10, Infinity)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, 10, -Infinity)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, 10, NaN)
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: An invalid or illegal string was specified
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, 10, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, Infinity, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, Infinity, Infinity)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, 10, Infinity)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, 10, Infinity, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, 10, Infinity, Infinity)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, 10, 10, Infinity)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, Infinity, Infinity, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, Infinity, Infinity, Infinity)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, Infinity, 10, Infinity)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, Infinity, Infinity)
    +
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, 10, 10, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, -Infinity, 10, 10, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, NaN, 10, 10, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, Infinity, 10, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, -Infinity, 10, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, NaN, 10, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, Infinity, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, -Infinity, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, NaN, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, 10, Infinity)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, 10, -Infinity)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, 10, NaN)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, 10, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, Infinity, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, Infinity, Infinity)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, 10, Infinity)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, 10, Infinity, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, 10, Infinity, Infinity)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, 10, 10, Infinity)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, Infinity, Infinity, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, Infinity, Infinity, Infinity)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, Infinity, 10, Infinity)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, Infinity, Infinity)
    +
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    • Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: INDEX_SIZE_ERR: DOM Exception 1
    +
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, 10, 10, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, -Infinity, 10, 10, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, NaN, 10, 10, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, Infinity, 10, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, -Infinity, 10, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, NaN, 10, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, Infinity, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, -Infinity, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, NaN, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, 10, Infinity)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, 10, -Infinity)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, 10, NaN)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, 10, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, Infinity, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, Infinity, Infinity)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, 10, Infinity)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, 10, Infinity, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, 10, Infinity, Infinity)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, 10, 10, Infinity)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, Infinity, Infinity, 10)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, Infinity, Infinity, Infinity)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, Infinity, 10, Infinity)
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, Infinity, Infinity)
    +
    • Failed assertion: should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10)
    • Aborted with exception: 'DOMException' is undefined
    +
    # 2d.imageData.put.basic +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.imageData.put.created +
    • Passed
    +
    • Aborted with exception: 'ctx.createImageData' is not a function
    +
    • Passed
    +
    • Failed assertion: got pixel [0,0,0,255] at (50,25), expected [0,255,0,255] +/- 2
    +
    • Passed
    +
    # 2d.imageData.put.wrongtype +
    • Failed assertion: should throw exception of type TYPE_MISMATCH_ERR: ctx.putImageData(imgdata, 0, 0)
    • Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: An invalid or illegal string was specified
    • Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: An invalid or illegal string was specified
    +
    • Failed assertion: should throw exception of type TYPE_MISMATCH_ERR: ctx.putImageData(imgdata, 0, 0)
    • Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: WRONG_ARGUMENTS_ERR
    • Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: WRONG_ARGUMENTS_ERR
    +
    • Passed
    +
    • Failed assertion: should throw exception of type TYPE_MISMATCH_ERR: ctx.putImageData(imgdata, 0, 0)
    +
    • Failed assertion: should throw exception of type TYPE_MISMATCH_ERR: ctx.putImageData(imgdata, 0, 0)
    • Aborted with exception: 'DOMException' is undefined
    +
    # 2d.imageData.put.cross +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.imageData.put.alpha +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion: got pixel [0,259,0,63] at (50,25), expected [0,255,0,64] +/- 2
    +
    • Passed
    +
    # 2d.imageData.put.modified +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.imageData.put.dirty.zero +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255] +/- 2
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255] +/- 2
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255] +/- 2
    +
    • Passed
    +
    # 2d.imageData.put.dirty.rect1 +
    • Aborted with exception: An invalid or illegal string was specified
    +
    • Failed assertion: got pixel [255,0,0,255] at (65,25), expected [0,255,0,255] +/- 2
    • Failed assertion: got pixel [255,0,0,255] at (50,45), expected [0,255,0,255] +/- 2
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (65,25), expected [0,255,0,255] +/- 2
    • Failed assertion: got pixel [255,0,0,255] at (50,45), expected [0,255,0,255] +/- 2
    +
    • Passed
    +
    # 2d.imageData.put.dirty.rect2 +
    • Aborted with exception: An invalid or illegal string was specified
    +
    • Failed assertion: got pixel [255,0,0,255] at (35,25), expected [0,255,0,255] +/- 2
    • Failed assertion: got pixel [255,0,0,255] at (65,25), expected [0,255,0,255] +/- 2
    • Failed assertion: got pixel [255,0,0,255] at (50,15), expected [0,255,0,255] +/- 2
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (35,25), expected [0,255,0,255] +/- 2
    • Failed assertion: got pixel [255,0,0,255] at (65,25), expected [0,255,0,255] +/- 2
    • Failed assertion: got pixel [255,0,0,255] at (50,15), expected [0,255,0,255] +/- 2
    +
    • Passed
    +
    # 2d.imageData.put.dirty.negative +
    • Aborted with exception: An invalid or illegal string was specified
    +
    • Failed assertion: got pixel [255,0,0,255] at (65,25), expected [0,255,0,255] +/- 2
    • Failed assertion: got pixel [255,0,0,255] at (50,45), expected [0,255,0,255] +/- 2
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (65,25), expected [0,255,0,255] +/- 2
    • Failed assertion: got pixel [255,0,0,255] at (50,45), expected [0,255,0,255] +/- 2
    +
    • Passed
    +
    # 2d.imageData.put.dirty.outside +
    • Aborted with exception: An invalid or illegal string was specified
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255] +/- 2
    • Failed assertion: got pixel [255,0,0,255] at (98,25), expected [0,255,0,255] +/- 2
    • Failed assertion: got pixel [255,0,0,255] at (98,45), expected [0,255,0,255] +/- 2
    • Failed assertion: got pixel [255,0,0,255] at (1,25), expected [0,255,0,255] +/- 2
    • Failed assertion: got pixel [255,0,0,255] at (1,45), expected [0,255,0,255] +/- 2
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (50,25), expected [0,255,0,255] +/- 2
    • Failed assertion: got pixel [255,0,0,255] at (98,25), expected [0,255,0,255] +/- 2
    • Failed assertion: got pixel [255,0,0,255] at (98,45), expected [0,255,0,255] +/- 2
    • Failed assertion: got pixel [255,0,0,255] at (1,25), expected [0,255,0,255] +/- 2
    • Failed assertion: got pixel [255,0,0,255] at (1,45), expected [0,255,0,255] +/- 2
    +
    • Passed
    +
    # 2d.imageData.put.unchanged +
    • Passed
    +
    • Passed
    +
    • Failed assertion olddata["533"] === imgdata2.data["533"] (got 198[number], expected 197[number])
    • Failed assertion olddata["557"] === imgdata2.data["557"] (got 206[number], expected 205[number])
    • Failed assertion olddata["562"] === imgdata2.data["562"] (got 188[number], expected 187[number])
    • Failed assertion olddata["584"] === imgdata2.data["584"] (got 145[number], expected 144[number])
    • Failed assertion olddata["600"] === imgdata2.data["600"] (got 148[number], expected 147[number])
    • Failed assertion olddata["608"] === imgdata2.data["608"] (got 151[number], expected 150[number])
    • Failed assertion olddata["609"] === imgdata2.data["609"] (got 227[number], expected 226[number])
    • Failed assertion olddata["620"] === imgdata2.data["620"] (got 153[number], expected 152[number])
    • Failed assertion olddata["628"] === imgdata2.data["628"] (got 156[number], expected 155[number])
    • Failed assertion olddata["634"] === imgdata2.data["634"] (got 95[number], expected 94[number])
    • Failed assertion olddata["644"] === imgdata2.data["644"] (got 160[number], expected 159[number])
    • Failed assertion olddata["653"] === imgdata2.data["653"] (got 243[number], expected 242[number])
    • Failed assertion olddata["660"] === imgdata2.data["660"] (got 164[number], expected 163[number])
    • Failed assertion olddata["665"] === imgdata2.data["665"] (got 248[number], expected 247[number])
    • Failed assertion olddata["668"] === imgdata2.data["668"] (got 165[number], expected 164[number])
    • Failed assertion olddata["672"] === imgdata2.data["672"] (got 167[number], expected 166[number])
    • Failed assertion olddata["673"] === imgdata2.data["673"] (got 251[number], expected 250[number])
    • Failed assertion olddata["680"] === imgdata2.data["680"] (got 168[number], expected 167[number])
    • Failed assertion olddata["692"] === imgdata2.data["692"] (got 171[number], expected 170[number])
    • Failed assertion olddata["693"] === imgdata2.data["693"] (got 2[number], expected 1[number])
    • Failed assertion olddata["694"] === imgdata2.data["694"] (got 189[number], expected 188[number])
    • Failed assertion olddata["696"] === imgdata2.data["696"] (got 173[number], expected 172[number])
    • Failed assertion olddata["701"] === imgdata2.data["701"] (got 5[number], expected 4[number])
    • Failed assertion olddata["706"] === imgdata2.data["706"] (got 2[number], expected 1[number])
    • Failed assertion olddata["708"] === imgdata2.data["708"] (got 176[number], expected 175[number])
    • Failed assertion olddata["721"] === imgdata2.data["721"] (got 12[number], expected 11[number])
    • Failed assertion olddata["722"] === imgdata2.data["722"] (got 96[number], expected 95[number])
    • Failed assertion olddata["724"] === imgdata2.data["724"] (got 179[number], expected 178[number])
    • Failed assertion olddata["728"] === imgdata2.data["728"] (got 181[number], expected 180[number])
    • Failed assertion olddata["729"] === imgdata2.data["729"] (got 16[number], expected 15[number])
    • Failed assertion olddata["733"] === imgdata2.data["733"] (got 16[number], expected 15[number])
    • Failed assertion olddata["734"] === imgdata2.data["734"] (got 166[number], expected 165[number])
    • Failed assertion olddata["736"] === imgdata2.data["736"] (got 183[number], expected 182[number])
    • Failed assertion olddata["738"] === imgdata2.data["738"] (got 190[number], expected 189[number])
    • Failed assertion olddata["741"] === imgdata2.data["741"] (got 20[number], expected 19[number])
    • Failed assertion olddata["753"] === imgdata2.data["753"] (got 25[number], expected 24[number])
    • Failed assertion olddata["757"] === imgdata2.data["757"] (got 25[number], expected 24[number])
    • Failed assertion olddata["766"] === imgdata2.data["766"] (got 97[number], expected 96[number])
    • Failed assertion olddata["773"] === imgdata2.data["773"] (got 31[number], expected 30[number])
    • Failed assertion olddata["778"] === imgdata2.data["778"] (got 167[number], expected 166[number])
    • Failed assertion olddata["785"] === imgdata2.data["785"] (got 37[number], expected 36[number])
    • Failed assertion olddata["794"] === imgdata2.data["794"] (got 3[number], expected 2[number])
    • Failed assertion olddata["800"] === imgdata2.data["800"] (got 199[number], expected 198[number])
    • Failed assertion olddata["806"] === imgdata2.data["806"] (got 73[number], expected 72[number])
    • Failed assertion olddata["808"] === imgdata2.data["808"] (got 201[number], expected 200[number])
    • Failed assertion olddata["809"] === imgdata2.data["809"] (got 46[number], expected 45[number])
    • Failed assertion olddata["810"] === imgdata2.data["810"] (got 97[number], expected 96[number])
    • Failed assertion olddata["812"] === imgdata2.data["812"] (got 201[number], expected 200[number])
    • Failed assertion olddata["813"] === imgdata2.data["813"] (got 47[number], expected 46[number])
    • Failed assertion olddata["814"] === imgdata2.data["814"] (got 119[number], expected 118[number])
    • Failed assertion olddata["817"] === imgdata2.data["817"] (got 48[number], expected 47[number])
    • Failed assertion olddata["828"] === imgdata2.data["828"] (got 206[number], expected 205[number])
    • Failed assertion olddata["834"] === imgdata2.data["834"] (got 237[number], expected 236[number])
    • Failed assertion olddata["838"] === imgdata2.data["838"] (got 4[number], expected 3[number])
    • Failed assertion olddata["840"] === imgdata2.data["840"] (got 209[number], expected 208[number])
    • Failed assertion olddata["849"] === imgdata2.data["849"] (got 61[number], expected 60[number])
    • Failed assertion olddata["850"] === imgdata2.data["850"] (got 74[number], expected 73[number])
    • Failed assertion olddata["852"] === imgdata2.data["852"] (got 212[number], expected 211[number])
    • Failed assertion olddata["857"] === imgdata2.data["857"] (got 64[number], expected 63[number])
    • Failed assertion olddata["858"] === imgdata2.data["858"] (got 120[number], expected 119[number])
    • Failed assertion olddata["864"] === imgdata2.data["864"] (got 215[number], expected 214[number])
    • Failed assertion olddata["865"] === imgdata2.data["865"] (got 67[number], expected 66[number])
    • Failed assertion olddata["876"] === imgdata2.data["876"] (got 218[number], expected 217[number])
    • Failed assertion olddata["882"] === imgdata2.data["882"] (got 5[number], expected 4[number])
    • Failed assertion olddata["886"] === imgdata2.data["886"] (got 28[number], expected 27[number])
    • Failed assertion olddata["890"] === imgdata2.data["890"] (got 51[number], expected 50[number])
    • Failed assertion olddata["892"] === imgdata2.data["892"] (got 222[number], expected 221[number])
    • Failed assertion olddata["893"] === imgdata2.data["893"] (got 76[number], expected 75[number])
    • Failed assertion olddata["894"] === imgdata2.data["894"] (got 74[number], expected 73[number])
    • Failed assertion olddata["901"] === imgdata2.data["901"] (got 80[number], expected 79[number])
    • Failed assertion olddata["902"] === imgdata2.data["902"] (got 121[number], expected 120[number])
    • Failed assertion olddata["905"] === imgdata2.data["905"] (got 82[number], expected 81[number])
    • Failed assertion olddata["908"] === imgdata2.data["908"] (got 226[number], expected 225[number])
    • Failed assertion olddata["918"] === imgdata2.data["918"] (got 214[number], expected 213[number])
    • Failed assertion olddata["921"] === imgdata2.data["921"] (got 87[number], expected 86[number])
    • Failed assertion olddata["924"] === imgdata2.data["924"] (got 230[number], expected 229[number])
    • Failed assertion olddata["925"] === imgdata2.data["925"] (got 89[number], expected 88[number])
    • Failed assertion olddata["928"] === imgdata2.data["928"] (got 231[number], expected 230[number])
    • Failed assertion olddata["929"] === imgdata2.data["929"] (got 91[number], expected 90[number])
    • Failed assertion olddata["930"] === imgdata2.data["930"] (got 28[number], expected 27[number])
    • Failed assertion olddata["934"] === imgdata2.data["934"] (got 51[number], expected 50[number])
    • Failed assertion olddata["941"] === imgdata2.data["941"] (got 95[number], expected 94[number])
    • Failed assertion olddata["945"] === imgdata2.data["945"] (got 97[number], expected 96[number])
    • Failed assertion olddata["948"] === imgdata2.data["948"] (got 236[number], expected 235[number])
    • Failed assertion olddata["950"] === imgdata2.data["950"] (got 145[number], expected 144[number])
    • Failed assertion olddata["952"] === imgdata2.data["952"] (got 237[number], expected 236[number])
    • Failed assertion olddata["954"] === imgdata2.data["954"] (got 168[number], expected 167[number])
    • Failed assertion olddata["956"] === imgdata2.data["956"] (got 238[number], expected 237[number])
    • Failed assertion olddata["957"] === imgdata2.data["957"] (got 101[number], expected 100[number])
    • Failed assertion olddata["958"] === imgdata2.data["958"] (got 191[number], expected 190[number])
    • Failed assertion olddata["969"] === imgdata2.data["969"] (got 106[number], expected 105[number])
    • Failed assertion olddata["980"] === imgdata2.data["980"] (got 244[number], expected 243[number])
    • Failed assertion olddata["981"] === imgdata2.data["981"] (got 110[number], expected 109[number])
    • Failed assertion olddata["984"] === imgdata2.data["984"] (got 245[number], expected 244[number])
    • Failed assertion olddata["986"] === imgdata2.data["986"] (got 98[number], expected 97[number])
    • Failed assertion olddata["988"] === imgdata2.data["988"] (got 246[number], expected 245[number])
    • Failed assertion olddata["989"] === imgdata2.data["989"] (got 112[number], expected 111[number])
    • Failed assertion olddata["992"] === imgdata2.data["992"] (got 247[number], expected 246[number])
    • Failed assertion olddata["993"] === imgdata2.data["993"] (got 115[number], expected 114[number])
    • Failed assertion olddata["994"] === imgdata2.data["994"] (got 145[number], expected 144[number])
    • Failed assertion olddata["996"] === imgdata2.data["996"] (got 248[number], expected 247[number])
    • Failed assertion olddata["998"] === imgdata2.data["998"] (got 168[number], expected 167[number])
    • Failed assertion olddata["1000"] === imgdata2.data["1000"] (got 249[number], expected 248[number])
    • Failed assertion olddata["1001"] === imgdata2.data["1001"] (got 118[number], expected 117[number])
    • Failed assertion olddata["1002"] === imgdata2.data["1002"] (got 192[number], expected 191[number])
    • Failed assertion olddata["1004"] === imgdata2.data["1004"] (got 250[number], expected 249[number])
    • Failed assertion olddata["1008"] === imgdata2.data["1008"] (got 251[number], expected 250[number])
    • Failed assertion olddata["1009"] === imgdata2.data["1009"] (got 121[number], expected 120[number])
    • Failed assertion olddata["1010"] === imgdata2.data["1010"] (got 238[number], expected 237[number])
    • Failed assertion olddata["1012"] === imgdata2.data["1012"] (got 252[number], expected 251[number])
    • Failed assertion olddata["1016"] === imgdata2.data["1016"] (got 253[number], expected 252[number])
    • Failed assertion olddata["1017"] === imgdata2.data["1017"] (got 124[number], expected 123[number])
    +
    • Passed
    +
    • Passed
    +
    # 2d.imageData.put.unaffected +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.imageData.put.clip +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.imageData.put.path +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.text.font.parse.basic +
    • Failed assertion ctx.font === '20px serif' (got 20PX SERIF[string], expected 20px serif[string])
    +
    • Passed
    +
    • Failed assertion ctx.font === '20px serif' (got 20PX SERIF[string], expected 20px serif[string])
    +
    • Failed assertion ctx.font === '20px serif' (got 20PX SERIF[string], expected 20px serif[string])
    +
    • Failed assertion ctx.font === '20px serif' (got 20px SERIF[string], expected 20px serif[string])
    +
    # 2d.text.font.parse.complex +
    • Failed assertion ctx.font === 'italic small-caps 12px "Unknown Font", sans-serif' (got small-caps italic 400 12px/2 Unknown Font, sans-serif[string], expected italic small-caps 12px "Unknown Font", sans-serif[string])
    +
    • Passed
    +
    • Failed assertion ctx.font === 'italic small-caps 12px "Unknown Font", sans-serif' (got small-caps italic 400 12px/2 Unknown Font, sans-serif[string], expected italic small-caps 12px "Unknown Font", sans-serif[string])
    +
    • Failed assertion ctx.font === 'italic small-caps 12px "Unknown Font", sans-serif' (got small-caps italic 400 12px/2 Unknown Font, sans-serif[string], expected italic small-caps 12px "Unknown Font", sans-serif[string])
    +
    • Failed assertion ctx.font === 'italic small-caps 12px "Unknown Font", sans-serif' (got italic small-caps 12px Unknown Font, sans-serif[string], expected italic small-caps 12px "Unknown Font", sans-serif[string])
    +
    # 2d.text.font.parse.size.percentage +
    • Failed assertion ctx.font === '72px serif' (got 50% serif[string], expected 72px serif[string])
    • Failed assertion ctx.font === '72px serif' (got 50% serif[string], expected 72px serif[string])
    +
    • Failed assertion ctx.font === '72px serif' (got 50% serif[string], expected 72px serif[string])
    • Failed assertion ctx.font === '72px serif' (got 50% serif[string], expected 72px serif[string])
    +
    • Failed assertion ctx.font === '72px serif' (got 50% serif[string], expected 72px serif[string])
    • Failed assertion ctx.font === '72px serif' (got 50% serif[string], expected 72px serif[string])
    +
    • Failed assertion ctx.font === '72px serif' (got 50% serif[string], expected 72px serif[string])
    • Failed assertion ctx.font === '72px serif' (got 50% serif[string], expected 72px serif[string])
    +
    • Failed assertion ctx.font === '72px serif' (got 50% serif[string], expected 72px serif[string])
    • Failed assertion ctx.font === '72px serif' (got 50% serif[string], expected 72px serif[string])
    +
    # 2d.text.font.parse.size.percentage.default +
    • Failed assertion ctx.font === '100px serif' (got 1000% serif[string], expected 100px serif[string])
    +
    • Failed assertion ctx.font === '100px serif' (got 1000% serif[string], expected 100px serif[string])
    +
    • Failed assertion ctx.font === '100px serif' (got 1000% serif[string], expected 100px serif[string])
    +
    • Failed assertion ctx.font === '100px serif' (got 1000% serif[string], expected 100px serif[string])
    +
    • Failed assertion ctx.font === '100px serif' (got 1000% serif[string], expected 100px serif[string])
    +
    # 2d.text.font.parse.system +
    • Failed assertion ctx.font !== 'message-box' (got message-box[string], expected not message-box[string])
    +
    • Failed assertion ctx.font !== 'message-box' (got message-box[string], expected not message-box[string])
    +
    • Failed assertion ctx.font !== 'message-box' (got message-box[string], expected not message-box[string])
    +
    • Failed assertion ctx.font !== 'message-box' (got message-box[string], expected not message-box[string])
    +
    • Failed assertion ctx.font !== 'message-box' (got message-box[string], expected not message-box[string])
    +
    # 2d.text.font.parse.invalid +
    • Failed assertion ctx.font === '20px serif' (got bogus[string], expected 20px serif[string])
    • Failed assertion ctx.font === '20px serif' (got inherit[string], expected 20px serif[string])
    • Failed assertion ctx.font === '20px serif' (got 10px {bogus}[string], expected 20px serif[string])
    • Failed assertion ctx.font === '20px serif' (got 10px initial[string], expected 20px serif[string])
    • Failed assertion ctx.font === '20px serif' (got 10px default[string], expected 20px serif[string])
    • Failed assertion ctx.font === '20px serif' (got 10px inherit[string], expected 20px serif[string])
    +
    • Failed assertion ctx.font === '20px serif' (got 10px "initial"[string], expected 20px serif[string])
    • Failed assertion ctx.font === '20px serif' (got 10px "default"[string], expected 20px serif[string])
    +
    • Failed assertion ctx.font === '20px serif' (got inherit[string], expected 20px serif[string])
    • Failed assertion ctx.font === '20px serif' (got 10px initial[string], expected 20px serif[string])
    • Failed assertion ctx.font === '20px serif' (got 10px default[string], expected 20px serif[string])
    • Failed assertion ctx.font === '20px serif' (got 10px inherit[string], expected 20px serif[string])
    +
    • Failed assertion ctx.font === '20px serif' (got bogus[string], expected 20px serif[string])
    • Failed assertion ctx.font === '20px serif' (got inherit[string], expected 20px serif[string])
    • Failed assertion ctx.font === '20px serif' (got 10px {bogus}[string], expected 20px serif[string])
    • Failed assertion ctx.font === '20px serif' (got 10px initial[string], expected 20px serif[string])
    • Failed assertion ctx.font === '20px serif' (got 10px default[string], expected 20px serif[string])
    • Failed assertion ctx.font === '20px serif' (got 10px inherit[string], expected 20px serif[string])
    +
    • Failed assertion ctx.font === '20px serif' (got 10px initial[string], expected 20px serif[string])
    • Failed assertion ctx.font === '20px serif' (got 10px default[string], expected 20px serif[string])
    • Failed assertion ctx.font === '20px serif' (got 10px inherit[string], expected 20px serif[string])
    +
    # 2d.text.font.default +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion ctx.font === '10px sans-serif' (got [undefined], expected 10px sans-serif[string])
    +
    • Passed
    +
    # 2d.text.align.valid +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.text.align.invalid +
    • Aborted with exception: Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIDOMCanvasRenderingContext2D.textAlign]
    +
    • Failed assertion ctx.textAlign === 'start' (got end[string], expected start[string])
    +
    • Passed
    +
    • Failed assertion ctx.textAlign === 'start' (got bogus[string], expected start[string])
    • Failed assertion ctx.textAlign === 'start' (got END[string], expected start[string])
    • Failed assertion ctx.textAlign === 'start' (got end [string], expected start[string])
    • Failed assertion ctx.textAlign === 'start' (got end[string], expected start[string])
    +
    • Failed assertion ctx.textAlign === 'start' (got end[string], expected start[string])
    +
    # 2d.text.align.default +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion ctx.textAlign === 'start' (got [undefined], expected start[string])
    +
    • Passed
    +
    # 2d.text.baseline.valid +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    # 2d.text.baseline.invalid +
    • Aborted with exception: Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIDOMCanvasRenderingContext2D.textBaseline]
    +
    • Failed assertion ctx.textBaseline === 'top' (got middle[string], expected top[string])
    +
    • Passed
    +
    • Failed assertion ctx.textBaseline === 'top' (got bogus[string], expected top[string])
    • Failed assertion ctx.textBaseline === 'top' (got MIDDLE[string], expected top[string])
    • Failed assertion ctx.textBaseline === 'top' (got middle [string], expected top[string])
    • Failed assertion ctx.textBaseline === 'top' (got middle[string], expected top[string])
    +
    • Failed assertion ctx.textBaseline === 'top' (got middle[string], expected top[string])
    +
    # 2d.text.baseline.default +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Failed assertion ctx.textBaseline === 'alphabetic' (got [undefined], expected alphabetic[string])
    +
    • Passed
    +
    # 2d.text.draw.fill.basic +
    • Cannot automatically verify result
    +
    • Cannot automatically verify result
    +
    • Cannot automatically verify result
    +
    • Aborted with exception: Attempt to use a non-function object or a value as a function.
    +
    • Cannot automatically verify result
    +
    # 2d.text.draw.fill.unaffected +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Aborted with exception: Attempt to use a non-function object or a value as a function.
    +
    • Passed
    +
    # 2d.text.draw.fill.rtl +
    • Cannot automatically verify result
    +
    • Cannot automatically verify result
    +
    • Cannot automatically verify result
    +
    • Aborted with exception: Attempt to use a non-function object or a value as a function.
    +
    • Cannot automatically verify result
    +
    # 2d.text.draw.fill.maxWidth.large +
    • Cannot automatically verify result
    +
    • Cannot automatically verify result
    +
    • Cannot automatically verify result
    +
    • Aborted with exception: Attempt to use a non-function object or a value as a function.
    +
    • Cannot automatically verify result
    +
    # 2d.text.draw.fill.maxWidth.small +
    • Cannot automatically verify result
    +
    • Cannot automatically verify result
    +
    • Cannot automatically verify result
    +
    • Aborted with exception: Attempt to use a non-function object or a value as a function.
    +
    • Cannot automatically verify result
    +
    # 2d.text.draw.fill.maxWidth.zero +
    • Cannot automatically verify result
    +
    • Cannot automatically verify result
    +
    • Cannot automatically verify result
    +
    • Aborted with exception: Attempt to use a non-function object or a value as a function.
    +
    • Cannot automatically verify result
    +
    # 2d.text.draw.stroke.basic +
    • Cannot automatically verify result
    +
    • Cannot automatically verify result
    +
    • Cannot automatically verify result
    +
    • Aborted with exception: Attempt to use a non-function object or a value as a function.
    +
    • Cannot automatically verify result
    +
    # 2d.text.draw.stroke.unaffected +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Aborted with exception: Attempt to use a non-function object or a value as a function.
    +
    • Passed
    +
    # 2d.text.draw.kern.consistent +
    • Cannot automatically verify result
    +
    • Cannot automatically verify result
    +
    • Cannot automatically verify result
    +
    • Aborted with exception: Attempt to use a non-function object or a value as a function.
    +
    • Cannot automatically verify result
    +
    # 2d.text.draw.fill.maxWidth.fontface +
    • Failed assertion: got pixel [255,0,0,255] at (5,5), expected [0,255,0,255] +/- 2
    • Failed assertion: got pixel [255,0,0,255] at (25,25), expected [0,255,0,255] +/- 2
    +
    • Passed
    +
    • Failed assertion: got pixel [255,0,0,255] at (5,5), expected [0,255,0,255] +/- 2
    • Failed assertion: got pixel [255,0,0,255] at (95,5), expected [0,255,0,255] +/- 2
    • Failed assertion: got pixel [255,0,0,255] at (25,25), expected [0,255,0,255] +/- 2
    • Failed assertion: got pixel [255,0,0,255] at (75,25), expected [0,255,0,255] +/- 2
    +
    • Aborted with exception: Attempt to use a non-function object or a value as a function.
    +
    • Passed
    +
    # 2d.text.draw.fill.maxWidth.bound +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Aborted with exception: Attempt to use a non-function object or a value as a function.
    +
    • Passed
    +
    # 2d.text.draw.fontface +
    • Passed
    +
    • Passed
    +
    • Passed
    +
    • Aborted with exception: Attempt to use a non-function object or a value as a function.
    +
    • Passed
    +
    # 2d.text.draw.fontface.repeat +
      +
        +
          +
            +
            • Passed
            +
            # 2d.text.draw.fontface.notinpage +
            • Failed assertion: got pixel [255,0,0,255] at (5,5), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (95,5), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (25,25), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (75,25), expected [0,255,0,255] +/- 2
            +
            • Failed assertion: got pixel [255,0,0,255] at (5,5), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (95,5), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (25,25), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [159,96,0,255] at (75,25), expected [0,255,0,255] +/- 2
            +
            • Passed
            +
            • Aborted with exception: Attempt to use a non-function object or a value as a function.
            +
            • Passed
            +
            # 2d.text.draw.baseline.top +
            • Passed
            +
            • Failed assertion: got pixel [255,0,0,255] at (5,5), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (95,5), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (25,25), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (75,25), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (5,45), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (95,45), expected [0,255,0,255] +/- 2
            +
            • Failed assertion: got pixel [254,0,0,255] at (5,5), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [254,0,0,255] at (95,5), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [254,0,0,255] at (25,25), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [254,0,0,255] at (75,25), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [254,0,0,255] at (5,45), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [254,0,0,255] at (95,45), expected [0,255,0,255] +/- 2
            +
            • Aborted with exception: Attempt to use a non-function object or a value as a function.
            +
            • Failed assertion: got pixel [255,0,0,255] at (5,5), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (95,5), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (25,25), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (75,25), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (5,45), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (95,45), expected [0,255,0,255] +/- 2
            +
            # 2d.text.draw.baseline.bottom +
            • Passed
            +
            • Failed assertion: got pixel [255,0,0,255] at (25,25), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (75,25), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (5,45), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (95,45), expected [0,255,0,255] +/- 2
            +
            • Failed assertion: got pixel [254,0,0,255] at (25,25), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [254,0,0,255] at (75,25), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (5,45), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (95,45), expected [0,255,0,255] +/- 2
            +
            • Aborted with exception: Attempt to use a non-function object or a value as a function.
            +
            • Failed assertion: got pixel [255,0,0,255] at (25,25), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (75,25), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (5,45), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (95,45), expected [0,255,0,255] +/- 2
            +
            # 2d.text.draw.baseline.middle +
            • Passed
            +
            • Failed assertion: got pixel [255,0,0,255] at (5,5), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (95,5), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (25,25), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (75,25), expected [0,255,0,255] +/- 2
            +
            • Failed assertion: got pixel [254,0,0,255] at (5,5), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [254,0,0,255] at (95,5), expected [0,255,0,255] +/- 2
            +
            • Aborted with exception: Attempt to use a non-function object or a value as a function.
            +
            • Failed assertion: got pixel [255,0,0,255] at (5,5), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (95,5), expected [0,255,0,255] +/- 2
            +
            # 2d.text.draw.baseline.alphabetic +
            • Passed
            +
            • Passed
            +
            • Passed
            +
            • Aborted with exception: Attempt to use a non-function object or a value as a function.
            +
            • Passed
            +
            # 2d.text.draw.baseline.ideographic +
            • Failed assertion: got pixel [255,0,0,255] at (5,45), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (95,45), expected [0,255,0,255] +/- 2
            +
            • Failed assertion: got pixel [255,0,0,255] at (5,45), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (95,45), expected [0,255,0,255] +/- 2
            +
            • Failed assertion: got pixel [254,0,0,255] at (5,5), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [254,0,0,255] at (95,5), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [254,0,0,255] at (25,25), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [254,0,0,255] at (75,25), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (5,45), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (95,45), expected [0,255,0,255] +/- 2
            +
            • Aborted with exception: Attempt to use a non-function object or a value as a function.
            +
            • Failed assertion: got pixel [255,0,0,255] at (5,45), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (95,45), expected [0,255,0,255] +/- 2
            +
            # 2d.text.draw.baseline.hanging +
            • Failed assertion: got pixel [255,0,0,255] at (25,25), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (75,25), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (5,45), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (95,45), expected [0,255,0,255] +/- 2
            +
            • Failed assertion: got pixel [255,0,0,255] at (5,5), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (95,5), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (5,45), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (95,45), expected [0,255,0,255] +/- 2
            +
            • Failed assertion: got pixel [255,0,0,255] at (5,5), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (95,5), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [254,0,0,255] at (5,45), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [254,0,0,255] at (95,45), expected [0,255,0,255] +/- 2
            +
            • Aborted with exception: Attempt to use a non-function object or a value as a function.
            +
            • Failed assertion: got pixel [255,0,0,255] at (5,5), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (95,5), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (5,45), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (95,45), expected [0,255,0,255] +/- 2
            +
            # 2d.text.draw.align.left +
            • Passed
            +
            • Passed
            +
            • Passed
            +
            • Aborted with exception: Attempt to use a non-function object or a value as a function.
            +
            • Passed
            +
            # 2d.text.draw.align.right +
            • Passed
            +
            • Failed assertion: got pixel [255,0,0,255] at (95,5), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (25,25), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (75,25), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (95,45), expected [0,255,0,255] +/- 2
            +
            • Passed
            +
            • Aborted with exception: Attempt to use a non-function object or a value as a function.
            +
            • Passed
            +
            # 2d.text.draw.align.start.ltr +
            • Passed
            +
            • Passed
            +
            • Passed
            +
            • Aborted with exception: Attempt to use a non-function object or a value as a function.
            +
            • Passed
            +
            # 2d.text.draw.align.start.rtl +
            • Passed
            +
            • Failed assertion: got pixel [255,0,0,255] at (95,5), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (25,25), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (75,25), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (95,45), expected [0,255,0,255] +/- 2
            +
            • Passed
            +
            • Aborted with exception: Attempt to use a non-function object or a value as a function.
            +
            • Failed assertion: got pixel [255,0,0,255] at (5,5), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (95,5), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (25,25), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (75,25), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (5,45), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (95,45), expected [0,255,0,255] +/- 2
            +
            # 2d.text.draw.align.end.ltr +
            • Passed
            +
            • Failed assertion: got pixel [255,0,0,255] at (95,5), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (25,25), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (75,25), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (95,45), expected [0,255,0,255] +/- 2
            +
            • Passed
            +
            • Aborted with exception: Attempt to use a non-function object or a value as a function.
            +
            • Passed
            +
            # 2d.text.draw.align.end.rtl +
            • Passed
            +
            • Passed
            +
            • Passed
            +
            • Aborted with exception: Attempt to use a non-function object or a value as a function.
            +
            • Failed assertion: got pixel [255,0,0,255] at (5,5), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (95,5), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [40,215,0,255] at (25,25), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (75,25), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (5,45), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (95,45), expected [0,255,0,255] +/- 2
            +
            # 2d.text.draw.align.center +
            • Passed
            +
            • Failed assertion: got pixel [255,0,0,255] at (95,5), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (95,45), expected [0,255,0,255] +/- 2
            +
            • Passed
            +
            • Aborted with exception: Attempt to use a non-function object or a value as a function.
            +
            • Passed
            +
            # 2d.text.draw.space.basic +
            • Passed
            +
            • Passed
            +
            • Passed
            +
            • Aborted with exception: Attempt to use a non-function object or a value as a function.
            +
            • Passed
            +
            # 2d.text.draw.space.collapse.space +
            • Failed assertion: got pixel [255,0,0,255] at (25,25), expected [0,255,0,255] +/- 2
            +
            • Failed assertion: got pixel [255,0,0,255] at (25,25), expected [0,255,0,255] +/- 2
            +
            • Failed assertion: got pixel [255,0,0,255] at (25,25), expected [0,255,0,255] +/- 2
            +
            • Aborted with exception: Attempt to use a non-function object or a value as a function.
            +
            • Failed assertion: got pixel [255,0,0,255] at (25,25), expected [0,255,0,255] +/- 2
            +
            # 2d.text.draw.space.collapse.other +
            • Failed assertion: got pixel [255,0,0,255] at (25,25), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (75,25), expected [0,255,0,255] +/- 2
            +
            • Failed assertion: got pixel [255,0,0,255] at (25,25), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (75,25), expected [0,255,0,255] +/- 2
            +
            • Failed assertion: got pixel [255,0,0,255] at (25,25), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (75,25), expected [0,255,0,255] +/- 2
            +
            • Aborted with exception: Attempt to use a non-function object or a value as a function.
            +
            • Failed assertion: got pixel [255,0,0,255] at (25,25), expected [0,255,0,255] +/- 2
            • Failed assertion: got pixel [255,0,0,255] at (75,25), expected [0,255,0,255] +/- 2
            +
            # 2d.text.draw.space.collapse.nonspace +
            • Passed
            +
            • Failed assertion: got pixel [255,0,0,255] at (75,25), expected [0,255,0,255] +/- 2
            +
            • Failed assertion: got pixel [255,0,0,255] at (75,25), expected [0,255,0,255] +/- 2
            +
            • Aborted with exception: Attempt to use a non-function object or a value as a function.
            +
            • Failed assertion: got pixel [255,0,0,255] at (75,25), expected [0,255,0,255] +/- 2
            +
            # 2d.text.draw.space.collapse.start +
            • Failed assertion: got pixel [255,0,0,255] at (25,25), expected [0,255,0,255] +/- 2
            +
            • Failed assertion: got pixel [255,0,0,255] at (25,25), expected [0,255,0,255] +/- 2
            +
            • Failed assertion: got pixel [255,0,0,255] at (25,25), expected [0,255,0,255] +/- 2
            +
            • Aborted with exception: Attempt to use a non-function object or a value as a function.
            +
            • Passed
            +
            # 2d.text.draw.space.collapse.end +
            • Failed assertion: got pixel [255,0,0,255] at (75,25), expected [0,255,0,255] +/- 2
            +
            • Passed
            +
            • Failed assertion: got pixel [255,0,0,255] at (75,25), expected [0,255,0,255] +/- 2
            +
            • Aborted with exception: Attempt to use a non-function object or a value as a function.
            +
            • Failed assertion: got pixel [255,0,0,255] at (75,25), expected [0,255,0,255] +/- 2
            +
            # 2d.text.measure.width.basic +
            • Passed
            +
            • Passed
            +
            • Passed
            +
            • Aborted with exception: Attempt to use a non-function object or a value as a function.
            +
            • Passed
            +
            # 2d.text.measure.width.empty +
            • Passed
            +
            • Passed
            +
            • Passed
            +
            • Aborted with exception: Attempt to use a non-function object or a value as a function.
            +
            • Passed
            +
            # 2d.text.measure.width.space +
            • Failed assertion ctx.measureText('A B').width === 150 (got 200[number], expected 150[number])
            • Failed assertion ctx.measureText('A \x09\x0a\x0c\x0d \x09\x0a\x0c\x0dB').width === 150 (got 650[number], expected 150[number])
            • Failed assertion ctx.measureText(' AB').width === 100 (got 150[number], expected 100[number])
            • Failed assertion ctx.measureText('AB ').width === 100 (got 150[number], expected 100[number])
            +
            • Failed assertion ctx.measureText('A B').width === 150 (got 200[number], expected 150[number])
            • Failed assertion ctx.measureText('A \x09\x0a\x0c\x0d \x09\x0a\x0c\x0dB').width === 150 (got 650[number], expected 150[number])
            • Failed assertion ctx.measureText(' AB').width === 100 (got 150[number], expected 100[number])
            • Failed assertion ctx.measureText('AB ').width === 100 (got 150[number], expected 100[number])
            +
            • Failed assertion ctx.measureText('A B').width === 150 (got 200[number], expected 150[number])
            • Failed assertion ctx.measureText('A \x09\x0a\x0c\x0d \x09\x0a\x0c\x0dB').width === 150 (got 450[number], expected 150[number])
            • Failed assertion ctx.measureText(' AB').width === 100 (got 150[number], expected 100[number])
            • Failed assertion ctx.measureText('AB ').width === 100 (got 150[number], expected 100[number])
            +
            • Aborted with exception: Attempt to use a non-function object or a value as a function.
            +
            • Failed assertion ctx.measureText('A B').width === 150 (got 200[number], expected 150[number])
            • Failed assertion ctx.measureText('A \x09\x0a\x0c\x0d \x09\x0a\x0c\x0dB').width === 150 (got 575[number], expected 150[number])
            • Failed assertion ctx.measureText(' AB').width === 100 (got 113[number], expected 100[number])
            • Failed assertion ctx.measureText('AB ').width === 100 (got 150[number], expected 100[number])
            +
            Passes +75.4% +79.2% +74.2% +70.4% +73.7% +
            +Firefox 3.7 alpha (20100227; Linux) +Opera 10.50 alpha (6234; Linux) +Chromium 5.0.308.0 (Linux) +Konqueror 4.3.3 (Linux) +IE9 Preview 3 (Windows) +
            diff --git a/platforms/ios/www/test/tests-todo/security.dataURI.js b/platforms/ios/www/test/tests-todo/security.dataURI.js new file mode 100644 index 0000000..4a31daa --- /dev/null +++ b/platforms/ios/www/test/tests-todo/security.dataURI.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +var data = canvas.toDataURL(); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +var img = new Image(); +deferTest(); +img.onload = wrapFunction(function () +{ + ctx.drawImage(img, 0, 0); + canvas.toDataURL(); // should be permitted + _assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +}); +img.src = data; + + +}); diff --git a/platforms/ios/www/test/tests-todo/security.drawImage.canvas.js b/platforms/ios/www/test/tests-todo/security.drawImage.canvas.js new file mode 100644 index 0000000..c000ef4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/security.drawImage.canvas.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.drawImage(document.getElementById('yellow.png'), 0, 0); +ctx.drawImage(canvas2, 0, 0); +try { var _thrown = false; canvas.toDataURL(); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: canvas.toDataURL()"); } +try { var _thrown = false; ctx.getImageData(0, 0, 1, 1); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: ctx.getImageData(0, 0, 1, 1)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/security.drawImage.image.js b/platforms/ios/www/test/tests-todo/security.drawImage.image.js new file mode 100644 index 0000000..8f29754 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/security.drawImage.image.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +ctx.drawImage(document.getElementById('yellow.png'), 0, 0); +try { var _thrown = false; canvas.toDataURL(); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: canvas.toDataURL()"); } +try { var _thrown = false; ctx.getImageData(0, 0, 1, 1); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: ctx.getImageData(0, 0, 1, 1)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/security.pattern.canvas.fillStyle.js b/platforms/ios/www/test/tests-todo/security.pattern.canvas.fillStyle.js new file mode 100644 index 0000000..32c9d57 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/security.pattern.canvas.fillStyle.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.drawImage(document.getElementById('yellow.png'), 0, 0); +var p = ctx.createPattern(canvas2, 'repeat'); +ctx.fillStyle = p; +ctx.fillStyle = 'red'; +try { var _thrown = false; canvas.toDataURL(); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: canvas.toDataURL()"); } +try { var _thrown = false; ctx.getImageData(0, 0, 1, 1); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: ctx.getImageData(0, 0, 1, 1)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/security.pattern.canvas.strokeStyle.js b/platforms/ios/www/test/tests-todo/security.pattern.canvas.strokeStyle.js new file mode 100644 index 0000000..9c14a15 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/security.pattern.canvas.strokeStyle.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.drawImage(document.getElementById('yellow.png'), 0, 0); +var p = ctx.createPattern(canvas2, 'repeat'); +ctx.strokeStyle = p; +ctx.strokeStyle = 'red'; +try { var _thrown = false; canvas.toDataURL(); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: canvas.toDataURL()"); } +try { var _thrown = false; ctx.getImageData(0, 0, 1, 1); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: ctx.getImageData(0, 0, 1, 1)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/security.pattern.canvas.timing.js b/platforms/ios/www/test/tests-todo/security.pattern.canvas.timing.js new file mode 100644 index 0000000..76ed28a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/security.pattern.canvas.timing.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = '#0f0'; +ctx2.fillRect(0, 0, 100, 50); +var p = ctx.createPattern(canvas2, 'repeat'); +ctx2.drawImage(document.getElementById('yellow.png'), 0, 0); // make canvas2 origin-unclean +ctx.fillStyle = p; +ctx.fillRect(0, 0, 100, 50); +canvas.toDataURL(); +ctx.getImageData(0, 0, 1, 1); +_assert(true, "true"); // okay if there was no exception + + +}); diff --git a/platforms/ios/www/test/tests-todo/security.pattern.create.js b/platforms/ios/www/test/tests-todo/security.pattern.create.js new file mode 100644 index 0000000..a45b354 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/security.pattern.create.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +var p = ctx.createPattern(document.getElementById('yellow.png'), 'repeat'); +canvas.toDataURL(); +ctx.getImageData(0, 0, 1, 1); +_assert(true, "true"); // okay if there was no exception + + +}); diff --git a/platforms/ios/www/test/tests-todo/security.pattern.cross.js b/platforms/ios/www/test/tests-todo/security.pattern.cross.js new file mode 100644 index 0000000..81be569 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/security.pattern.cross.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +var p = ctx2.createPattern(document.getElementById('yellow.png'), 'repeat'); +ctx.fillStyle = p; +ctx.fillRect(0, 0, 100, 50); +try { var _thrown = false; canvas.toDataURL(); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: canvas.toDataURL()"); } +try { var _thrown = false; ctx.getImageData(0, 0, 1, 1); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: ctx.getImageData(0, 0, 1, 1)"); } +canvas2.toDataURL(); +ctx2.getImageData(0, 0, 1, 1); + + +}); diff --git a/platforms/ios/www/test/tests-todo/security.pattern.image.fillStyle.js b/platforms/ios/www/test/tests-todo/security.pattern.image.fillStyle.js new file mode 100644 index 0000000..9818f60 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/security.pattern.image.fillStyle.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +var p = ctx.createPattern(document.getElementById('yellow.png'), 'repeat'); +ctx.fillStyle = p; +ctx.fillStyle = 'red'; +try { var _thrown = false; canvas.toDataURL(); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: canvas.toDataURL()"); } +try { var _thrown = false; ctx.getImageData(0, 0, 1, 1); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: ctx.getImageData(0, 0, 1, 1)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/security.pattern.image.strokeStyle.js b/platforms/ios/www/test/tests-todo/security.pattern.image.strokeStyle.js new file mode 100644 index 0000000..89e7561 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/security.pattern.image.strokeStyle.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +var p = ctx.createPattern(document.getElementById('yellow.png'), 'repeat'); +ctx.strokeStyle = p; +ctx.strokeStyle = 'red'; +try { var _thrown = false; canvas.toDataURL(); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: canvas.toDataURL()"); } +try { var _thrown = false; ctx.getImageData(0, 0, 1, 1); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: ctx.getImageData(0, 0, 1, 1)"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/security.reset.js b/platforms/ios/www/test/tests-todo/security.reset.js new file mode 100644 index 0000000..22cd77c --- /dev/null +++ b/platforms/ios/www/test/tests-todo/security.reset.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 50; +ctx.drawImage(document.getElementById('yellow.png'), 0, 0); +try { var _thrown = false; canvas.toDataURL(); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: canvas.toDataURL()"); } +canvas.width = 100; +try { var _thrown = false; canvas.toDataURL(); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: canvas.toDataURL()"); } + + +}); diff --git a/platforms/ios/www/test/tests-todo/size.attributes.default.js b/platforms/ios/www/test/tests-todo/size.attributes.default.js new file mode 100644 index 0000000..7f32024 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/size.attributes.default.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 300, "canvas.width", "300"); +_assertSame(canvas.height, 150, "canvas.height", "150"); +_assert(!canvas.hasAttribute('width'), "!canvas.hasAttribute('width')"); +_assert(!canvas.hasAttribute('height'), "!canvas.hasAttribute('height')"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/size.attributes.get.js b/platforms/ios/www/test/tests-todo/size.attributes.get.js new file mode 100644 index 0000000..47eef4f --- /dev/null +++ b/platforms/ios/www/test/tests-todo/size.attributes.get.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 120, "canvas.width", "120"); +_assertSame(canvas.height, 60, "canvas.height", "60"); +_assertSame(canvas.getAttribute('width'), '120', "canvas.getAttribute('width')", "'120'"); +_assertSame(canvas.getAttribute('height'), '60', "canvas.getAttribute('height')", "'60'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/size.attributes.idl.js b/platforms/ios/www/test/tests-todo/size.attributes.idl.js new file mode 100644 index 0000000..edd0f4b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/size.attributes.idl.js @@ -0,0 +1,29 @@ +_addTest(function(canvas, ctx) { + +canvas.width = "100"; +canvas.height = "100"; +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); + +canvas.width = "+1.5e2"; +canvas.height = "0x96"; +_assertSame(canvas.width, 150, "canvas.width", "150"); +_assertSame(canvas.height, 150, "canvas.height", "150"); + +canvas.width = 200 - Math.pow(2, 32); +canvas.height = 200 - Math.pow(2, 32); +_assertSame(canvas.width, 200, "canvas.width", "200"); +_assertSame(canvas.height, 200, "canvas.height", "200"); + +canvas.width = 301.999; +canvas.height = 301.001; +_assertSame(canvas.width, 301, "canvas.width", "301"); +_assertSame(canvas.height, 301, "canvas.height", "301"); + +canvas.width = "400x"; +canvas.height = "foo"; +_assertSame(canvas.width, 0, "canvas.width", "0"); +_assertSame(canvas.height, 0, "canvas.height", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/size.attributes.idl.set.zero.js b/platforms/ios/www/test/tests-todo/size.attributes.idl.set.zero.js new file mode 100644 index 0000000..5952df1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/size.attributes.idl.set.zero.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 0; +canvas.height = 0; +_assertSame(canvas.width, 0, "canvas.width", "0"); +_assertSame(canvas.height, 0, "canvas.height", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/size.attributes.parse.decimal.js b/platforms/ios/www/test/tests-todo/size.attributes.parse.decimal.js new file mode 100644 index 0000000..044156b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/size.attributes.parse.decimal.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/size.attributes.parse.em.js b/platforms/ios/www/test/tests-todo/size.attributes.parse.em.js new file mode 100644 index 0000000..044156b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/size.attributes.parse.em.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/size.attributes.parse.empty.js b/platforms/ios/www/test/tests-todo/size.attributes.parse.empty.js new file mode 100644 index 0000000..78b3641 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/size.attributes.parse.empty.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 300, "canvas.width", "300"); +_assertSame(canvas.height, 150, "canvas.height", "150"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/size.attributes.parse.exp.js b/platforms/ios/www/test/tests-todo/size.attributes.parse.exp.js new file mode 100644 index 0000000..044156b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/size.attributes.parse.exp.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/size.attributes.parse.hex.js b/platforms/ios/www/test/tests-todo/size.attributes.parse.hex.js new file mode 100644 index 0000000..7d69957 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/size.attributes.parse.hex.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 0, "canvas.width", "0"); +_assertSame(canvas.height, 0, "canvas.height", "0"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "0px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"0px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/size.attributes.parse.junk.js b/platforms/ios/www/test/tests-todo/size.attributes.parse.junk.js new file mode 100644 index 0000000..78b3641 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/size.attributes.parse.junk.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 300, "canvas.width", "300"); +_assertSame(canvas.height, 150, "canvas.height", "150"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/size.attributes.parse.minus.js b/platforms/ios/www/test/tests-todo/size.attributes.parse.minus.js new file mode 100644 index 0000000..78b3641 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/size.attributes.parse.minus.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 300, "canvas.width", "300"); +_assertSame(canvas.height, 150, "canvas.height", "150"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/size.attributes.parse.octal.js b/platforms/ios/www/test/tests-todo/size.attributes.parse.octal.js new file mode 100644 index 0000000..044156b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/size.attributes.parse.octal.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/size.attributes.parse.onlyspace.js b/platforms/ios/www/test/tests-todo/size.attributes.parse.onlyspace.js new file mode 100644 index 0000000..78b3641 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/size.attributes.parse.onlyspace.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 300, "canvas.width", "300"); +_assertSame(canvas.height, 150, "canvas.height", "150"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/size.attributes.parse.percent.js b/platforms/ios/www/test/tests-todo/size.attributes.parse.percent.js new file mode 100644 index 0000000..044156b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/size.attributes.parse.percent.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/size.attributes.parse.plus.js b/platforms/ios/www/test/tests-todo/size.attributes.parse.plus.js new file mode 100644 index 0000000..044156b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/size.attributes.parse.plus.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/size.attributes.parse.space.js b/platforms/ios/www/test/tests-todo/size.attributes.parse.space.js new file mode 100644 index 0000000..044156b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/size.attributes.parse.space.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/size.attributes.parse.trailingjunk.js b/platforms/ios/www/test/tests-todo/size.attributes.parse.trailingjunk.js new file mode 100644 index 0000000..044156b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/size.attributes.parse.trailingjunk.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/size.attributes.parse.whitespace.js b/platforms/ios/www/test/tests-todo/size.attributes.parse.whitespace.js new file mode 100644 index 0000000..044156b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/size.attributes.parse.whitespace.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/size.attributes.parse.zero.js b/platforms/ios/www/test/tests-todo/size.attributes.parse.zero.js new file mode 100644 index 0000000..7d69957 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/size.attributes.parse.zero.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 0, "canvas.width", "0"); +_assertSame(canvas.height, 0, "canvas.height", "0"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "0px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"0px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/size.attributes.reflect.setcontent.js b/platforms/ios/www/test/tests-todo/size.attributes.reflect.setcontent.js new file mode 100644 index 0000000..adfcc79 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/size.attributes.reflect.setcontent.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', '120'); +canvas.setAttribute('height', '60'); +_assertSame(canvas.getAttribute('width'), '120', "canvas.getAttribute('width')", "'120'"); +_assertSame(canvas.getAttribute('height'), '60', "canvas.getAttribute('height')", "'60'"); +_assertSame(canvas.width, 120, "canvas.width", "120"); +_assertSame(canvas.height, 60, "canvas.height", "60"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/size.attributes.reflect.setidl.js b/platforms/ios/www/test/tests-todo/size.attributes.reflect.setidl.js new file mode 100644 index 0000000..0e295e2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/size.attributes.reflect.setidl.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 120; +canvas.height = 60; +_assertSame(canvas.getAttribute('width'), '120', "canvas.getAttribute('width')", "'120'"); +_assertSame(canvas.getAttribute('height'), '60', "canvas.getAttribute('height')", "'60'"); +_assertSame(canvas.width, 120, "canvas.width", "120"); +_assertSame(canvas.height, 60, "canvas.height", "60"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/size.attributes.reflect.setidlzero.js b/platforms/ios/www/test/tests-todo/size.attributes.reflect.setidlzero.js new file mode 100644 index 0000000..015bfa7 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/size.attributes.reflect.setidlzero.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 0; +canvas.height = 0; +_assertSame(canvas.getAttribute('width'), '0', "canvas.getAttribute('width')", "'0'"); +_assertSame(canvas.getAttribute('height'), '0', "canvas.getAttribute('height')", "'0'"); +_assertSame(canvas.width, 0, "canvas.width", "0"); +_assertSame(canvas.height, 0, "canvas.height", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/size.attributes.removed.js b/platforms/ios/www/test/tests-todo/size.attributes.removed.js new file mode 100644 index 0000000..3840046 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/size.attributes.removed.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.width, 120, "canvas.width", "120"); +canvas.removeAttribute('width'); +_assertSame(canvas.width, 300, "canvas.width", "300"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/size.attributes.set.js b/platforms/ios/www/test/tests-todo/size.attributes.set.js new file mode 100644 index 0000000..f150b97 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/size.attributes.set.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +canvas.width = 120; +canvas.height = 60; +_assertSame(canvas.width, 120, "canvas.width", "120"); +_assertSame(canvas.height, 60, "canvas.height", "60"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.decimal.js b/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.decimal.js new file mode 100644 index 0000000..682ed15 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.decimal.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', '100.999'); +canvas.setAttribute('height', '100.999'); +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.em.js b/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.em.js new file mode 100644 index 0000000..97f9d6b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.em.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', '100em'); +canvas.setAttribute('height', '100em'); +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.empty.js b/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.empty.js new file mode 100644 index 0000000..44c9ca2 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.empty.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', ''); +canvas.setAttribute('height', ''); +_assertSame(canvas.width, 300, "canvas.width", "300"); +_assertSame(canvas.height, 150, "canvas.height", "150"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.exp.js b/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.exp.js new file mode 100644 index 0000000..ded7cee --- /dev/null +++ b/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.exp.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', '100e1'); +canvas.setAttribute('height', '100e1'); +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.hex.js b/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.hex.js new file mode 100644 index 0000000..55f4fd3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.hex.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', '0x100'); +canvas.setAttribute('height', '0x100'); +_assertSame(canvas.width, 0, "canvas.width", "0"); +_assertSame(canvas.height, 0, "canvas.height", "0"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "0px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"0px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.junk.js b/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.junk.js new file mode 100644 index 0000000..04830d5 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.junk.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', '#!?'); +canvas.setAttribute('height', '#!?'); +_assertSame(canvas.width, 300, "canvas.width", "300"); +_assertSame(canvas.height, 150, "canvas.height", "150"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.minus.js b/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.minus.js new file mode 100644 index 0000000..f16c035 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.minus.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', '-100'); +canvas.setAttribute('height', '-100'); +_assertSame(canvas.width, 300, "canvas.width", "300"); +_assertSame(canvas.height, 150, "canvas.height", "150"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.octal.js b/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.octal.js new file mode 100644 index 0000000..d84eba9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.octal.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', '0100'); +canvas.setAttribute('height', '0100'); +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.onlyspace.js b/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.onlyspace.js new file mode 100644 index 0000000..259a0c8 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.onlyspace.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', ' '); +canvas.setAttribute('height', ' '); +_assertSame(canvas.width, 300, "canvas.width", "300"); +_assertSame(canvas.height, 150, "canvas.height", "150"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.percent.js b/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.percent.js new file mode 100644 index 0000000..411d4fc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.percent.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', '100%'); +canvas.setAttribute('height', '100%'); +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.plus.js b/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.plus.js new file mode 100644 index 0000000..a512583 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.plus.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', '+100'); +canvas.setAttribute('height', '+100'); +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.space.js b/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.space.js new file mode 100644 index 0000000..56880e5 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.space.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', ' 100'); +canvas.setAttribute('height', ' 100'); +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.trailingjunk.js b/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.trailingjunk.js new file mode 100644 index 0000000..826a3ac --- /dev/null +++ b/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.trailingjunk.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', '100#!?'); +canvas.setAttribute('height', '100#!?'); +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.whitespace.js b/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.whitespace.js new file mode 100644 index 0000000..e0db93d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.whitespace.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', '\r\n\t\x0c100'); +canvas.setAttribute('height', '\r\n\t\x0c100'); +_assertSame(canvas.width, 100, "canvas.width", "100"); +_assertSame(canvas.height, 100, "canvas.height", "100"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.zero.js b/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.zero.js new file mode 100644 index 0000000..d2f7160 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/size.attributes.setAttribute.zero.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +canvas.setAttribute('width', '0'); +canvas.setAttribute('height', '0'); +_assertSame(canvas.width, 0, "canvas.width", "0"); +_assertSame(canvas.height, 0, "canvas.height", "0"); +_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "0px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"0px\""); + + +}); diff --git a/platforms/ios/www/test/tests-todo/size.attributes.style.js b/platforms/ios/www/test/tests-todo/size.attributes.style.js new file mode 100644 index 0000000..1d91d9a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/size.attributes.style.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +_assertEqual(canvas.width, 50, "canvas.width", "50"); +_assertEqual(canvas.height, 30, "canvas.height", "30"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/spec.js b/platforms/ios/www/test/tests-todo/spec.js new file mode 100644 index 0000000..2d8c777 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/spec.js @@ -0,0 +1,3268 @@ + +HTML5 (including next generation additions still in development)

            4.8.10 The canvas element

            + +
            Categories
            +
            Flow content.
            +
            Phrasing content.
            +
            Embedded content.
            +
            Contexts in which this element may be used:
            +
            Where embedded content is expected.
            +
            Content model:
            +
            Transparent.
            +
            Content attributes:
            +
            Global attributes
            +
            width
            +
            height
            +
            DOM interface:
            +
            +
            interface HTMLCanvasElement # type.name type.exists type.delete type.prototype type.replace type.extend  : HTMLElement {
            +           attribute unsigned long width; # size.attributes.get size.attributes.set size.attributes.idl.set.zero size.attributes.idl 
            +           attribute unsigned long height; # size.attributes.get size.attributes.set size.attributes.idl.set.zero size.attributes.idl 
            +
            +  DOMString toDataURL(in optional DOMString type, in any... args);
            +
            +  object getContext(in DOMString contextId);
            +};
            +
            +

            The canvas element provides scripts with a + resolution-dependent bitmap canvas, which can be used for rendering + graphs, game graphics, or other visual images on the fly.

            + +

            Authors should not use the canvas element in a + document when a more suitable element is available. For example, it + is inappropriate to use a canvas element to render a + page heading: if the desired presentation of the heading is + graphically intense, it should be marked up using appropriate + elements (typically h1) and then styled using CSS and + supporting technologies such as XBL.

            + +

            When authors use the canvas element, they must also + provide content that, when presented to the user, conveys + essentially the same function or purpose as the bitmap canvas. This + content may be placed as content of the canvas + element. The contents of the canvas element, if any, + are the element's fallback content # fallback.basic fallback.multiple fallback.nested .

            + +

            In interactive visual media, if scripting is enabled for the + canvas element, and if support for canvas + elements has been enabled, the canvas element + represents embedded content consisting of + a dynamically created image.

            + +

            In non-interactive, static, visual media, if the + canvas element has been previously painted on (e.g. if + the page was viewed in an interactive visual medium and is now being + printed, or if some script that ran during the page layout process + painted on the element), then the canvas element + represents embedded content with the + current image and size. Otherwise, the element represents its + fallback content instead.

            + +

            In non-visual media, and in visual media if scripting is disabled for the + canvas element or if support for canvas + elements has been disabled, the canvas element + represents its fallback content + instead.

            + + +

            When a canvas element represents + embedded content, the user can still focus descendants + of the canvas element (in the fallback + content). This allows authors to make an interactive canvas + keyboard-focusable: authors should have a one-to-one mapping of + interactive regions to focusable elements in the fallback + content.

            + +

            The canvas element has two attributes to control the + size of the coordinate space: width and height. These + attributes, when specified, must have values that are valid non-negative + integers. The rules for parsing + non-negative integers must be used to obtain their numeric + values # size.attributes.parse.zero size.attributes.parse.empty size.attributes.parse.onlyspace size.attributes.parse.space size.attributes.parse.whitespace size.attributes.parse.plus size.attributes.parse.minus size.attributes.parse.octal size.attributes.parse.hex size.attributes.parse.exp size.attributes.parse.decimal size.attributes.parse.percent size.attributes.parse.em size.attributes.parse.junk size.attributes.parse.trailingjunk size.attributes.setAttribute.zero size.attributes.setAttribute.empty size.attributes.setAttribute.onlyspace size.attributes.setAttribute.space size.attributes.setAttribute.whitespace size.attributes.setAttribute.plus size.attributes.setAttribute.minus size.attributes.setAttribute.octal size.attributes.setAttribute.hex size.attributes.setAttribute.exp size.attributes.setAttribute.decimal size.attributes.setAttribute.percent size.attributes.setAttribute.em size.attributes.setAttribute.junk size.attributes.setAttribute.trailingjunk . If an attribute is missing # size.attributes.default size.attributes.removed , or if parsing its value returns + an error # size.attributes.parse.empty size.attributes.parse.onlyspace size.attributes.parse.minus size.attributes.parse.junk size.attributes.setAttribute.empty size.attributes.setAttribute.onlyspace size.attributes.setAttribute.minus size.attributes.setAttribute.junk , then the default value must be used instead. The + width attribute defaults to + 300, and the height + attribute defaults to 150 # size.attributes.default .

            + +

            The intrinsic dimensions of the canvas element equal + the size of the coordinate space, with the numbers interpreted in + CSS pixels. However, the element can be sized arbitrarily by a + style sheet. During rendering, the image is scaled to fit this layout + size # size.attributes.style .

            + +
            + +

            The size of the coordinate space does not necessarily represent + the size of the actual bitmap that the user agent will use + internally or during rendering. On high-definition displays, for + instance, the user agent may internally use a bitmap with two device + pixels per unit in the coordinate space, so that the rendering + remains at high quality throughout.

            + +

            When the canvas element is created, and subsequently + whenever the width and height attributes are set (whether + to a new value or to the previous value), the bitmap and any + associated contexts must be cleared back to their initial state and + reinitialized with the newly specified coordinate space + dimensions # initial.reset.different initial.reset.same initial.reset.path initial.reset.clip initial.reset.transform initial.reset.gradient initial.reset.pattern security.reset initial.reset.2dstate .

            + +

            When the canvas is initialized, its bitmap must be cleared to + transparent black # initial.colour .

            + +

            The width and + height IDL + attributes must reflect the respective content + attributes of the same name # size.attributes.reflect.setidl size.attributes.reflect.setidlzero size.attributes.reflect.setcontent .

            + +
            + +
            +

            Only one square appears to be drawn in the following example:

            +
              // canvas is a reference to a <canvas> element
            +  var context = canvas.getContext('2d');
            +  context.fillRect(0,0,50,50);
            +  canvas.setAttribute('width', '300'); // clears the canvas
            +  context.fillRect(0,100,50,50);
            +  canvas.width = canvas.width; // clears the canvas
            +  context.fillRect(100,0,50,50); // only this square remains
            +
            + +

            To draw on the canvas, authors must first obtain a reference to a + context using the getContext(contextId) method of the + canvas element.

            + +
            context = canvas . getContext(contextId)
            + +
            + +

            Returns an object that exposes an API for drawing on the canvas.

            + +

            Returns null if the given context ID is not supported.

            + +
            + +

            This specification only defines one context, with the name "2d". If getContext() is called with + that exact string for its contextId argument, + then the UA must return a reference to an object implementing + CanvasRenderingContext2D # 2d.getcontext.exists . Other specifications may + define their own contexts, which would return different + objects.

            + + + +
            + +

            Vendors may also define experimental contexts using the syntax + vendorname-context, for example, moz-3d.

            + +

            When the UA is passed an empty string # context.emptystring or a string specifying a + context that it does not support # context.unrecognised.badname context.unrecognised.badsuffix context.unrecognised.nullsuffix context.unrecognised.unicode , then it must return null. String + comparisons must be case-sensitive # context.casesensitive .

            + +
            + +
            url = canvas . toDataURL( [ type, ... ])
            + +
            + +

            Returns a data: URL for the image in the + canvas.

            + +

            The first argument, if provided, controls the type of the image + to be returned (e.g. PNG or JPEG). The default is image/png; that type is also used if the given + type isn't supported. The other arguments are specific to the + type, and control the way that the image is generated, as given in + the table below.

            + +
            + +
            + +

            The toDataURL() method + must, when called with no arguments, return a data: URL containing a representation of the image + as a PNG file # toDataURL.default toDataURL.nocontext . [PNG]

            + +

            If the canvas has no pixels (i.e. either its horizontal dimension + or its vertical dimension is zero) then the method must return the + string "data:," # toDataURL.zerosize . (This is the shortest data: URL; it represents the empty string in a text/plain resource.)

            + +

            When the toDataURL(type) method is called with one or + more arguments, it must return a data: + URL containing a representation of the image in the format given by + type # toDataURL.png . The possible values are MIME types with no parameters, for example + image/png, image/jpeg, or even maybe + image/svg+xml if the implementation actually keeps + enough information to reliably render an SVG image from the + canvas.

            + +

            For image types that do not support an alpha channel, the image + must be composited onto a solid black background using the + source-over operator, and the resulting image must be the one used + to create the data: URL # toDataURL.jpeg.alpha .

            + +

            Only support for image/png is required # toDataURL.png toDataURL.png.primarycolours toDataURL.png.complexcolours . User agents + may support other types. If the user agent does not support the + requested type, it must return the image using the PNG format # toDataURL.bogustype toDataURL.unrecognised .

            + +

            User agents must convert the + provided type to ASCII lowercase before establishing if they + support that type and before creating the data: URL # toDataURL.lowercase.ascii toDataURL.lowercase.unicode .

            + +
            + +

            When trying to use types other than + image/png, authors can check if the image was really + returned in the requested format by checking to see if the returned + string starts with one the exact strings "data:image/png," or "data:image/png;". If it does, the image is PNG, and + thus the requested type was not supported. (The one exception to + this is if the canvas has either no height or no width, in which + case the result might simply be "data:,".)

            + +
            + +

            If the method is invoked with the first argument giving a type + corresponding to one of the types given in the first column of the + following table, and the user agent supports that type, then the + subsequent arguments, if any, must be treated as described in the + second cell of that row.

            + +
            + +
            Type Other arguments +
            image/jpeg # toDataURL.jpeg.primarycolours toDataURL.jpeg.alpha + The second argument, if it is a + number between 0.0 and 1.0, must be + treated as the desired quality level # toDataURL.jpeg.quality.basic . If it is + not a number # toDataURL.jpeg.quality.notnumber or is outside that range # toDataURL.jpeg.quality.outsiderange , the user agent must use + its default value, as if the argument had been omitted. +
            + +

            Other arguments must be ignored and must not cause the user agent + to raise an exception # toDataURL.arguments.1 toDataURL.arguments.2 toDataURL.arguments.3 . A future version of this specification will + probably define other parameters to be passed to toDataURL() to allow authors to + more carefully control compression settings, image metadata, + etc.

            + +
            + + + +
            4.8.10.1 The 2D context
            + + + +

            When the getContext() + method of a canvas element is invoked with 2d as the argument, a + CanvasRenderingContext2D object is returned.

            + + + +
            + + +

            There is only one CanvasRenderingContext2D object + per canvas, so calling the getContext() method with the + 2d argument a second time + must return the same object # 2d.getcontext.unique 2d.getcontext.shared .

            + +
            + +

            The 2D context represents a flat Cartesian surface whose origin + (0,0) is at the top left corner, with the coordinate space having + x values increasing when going right, and y values increasing when going down # 2d.coordinatespace .

            + +
            interface CanvasRenderingContext2D #  {
            +
            +  // back-reference to the canvas
            +  readonly # 2d.canvas.readonly  attribute HTMLCanvasElement canvas;
            +
            +  // state
            +  void save(); // push state on state stack
            +  void restore(); // pop state stack and restore state
            +
            +  // transformations (default transform is the identity matrix)
            +  void scale(in float x, in float y);
            +  void rotate(in float angle);
            +  void translate(in float x, in float y);
            +  void transform(in float m11, in float m12, in float m21, in float m22, in float dx, in float dy);
            +  void setTransform(in float m11, in float m12, in float m21, in float m22, in float dx, in float dy);
            +
            +  // compositing
            +           attribute float globalAlpha; // (default 1.0)
            +           attribute DOMString globalCompositeOperation; // (default source-over)
            +
            +  // colors and styles
            +           attribute any strokeStyle; // (default black)
            +           attribute any fillStyle; // (default black)
            +  CanvasGradient createLinearGradient(in float x0, in float y0, in float x1, in float y1);
            +  CanvasGradient createRadialGradient(in float x0, in float y0, in float r0, in float x1, in float y1, in float r1);
            +  CanvasPattern createPattern(in HTMLImageElement image, in DOMString repetition);
            +  CanvasPattern createPattern(in HTMLCanvasElement image, in DOMString repetition);
            +  CanvasPattern createPattern(in HTMLVideoElement image, in DOMString repetition);
            +
            +  // line caps/joins
            +           attribute float lineWidth; // (default 1)
            +           attribute DOMString lineCap; // "butt", "round", "square" (default "butt")
            +           attribute DOMString lineJoin; // "round", "bevel", "miter" (default "miter")
            +           attribute float miterLimit; // (default 10)
            +
            +  // shadows
            +           attribute float shadowOffsetX; // (default 0)
            +           attribute float shadowOffsetY; // (default 0)
            +           attribute float shadowBlur; // (default 0)
            +           attribute DOMString shadowColor; // (default transparent black)
            +
            +  // rects
            +  void clearRect(in float x, in float y, in float w, in float h);
            +  void fillRect(in float x, in float y, in float w, in float h);
            +  void strokeRect(in float x, in float y, in float w, in float h);
            +
            +  // path API
            +  void beginPath();
            +  void closePath();
            +  void moveTo(in float x, in float y);
            +  void lineTo(in float x, in float y);
            +  void quadraticCurveTo(in float cpx, in float cpy, in float x, in float y);
            +  void bezierCurveTo(in float cp1x, in float cp1y, in float cp2x, in float cp2y, in float x, in float y);
            +  void arcTo(in float x1, in float y1, in float x2, in float y2, in float radius);
            +  void rect(in float x, in float y, in float w, in float h);
            +  void arc(in float x, in float y, in float radius, in float startAngle, in float endAngle, in boolean anticlockwise);
            +  void fill();
            +  void stroke();
            +  void clip();
            +  boolean isPointInPath(in float x, in float y);
            +
            +  // focus management
            +  boolean drawFocusRing(in Element element, in float xCaret, in float yCaret, in optional boolean canDrawCustom);
            +
            +  // text
            +           attribute DOMString font; // (default 10px sans-serif)
            +           attribute DOMString textAlign; // "start", "end", "left", "right", "center" (default: "start")
            +           attribute DOMString textBaseline; // "top", "hanging", "middle", "alphabetic", "ideographic", "bottom" (default: "alphabetic")
            +  void fillText(in DOMString text, in float x, in float y, in optional float maxWidth);
            +  void strokeText(in DOMString text, in float x, in float y, in optional float maxWidth);
            +  TextMetrics measureText(in DOMString text);
            +
            +  // drawing images
            +  void drawImage(in HTMLImageElement image, in float dx, in float dy, in optional float dw, in float dh);
            +  void drawImage(in HTMLImageElement image, in float sx, in float sy, in float sw, in float sh, in float dx, in float dy, in float dw, in float dh);
            +  void drawImage(in HTMLCanvasElement image, in float dx, in float dy, in optional float dw, in float dh);
            +  void drawImage(in HTMLCanvasElement image, in float sx, in float sy, in float sw, in float sh, in float dx, in float dy, in float dw, in float dh);
            +  void drawImage(in HTMLVideoElement image, in float dx, in float dy, in optional float dw, in float dh);
            +  void drawImage(in HTMLVideoElement image, in float sx, in float sy, in float sw, in float sh, in float dx, in float dy, in float dw, in float dh);
            +
            +  // pixel manipulation
            +  ImageData createImageData(in float sw, in float sh);
            +  ImageData createImageData(in ImageData imagedata);
            +  ImageData getImageData(in float sx, in float sy, in float sw, in float sh);
            +  void putImageData(in ImageData imagedata, in float dx, in float dy, in optional float dirtyX, in float dirtyY, in float dirtyWidth, in float dirtyHeight);
            +};
            +
            +interface CanvasGradient {
            +  // opaque object
            +  void addColorStop(in float offset, in DOMString color);
            +};
            +
            +interface CanvasPattern {
            +  // opaque object
            +};
            +
            +interface TextMetrics {
            +  readonly attribute float width;
            +};
            +
            +interface ImageData # 2d.imageData.object.properties 2d.imageData.object.readonly 2d.imageData.object.ctor  {
            +  readonly attribute unsigned long width;
            +  readonly attribute unsigned long height;
            +  readonly attribute CanvasPixelArray data;
            +};
            +
            +interface CanvasPixelArray {
            +  readonly attribute unsigned long length;
            +  getter octet (in unsigned long index);
            +  setter void (in unsigned long index, in octet value);
            +};
            + +
            context . canvas
            + +
            + +

            Returns the canvas element.

            + +
            + +
            + +

            The canvas + attribute must return the canvas element that the + context paints on # 2d.canvas.reference .

            + +

            Except where otherwise specified, for the 2D context interface, + any method call with a numeric argument whose value is infinite or a + NaN value must be ignored # 2d.transformation.scale.nonfinite 2d.transformation.rotate.nonfinite 2d.transformation.translate.nonfinite 2d.transformation.transform.nonfinite 2d.transformation.setTransform.nonfinite 2d.clearRect.nonfinite 2d.fillRect.nonfinite 2d.strokeRect.nonfinite 2d.path.moveTo.nonfinite 2d.path.lineTo.nonfinite 2d.path.quadraticCurveTo.nonfinite 2d.path.bezierCurveTo.nonfinite 2d.path.arcTo.nonfinite 2d.path.arc.nonfinite 2d.path.rect.nonfinite 2d.drawImage.nonfinite .

            + + + +

            Whenever the CSS value currentColor is used + as a color in this API, the "computed value of the 'color' property" + for the purposes of determining the computed value of the currentColor keyword is the computed value of the + 'color' property on the element in question at the time that the + color is specified # 2d.fillStyle.parse.current.basic 2d.fillStyle.parse.current.changed (e.g. when the appropriate attribute is set, or + when the method is called; not when the color is rendered or + otherwise used). If the computed value of the 'color' property is + undefined for a particular case (e.g. because the element is not + in a Document), then the "computed value + of the 'color' property" for the purposes of determining the + computed value of the currentColor keyword is + fully opaque black # 2d.fillStyle.parse.current.removed . [CSSCOLOR]

            + +
            + + + +
            4.8.10.1.1 The canvas state
            + +

            Each context maintains a stack of drawing states. Drawing states consist of:

            + +

            The current path # 2d.state.saverestore.path and the current bitmap # 2d.state.saverestore.bitmap are not part + of the drawing state. The current path is persistent, and can only + be reset using the beginPath() method. The + current bitmap is a property of the canvas, not the context.

            + +
            context . save()
            + +
            + +

            Pushes the current state onto the stack.

            + +
            + +
            context . restore()
            + +
            + +

            Pops the top state on the stack, restoring the context to that state.

            + +
            + +
            + +

            The save() + method must push a copy of the current drawing state onto the + drawing state stack # 2d.state.saverestore.stack 2d.state.saverestore.stackdepth .

            + +

            The restore() method + must pop the top entry in the drawing state stack, and reset the + drawing state it describes # 2d.state.saverestore.stack 2d.state.saverestore.stackdepth . If there is no saved state, the method + must do nothing # 2d.state.saverestore.underflow .

            + + + +
            + + +
            4.8.10.1.2 Transformations
            + +

            The transformation matrix is applied to coordinates when creating + shapes and paths.

            + +
            + +

            When the context is created, the transformation matrix must + initially be the identity transform # . It may then be adjusted using + the transformation methods.

            + +

            The transformations must be performed in reverse order # 2d.transformation.order . For + instance, if a scale transformation that doubles the width is + applied, followed by a rotation transformation that rotates drawing + operations by a quarter turn, and a rectangle twice as wide as it is + tall is then drawn on the canvas, the actual result will be a + square.

            + +
            + +
            context . scale(x, y)
            + +
            + +

            Changes the transformation matrix to apply a scaling transformation with the given characteristics.

            + +
            + +
            context . rotate(angle)
            + +
            + +

            Changes the transformation matrix to apply a rotation transformation with the given characteristics. The angle is in radians.

            + +
            + +
            context . translate(x, y)
            + +
            + +

            Changes the transformation matrix to apply a translation transformation with the given characteristics.

            + +
            + +
            context . transform(m11, m12, m21, m22, dx, dy)
            + +
            + +

            Changes the transformation matrix to apply the matrix given by the arguments as described below.

            + +
            + +
            context . setTransform(m11, m12, m21, m22, dx, dy)
            + +
            + +

            Changes the transformation matrix to the matrix given by the arguments as described below.

            + +
            + +
            + +

            The scale(x, y) method must + add the scaling transformation described by the arguments to the + transformation matrix # 2d.transformation.scale.basic 2d.transformation.scale.zero 2d.transformation.scale.negative 2d.transformation.scale.large . The x argument represents + the scale factor in the horizontal direction and the y argument represents the scale factor in the + vertical direction. The factors are multiples # 2d.transformation.scale.multiple .

            + +

            The rotate(angle) method must add the rotation + transformation described by the argument to the transformation + matrix # 2d.transformation.rotate.zero 2d.transformation.rotate.wrap 2d.transformation.rotate.wrapnegative . The angle argument represents a + clockwise rotation angle # 2d.transformation.rotate.direction expressed in radians # 2d.transformation.rotate.radians .

            + +

            The translate(x, y) method must + add the translation transformation described by the arguments to the + transformation matrix # 2d.transformation.translate.basic . The x argument represents + the translation distance in the horizontal direction and the y argument represents the translation distance in the + vertical direction. The arguments are in coordinate space units.

            + +

            The transform(m11, m12, m21, m22, dx, + dy) method must multiply # 2d.transformation.transform.multiply the + current transformation matrix with the matrix described by # 2d.transformation.transform.identity 2d.transformation.transform.skewed :

            + +
            + + + + + + + + + + +
            m11m21dx
            m12m22dy
            001
            + +

            The setTransform(m11, m12, m21, m22, dx, + dy) method must reset the current + transform to the identity matrix # 2d.transformation.setTransform.multiple , and then invoke the transform(m11, m12, m21, m22, dx, + dy) method with the same arguments # 2d.transformation.setTransform.skewed .

            + +
            + + +
            4.8.10.1.3 Compositing
            + +
            context . globalAlpha [ = value ]
            + +
            + +

            Returns the current alpha value applied to rendering operations.

            + +

            Can be set, to change the alpha value. Values outside of the + range 0.0 .. 1.0 are ignored.

            + +
            + + +
            context . globalCompositeOperation [ = value ]
            + +
            + +

            Returns the current composition operation, from the list below.

            + +

            Can be set, to change the composition operation. Unknown values + are ignored.

            + +
            + +
            + +

            All drawing operations are affected by the global compositing + attributes, globalAlpha and globalCompositeOperation # 2d.composite.operation.get .

            + + + +

            The globalAlpha + attribute gives an alpha value that is applied to shapes # 2d.composite.globalAlpha.fill and images # 2d.composite.globalAlpha.image 2d.composite.globalAlpha.canvas 2d.composite.globalAlpha.imagepattern 2d.composite.globalAlpha.canvaspattern + before they are composited onto the canvas. The value must be in the + range from 0.0 (fully transparent) to 1.0 (no additional + transparency). If an attempt is made to set the attribute to a value + outside this range, including Infinity and Not-a-Number (NaN) + values, the attribute must retain its previous value # 2d.composite.globalAlpha.range 2d.composite.globalAlpha.invalid . When the + context is created, the globalAlpha attribute must + initially have the value 1.0 # 2d.composite.globalAlpha.default .

            + +

            The globalCompositeOperation + attribute sets how shapes # and images # are drawn onto the existing + bitmap, once they have had globalAlpha and the + current transformation matrix applied. It must be set to a value + from the following list. In the descriptions below, the source + image, A, is the shape or image being rendered, + and the destination image, B, is the current + state of the bitmap.

            + +
            + +
            source-atop
            # 2d.composite.solid.source-atop 2d.composite.transparent.source-atop 2d.composite.image.source-atop 2d.composite.canvas.source-atop 2d.composite.clip.source-atop + +
            A atop B. Display the + source image wherever both images are opaque. Display the + destination image wherever the destination image is opaque but the + source image is transparent. Display transparency elsewhere.
            + +
            source-in
            # 2d.composite.solid.source-in 2d.composite.transparent.source-in 2d.composite.image.source-in 2d.composite.canvas.source-in 2d.composite.uncovered.fill.source-in 2d.composite.uncovered.image.source-in 2d.composite.uncovered.nocontext.source-in 2d.composite.uncovered.pattern.source-in 2d.composite.clip.source-in + +
            A in B. Display the + source image wherever both the source image and destination image + are opaque. Display transparency elsewhere.
            + +
            source-out
            # 2d.composite.solid.source-out 2d.composite.transparent.source-out 2d.composite.image.source-out 2d.composite.canvas.source-out 2d.composite.uncovered.fill.source-out 2d.composite.uncovered.image.source-out 2d.composite.uncovered.nocontext.source-out 2d.composite.uncovered.pattern.source-out 2d.composite.clip.source-out + +
            A out B. Display the + source image wherever the source image is opaque and the + destination image is transparent. Display transparency + elsewhere.
            + +
            source-over (default)
            # 2d.composite.solid.source-over 2d.composite.transparent.source-over 2d.composite.image.source-over 2d.composite.canvas.source-over 2d.composite.clip.source-over + +
            A over B. Display the + source image wherever the source image is opaque. Display the + destination image elsewhere.
            + + +
            destination-atop
            # 2d.composite.solid.destination-atop 2d.composite.transparent.destination-atop 2d.composite.image.destination-atop 2d.composite.canvas.destination-atop 2d.composite.uncovered.fill.destination-atop 2d.composite.uncovered.image.destination-atop 2d.composite.uncovered.nocontext.destination-atop 2d.composite.uncovered.pattern.destination-atop 2d.composite.clip.destination-atop + +
            B atop A. Same as source-atop but using the + destination image instead of the source image and vice versa.
            + +
            destination-in
            # 2d.composite.solid.destination-in 2d.composite.transparent.destination-in 2d.composite.image.destination-in 2d.composite.canvas.destination-in 2d.composite.uncovered.fill.destination-in 2d.composite.uncovered.image.destination-in 2d.composite.uncovered.nocontext.destination-in 2d.composite.uncovered.pattern.destination-in 2d.composite.clip.destination-in + +
            B in A. Same as source-in but using the destination + image instead of the source image and vice versa.
            + +
            destination-out
            # 2d.composite.solid.destination-out 2d.composite.transparent.destination-out 2d.composite.image.destination-out 2d.composite.canvas.destination-out 2d.composite.clip.destination-out + +
            B out A. Same as source-out but using the destination + image instead of the source image and vice versa.
            + +
            destination-over
            # 2d.composite.solid.destination-over 2d.composite.transparent.destination-over 2d.composite.image.destination-over 2d.composite.canvas.destination-over 2d.composite.clip.destination-over + +
            B over A. Same as source-over but using the + destination image instead of the source image and vice versa.
            + + + + +
            lighter
            # 2d.composite.solid.lighter 2d.composite.transparent.lighter 2d.composite.image.lighter 2d.composite.canvas.lighter 2d.composite.clip.lighter + +
            A plus B. Display the + sum of the source image and destination image, with color values + approaching 1 as a limit.
            + + +
            copy
            # 2d.composite.solid.copy 2d.composite.transparent.copy 2d.composite.image.copy 2d.composite.canvas.copy 2d.composite.uncovered.fill.copy 2d.composite.uncovered.image.copy 2d.composite.uncovered.nocontext.copy 2d.composite.uncovered.pattern.copy 2d.composite.clip.copy + +
            A (B is + ignored). Display the source image instead of the destination + image.
            + + +
            xor
            # 2d.composite.solid.xor 2d.composite.transparent.xor 2d.composite.image.xor 2d.composite.canvas.xor 2d.composite.clip.xor + +
            A xor B. Exclusive OR + of the source image and destination image.
            + + +
            vendorName-operationName
            + +
            Vendor-specific extensions to the list of + composition operators should use this syntax.
            + +
            + +

            These values are all case-sensitive # 2d.composite.operation.casesensitive — they must be used + exactly as shown. User agents must not recognize values that are not + a case-sensitive match for one of the values given + above # 2d.composite.operation.nullsuffix .

            + +

            The operators in the above list must be treated as described by + the Porter-Duff operator given at the start of their description + (e.g. A over B) # . [PORTERDUFF]

            + +

            On setting, if the user agent does not recognize the specified + value, it must be ignored, leaving the value of globalCompositeOperation + unaffected # 2d.composite.operation.unrecognised 2d.composite.operation.darker 2d.composite.operation.over 2d.composite.operation.clear 2d.composite.operation.highlight .

            + +

            When the context is created, the globalCompositeOperation + attribute must initially have the value + source-over # 2d.composite.operation.default .

            + +
            + + +
            4.8.10.1.4 Colors and styles
            + +
            context . strokeStyle [ = value ]
            + +
            + +

            Returns the current style used for stroking shapes.

            + +

            Can be set, to change the stroke style.

            + +

            The style can be either a string containing a CSS color, or a + CanvasGradient or CanvasPattern + object. Invalid values are ignored.

            + +
            + +
            context . fillStyle [ = value ]
            + +
            + +

            Returns the current style used for filling shapes.

            + +

            Can be set, to change the fill style.

            + +

            The style can be either a string containing a CSS color, or a + CanvasGradient or CanvasPattern + object. Invalid values are ignored.

            + +
            + +
            + + + +

            The strokeStyle + attribute represents the color or style to use for the lines around + shapes, and the fillStyle + attribute represents the color or style to use inside the + shapes.

            + +

            Both attributes can be either strings, + CanvasGradients, or CanvasPatterns. On + setting, strings must be parsed as CSS <color> values and the + color assigned # 2d.fillStyle.parse.html4 2d.fillStyle.parse.hex3 2d.fillStyle.parse.hex6 2d.fillStyle.parse.rgb-num 2d.fillStyle.parse.rgb-clamp-1 2d.fillStyle.parse.rgb-clamp-2 2d.fillStyle.parse.rgb-clamp-3 2d.fillStyle.parse.rgb-clamp-4 2d.fillStyle.parse.rgb-clamp-5 2d.fillStyle.parse.rgb-percent 2d.fillStyle.parse.rgba-solid-1 2d.fillStyle.parse.rgba-solid-2 2d.fillStyle.parse.rgba-num-1 2d.fillStyle.parse.rgba-num-2 2d.fillStyle.parse.rgba-percent 2d.fillStyle.parse.rgba-clamp-1 2d.fillStyle.parse.rgba-clamp-2 2d.fillStyle.parse.transparent-1 2d.fillStyle.parse.transparent-2 2d.fillStyle.parse.hsl-1 2d.fillStyle.parse.hsl-2 2d.fillStyle.parse.hsl-3 2d.fillStyle.parse.hsl-4 2d.fillStyle.parse.hsl-5 2d.fillStyle.parse.hsl-clamp-1 2d.fillStyle.parse.hsl-clamp-2 2d.fillStyle.parse.hsl-clamp-3 2d.fillStyle.parse.hsl-clamp-4 2d.fillStyle.parse.hsla-1 2d.fillStyle.parse.hsla-2 2d.fillStyle.parse.hsla-clamp-1 2d.fillStyle.parse.hsla-clamp-2 2d.fillStyle.parse.hsla-clamp-3 2d.fillStyle.parse.hsla-clamp-4 2d.fillStyle.parse.hsla-clamp-5 2d.fillStyle.parse.hsla-clamp-6 2d.fillStyle.parse.svg-1 2d.fillStyle.parse.svg-2 2d.fillStyle.parse.invalid.hex1 2d.fillStyle.parse.invalid.hex2 2d.fillStyle.parse.invalid.hex3 2d.fillStyle.parse.invalid.hex4 2d.fillStyle.parse.invalid.hex5 2d.fillStyle.parse.invalid.hex6 2d.fillStyle.parse.invalid.hex7 2d.fillStyle.parse.invalid.hex8 2d.fillStyle.parse.invalid.rgb-1 2d.fillStyle.parse.invalid.rgb-2 2d.fillStyle.parse.invalid.rgb-3 2d.fillStyle.parse.invalid.rgb-4 2d.fillStyle.parse.invalid.rgb-5 2d.fillStyle.parse.invalid.rgb-6 2d.fillStyle.parse.invalid.rgb-7 2d.fillStyle.parse.invalid.rgba-1 2d.fillStyle.parse.invalid.rgba-2 2d.fillStyle.parse.invalid.rgba-3 2d.fillStyle.parse.invalid.rgba-4 2d.fillStyle.parse.invalid.rgba-5 2d.fillStyle.parse.invalid.hsl-1 2d.fillStyle.parse.invalid.hsl-2 2d.fillStyle.parse.invalid.hsl-3 2d.fillStyle.parse.invalid.hsl-4 2d.fillStyle.parse.invalid.hsl-5 2d.fillStyle.parse.invalid.hsla-1 2d.fillStyle.parse.invalid.hsla-2 2d.fillStyle.parse.invalid.name-1 2d.fillStyle.parse.invalid.name-2 2d.fillStyle.parse.invalid.name-3 2d.fillStyle.parse.system 2d.fillStyle.parse.current.basic 2d.fillStyle.parse.current.changed 2d.fillStyle.parse.current.removed , and CanvasGradient # and + CanvasPattern # objects must be assigned themselves. [CSSCOLOR] If the value is a string but + is not a valid color # 2d.fillStyle.invalidstring , or is neither a string, a + CanvasGradient, nor a CanvasPattern # 2d.fillStyle.invalidtype , then + it must be ignored, and the attribute must retain its previous + value.

            + +

            On getting, if the value is a color, then the serialization of the color + must be returned # 2d.fillStyle.get.solid 2d.fillStyle.get.semitransparent 2d.fillStyle.get.transparent . Otherwise, if it is not a color but a + CanvasGradient # 2d.gradient.object.compare or CanvasPattern # , then the + respective object must be returned. (Such objects are opaque and + therefore only useful for assigning to other attributes or for + comparison to other gradients or patterns.)

            + +

            The serialization of a color for a color value is a + string, computed as follows: if it has alpha equal to 1.0, then the + string is a lowercase six-digit hex value # 2d.fillStyle.get.solid , prefixed with a "#" + character (U+0023 NUMBER SIGN), with the first two digits + representing the red component, the next two digits representing the + green component, and the last two digits representing the blue + component, the digits being in the range 0-9 a-f (U+0030 to U+0039 + and U+0061 to U+0066). Otherwise, the color value has alpha less + than 1.0, and the string is the color value in the CSS rgba() functional-notation format # 2d.fillStyle.get.semitransparent 2d.fillStyle.get.transparent : the literal + string rgba (U+0072 U+0067 U+0062 U+0061) + followed by a U+0028 LEFT PARENTHESIS, a base-ten integer in the + range 0-255 representing the red component (using digits 0-9, U+0030 + to U+0039, in the shortest form possible), a literal U+002C COMMA + and U+0020 SPACE, an integer for the green component, a comma and a + space, an integer for the blue component, another comma and space, a + U+0030 DIGIT ZERO, a U+002E FULL STOP (representing the decimal + point), one or more digits in the range 0-9 (U+0030 to U+0039) + representing the fractional part of the alpha value, and finally a + U+0029 RIGHT PARENTHESIS.

            + +

            When the context is created, the strokeStyle and fillStyle attributes must + initially have the string value #000000 # 2d.fillStyle.default 2d.strokeStyle.default .

            + +
            + +

            There are two types of gradients, linear gradients and radial + gradients, both represented by objects implementing the opaque + CanvasGradient interface.

            + +

            Once a gradient has been created (see below), + stops are placed along it to define how the colors are distributed + along the gradient. The color of the gradient at + each stop is the color specified for that stop. Between each such + stop, the colors and the alpha component must be linearly + interpolated # 2d.gradient.interpolate.solid 2d.gradient.interpolate.colour 2d.gradient.interpolate.alpha 2d.gradient.interpolate.vertical 2d.gradient.interpolate.multiple over the RGBA space without premultiplying the alpha + value # 2d.gradient.interpolate.colouralpha to find the color to use at that offset. Before the first + stop, the color must be the color of the first stop # 2d.gradient.interpolate.outside . After the last + stop, the color must be the color of the last stop # 2d.gradient.interpolate.outside . When there are + no stops, the gradient is transparent black # 2d.gradient.empty .

            + +
            gradient . addColorStop(offset, color)
            + +
            + +

            Adds a color stop with the given color to the gradient at the + given offset. 0.0 is the offset at one end of the gradient, 1.0 is + the offset at the other end.

            + +

            Throws an INDEX_SIZE_ERR exception if the offset + it out of range. Throws a SYNTAX_ERR exception if the + color cannot be parsed.

            + +
            + +
            gradient = context . createLinearGradient(x0, y0, x1, y1)
            + +
            + +

            Returns a CanvasGradient object that represents a + linear gradient that paints along the line given by the + coordinates represented by the arguments.

            + +

            If any of the arguments are not finite numbers, throws a + NOT_SUPPORTED_ERR exception.

            + +
            + +
            gradient = context . createRadialGradient(x0, y0, r0, x1, y1, r1)
            + +
            + +

            Returns a CanvasGradient object that represents a + radial gradient that paints along the cone given by the circles + represented by the arguments.

            + +

            If any of the arguments are not finite numbers, throws a + NOT_SUPPORTED_ERR exception. If either of the radii + are negative throws an INDEX_SIZE_ERR exception.

            + +
            + +
            + +

            The addColorStop(offset, color) + method on the CanvasGradient interface adds a new stop + to a gradient. If the offset is less than 0, + greater than 1, infinite, or NaN, then an + INDEX_SIZE_ERR exception must be raised # 2d.gradient.object.invalidoffset . If the color cannot be parsed as a CSS color, then a + SYNTAX_ERR exception must be raised # 2d.gradient.object.invalidcolour . Otherwise, the + gradient must have a new stop placed, at offset offset relative to the whole gradient, and with the + color obtained by parsing color as a CSS + <color> value # 2d.gradient.object.update . If multiple stops are added at the same offset + on a gradient, they must be placed in the order added, with the + first one closest to the start of the gradient, and each subsequent + one infinitesimally further along towards the end point (in effect + causing all but the first and last stop added at each point to be + ignored) # 2d.gradient.interpolate.overlap 2d.gradient.interpolate.overlap2 .

            + +

            The createLinearGradient(x0, y0, x1, + y1) method takes four arguments + that represent the start point (x0, y0) and end point (x1, y1) of the gradient. If any of the arguments to createLinearGradient() + are infinite or NaN, the method must raise a + NOT_SUPPORTED_ERR exception # 2d.gradient.linear.nonfinite . Otherwise, the method must + return a linear CanvasGradient initialized with the + specified line # 2d.gradient.object.return .

            + +

            Linear gradients must be rendered such that all points on a line + perpendicular to the line that crosses the start and end points have + the color at the point where those two lines cross (with the colors + coming from the interpolation and + extrapolation described above) # . The points in the linear + gradient must be transformed as described by the current transformation + matrix when rendering # 2d.gradient.linear.transform.1 2d.gradient.linear.transform.2 2d.gradient.linear.transform.3 .

            + +

            If x0 = x1 and y0 = y1, then + the linear gradient must paint nothing # 2d.gradient.interpolate.zerosize .

            + +

            The createRadialGradient(x0, y0, r0, + x1, y1, r1) method takes six arguments, the + first three representing the start circle with origin (x0, y0) and radius r0, and the last three representing the end circle + with origin (x1, y1) and + radius r1. The values are in coordinate space + units. If any of the arguments are infinite or NaN, a + NOT_SUPPORTED_ERR exception must be raised # 2d.gradient.radial.nonfinite . If either + of r0 or r1 are negative, an + INDEX_SIZE_ERR exception must be raised # 2d.gradient.radial.negative . Otherwise, + the method must return a radial CanvasGradient + initialized with the two specified circles # 2d.gradient.object.return .

            + +

            Radial gradients must be rendered by following these steps # 2d.gradient.radial.inside1 2d.gradient.radial.inside2 2d.gradient.radial.inside3 2d.gradient.radial.outside1 2d.gradient.radial.outside2 2d.gradient.radial.outside3 2d.gradient.radial.touch1 2d.gradient.radial.touch2 2d.gradient.radial.touch3 2d.gradient.radial.cone.behind 2d.gradient.radial.cone.front 2d.gradient.radial.cone.bottom 2d.gradient.radial.cone.top 2d.gradient.radial.cone.beside 2d.gradient.radial.cone.cylinder 2d.gradient.radial.cone.shape1 2d.gradient.radial.cone.shape2 :

            + +
            1. If x0 = x1 and y0 = y1 and r0 = r1, then the radial gradient must + paint nothing # 2d.gradient.radial.equal . Abort these steps.

            2. + +
            3. + +

              Let x(ω) = (x1-x0)ω + x0

              + +

              Let y(ω) = (y1-y0)ω + y0

              + +

              Let r(ω) = (r1-r0)ω + r0

              + +

              Let the color at ω be the color at + that position on the gradient (with the colors coming from the interpolation and extrapolation + described above).

              + +
            4. + +
            5. For all values of ω where r(ω) > 0, + starting with the value of ω nearest to + positive infinity and ending with the value of ω nearest to negative infinity, draw the + circumference of the circle with radius r(ω) at position (x(ω), y(ω)), with the color at ω, but only painting on the parts of the + canvas that have not yet been painted on by earlier circles in this + step for this rendering of the gradient.

            6. + +

            This effectively creates a cone, touched by the two + circles defined in the creation of the gradient, with the part of + the cone before the start circle (0.0) using the color of the first + offset, the part of the cone after the end circle (1.0) using the + color of the last offset, and areas outside the cone untouched by + the gradient (transparent black).

            + +

            Gradients must be painted only where the relevant stroking or + filling effects requires that they be drawn # .

            + +

            The points in the radial gradient must be transformed as + described by the current + transformation matrix when rendering # 2d.gradient.radial.transform.1 2d.gradient.radial.transform.2 2d.gradient.radial.transform.3 .

            + + + +
            + +

            Patterns are represented by objects implementing the opaque + CanvasPattern interface.

            + +
            pattern = context . createPattern(image, repetition)
            + +
            + +

            Returns a CanvasPattern object that uses the given image + and repeats in the direction(s) given by the repetition argument.

            + +

            The allowed values for repeat are repeat (both directions), repeat-x (horizontal only), repeat-y (vertical only), and no-repeat (neither). If the repetition argument is empty or null, the value + repeat is used.

            + +

            If the first argument isn't an img, + canvas, or video element, throws a + TYPE_MISMATCH_ERR exception. If the image has no + image data, throws an INVALID_STATE_ERR exception. If + the second argument isn't one of the allowed values, throws a + SYNTAX_ERR exception. If the image isn't yet fully + decoded, then the method returns null.

            + +
            + +
            + +

            To create objects of this type, the createPattern(image, repetition) + method is used. The first argument gives the image to use as the + pattern (either an HTMLImageElement, + HTMLCanvasElement, or HTMLVideoElement + object). Modifying this image after calling the createPattern() method + must not affect the pattern # 2d.pattern.modify.image1 2d.pattern.modify.image2 2d.pattern.modify.canvas1 2d.pattern.modify.canvas2 . The second argument must be a string + with one of the following values: repeat, + repeat-x, repeat-y, + no-repeat. If the empty string or null is + specified, repeat must be assumed # 2d.pattern.repeat.empty 2d.pattern.repeat.null . If an + unrecognized value is given, then the user agent must raise a + SYNTAX_ERR exception # 2d.pattern.repeat.undefined 2d.pattern.repeat.unrecognised . User agents must recognize the + four values described above exactly (e.g. they must not do case + folding) # 2d.pattern.repeat.case 2d.pattern.repeat.nullsuffix . The method must return a CanvasPattern object + suitably initialized # 2d.pattern.basic.type .

            + +

            The image argument is an instance of either + HTMLImageElement, HTMLCanvasElement, or + HTMLVideoElement. If the image is + of the wrong type or null, the implementation must raise a + TYPE_MISMATCH_ERR exception # 2d.pattern.image.undefined 2d.pattern.image.null 2d.pattern.image.string .

            + + +

            If the image argument is an + HTMLImageElement object whose complete attribute is false # 2d.pattern.image.incomplete 2d.pattern.image.broken , or + if the image argument is an + HTMLVideoElement object whose readyState attribute is either + HAVE_NOTHING or HAVE_METADATA # , then the + implementation must return null.

            + + +

            If the image argument is an + HTMLCanvasElement object with either a horizontal + dimension or a vertical dimension equal to zero, then the + implementation must raise an INVALID_STATE_ERR + exception # 2d.pattern.basic.zerocanvas .

            + + +

            Patterns must be painted so that the top left of the first image + is anchored at the origin of the coordinate space, and images are + then repeated horizontally to the left and right (if the + repeat-x string was specified) or vertically up and + down (if the repeat-y string was specified) or in all + four directions all over the canvas (if the repeat + string was specified) # 2d.pattern.basic.image 2d.pattern.basic.canvas 2d.pattern.basic.nocontext 2d.pattern.paint.norepeat.basic 2d.pattern.paint.norepeat.outside 2d.pattern.paint.norepeat.coord1 2d.pattern.paint.norepeat.coord2 2d.pattern.paint.norepeat.coord3 2d.pattern.paint.repeat.basic 2d.pattern.paint.repeat.outside 2d.pattern.paint.repeat.coord1 2d.pattern.paint.repeat.coord2 2d.pattern.paint.repeat.coord3 2d.pattern.paint.repeatx.basic 2d.pattern.paint.repeatx.outside 2d.pattern.paint.repeatx.coord1 2d.pattern.paint.repeaty.basic 2d.pattern.paint.repeaty.outside 2d.pattern.paint.repeaty.coord1 2d.pattern.paint.orientation.image 2d.pattern.paint.orientation.canvas . The images are not scaled by this process; + one CSS pixel of the image must be painted on one coordinate space + unit # . Of course, patterns must actually be painted only where the + stroking or filling effect requires that they be drawn # , and are + affected by the current transformation matrix.

            + +

            When the createPattern() method + is passed an animated image as its image + argument, the user agent must use the poster frame of the animation, + or, if there is no poster frame, the first frame of the + animation # 2d.pattern.animated.gif .

            + + +

            When the image argument is an + HTMLVideoElement, then the frame at the current + playback position must be used as the source image # , and the + source image's dimensions must be the intrinsic width and + intrinsic height + of the media resource (i.e. after any aspect-ratio + correction has been applied) # .

            + + + + +
            + + + +
            4.8.10.1.5 Line styles
            + +
            context . lineWidth [ = value ]
            + +
            + +

            Returns the current line width.

            + +

            Can be set, to change the line width. Values that are not + finite values greater than zero are ignored.

            + +
            + +
            context . lineCap [ = value ]
            + +
            + +

            Returns the current line cap style.

            + +

            Can be set, to change the line cap style.

            + +

            The possible line cap styles are butt, + round, and square. Other values are + ignored.

            + +
            + +
            context . lineJoin [ = value ]
            + +
            + +

            Returns the current line join style.

            + +

            Can be set, to change the line join style.

            + +

            The possible line join styles are bevel, + round, and miter. Other values are + ignored.

            + +
            + +
            context . miterLimit [ = value ]
            + +
            + +

            Returns the current miter limit ratio.

            + +

            Can be set, to change the miter limit ratio. Values that are + not finite values greater than zero are ignored.

            + +
            + +
            + +

            The lineWidth + attribute gives the width of lines, in coordinate space units # 2d.line.width.basic 2d.line.width.transformed 2d.line.width.scaledefault . On + getting, it must return the current value # 2d.line.width.valid . On setting, zero, + negative, infinite, and NaN values must be ignored, leaving the + value unchanged # 2d.line.width.invalid ; other values must change the current value to the + new value # 2d.line.width.valid .

            + +

            When the context is created, the lineWidth attribute must + initially have the value 1.0 # 2d.line.defaults .

            + +

            The lineCap attribute + defines the type of endings that UAs will place on the end of + lines # 2d.line.cap.open 2d.line.cap.closed . The three valid values are butt, + round, and square. The butt + value means that the end of each line has a flat edge perpendicular + to the direction of the line (and that no additional line cap is + added) # 2d.line.cap.butt . The round value means that a semi-circle with + the diameter equal to the width of the line must then be added on to + the end of the line # 2d.line.cap.round . The square value means that a + rectangle with the length of the line width and the width of half + the line width, placed flat against the edge perpendicular to the + direction of the line, must be added at the end of each line # 2d.line.cap.square .

            + +

            On getting, it must return the current value # 2d.line.cap.valid . On setting, if the + new value is one of the literal strings butt, + round, and square, then the current value + must be changed to the new value # 2d.line.cap.valid ; other values must ignored, leaving + the value unchanged # 2d.line.cap.invalid .

            + +

            When the context is created, the lineCap attribute must + initially have the value butt # 2d.line.defaults .

            + +

            The lineJoin + attribute defines the type of corners that UAs will place where two + lines meet. The three valid values are bevel, + round, and miter.

            + +

            On getting, it must return the current value # 2d.line.join.valid . On setting, if the + new value is one of the literal strings bevel, + round, and miter, then the current value + must be changed to the new value # 2d.line.join.valid ; other values must be ignored, + leaving the value unchanged # 2d.line.join.invalid .

            + +

            When the context is created, the lineJoin attribute must + initially have the value miter # 2d.line.defaults .

            + +

            A join exists at any point in a subpath shared by two consecutive + lines # 2d.line.join.open 2d.line.join.parallel . When a subpath is closed, then a join also exists at its + first point (equivalent to its last point) connecting the first and + last lines in the subpath # 2d.line.join.closed .

            + +

            In addition to the point where the join occurs, two additional + points are relevant to each join, one for each line: the two corners + found half the line width away from the join point, one + perpendicular to each line, each on the side furthest from the other + line.

            + +

            A filled triangle connecting these two opposite corners with a + straight line, with the third point of the triangle being the join + point, must be rendered at all joins # 2d.line.join.bevel . The lineJoin attribute controls + whether anything else is rendered. The three aforementioned values + have the following meanings:

            + +

            The bevel value means that this is all that is + rendered at joins # 2d.line.join.bevel .

            + +

            The round value means that a filled arc connecting + the two aforementioned corners of the join, abutting (and not + overlapping) the aforementioned triangle, with the diameter equal to + the line width and the origin at the point of the join, must be + rendered at joins # 2d.line.join.round .

            + +

            The miter value means that a second filled triangle + must (if it can given the miter length) be rendered at the join, + with one line being the line between the two aforementioned corners, + abutting the first triangle, and the other two being continuations of + the outside edges of the two joining lines, as long as required to + intersect without going over the miter length # 2d.line.join.miter 2d.line.miter.exceeded 2d.line.miter.acute 2d.line.miter.obtuse 2d.line.miter.rightangle 2d.line.miter.lineedge 2d.line.miter.within .

            + +

            The miter length is the distance from the point where the join + occurs to the intersection of the line edges on the outside of the + join. The miter limit ratio is the maximum allowed ratio of the + miter length to half the line width. If the miter length would cause + the miter limit ratio to be exceeded, this second triangle must not + be rendered # 2d.line.miter.exceeded 2d.line.miter.acute 2d.line.miter.obtuse .

            + +

            The miter limit ratio can be explicitly set using the miterLimit + attribute. On getting, it must return the current value # 2d.line.miter.valid . On setting, + zero, negative, infinite, and NaN values must be ignored, leaving + the value unchanged # 2d.line.miter.invalid ; other values must change the current value to + the new value # 2d.line.miter.valid .

            + +

            When the context is created, the miterLimit attribute must + initially have the value 10.0 # 2d.line.defaults .

            + + + +
            + + +
            4.8.10.1.6 Shadows
            + +

            All drawing operations are affected by the four global shadow + attributes.

            + +
            context . shadowColor [ = value ]
            + +
            + +

            Returns the current shadow color.

            + +

            Can be set, to change the shadow color. Values that cannot be parsed as CSS colors are ignored.

            + +
            + +
            context . shadowOffsetX [ = value ]
            +
            context . shadowOffsetY [ = value ]
            + +
            + +

            Returns the current shadow offset.

            + +

            Can be set, to change the shadow offset. Values that are not finite numbers are ignored.

            + +
            + +
            context . shadowBlur [ = value ]
            + +
            + +

            Returns the current level of blur applied to shadows.

            + +

            Can be set, to change the blur level. Values that are not finite numbers greater than or equal to zero are ignored.

            + +
            + +
            + +

            The shadowColor + attribute sets the color of the shadow.

            + +

            When the context is created, the shadowColor attribute + initially must be fully-transparent black # 2d.shadow.attributes.shadowColor.initial .

            + +

            On getting, the serialization of the color must be returned # 2d.shadow.attributes.shadowColor.valid .

            + +

            On setting, the new value must be parsed as a CSS <color> + value and the color assigned # 2d.shadow.attributes.shadowColor.valid . If the value is not a valid color, + then it must be ignored, and the attribute must retain its previous + value # 2d.shadow.attributes.shadowColor.invalid . [CSSCOLOR]

            + +

            The shadowOffsetX + and shadowOffsetY + attributes specify the distance that the shadow will be offset in + the positive horizontal and positive vertical distance + respectively. Their values are in coordinate space units. They are + not affected by the current transformation matrix.

            + +

            When the context is created, the shadow offset attributes must + initially have the value 0 # 2d.shadow.attributes.shadowOffset.initial .

            + +

            On getting, they must return their current value # 2d.shadow.attributes.shadowOffset.valid . On setting, the + attribute being set must be set to the new value # 2d.shadow.attributes.shadowOffset.valid , except if the + value is infinite or NaN, in which case the new value must be + ignored # 2d.shadow.attributes.shadowOffset.invalid .

            + +

            The shadowBlur + attribute specifies the size of the blurring effect. (The units do + not map to coordinate space units, and are not affected by the + current transformation matrix.)

            + +

            When the context is created, the shadowBlur attribute must + initially have the value 0 # 2d.shadow.attributes.shadowBlur.initial .

            + +

            On getting, the attribute must return its current value # 2d.shadow.attributes.shadowBlur.initial 2d.shadow.attributes.shadowBlur.valid . On + setting the attribute must be set to the new value # 2d.shadow.attributes.shadowBlur.valid , except if the + value is negative, infinite or NaN, in which case the new value must + be ignored # 2d.shadow.attributes.shadowBlur.invalid .

            + +

            Shadows are only drawn + if the opacity component of the alpha component of the color + of shadowColor is + non-zero and either the shadowBlur is non-zero, or + the shadowOffsetX + is non-zero, or the shadowOffsetY is + non-zero # 2d.shadow.enable.off.1 2d.shadow.enable.off.2 2d.shadow.enable.blur 2d.shadow.enable.x 2d.shadow.enable.y .

            + +

            When shadows are drawn, they must be rendered as follows # 2d.shadow.enable.off.1 2d.shadow.enable.off.2 2d.shadow.enable.blur 2d.shadow.enable.x 2d.shadow.enable.y 2d.shadow.offset.positiveX 2d.shadow.offset.negativeX 2d.shadow.offset.positiveY 2d.shadow.offset.negativeY 2d.shadow.outside 2d.shadow.clip.1 2d.shadow.clip.2 2d.shadow.clip.3 2d.shadow.stroke.basic 2d.shadow.stroke.cap.1 2d.shadow.stroke.cap.2 2d.shadow.stroke.join.1 2d.shadow.stroke.join.2 2d.shadow.stroke.join.3 2d.shadow.image.basic 2d.shadow.image.transparent.1 2d.shadow.image.transparent.2 2d.shadow.image.alpha 2d.shadow.image.section 2d.shadow.image.scale 2d.shadow.canvas.basic 2d.shadow.canvas.transparent.1 2d.shadow.canvas.transparent.2 2d.shadow.canvas.alpha 2d.shadow.pattern.basic 2d.shadow.pattern.transparent.1 2d.shadow.pattern.transparent.2 2d.shadow.pattern.alpha 2d.shadow.gradient.basic 2d.shadow.gradient.transparent.1 2d.shadow.gradient.transparent.2 2d.shadow.gradient.alpha 2d.shadow.transform.1 2d.shadow.transform.2 2d.shadow.blur.low 2d.shadow.blur.high 2d.shadow.alpha.1 2d.shadow.alpha.2 2d.shadow.alpha.3 2d.shadow.alpha.4 2d.shadow.alpha.5 2d.shadow.composite.1 2d.shadow.composite.2 2d.shadow.composite.3 :

            + +
            1. Let A be an infinite transparent black + bitmap on which the source image for which a shadow is being + created has been rendered.

            2. + +
            3. Let B be an infinite transparent black + bitmap, with a coordinate space and an origin identical to A.

            4. + +
            5. Copy the alpha channel of A to B, offset by shadowOffsetX in the + positive x direction, and shadowOffsetY in the + positive y direction.

            6. + +
            7. If shadowBlur is greater than + 0:

              + +
              1. If shadowBlur is less than + 8, let σ be half the value of shadowBlur; otherwise, + let σ be the square root of multiplying + the value of shadowBlur by + 2.

              2. + +
              3. Perform a 2D Gaussian Blur on B, + using σ as the standard deviation.

                +
              4. + +

              User agents may limit values of σ to + an implementation-specific maximum value to avoid exceeding + hardware limitations during the Gaussian blur operation.

              + +
            8. + +
            9. Set the red, green, and blue components of every pixel in + B to the red, green, and blue components + (respectively) of the color of shadowColor.

            10. + +
            11. Multiply the alpha component of every pixel in B by the alpha component of the color of shadowColor.

            12. + +
            13. The shadow is in the bitmap B, and is + rendered as part of the drawing model described below.

            14. + +
            + +

            If the current composition operation is copy, shadows effectively won't render + (since the shape will overwrite the shadow).

            + + +
            4.8.10.1.7 Simple shapes (rectangles)
            + +

            There are three methods that immediately draw rectangles to the + bitmap. They each take four arguments; the first two give the x and y coordinates of the top + left of the rectangle, and the second two give the width w and height h of the rectangle, + respectively.

            + +
            + +

            The current + transformation matrix must be applied to the following four + coordinates # , which form the path that must then be closed to get the + specified rectangle # : (x, y), (x+w, y), + (x+w, + y+h), + (x, y+h).

            + +

            Shapes are painted without affecting the current path, and are + subject to the clipping region, + and, with the exception of clearRect(), also shadow effects, global alpha, and global composition + operators.

            + +
            + +
            context . clearRect(x, y, w, h)
            + +
            + +

            Clears all pixels on the canvas in the given rectangle to transparent black.

            + +
            + +
            context . fillRect(x, y, w, h)
            + +
            + +

            Paints the given rectangle onto the canvas, using the current fill style.

            + +
            + +
            context . strokeRect(x, y, w, h)
            + +
            + +

            Paints the box that outlines the given rectangle onto the canvas, using the current stroke style.

            + +
            + +
            + +

            The clearRect(x, y, w, h) method must clear the pixels in the + specified rectangle that also intersect the current clipping region + to a fully transparent black, erasing any previous image # 2d.clearRect.basic 2d.clearRect.path 2d.clearRect.zero 2d.clearRect.negative 2d.clearRect.transform 2d.clearRect.globalalpha 2d.clearRect.globalcomposite 2d.clearRect.clip 2d.clearRect.shadow . If either + height or width are zero, this method has no effect.

            + +

            The fillRect(x, y, w, h) method must paint the specified + rectangular area using the fillStyle # 2d.fillRect.basic 2d.fillRect.path 2d.fillRect.zero 2d.fillRect.negative 2d.fillRect.transform 2d.fillRect.clip 2d.fillRect.shadow . If either height + or width are zero, this method has no effect.

            + +

            The strokeRect(x, y, w, h) method must stroke the specified + rectangle's path using the strokeStyle, lineWidth, lineJoin, and (if + appropriate) miterLimit attributes # 2d.strokeRect.basic 2d.strokeRect.path 2d.strokeRect.zero.1 2d.strokeRect.zero.2 2d.strokeRect.zero.3 2d.strokeRect.zero.4 2d.strokeRect.zero.5 2d.strokeRect.negative 2d.strokeRect.transform 2d.strokeRect.globalalpha 2d.strokeRect.globalcomposite 2d.strokeRect.clip 2d.strokeRect.shadow . If + both height and width are zero, this method has no effect, since + there is no path to stroke (it's a point). If only one of the two is + zero, then the method will draw a line instead (the path for the + outline is just a straight line along the non-zero dimension).

            + +
            + + +
            4.8.10.1.8 Complex shapes (paths)
            + +

            The context always has a current path. There is only one current + path, it is not part of the drawing state.

            + +

            A path has a list of zero or more subpaths. Each + subpath consists of a list of one or more points, connected by + straight or curved lines, and a flag indicating whether the subpath + is closed or not. A closed subpath is one where the last point of + the subpath is connected to the first point of the subpath by a + straight line. Subpaths with fewer than two points are ignored when + painting the path.

            + +
            context . beginPath()
            + +
            + +

            Resets the current path.

            + +
            + +
            context . moveTo(x, y)
            + +
            + +

            Creates a new subpath with the given point.

            + +
            + +
            context . closePath()
            + +
            + +

            Marks the current subpath as closed, and starts a new subpath with a point the same as the start and end of the newly closed subpath.

            + +
            + +
            context . lineTo(x, y)
            + +
            + +

            Adds the given point to the current subpath, connected to the previous one by a straight line.

            + +
            + +
            context . quadraticCurveTo(cpx, cpy, x, y)
            + +
            + +

            Adds the given point to the current path, connected to the previous one by a quadratic Bézier curve with the given control point.

            + +
            + +
            context . bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y)
            + +
            + +

            Adds the given point to the current path, connected to the previous one by a cubic Bézier curve with the given control points.

            + +
            + +
            context . arcTo(x1, y1, x2, y2, radius)
            + +
            + +

            Adds a point to the current path, connected to the previous one + by a straight line, then adds a second point to the current path, + connected to the previous one by an arc whose properties are + described by the arguments.

            + +

            Throws an INDEX_SIZE_ERR exception if the given + radius is negative.

            + +
            + +
            context . arc(x, y, radius, startAngle, endAngle, anticlockwise)
            + +
            + +

            Adds points to the subpath such that the arc described by the + circumference of the circle described by the arguments, starting + at the given start angle and ending at the given end angle, going + in the given direction, is added to the path, connected to the + previous point by a straight line.

            + +

            Throws an INDEX_SIZE_ERR exception if the given + radius is negative.

            + +
            + +
            context . rect(x, y, w, h)
            + +
            + +

            Adds a new closed subpath to the path, representing the given rectangle.

            + +
            + +
            context . fill()
            + +
            + +

            Fills the subpaths with the current fill style.

            + +
            + +
            context . stroke()
            + +
            + +

            Strokes the subpaths with the current stroke style.

            + +
            + +
            context . clip()
            + +
            + +

            Further constrains the clipping region to the given path.

            + +
            + +
            context . isPointInPath(x, y)
            + +
            + +

            Returns true if the given point is in the current path.

            + +
            + +
            + +

            Initially, the context's path must have zero subpaths # 2d.path.initial .

            + +

            The points and lines added to the path by these methods must be + transformed according to the current transformation + matrix as they are added # 2d.path.arc.scale.1 2d.path.stroke.scale1 2d.path.stroke.scale2 2d.path.stroke.skew 2d.path.transformation.basic 2d.path.transformation.multiple 2d.path.transformation.changing .

            + + +

            The beginPath() + method must empty the list of subpaths so that the context once + again has zero subpaths # 2d.path.beginPath .

            + + +

            The moveTo(x, y) method must + create a new subpath with the specified point as its first (and + only) point # 2d.path.moveTo.basic 2d.path.moveTo.newsubpath 2d.path.moveTo.multiple .

            + +

            When the user agent is to ensure there is a subpath + for a coordinate (x, y), the + user agent must check to see if the context has any subpaths, and if + it does not, then the user agent must create a new subpath with the + point (x, y) as its first + (and only) point, as if the moveTo() method had been + called # 2d.path.lineTo.ensuresubpath.1 2d.path.lineTo.ensuresubpath.2 2d.path.quadraticCurveTo.ensuresubpath.1 2d.path.quadraticCurveTo.ensuresubpath.2 2d.path.bezierCurveTo.ensuresubpath.1 2d.path.bezierCurveTo.ensuresubpath.2 2d.path.arcTo.ensuresubpath.1 2d.path.arcTo.ensuresubpath.2 .

            + + +

            The closePath() + method must do nothing if the context has no subpaths # 2d.path.closePath.empty . Otherwise, it + must mark the last subpath as closed, create a new subpath whose + first point is the same as the previous subpath's first point, and + finally add this new subpath to the path # 2d.path.closePath.newline 2d.path.closePath.nextpoint .

            + +

            If the last subpath had more than one point in its + list of points, then this is equivalent to adding a straight line + connecting the last point back to the first point, thus "closing" + the shape, and then repeating the last (possibly implied) moveTo() call.

            + + +

            New points and the lines connecting them are added to subpaths + using the methods described below. In all cases, the methods only + modify the last subpath in the context's paths.

            + + +

            The lineTo(x, y) method must + ensure there is a subpath for (x, y) if the context has + no subpaths # 2d.path.lineTo.ensuresubpath.1 2d.path.lineTo.ensuresubpath.2 . Otherwise, it must connect the last point in the + subpath to the given point (x, y) using a straight line, and must then add the given + point (x, y) to the + subpath # 2d.path.lineTo.basic 2d.path.lineTo.nextpoint .

            + + +

            The quadraticCurveTo(cpx, cpy, x, + y) method must ensure there + is a subpath for (cpx, + cpy) # 2d.path.quadraticCurveTo.ensuresubpath.1 2d.path.quadraticCurveTo.ensuresubpath.2 , and then must connect the last + point in the subpath to the given point (x, y) using a quadratic Bézier curve with control + point (cpx, cpy), and must + then add the given point (x, y) to the subpath # 2d.path.quadraticCurveTo.basic 2d.path.quadraticCurveTo.shape 2d.path.quadraticCurveTo.scaled . [BEZIER]

            + + +

            The bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y) method must + ensure there is a subpath for (cp1x, cp1y) # 2d.path.bezierCurveTo.ensuresubpath.1 2d.path.bezierCurveTo.ensuresubpath.2 , and then must + connect the last point in the subpath to the given point (x, y) using a cubic Bézier + curve with control points (cp1x, cp1y) and (cp2x, cp2y). Then, it must add the point (x, y) to the subpath # 2d.path.bezierCurveTo.basic 2d.path.bezierCurveTo.shape 2d.path.bezierCurveTo.scaled . [BEZIER]

            + +

            The arcTo(x1, y1, x2, + y2, radius) + method must first ensure there is a subpath for (x1, y1) # 2d.path.arcTo.ensuresubpath.1 2d.path.arcTo.ensuresubpath.2 . Then, the behavior depends on the + arguments and the last point in the subpath, as described below.

            + +

            Negative values for radius must cause the + implementation to raise an INDEX_SIZE_ERR + exception # 2d.path.arcTo.negative .

            + +

            Let the point (x0, y0) be + the last point in the subpath.

            + +

            If the point (x0, y0) is + equal to the point (x1, y1) # 2d.path.arcTo.coincide.1 , + or if the point (x1, y1) is + equal to the point (x2, y2) # 2d.path.arcTo.coincide.2 , + or if the radius radius is zero # 2d.path.arcTo.zero.1 2d.path.arcTo.zero.2 , then the method + must add the point (x1, y1) + to the subpath, and connect that point to the previous point (x0, y0) by a straight line.

            + +

            Otherwise, if the points (x0, y0), (x1, y1), and (x2, y2) all lie on a single straight line, then the + method must add the point (x1, y1) to the subpath, and connect that point to the + previous point (x0, y0) by a + straight line # 2d.path.arcTo.collinear.1 2d.path.arcTo.collinear.2 2d.path.arcTo.collinear.3 .

            + +

            Otherwise, let The Arc be the shortest arc + given by circumference of the circle that has radius radius, and that has one point tangent to the + half-infinite line that crosses the point (x0, + y0) and ends at the point (x1, y1), and that has a different + point tangent to the half-infinite line that ends at the point (x1, y1) and crosses the point + (x2, y2). The points at + which this circle touches these two lines are called the start and + end tangent points respectively. The method must connect the point + (x0, y0) to the start + tangent point by a straight line, adding the start tangent point to + the subpath, and then must connect the start tangent point to the + end tangent point by The Arc, adding the end + tangent point to the subpath # 2d.path.arcTo.shape.curve1 2d.path.arcTo.shape.curve2 2d.path.arcTo.shape.start 2d.path.arcTo.shape.end .

            + +

            The arc(x, y, radius, + startAngle, endAngle, anticlockwise) method draws an arc. If + the context has any subpaths, then the method must add a straight + line from the last point in the subpath to the start point of the + arc # 2d.path.arc.empty 2d.path.arc.nonempty . In any case, it must draw the arc between the start point of + the arc and the end point of the arc, and add the start and end + points of the arc to the subpath # 2d.path.arc.end 2d.path.arc.angle.1 2d.path.arc.angle.2 2d.path.arc.angle.3 2d.path.arc.angle.4 2d.path.arc.angle.5 2d.path.arc.angle.6 2d.path.arc.zero.1 2d.path.arc.zero.2 2d.path.arc.twopie.1 2d.path.arc.twopie.2 2d.path.arc.twopie.3 2d.path.arc.twopie.4 2d.path.arc.shape.1 2d.path.arc.shape.2 2d.path.arc.shape.3 2d.path.arc.shape.4 2d.path.arc.shape.5 2d.path.arc.selfintersect.1 2d.path.arc.selfintersect.2 2d.path.arc.scale.2 . The arc and its start and end + points are defined as follows:

            + +

            Consider a circle that has its origin at (x, + y) and that has radius radius. The points at startAngle + and endAngle along this circle's circumference, + measured in radians clockwise from the positive x-axis, are the + start and end points respectively.

            + +

            If the anticlockwise argument is false and + endAngle-startAngle is equal to or greater than + , or, if the anticlockwise + argument is true and startAngle-endAngle is + equal to or greater than , then the arc is the + whole circumference of this circle.

            + + + +

            Otherwise, the arc is the path along the circumference of this + circle from the start point to the end point, going anti-clockwise + if the anticlockwise argument is true, and + clockwise otherwise. Since the points are on the circle, as opposed + to being simply angles from zero, the arc can never cover an angle + greater than radians. If the two points are the + same, or if the radius is zero # 2d.path.arc.zeroradius , then the arc is defined as being of + zero length in both directions.

            + +

            Negative values for radius must cause the + implementation to raise an INDEX_SIZE_ERR + exception # 2d.path.arc.negative .

            + +

            The rect(x, y, w, h) method must create a new subpath + containing just the four points (x, y), (x+w, + y), (x+w, y+h), + (x, y+h), with those four points connected by straight + lines # 2d.path.rect.basic 2d.path.rect.newsubpath 2d.path.rect.zero.1 2d.path.rect.zero.2 2d.path.rect.zero.3 2d.path.rect.zero.4 2d.path.rect.zero.5 2d.path.rect.zero.6 2d.path.rect.negative 2d.path.rect.winding , and must then mark the subpath as closed # 2d.path.rect.closed . It must then create + a new subpath with the point (x, y) as the only point in the subpath # 2d.path.rect.end.1 2d.path.rect.end.2 .

            + + + + + +

            The fill() + method must fill all the subpaths of the current path, using + fillStyle, and using + the non-zero winding number rule # 2d.path.fill.overlap 2d.path.fill.winding.add 2d.path.fill.winding.subtract.1 2d.path.fill.winding.subtract.2 2d.path.fill.winding.subtract.3 . Open subpaths must be implicitly + closed when being filled (without affecting the actual + subpaths) # 2d.path.fill.closed.basic 2d.path.fill.closed.unaffected .

            + +

            Thus, if two overlapping but otherwise independent + subpaths have opposite windings, they cancel out and result in no + fill. If they have the same winding, that area just gets painted + once.

            + +

            The stroke() method + must calculate the strokes of all the subpaths of the current path, + using the lineWidth, + lineCap, lineJoin, and (if + appropriate) miterLimit attributes, and + then fill the combined stroke area using the strokeStyle + attribute # 2d.path.stroke.overlap 2d.path.stroke.union 2d.path.stroke.unaffected .

            + +

            Since the subpaths are all stroked as one, + overlapping parts of the paths in one stroke operation are treated + as if their union was what was painted.

            + +

            Paths, when filled or stroked, must be painted without affecting + the current path # , and must be subject to shadow effects, global alpha, the clipping region, and global composition + operators # . (Transformations affect the path when the path is + created, not when it is painted, though the stroke style is + still affected by the transformation during painting.)

            + +

            Zero-length line segments must be pruned before stroking a + path # 2d.path.stroke.prune.line 2d.path.stroke.prune.closed 2d.path.stroke.prune.curve 2d.path.stroke.prune.arc 2d.path.stroke.prune.rect 2d.path.stroke.prune.corner . Empty subpaths must be ignored # 2d.path.stroke.empty .

            + + +

            The clip() + method must create a new clipping region by calculating + the intersection of the current clipping region and the area + described by the current path, using the non-zero winding number + rule # 2d.path.clip.empty 2d.path.clip.basic.1 2d.path.clip.basic.2 2d.path.clip.intersect 2d.path.clip.winding.1 2d.path.clip.winding.2 . Open subpaths must be implicitly closed when computing the + clipping region, without affecting the actual subpaths # 2d.path.clip.unaffected . The new + clipping region replaces the current clipping region.

            + +

            When the context is initialized, the clipping region must be set + to the rectangle with the top left corner at (0,0) and the width and + height of the coordinate space # .

            + + + + +

            The isPointInPath(x, y) method must + return true if the point given by the x and y coordinates passed to the method, when treated as + coordinates in the canvas coordinate space unaffected by the current + transformation, is inside the current path as determined by the + non-zero winding number rule; and must return false + otherwise # 2d.path.isPointInPath.basic.1 2d.path.isPointInPath.basic.2 2d.path.isPointInPath.empty 2d.path.isPointInPath.subpath 2d.path.isPointInPath.outside 2d.path.isPointInPath.unclosed 2d.path.isPointInPath.arc 2d.path.isPointInPath.bigarc 2d.path.isPointInPath.bezier 2d.path.isPointInPath.winding 2d.path.isPointInPath.transform.1 2d.path.isPointInPath.transform.2 2d.path.isPointInPath.transform.3 . Points on the path itself are considered to be inside the + path # 2d.path.isPointInPath.edge . If either of the arguments is infinite or NaN, then the method + must return false # 2d.path.isPointInPath.nonfinite .

            + +
            + + +
            4.8.10.1.9 Focus management
            + +

            When a canvas is interactive, authors should include focusable + elements in the element's fallback content corresponding to each + focusable part of the canvas.

            + +

            To indicate which focusable part of the canvas is currently + focused, authors should use the drawFocusRing() method, + passing it the element for which a ring is being drawn. This method + only draws the focus ring if the element is focused, so that it can + simply be called whenever drawing the element, without checking + whether the element is focused or not first. The position of the + center of the control, or of the editing caret if the control has + one, should be given in the x and y arguments.

            + +
            shouldDraw = context . drawFocusRing(element, x, y, [ canDrawCustom ])
            + +
            + +

            If the given element is focused, draws a focus ring around the + current path, following the platform conventions for focus + rings. The given coordinate is used if the user's attention needs + to be brought to a particular position (e.g. if a magnifier is + following the editing caret in a text field).

            + +

            If the canDrawCustom argument is true, then + the focus ring is only drawn if the user has configured his system + to draw focus rings in a particular manner. (For example, high + contrast focus rings.)

            + +

            Returns true if the given element is focused, the canDrawCustom argument is true, and the user has + not configured his system to draw focus rings in a particular + manner. Otherwise, returns false.

            + +

            When the method returns true, the author is expected to + manually draw a focus ring.

            + +
            + +
            + +

            The drawFocusRing(element, x, y, [canDrawCustom]) + method, when invoked, must run the following steps:

            + +
            1. If element is not focused or is not a + descendant of the element with whose context the method is + associated, then return false and abort these steps.

            2. + +
            3. Transform the given point (x, y) according to the current transformation + matrix.

            4. + +
            5. Optionally, inform the user that the focus is at the given + (transformed) coordinate on the canvas. (For example, this could + involve moving the user's magnification tool.)

            6. + +
            7. + +

              If the user has requested the use of particular focus rings + (e.g. high-contrast focus rings), or if the canDrawCustom argument is absent or false, then + draw a focus ring of the appropriate style along the path, + following platform conventions, return false, and abort these + steps.

              + +

              The focus ring should not be subject to the shadow effects, the global alpha, or the global composition + operators, but should be subject to the clipping region.

              + +
            8. + +
            9. Return true.

            10. + +
            + +
            + +

            This canvas element has a couple of checkboxes:

            + +
            <canvas height=400 width=750>
            + <label><input type=checkbox id=showA> Show As</label>
            + <label><input type=checkbox id=showB> Show Bs</label>
            + <!-- ... -->
            +</canvas>
            +<script>
            + function drawCheckbox(context, element, x, y) {
            +   context.save();
            +   context.font = '10px sans-serif';
            +   context.textAlign = 'left';
            +   context.textBaseline = 'middle';
            +   var metrics = context.measureText(element.labels[0].textContent);
            +   context.beginPath();
            +   context.strokeStyle = 'black';
            +   context.rect(x-5, y-5, 10, 10);
            +   context.stroke();
            +   if (element.checked) {
            +     context.fillStyle = 'black';
            +     context.fill();
            +   }
            +   context.fillText(element.labels[0].textContent, x+5, y);
            +   context.beginPath();
            +   context.rect(x-7, y-7, 12 + metrics.width+2, 14);
            +   if (context.drawFocusRing(element, x, y, true)) {
            +     context.strokeStyle = 'silver';
            +     context.stroke();
            +   }
            +   context.restore();
            + }
            + function drawBase() { /* ... */ }
            + function drawAs() { /* ... */ }
            + function drawBs() { /* ... */ }
            + function redraw() {
            +   var canvas = document.getElementsByTagName('canvas')[0];
            +   var context = canvas.getContext('2d');
            +   context.clearRect(0, 0, canvas.width, canvas.height);
            +   drawCheckbox(context, document.getElementById('showA'), 20, 40);
            +   drawCheckbox(context, document.getElementById('showB'), 20, 60);
            +   drawBase();
            +   if (document.getElementById('showA').checked)
            +     drawAs();
            +   if (document.getElementById('showB').checked)
            +     drawBs();
            + }
            + function processClick(event) {
            +   var canvas = document.getElementsByTagName('canvas')[0];
            +   var context = canvas.getContext('2d');
            +   var x = event.clientX - canvas.offsetLeft;
            +   var y = event.clientY - canvas.offsetTop;
            +   drawCheckbox(context, document.getElementById('showA'), 20, 40);
            +   if (context.isPointInPath(x, y))
            +     document.getElementById('showA').checked = !(document.getElementById('showA').checked);
            +   drawCheckbox(context, document.getElementById('showB'), 20, 60);
            +   if (context.isPointInPath(x, y))
            +     document.getElementById('showB').checked = !(document.getElementById('showB').checked);
            +   redraw();
            + }
            + document.getElementsByTagName('canvas')[0].addEventListener('focus', redraw, true);
            + document.getElementsByTagName('canvas')[0].addEventListener('blur', redraw, true);
            + document.getElementsByTagName('canvas')[0].addEventListener('change', redraw, true);
            + document.getElementsByTagName('canvas')[0].addEventListener('click', processClick, false);
            + redraw();
            +</script>
            + + +
            + + +
            4.8.10.1.10 Text
            + +
            context . font [ = value ]
            + +
            + +

            Returns the current font settings.

            + +

            Can be set, to change the font. The syntax is the same as for + the CSS 'font' property; values that cannot be parsed as CSS font + values are ignored.

            + +

            Relative keywords and lengths are computed relative to the font + of the canvas element.

            + +
            + +
            context . textAlign [ = value ]
            + +
            + +

            Returns the current text alignment settings.

            + +

            Can be set, to change the alignment. The possible values are + start, end, left, right, and center. Other values are ignored. The default is + start.

            + +
            + +
            context . textBaseline [ = value ]
            + +
            + +

            Returns the current baseline alignment settings.

            + +

            Can be set, to change the baseline alignment. The possible + values and their meanings are given below. Other values are + ignored. The default is alphabetic.

            + +
            + +
            context . fillText(text, x, y [, maxWidth ] )
            +
            context . strokeText(text, x, y [, maxWidth ] )
            + +
            + +

            Fills or strokes (respectively) the given text at the given + position. If a maximum width is provided, the text will be scaled + to fit that width if necessary.

            + +
            + +
            metrics = context . measureText(text)
            + +
            + +

            Returns a TextMetrics object with the metrics of the given text in the current font.

            + +
            + +
            metrics . width
            + +
            + +

            Returns the advance width of the text that was passed to the + measureText() + method.

            + +
            + +
            + +

            The font IDL + attribute, on setting, must be parsed the same way as the 'font' + property of CSS (but without supporting property-independent style + sheet syntax like 'inherit') # 2d.text.font.parse.basic 2d.text.font.parse.complex 2d.text.font.parse.size.percentage 2d.text.font.parse.system , and the resulting font must be + assigned to the context, with the 'line-height' component forced to + 'normal' # 2d.text.font.parse.complex , with the 'font-size' component converted to CSS pixels # 2d.text.font.parse.size.percentage , + and with system fonts being computed to explicit values # 2d.text.font.parse.system . If the new + value is syntactically incorrect (including using + property-independent style sheet syntax like 'inherit' or + 'initial'), then it must be ignored, without assigning a new font + value # 2d.text.font.parse.invalid . [CSS]

            + +

            Font names must be interpreted in the context of the + canvas element's stylesheets; any fonts embedded using + @font-face must therefore be available once + they are loaded # 2d.text.draw.fontface 2d.text.draw.fontface.repeat 2d.text.draw.fontface.notinpage . (If a font is referenced before it is fully loaded, + then it must be treated as if it was an unknown font, falling back + to another as described by the relevant CSS specifications # .) [CSSFONTS]

            + +

            Only vector fonts should be used by the user agent; if a user + agent were to use bitmap fonts then transformations would likely + make the font look very ugly.

            + +

            On getting, the font + attribute must return the serialized form of the current font of the context + (with no 'line-height' component) # 2d.text.font.parse.basic 2d.text.font.parse.complex 2d.text.font.parse.size.percentage 2d.text.font.parse.system . [CSSOM]

            + +
            + +

            For example, after the following statement:

            + +
            context.font = 'italic 400 12px/2 Unknown Font, sans-serif';
            + +

            ...the expression context.font would + evaluate to the string "italic 12px "Unknown Font", sans-serif". The + "400" font-weight doesn't appear because that is the default + value. The line-height doesn't appear because it is forced to + "normal", the default value.

            + +
            + +

            When the context is created, the font of the context must be set + to 10px sans-serif # 2d.text.font.default . When the 'font-size' component is set to lengths + using percentages, 'em' or 'ex' units, or the 'larger' or 'smaller' + keywords, these must be interpreted relative to the computed value + of the 'font-size' property of the corresponding canvas + element at the time that the attribute is set # 2d.text.font.parse.size.percentage . When the + 'font-weight' component is set to the relative values 'bolder' and + 'lighter', these must be interpreted relative to the computed value + of the 'font-weight' property of the corresponding + canvas element at the time that the attribute is + set # . If the computed values are undefined for a particular case + (e.g. because the canvas element is not in a + Document), then the relative keywords must be + interpreted relative to the normal-weight 10px sans-serif + default # 2d.text.font.parse.size.percentage.default .

            + +

            The textAlign IDL + attribute, on getting, must return the current value # 2d.text.align.valid . On setting, if + the value is one of start, end, left, right, or center, then the + value must be changed to the new value # 2d.text.align.valid . Otherwise, the new value + must be ignored # 2d.text.align.invalid . When the context is created, the textAlign attribute must + initially have the value start # 2d.text.align.default .

            + +

            The textBaseline + IDL attribute, on getting, must return the current value # 2d.text.baseline.valid . On + setting, if the value is one of top, hanging, middle, alphabetic, + ideographic, + or bottom, + then the value must be changed to the new value # 2d.text.baseline.valid . Otherwise, the new + value must be ignored # 2d.text.baseline.invalid . When the context is created, the textBaseline attribute + must initially have the value alphabetic # 2d.text.baseline.default .

            + +
            + +

            The textBaseline + attribute's allowed keywords correspond to alignment points in the + font:

            + +

            The top of the em square is   roughly at the top of the glyphs in a font, the hanging baseline is   where some glyphs like आ are anchored, the middle is half-way   between the top of the em square and the bottom of the em square,   the alphabetic baseline is where characters like Á, ÿ,   f, and Ω are anchored, the ideographic baseline is   where glyphs like 私 and 達 are anchored, and the bottom   of the em square is roughly at the bottom of the glyphs in a   font. The top and bottom of the bounding box can be far from these   baselines, due to glyphs extending far outside the em square.

            + +

            The keywords map to these alignment points as follows:

            + +
            top +
            The top of the em square
            + +
            hanging +
            The hanging baseline
            + +
            middle +
            The middle of the em square
            + +
            alphabetic +
            The alphabetic baseline
            + +
            ideographic +
            The ideographic baseline
            + +
            bottom +
            The bottom of the em square
            + +
            + +

            The fillText() and + strokeText() + methods take three or four arguments, text, x, y, and optionally maxWidth, and render the given text at the given (x, y) coordinates ensuring that the text isn't wider + than maxWidth if specified, using the current + font, textAlign, and textBaseline + values. Specifically, when the methods are called, the user agent + must run the following steps # 2d.text.draw.fill.basic 2d.text.draw.fill.rtl 2d.text.draw.stroke.basic 2d.text.draw.kern.consistent :

            + +
            1. Let font be the current font of the + context, as given by the font attribute.

            2. + +
            3. Replace all the space + characters in text with U+0020 SPACE + characters # 2d.text.draw.space.basic 2d.text.draw.space.collapse.space 2d.text.draw.space.collapse.other 2d.text.draw.space.collapse.nonspace 2d.text.draw.space.collapse.start 2d.text.draw.space.collapse.end .

            4. + +
            5. Form a hypothetical infinitely wide CSS line box containing + a single inline box containing the text text, + with all the properties at their initial values except the 'font' + property of the inline box set to font and the + 'direction' property of the inline box set to the + directionality of the canvas element # 2d.text.draw.align.start.rtl 2d.text.draw.align.end.rtl . [CSS]

            6. + + + +
            7. If the maxWidth argument was specified + and the hypothetical width of the inline box in the hypothetical + line box is greater than maxWidth CSS pixels, + then change font to have a more condensed font + (if one is available or if a reasonably readable one can be + synthesized by applying a horizontal scale factor to the font) or a + smaller font, and return to the previous step # 2d.text.draw.fill.maxWidth.large 2d.text.draw.fill.maxWidth.small 2d.text.draw.fill.maxWidth.zero 2d.text.draw.fill.maxWidth.fontface 2d.text.draw.fill.maxWidth.bound .

            8. + +
            9. + +

              Let the anchor point be a point on the + inline box, determined by the textAlign and textBaseline values, as + follows:

              + +

              Horizontal position:

              + +
              If textAlign is left
              +
              If textAlign is start and the directionality of the + canvas element is 'ltr'
              +
              If textAlign is end and the directionality of the + canvas element is 'rtl'
              + +
              Let the anchor point's horizontal + position be the left edge of the inline box # 2d.text.draw.align.left 2d.text.draw.align.start.ltr 2d.text.draw.align.end.rtl .
              + + +
              If textAlign is right
              +
              If textAlign is end and the directionality of the + canvas element is 'ltr'
              +
              If textAlign is start and the directionality of the + canvas element is 'rtl'
              + +
              Let the anchor point's horizontal + position be the right edge of the inline box # 2d.text.draw.align.right 2d.text.draw.align.start.rtl 2d.text.draw.align.end.ltr .
              + + +
              If textAlign is center
              + +
              Let the anchor point's horizontal + position be half way between the left and right edges of the + inline box # 2d.text.draw.align.center .
              + +

              Vertical position:

              + +
              If textBaseline is top
              + +
              Let the anchor point's vertical position + be the top of the em box of the first available font of the + inline box # 2d.text.draw.baseline.top .
              + + +
              If textBaseline is hanging
              + +
              Let the anchor point's vertical position + be the hanging baseline of the first available font of the inline + box # 2d.text.draw.baseline.hanging .
              + + +
              If textBaseline is middle
              + +
              Let the anchor point's vertical position + be half way between the bottom and the top of the em box of the + first available font of the inline box # 2d.text.draw.baseline.middle .
              + + +
              If textBaseline is alphabetic
              + +
              Let the anchor point's vertical position + be the alphabetic baseline of the first available font of the inline + box # 2d.text.draw.baseline.alphabetic .
              + + +
              If textBaseline is ideographic
              + +
              Let the anchor point's vertical position + be the ideographic baseline of the first available font of the inline + box # 2d.text.draw.baseline.ideographic .
              + + +
              If textBaseline is bottom
              + +
              Let the anchor point's vertical position + be the bottom of the em box of the first available font of the + inline box # 2d.text.draw.baseline.bottom .
              + +
            10. + +
            11. + +

              Paint the hypothetical inline box as the shape given by the + text's glyphs, as transformed by the current transformation + matrix, and anchored and sized so that before applying the + current transformation + matrix, the anchor point is at (x, y) and each CSS pixel is + mapped to one coordinate space unit.

              + +

              For fillText() + fillStyle must be + applied to the glyphs and strokeStyle must be + ignored # 2d.text.draw.fill.basic 2d.text.draw.fill.unaffected . For strokeText() the reverse + holds and strokeStyle must be + applied to the glyph outlines and fillStyle must be + ignored # 2d.text.draw.stroke.basic 2d.text.draw.stroke.unaffected .

              + +

              Text is painted without affecting the current path, and is + subject to shadow effects, global alpha, the clipping region, and global composition + operators.

              + +
            12. + +

            The measureText() + method takes one argument, text. When the method + is invoked, the user agent must replace all the space characters in text with + U+0020 SPACE characters # 2d.text.measure.width.space , and then must form a hypothetical + infinitely wide CSS line box containing a single inline box + containing the text text, with all the + properties at their initial values except the 'font' property of the + inline element set to the current font of the context, as given by + the font attribute, and + must then return a new TextMetrics object with its + width attribute set to + the width of that inline box, in CSS pixels # 2d.text.measure.width.basic 2d.text.measure.width.empty . [CSS]

            + +

            The TextMetrics interface is used for the objects + returned from measureText(). It has one + attribute, width, which is set + by the measureText() + method.

            + +

            Glyphs rendered using fillText() and strokeText() can spill out + of the box given by the font size (the em square size) and the width + returned by measureText() (the text + width). This version of the specification does not provide a way to + obtain the bounding box dimensions of the text. If the text is to be + rendered and removed, care needs to be taken to replace the entire + area of the canvas that the clipping region covers, not just the box + given by the em square height and measured text width.

            + + + + + + +
            + +

            A future version of the 2D context API may provide a + way to render fragments of documents, rendered using CSS, straight + to the canvas. This would be provided in preference to a dedicated + way of doing multiline layout.

            + + + +
            4.8.10.1.11 Images
            + +

            To draw images onto the canvas, the drawImage method + can be used.

            + +

            This method can be invoked with three different sets of arguments:

            + +

            Each of those three can take either an + HTMLImageElement, an HTMLCanvasElement, or + an HTMLVideoElement for the image + argument.

            + +
            context . drawImage(image, dx, dy)
            +
            context . drawImage(image, dx, dy, dw, dh)
            +
            context . drawImage(image, sx, sy, sw, sh, dx, dy, dw, dh)
            + +
            + +

            Draws the given image onto the canvas. The arguments are + interpreted as follows:

            + +

            The sx and sy parameters give the x and y coordinates of the source rectangle; the sw and sh arguments give the width and height of the source rectangle; the dx and dy give the x and y coordinates of the destination rectangle; and the dw and dh arguments give the width and height of the destination rectangle.

            + +

            If the first argument isn't an img, + canvas, or video element, throws a + TYPE_MISMATCH_ERR exception. If the image has no + image data, throws an INVALID_STATE_ERR exception. If + the second argument isn't one of the allowed values, throws a + SYNTAX_ERR exception. If the image isn't yet fully + decoded, then nothing is drawn.

            + +
            + +
            + +

            If not specified, the dw and dh arguments must default to the values of sw and sh, interpreted such that + one CSS pixel in the image is treated as one unit in the canvas + coordinate space # 2d.drawImage.3arg . If the sx, sy, sw, and sh arguments are omitted, they must default to 0, 0, + the image's intrinsic width in image pixels, and the image's + intrinsic height in image pixels, respectively # 2d.drawImage.3arg 2d.drawImage.5arg .

            + +

            The image argument is an instance of either + HTMLImageElement, HTMLCanvasElement, or + HTMLVideoElement. If the image is + of the wrong type or null, the implementation must raise a + TYPE_MISMATCH_ERR exception # 2d.drawImage.null 2d.drawImage.wrongtype .

            + + +

            If the image argument is an + HTMLImageElement object whose complete attribute is false # 2d.drawImage.incomplete 2d.drawImage.broken , or + if the image argument is an + HTMLVideoElement object whose readyState attribute is either + HAVE_NOTHING or HAVE_METADATA # , then the + implementation must return without drawing anything.

            + + +

            If the image argument is an + HTMLCanvasElement object with either a horizontal + dimension or a vertical dimension equal to zero, then the + implementation must raise an INVALID_STATE_ERR + exception # 2d.drawImage.zerocanvas .

            + + +

            The source rectangle is the rectangle whose corners are the four + points (sx, sy), (sx+sw, sy), (sx+sw, sy+sh), (sx, sy+sh).

            + +

            If the source rectangle is not entirely within the source image # 2d.drawImage.outsidesource , + or if one of the sw or sh + arguments is zero # 2d.drawImage.zerosource , the implementation must raise an + INDEX_SIZE_ERR exception.

            + +

            The destination rectangle is the rectangle whose corners are the + four points (dx, dy), + (dx+dw, dy), (dx+dw, dy+dh), (dx, dy+dh).

            + +

            When drawImage() is + invoked, the region of the image specified by the source rectangle + must be painted on the region of the canvas specified by the + destination rectangle # 2d.drawImage.9arg.basic 2d.drawImage.9arg.sourcepos 2d.drawImage.9arg.sourcesize 2d.drawImage.9arg.destpos 2d.drawImage.9arg.destsize 2d.drawImage.canvas 2d.drawImage.floatsource , after applying the current transformation + matrix to the points of the destination rectangle.

            + +

            The original image data of the source image must be used, not the + image as it is rendered (e.g. width and height attributes on the source + element have no effect) # . The image data must be processed in the + original direction, even if the dimensions given are negative # 2d.drawImage.negativesource 2d.drawImage.negativedest 2d.drawImage.negativedir .

            + +

            This specification does not define the algorithm to + use when scaling the image, if necessary.

            + +

            When a canvas is drawn onto itself, the drawing + model requires the source to be copied before the image is drawn + back onto the canvas, so it is possible to copy parts of a canvas + onto overlapping parts of itself # 2d.drawImage.self.1 2d.drawImage.self.2 .

            + +

            When the drawImage() method + is passed an animated image as its image + argument, the user agent must use the poster frame of the animation, + or, if there is no poster frame, the first frame of the + animation # 2d.drawImage.animated.gif 2d.drawImage.animated.apng 2d.drawImage.animated.poster .

            + + +

            When the image argument is an + HTMLVideoElement, then the frame at the current + playback position must be used as the source image # , and the + source image's dimensions must be the intrinsic width and + intrinsic height + of the media resource (i.e. after any aspect-ratio + correction has been applied) # .

            + + +

            Images are painted without affecting the current path # 2d.drawImage.path , and are + subject to shadow effects, global alpha, the clipping region, and global composition + operators # 2d.drawImage.transform 2d.drawImage.alpha 2d.drawImage.clip 2d.drawImage.composite .

            + +
            + + + +
            4.8.10.1.12 Pixel manipulation
            + +
            imagedata = context . createImageData(sw, sh)
            + +
            + +

            Returns an ImageData object with the given + dimensions in CSS pixels (which might map to a different number of + actual device pixels exposed by the object itself). All the pixels + in the returned object are transparent black.

            + +
            + +
            imagedata = context . createImageData(imagedata)
            + +
            + +

            Returns an ImageData object with the same + dimensions as the argument. All the pixels in the returned object + are transparent black.

            + +

            Throws a NOT_SUPPORTED_ERR exception if the + argument is null.

            + +
            + +
            imagedata = context . getImageData(sx, sy, sw, sh)
            + +
            + +

            Returns an ImageData object containing the image + data for the given rectangle of the canvas.

            + +

            Throws a NOT_SUPPORTED_ERR exception if any of the + arguments are not finite. Throws an INDEX_SIZE_ERR + exception if the either of the width or height arguments are + zero.

            + +
            + +
            imagedata . width
            +
            imagedata . height
            + +
            + +

            Returns the actual dimensions of the data in the ImageData object, in device pixels.

            + +
            + +
            imagedata . data
            + +
            + +

            Returns the one-dimensional array containing the data.

            + +
            + +
            context . putImageData(imagedata, dx, dy [, dirtyX, dirtyY, dirtyWidth, dirtyHeight ])
            + +
            + +

            Paints the data from the given ImageData object + onto the canvas. If a dirty rectangle is provided, only the pixels + from that rectangle are painted.

            + +

            The globalAlpha + and globalCompositeOperation + attributes, as well as the shadow attributes, are ignored for the + purposes of this method call; pixels in the canvas are replaced + wholesale, with no composition, alpha blending, no shadows, + etc.

            + +

            If the first argument isn't an ImageData object, + throws a TYPE_MISMATCH_ERR exception. Throws a + NOT_SUPPORTED_ERR exception if any of the other + arguments are not finite.

            + +
            + +
            + +

            The createImageData() + method is used to instantiate new blank ImageData + objects. When the method is invoked with two arguments sw and sh, it must return an + ImageData object # 2d.imageData.create2.basic 2d.imageData.create2.type representing a rectangle with a width + in CSS pixels equal to the absolute magnitude of sw and a height in CSS pixels equal to the absolute + magnitude of sh # 2d.imageData.create2.initial 2d.imageData.create2.large 2d.imageData.create2.tiny 2d.imageData.create2.negative . When invoked with a single imagedata argument, it must return an + ImageData object # 2d.imageData.create1.basic 2d.imageData.create1.type representing a rectangle with the same + dimensions as the ImageData object passed as the + argument # 2d.imageData.create1.initial . The ImageData object return must be filled + with transparent black # 2d.imageData.create2.initial 2d.imageData.create1.initial .

            + +

            The getImageData(sx, sy, sw, + sh) method must return an + ImageData object # 2d.imageData.get.type representing the underlying pixel data + for the area of the canvas denoted by the rectangle whose corners are + the four points (sx, sy), + (sx+sw, sy), (sx+sw, sy+sh), (sx, sy+sh), in canvas + coordinate space units # 2d.imageData.get.basic 2d.imageData.get.source.outside 2d.imageData.get.source.negative 2d.imageData.get.source.size . Pixels outside the canvas must be returned + as transparent black # 2d.imageData.get.source.outside . Pixels must be returned as non-premultiplied + alpha values # 2d.imageData.get.nonpremul .

            + +

            If any of the arguments to createImageData() or + getImageData() are + infinite or NaN # 2d.imageData.create2.nonfinite 2d.imageData.get.nonfinite , or if the createImageData() + method is invoked with only one argument but that argument is null # 2d.imageData.create1.zero , + the method must instead raise a NOT_SUPPORTED_ERR + exception. If either the sw or sh arguments are zero, the method must instead raise + an INDEX_SIZE_ERR exception # 2d.imageData.create2.zero 2d.imageData.get.zero .

            + +

            ImageData objects must be initialized so that their + width attribute + is set to w, the number of physical device + pixels per row in the image data, their height attribute is + set to h, the number of rows in the image data, + and their data + attribute is initialized to a CanvasPixelArray object + holding the image data # 2d.imageData.create2.initial 2d.imageData.create1.initial . At least one pixel's worth of image data + must be returned # 2d.imageData.create2.tiny 2d.imageData.get.tiny .

            + +

            The CanvasPixelArray object provides ordered, + indexed access to the color components of each pixel of the image + data. The data must be represented in left-to-right order, row by + row top to bottom, starting with the top left, with each pixel's + red, green, blue, and alpha components being given in that order for + each pixel # 2d.imageData.get.source.negative 2d.imageData.get.order.cols 2d.imageData.get.order.rows 2d.imageData.get.order.rgb 2d.imageData.get.order.alpha . Each component of each device pixel represented in this + array must be in the range 0..255, representing the 8 bit value for + that component # 2d.imageData.get.range 2d.imageData.get.clamp . The components must be assigned consecutive indices + starting with 0 for the top left pixel's red component # 2d.imageData.get.order.rgb .

            + +

            The CanvasPixelArray object thus represents h×w×4 integers. The + length + attribute of a CanvasPixelArray object must return this + number # 2d.imageData.get.length .

            + +

            The object's indices of the supported indexed + properties are the numbers in the range 0 .. h×w×4-1.

            + +

            When a CanvasPixelArray object is indexed to retrieve an indexed + property index, the value returned must be + the value of the indexth component in the + array # 2d.imageData.get.range .

            + +

            When a CanvasPixelArray object is indexed to modify an indexed + property index with value value, the value of the indexth + component in the array must be set to value # 2d.imageData.object.set 2d.imageData.object.undefined 2d.imageData.object.nan 2d.imageData.object.string 2d.imageData.object.wrap 2d.imageData.object.round .

            + +

            The width and height (w and h) might be different from the sw + and sh arguments to the above methods, e.g. if + the canvas is backed by a high-resolution bitmap, or if the sw and sh arguments are + negative.

            + +

            The putImageData(imagedata, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight) method writes data from + ImageData structures back to the canvas.

            + +

            If any of the arguments to the method are infinite or NaN, the + method must raise a NOT_SUPPORTED_ERR exception # 2d.imageData.put.nonfinite .

            + +

            If the first argument to the method is null # 2d.imageData.put.null or not an + ImageData object # 2d.imageData.put.wrongtype then the putImageData() method + must raise a TYPE_MISMATCH_ERR exception.

            + +

            When the last four arguments are omitted, they must be assumed to + have the values 0, 0, the width member of the imagedata structure, and the height member of the imagedata structure, respectively # 2d.imageData.put.basic .

            + +

            When invoked with arguments that do not, per the last few + paragraphs, cause an exception to be raised, the putImageData() method + must act as follows # 2d.imageData.put.basic 2d.imageData.put.created 2d.imageData.put.cross 2d.imageData.put.alpha 2d.imageData.put.modified 2d.imageData.put.dirty.zero 2d.imageData.put.dirty.rect1 2d.imageData.put.dirty.rect2 2d.imageData.put.dirty.negative 2d.imageData.put.dirty.outside 2d.imageData.put.path :

            + +
            1. + +

              Let dxdevice be the x-coordinate + of the device pixel in the underlying pixel data of the canvas + corresponding to the dx coordinate in the + canvas coordinate space.

              + +

              Let dydevice be the y-coordinate + of the device pixel in the underlying pixel data of the canvas + corresponding to the dy coordinate in the + canvas coordinate space.

              + +
            2. + +
            3. + +

              If dirtyWidth is negative, let dirtyX be dirtyX+dirtyWidth, and let dirtyWidth be equal to the absolute magnitude of + dirtyWidth.

              + +

              If dirtyHeight is negative, let dirtyY be dirtyY+dirtyHeight, and let dirtyHeight be equal to the absolute magnitude of + dirtyHeight.

              + +
            4. + +
            5. + +

              If dirtyX is negative, let dirtyWidth be dirtyWidth+dirtyX, and + let dirtyX be zero.

              + +

              If dirtyY is negative, let dirtyHeight be dirtyHeight+dirtyY, and + let dirtyY be zero.

              + +
            6. + +
            7. + +

              If dirtyX+dirtyWidth is greater than the width attribute of the imagedata argument, let dirtyWidth be the value of that width attribute, minus the + value of dirtyX.

              + +

              If dirtyY+dirtyHeight is greater than the height attribute of the imagedata argument, let dirtyHeight be the value of that height attribute, minus the + value of dirtyY.

              + +
            8. + +
            9. + +

              If, after those changes, either dirtyWidth + or dirtyHeight is negative or zero, stop these + steps without affecting the canvas.

              + +
            10. + +
            11. Otherwise, for all integer values of x + and y where dirtyX ≤ x < dirtyX+dirtyWidth + and dirtyY ≤ y < dirtyY+dirtyHeight, copy the four channels of + the pixel with coordinate (x, y) in the imagedata data + structure to the pixel with coordinate (dxdevice+x, + dydevice+y) in the underlying pixel data of the + canvas.

            12. + +

            The handling of pixel rounding when the specified coordinates do + not exactly map to the device coordinate space is not defined by + this specification, except that the following must result in no + visible changes to the rendering # 2d.imageData.put.unchanged :

            + +
            context.putImageData(context.getImageData(x, y, w, h), p, q);
            + +

            ...for any value of x, y, + w, and h and where p is the smaller of x and the sum + of x and w, and q is the smaller of y and the sum + of y and h; and except that + the following two calls:

            + +
            context.createImageData(w, h);
            +context.getImageData(0, 0, w, h);
            + +

            ...must return ImageData objects with the same + dimensions, for any value of w and h # 2d.imageData.create2.round . In other words, while user agents may round the + arguments of these methods so that they map to device pixel + boundaries, any rounding performed must be performed consistently + for all of the createImageData(), getImageData() and putImageData() + operations.

            + +

            Due to the lossy nature of converting to and from + premultiplied alpha color values, pixels that have just been set + using putImageData() might be + returned to an equivalent getImageData() as + different values.

            + +

            The current path, transformation matrix, + shadow attributes, global alpha, the clipping region, and global composition + operator must not affect the getImageData() and putImageData() + methods # 2d.imageData.get.unaffected 2d.imageData.put.unaffected 2d.imageData.put.clip .

            + +
            + +
            + +

            The data returned by getImageData() is at the + resolution of the canvas backing store, which is likely to not be + one device pixel to each CSS pixel if the display used is a high + resolution display.

            + +

            In the following example, the script generates an + ImageData object so that it can draw onto it.

            + +
            // canvas is a reference to a <canvas> element
            +var context = canvas.getContext('2d');
            +
            +// create a blank slate
            +var data = context.createImageData(canvas.width, canvas.height);
            +
            +// create some plasma
            +FillPlasma(data, 'green'); // green plasma
            +
            +// add a cloud to the plasma
            +AddCloud(data, data.width/2, data.height/2); // put a cloud in the middle
            +
            +// paint the plasma+cloud on the canvas
            +context.putImageData(data, 0, 0);
            +
            +// support methods
            +function FillPlasma(data, color) { ... }
            +function AddCloud(data, x, y) { ... }
            + +
            + +
            + +

            Here is an example of using getImageData() and putImageData() to + implement an edge detection filter.

            + +
            <!DOCTYPE HTML>
            +<html>
            + <head>
            +  <title>Edge detection demo</title>
            +  <script>
            +   var image = new Image();
            +   function init() {
            +     image.onload = demo;
            +     image.src = "image.jpeg";
            +   }
            +   function demo() {
            +     var canvas = document.getElementsByTagName('canvas')[0];
            +     var context = canvas.getContext('2d');
            +
            +     // draw the image onto the canvas
            +     context.drawImage(image, 0, 0);
            +
            +     // get the image data to manipulate
            +     var input = context.getImageData(0, 0, canvas.width, canvas.height);
            +
            +     // get an empty slate to put the data into
            +     var output = context.createImageData(canvas.width, canvas.height);
            +
            +     // alias some variables for convenience
            +     // notice that we are using input.width and input.height here
            +     // as they might not be the same as canvas.width and canvas.height
            +     // (in particular, they might be different on high-res displays)
            +     var w = input.width, h = input.height;
            +     var inputData = input.data;
            +     var outputData = output.data;
            +
            +     // edge detection
            +     for (var y = 1; y < h-1; y += 1) {
            +       for (var x = 1; x < w-1; x += 1) {
            +         for (var c = 0; c < 3; c += 1) {
            +           var i = (y*w + x)*4 + c;
            +           outputData[i] = 127 + -inputData[i - w*4 - 4] -   inputData[i - w*4] - inputData[i - w*4 + 4] +
            +                                 -inputData[i - 4]       + 8*inputData[i]       - inputData[i + 4] +
            +                                 -inputData[i + w*4 - 4] -   inputData[i + w*4] - inputData[i + w*4 + 4];
            +         }
            +         outputData[(y*w + x)*4 + 3] = 255; // alpha
            +       }
            +     }
            +
            +     // put the image data back after manipulation
            +     context.putImageData(output, 0, 0);
            +   }
            +  </script>
            + </head>
            + <body onload="init()">
            +  <canvas></canvas>
            + </body>
            +</html>
            + +
            + + +
            + +
            4.8.10.1.13 Drawing model
            + +

            When a shape or image is painted, user agents must follow these + steps, in the order given (or act as if they do) # :

            + +
            1. Render the shape or image onto an infinite transparent black + bitmap, creating image A, as described in the + previous sections. For shapes, the current fill, stroke, and line + styles must be honored, and the stroke must itself also be + subjected to the current transformation matrix.

            2. + +
            3. When shadows are drawn, render the shadow from + image A, using the current shadow styles, + creating image B.

            4. + +
            5. When shadows are drawn, multiply the alpha + component of every pixel in B by globalAlpha.

            6. + +
            7. When shadows are drawn, composite B within the clipping region over the current canvas + bitmap using the current composition operator.

            8. + +
            9. Multiply the alpha component of every pixel in A by globalAlpha.

            10. + +
            11. Composite A within the clipping region + over the current canvas bitmap using the current composition + operator.

            12. + +
            + + +
            4.8.10.1.14 Examples
            + +

            This section is non-normative.

            + +

            Here is an example of a script that uses canvas to draw pretty + glowing lines.

            + +
            <canvas width="800" height="450"></canvas>
            +<script>
            +
            + var context = document.getElementsByTagName('canvas')[0].getContext('2d');
            +
            + var lastX = context.canvas.width * Math.random();
            + var lastY = context.canvas.height * Math.random();
            + var hue = 0;
            + function line() {
            +   context.save();
            +   context.translate(context.canvas.width/2, context.canvas.height/2);
            +   context.scale(0.9, 0.9);
            +   context.translate(-context.canvas.width/2, -context.canvas.height/2);
            +   context.beginPath();
            +   context.lineWidth = 5 + Math.random() * 10;
            +   context.moveTo(lastX, lastY);
            +   lastX = context.canvas.width * Math.random();
            +   lastY = context.canvas.height * Math.random();
            +   context.bezierCurveTo(context.canvas.width * Math.random(),
            +                         context.canvas.height * Math.random(),
            +                         context.canvas.width * Math.random(),
            +                         context.canvas.height * Math.random(),
            +                         lastX, lastY);
            +
            +   hue = hue + 10 * Math.random();
            +   context.strokeStyle = 'hsl(' + hue + ', 50%, 50%)';
            +   context.shadowColor = 'white';
            +   context.shadowBlur = 10;
            +   context.stroke();
            +   context.restore();
            + }
            + setInterval(line, 50);
            +
            + function blank() {
            +   context.fillStyle = 'rgba(0,0,0,0.1)';
            +   context.fillRect(0, 0, context.canvas.width, context.canvas.height);
            + }
            + setInterval(blank, 40);
            +
            +</script>
            + + + + +
            + +
            4.8.10.2 Color spaces and color correction
            + +

            The canvas APIs must perform color correction at + only two points: when rendering images with their own gamma + correction and color space information onto the canvas, to convert + the image to the color space used by the canvas (e.g. using the 2D + Context's drawImage() + method with an HTMLImageElement object) # , and when + rendering the actual canvas bitmap to the output device.

            + +

            Thus, in the 2D context, colors used to draw shapes + onto the canvas will exactly match colors obtained through the getImageData() + method.

            + +

            The toDataURL() method + must not include color space information in the resource + returned # . Where the output format allows it, the color of pixels in + resources created by toDataURL() must match those + returned by the getImageData() + method # .

            + +

            In user agents that support CSS, the color space used by a + canvas element must match the color space used for + processing any colors for that element in CSS # .

            + +

            The gamma correction and color space information of images must + be handled in such a way that an image rendered directly using an + img element would use the same colors as one painted on + a canvas element that is then itself + rendered # . Furthermore, the rendering of images that have no color + correction information (such as those returned by the toDataURL() method) must be + rendered with no color correction # .

            + +

            Thus, in the 2D context, calling the drawImage() method to render + the output of the toDataURL() method to the + canvas, given the appropriate dimensions, has no visible effect.

            + +
            + + +
            + +
            4.8.10.3 Security with canvas elements
            + +

            Information leakage can occur if scripts from + one origin can access information (e.g. read pixels) + from images from another origin (one that isn't the same).

            + +

            To mitigate this, canvas elements are defined to + have a flag indicating whether they are origin-clean. All + canvas elements must start with their + origin-clean set to true # security.pattern.create security.pattern.cross security.pattern.canvas.timing . The flag must be set to false if + any of the following actions occur:

            + +

            Whenever the toDataURL() method of a + canvas element whose origin-clean flag is set to + false is called, the method must raise a SECURITY_ERR + exception # security.drawImage.image .

            + +

            Whenever the getImageData() method of + the 2D context of a canvas element whose + origin-clean flag is set to false is called with otherwise + correct arguments, the method must raise a SECURITY_ERR + exception # security.drawImage.image .

            + +

            Even resetting the canvas state by changing its + width or height attributes doesn't reset + the origin-clean flag.

            + +
            + + + + \ No newline at end of file diff --git a/platforms/ios/www/test/tests-todo/testme.js b/platforms/ios/www/test/tests-todo/testme.js new file mode 100644 index 0000000..0bba424 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/testme.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +var img = new Image(); +img.src = 'test/images/red.png'; +img.onload = function () { + ctx.globalAlpha = 0; + ctx.drawImage(this, 0, 0); + _assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); +}; + +}); diff --git a/platforms/ios/www/test/tests-todo/tmp_1_2d.composite.uncovered.image.copy.js b/platforms/ios/www/test/tests-todo/tmp_1_2d.composite.uncovered.image.copy.js new file mode 100644 index 0000000..84a78e1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/tmp_1_2d.composite.uncovered.image.copy.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'copy'; +ctx.drawImage(document.getElementById('yellow.png'), 40, 40, 10, 10, 40, 50, 10, 10); +_assertPixelApprox(canvas, 15,15, 0,0,0,0, "15,15", "0,0,0,0", 5); +_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5); diff --git a/platforms/ios/www/test/tests-todo/tmp_2_2d.composite.uncovered.image.copy.js b/platforms/ios/www/test/tests-todo/tmp_2_2d.composite.uncovered.image.copy.js new file mode 100644 index 0000000..e69de29 diff --git a/platforms/ios/www/test/tests-todo/toDataURL.arguments.1.js b/platforms/ios/www/test/tests-todo/toDataURL.arguments.1.js new file mode 100644 index 0000000..a174352 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/toDataURL.arguments.1.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +var data = canvas.toDataURL('image/png', 'another argument that should not raise an exception'); +_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/toDataURL.arguments.2.js b/platforms/ios/www/test/tests-todo/toDataURL.arguments.2.js new file mode 100644 index 0000000..f03e416 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/toDataURL.arguments.2.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +var data = canvas.toDataURL('image/png', 'another argument that should not raise an exception', 'and another'); +_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/toDataURL.arguments.3.js b/platforms/ios/www/test/tests-todo/toDataURL.arguments.3.js new file mode 100644 index 0000000..3725aa9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/toDataURL.arguments.3.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +// More arguments that should not raise exceptions +var data = canvas.toDataURL('image/png', null, null, null); +_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/toDataURL.bogustype.js b/platforms/ios/www/test/tests-todo/toDataURL.bogustype.js new file mode 100644 index 0000000..6cf5d2b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/toDataURL.bogustype.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +var data = canvas.toDataURL('bogus'); +_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/toDataURL.default.js b/platforms/ios/www/test/tests-todo/toDataURL.default.js new file mode 100644 index 0000000..49bc0a1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/toDataURL.default.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +var data = canvas.toDataURL(); +_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/toDataURL.jpeg.alpha.js b/platforms/ios/www/test/tests-todo/toDataURL.jpeg.alpha.js new file mode 100644 index 0000000..25d12d7 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/toDataURL.jpeg.alpha.js @@ -0,0 +1,25 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = 'rgba(128, 255, 128, 0.5)'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-over'; // should be ignored by toDataURL +var data = canvas.toDataURL('image/jpeg'); +ctx.globalCompositeOperation = 'source-over'; +if (!data.match(/^data:image\/jpeg[;,]/)) { + _assert(true, "true"); +} else { + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + var img = new Image(); + deferTest(); + img.onload = wrapFunction(function () + { + ctx.drawImage(img, 0, 0); + + _assertPixelApprox(canvas, 50,25, 63,127,63,255, "50,25", "63,127,63,255", 8); + }); + img.src = data; +} + + +}); diff --git a/platforms/ios/www/test/tests-todo/toDataURL.jpeg.primarycolours.js b/platforms/ios/www/test/tests-todo/toDataURL.jpeg.primarycolours.js new file mode 100644 index 0000000..a41f973 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/toDataURL.jpeg.primarycolours.js @@ -0,0 +1,28 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#ff0'; +ctx.fillRect(0, 0, 25, 40); +ctx.fillStyle = '#0ff'; +ctx.fillRect(25, 0, 50, 40); +ctx.fillStyle = '#00f'; +ctx.fillRect(75, 0, 25, 40); +ctx.fillStyle = '#fff'; +ctx.fillRect(0, 40, 100, 10); +var data = canvas.toDataURL('image/jpeg'); // it is okay if this returns a PNG instead +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +var img = new Image(); +deferTest(); +img.onload = wrapFunction(function () +{ + ctx.drawImage(img, 0, 0); + + _assertPixelApprox(canvas, 12,20, 255,255,0,255, "12,20", "255,255,0,255", 8); + _assertPixelApprox(canvas, 50,20, 0,255,255,255, "50,20", "0,255,255,255", 8); + _assertPixelApprox(canvas, 87,20, 0,0,255,255, "87,20", "0,0,255,255", 8); + _assertPixelApprox(canvas, 50,45, 255,255,255,255, "50,45", "255,255,255,255", 8); +}); +img.src = data; + + +}); diff --git a/platforms/ios/www/test/tests-todo/toDataURL.jpeg.quality.basic.js b/platforms/ios/www/test/tests-todo/toDataURL.jpeg.quality.basic.js new file mode 100644 index 0000000..ca1fdfa --- /dev/null +++ b/platforms/ios/www/test/tests-todo/toDataURL.jpeg.quality.basic.js @@ -0,0 +1,36 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#00f'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0ff'; +ctx.fillRect(0, 3, 100, 1); +// Check for JPEG support first +var data = canvas.toDataURL('image/jpeg'); +if (!data.match(/^data:image\/jpeg[;,]/)) { + _assert(true, "true"); +} else { + var data_hi = canvas.toDataURL('image/jpeg', 0.99); + var data_lo = canvas.toDataURL('image/jpeg', 0.01); + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + deferTest(); + var img_hi = new Image(); + img_hi.onload = function () + { + var img_lo = new Image(); + img_lo.onload = wrapFunction(function () + { + ctx.drawImage(img_hi, 0, 0, 50, 50, 0, 0, 50, 50); + ctx.drawImage(img_lo, 0, 0, 50, 50, 50, 0, 50, 50); + + _assert(data_hi.length > data_lo.length, "data_hi.length > data_lo.length"); + _assertPixelApprox(canvas, 25,25, 0,0,255,255, "25,25", "0,0,255,255", 8); + _assertPixelApprox(canvas, 75,25, 0,0,255,255, "75,25", "0,0,255,255", 8); + }); + img_lo.src = data_lo; + }; + img_hi.src = data_hi; +} + + +}); diff --git a/platforms/ios/www/test/tests-todo/toDataURL.jpeg.quality.notnumber.js b/platforms/ios/www/test/tests-todo/toDataURL.jpeg.quality.notnumber.js new file mode 100644 index 0000000..0585361 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/toDataURL.jpeg.quality.notnumber.js @@ -0,0 +1,21 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#00f'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0ff'; +ctx.fillRect(0, 3, 100, 1); +// Check for JPEG support first +var data = canvas.toDataURL('image/jpeg'); +if (!data.match(/^data:image\/jpeg[;,]/)) { + _assert(true, "true"); +} else { + _assertSame(canvas.toDataURL('image/jpeg', 'bogus'), data, "canvas.toDataURL('image/jpeg', 'bogus')", "data"); + _assertSame(canvas.toDataURL('image/jpeg', {}), data, "canvas.toDataURL('image/jpeg', {})", "data"); + _assertSame(canvas.toDataURL('image/jpeg', null), data, "canvas.toDataURL('image/jpeg', null)", "data"); + _assertSame(canvas.toDataURL('image/jpeg', undefined), data, "canvas.toDataURL('image/jpeg', undefined)", "data"); + _assertSame(canvas.toDataURL('image/jpeg', true), data, "canvas.toDataURL('image/jpeg', true)", "data"); + _assertSame(canvas.toDataURL('image/jpeg', '0.01'), data, "canvas.toDataURL('image/jpeg', '0.01')", "data"); +} + + +}); diff --git a/platforms/ios/www/test/tests-todo/toDataURL.jpeg.quality.outsiderange.js b/platforms/ios/www/test/tests-todo/toDataURL.jpeg.quality.outsiderange.js new file mode 100644 index 0000000..7b07bfc --- /dev/null +++ b/platforms/ios/www/test/tests-todo/toDataURL.jpeg.quality.outsiderange.js @@ -0,0 +1,22 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#00f'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0ff'; +ctx.fillRect(0, 3, 100, 1); +// Check for JPEG support first +var data = canvas.toDataURL('image/jpeg'); +if (!data.match(/^data:image\/jpeg[;,]/)) { + _assert(true, "true"); +} else { + _assertSame(canvas.toDataURL('image/jpeg', 10), data, "canvas.toDataURL('image/jpeg', 10)", "data"); + _assertSame(canvas.toDataURL('image/jpeg', -10), data, "canvas.toDataURL('image/jpeg', -10)", "data"); + _assertSame(canvas.toDataURL('image/jpeg', 1.01), data, "canvas.toDataURL('image/jpeg', 1.01)", "data"); + _assertSame(canvas.toDataURL('image/jpeg', -0.01), data, "canvas.toDataURL('image/jpeg', -0.01)", "data"); + + _assert(canvas.toDataURL('image/jpeg', 1).length >= canvas.toDataURL('image/jpeg', 0.9).length, "canvas.toDataURL('image/jpeg', 1).length >= canvas.toDataURL('image/jpeg', 0.9).length"); + _assert(canvas.toDataURL('image/jpeg', 0).length <= canvas.toDataURL('image/jpeg', 0.1).length, "canvas.toDataURL('image/jpeg', 0).length <= canvas.toDataURL('image/jpeg', 0.1).length"); +} + + +}); diff --git a/platforms/ios/www/test/tests-todo/toDataURL.lowercase.ascii.js b/platforms/ios/www/test/tests-todo/toDataURL.lowercase.ascii.js new file mode 100644 index 0000000..4b2fbea --- /dev/null +++ b/platforms/ios/www/test/tests-todo/toDataURL.lowercase.ascii.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +var data = canvas.toDataURL('ImAgE/PnG'); +_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/"); + +// If JPEG is supported at all, it must be supported case-insensitively +data = canvas.toDataURL('image/jpeg'); +if (data.match(/^data:image\/jpeg[;,]/)) { + data = canvas.toDataURL('ImAgE/JpEg'); + _assertMatch(data, /^data:image\/jpeg[;,]/, "data", "/^data:image\\/jpeg[;,]/"); +} + + +}); diff --git a/platforms/ios/www/test/tests-todo/toDataURL.lowercase.unicode.js b/platforms/ios/www/test/tests-todo/toDataURL.lowercase.unicode.js new file mode 100644 index 0000000..321e122 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/toDataURL.lowercase.unicode.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +// Use LATIN CAPITAL LETTER I WITH DOT ABOVE (Unicode lowercase is "i") +var data = canvas.toDataURL('\u0130mage/png'); +_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/"); + +var data = canvas.toDataURL('\u0130mage/jpeg'); +_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/toDataURL.nocontext.js b/platforms/ios/www/test/tests-todo/toDataURL.nocontext.js new file mode 100644 index 0000000..2a7585d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/toDataURL.nocontext.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +var data = canvas2.toDataURL(); +_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/toDataURL.png.complexcolours.js b/platforms/ios/www/test/tests-todo/toDataURL.png.complexcolours.js new file mode 100644 index 0000000..f3b9a0d --- /dev/null +++ b/platforms/ios/www/test/tests-todo/toDataURL.png.complexcolours.js @@ -0,0 +1,28 @@ +_addTest(function(canvas, ctx) { + +// (These values are chosen to survive relatively alright through being premultiplied) +ctx.fillStyle = 'rgba(1, 3, 254, 1)'; +ctx.fillRect(0, 0, 25, 25); +ctx.fillStyle = 'rgba(8, 252, 248, 0.75)'; +ctx.fillRect(25, 0, 25, 25); +ctx.fillStyle = 'rgba(6, 10, 250, 0.502)'; +ctx.fillRect(50, 0, 25, 25); +ctx.fillStyle = 'rgba(12, 16, 244, 0.25)'; +ctx.fillRect(75, 0, 25, 25); +var img = new Image(); +deferTest(); +img.onload = wrapFunction(function () +{ + ctx.drawImage(img, 0, 25); + // (The alpha values do not really survive float->int conversion, so just + // do approximate comparisons) + + _assertPixel(canvas, 12,40, 1,3,254,255, "12,40", "1,3,254,255"); + _assertPixelApprox(canvas, 37,40, 8,252,248,191, "37,40", "8,252,248,191", 2); + _assertPixelApprox(canvas, 62,40, 6,10,250,127, "62,40", "6,10,250,127", 4); + _assertPixelApprox(canvas, 87,40, 12,16,244,63, "87,40", "12,16,244,63", 8); +}); +img.src = canvas.toDataURL(); + + +}); diff --git a/platforms/ios/www/test/tests-todo/toDataURL.png.js b/platforms/ios/www/test/tests-todo/toDataURL.png.js new file mode 100644 index 0000000..f4266c1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/toDataURL.png.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +var data = canvas.toDataURL('image/png'); +_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/toDataURL.png.primarycolours.js b/platforms/ios/www/test/tests-todo/toDataURL.png.primarycolours.js new file mode 100644 index 0000000..cd42cf3 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/toDataURL.png.primarycolours.js @@ -0,0 +1,28 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#ff0'; +ctx.fillRect(0, 0, 25, 40); +ctx.fillStyle = '#0ff'; +ctx.fillRect(25, 0, 50, 40); +ctx.fillStyle = '#00f'; +ctx.fillRect(75, 0, 25, 40); +ctx.fillStyle = '#fff'; +ctx.fillRect(0, 40, 100, 10); +var data = canvas.toDataURL(); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +var img = new Image(); +deferTest(); +img.onload = wrapFunction(function () +{ + ctx.drawImage(img, 0, 0); + + _assertPixel(canvas, 12,20, 255,255,0,255, "12,20", "255,255,0,255"); + _assertPixel(canvas, 50,20, 0,255,255,255, "50,20", "0,255,255,255"); + _assertPixel(canvas, 87,20, 0,0,255,255, "87,20", "0,0,255,255"); + _assertPixel(canvas, 50,45, 255,255,255,255, "50,45", "255,255,255,255"); +}); +img.src = data; + + +}); diff --git a/platforms/ios/www/test/tests-todo/toDataURL.unrecognised.js b/platforms/ios/www/test/tests-todo/toDataURL.unrecognised.js new file mode 100644 index 0000000..684af7a --- /dev/null +++ b/platforms/ios/www/test/tests-todo/toDataURL.unrecognised.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +var data = canvas.toDataURL('image/example'); +_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/toDataURL.zerosize.js b/platforms/ios/www/test/tests-todo/toDataURL.zerosize.js new file mode 100644 index 0000000..1b0a157 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/toDataURL.zerosize.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +var data = canvas.toDataURL(); +_assertSame(data, 'data:,', "data", "'data:,'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/type.delete.js b/platforms/ios/www/test/tests-todo/type.delete.js new file mode 100644 index 0000000..9989ae9 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/type.delete.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +delete window.HTMLCanvasElement; +_assert(window.HTMLCanvasElement, "window.HTMLCanvasElement"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/type.exists.js b/platforms/ios/www/test/tests-todo/type.exists.js new file mode 100644 index 0000000..0934d14 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/type.exists.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assert(window.HTMLCanvasElement, "window.HTMLCanvasElement"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/type.extend.js b/platforms/ios/www/test/tests-todo/type.extend.js new file mode 100644 index 0000000..a1be02b --- /dev/null +++ b/platforms/ios/www/test/tests-todo/type.extend.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +window.HTMLCanvasElement.prototype.getZero = function () { return 0; }; +_assertSame(canvas.getZero(), 0, "canvas.getZero()", "0"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/type.name.js b/platforms/ios/www/test/tests-todo/type.name.js new file mode 100644 index 0000000..9a31490 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/type.name.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(Object.prototype.toString.call(canvas), '[object HTMLCanvasElement]', "Object.prototype.toString.call(canvas)", "'[object HTMLCanvasElement]'"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/type.prototype.js b/platforms/ios/www/test/tests-todo/type.prototype.js new file mode 100644 index 0000000..3eb73b4 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/type.prototype.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +_assert(window.HTMLCanvasElement.prototype, "window.HTMLCanvasElement.prototype"); +_assert(window.HTMLCanvasElement.prototype.getContext, "window.HTMLCanvasElement.prototype.getContext"); +window.HTMLCanvasElement.prototype = null; +_assert(window.HTMLCanvasElement.prototype, "window.HTMLCanvasElement.prototype"); +delete window.HTMLCanvasElement.prototype; +_assert(window.HTMLCanvasElement.prototype, "window.HTMLCanvasElement.prototype"); +window.HTMLCanvasElement.prototype.getContext = 1; +_assertSame(window.HTMLCanvasElement.prototype.getContext, 1, "window.HTMLCanvasElement.prototype.getContext", "1"); +delete window.HTMLCanvasElement.prototype.getContext; +_assertSame(window.HTMLCanvasElement.prototype.getContext, undefined, "window.HTMLCanvasElement.prototype.getContext", "undefined"); + + +}); diff --git a/platforms/ios/www/test/tests-todo/type.replace.js b/platforms/ios/www/test/tests-todo/type.replace.js new file mode 100644 index 0000000..0f67cc1 --- /dev/null +++ b/platforms/ios/www/test/tests-todo/type.replace.js @@ -0,0 +1,7 @@ +_addTest(function(canvas, ctx) { + +window.HTMLCanvasElement.prototype.getContext = function (name) { return 0; }; +_assertSame(canvas.getContext('2d'), 0, "canvas.getContext('2d')", "0"); + + +}); diff --git a/platforms/ios/www/test/tests/2d.canvas.reference.js b/platforms/ios/www/test/tests/2d.canvas.reference.js new file mode 100644 index 0000000..23d3429 --- /dev/null +++ b/platforms/ios/www/test/tests/2d.canvas.reference.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(ctx.canvas, canvas, "ctx.canvas", "canvas"); + + +}); diff --git a/platforms/ios/www/test/tests/2d.clearRect.basic.js b/platforms/ios/www/test/tests/2d.clearRect.basic.js new file mode 100644 index 0000000..57341a3 --- /dev/null +++ b/platforms/ios/www/test/tests/2d.clearRect.basic.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.clearRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests/2d.clearRect.clip.js b/platforms/ios/www/test/tests/2d.clearRect.clip.js new file mode 100644 index 0000000..057de6f --- /dev/null +++ b/platforms/ios/www/test/tests/2d.clearRect.clip.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.beginPath(); +ctx.rect(0, 0, 16, 16); +ctx.clip(); + +ctx.clearRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 16, 16); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests/2d.clearRect.globalalpha.js b/platforms/ios/www/test/tests/2d.clearRect.globalalpha.js new file mode 100644 index 0000000..4525615 --- /dev/null +++ b/platforms/ios/www/test/tests/2d.clearRect.globalalpha.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalAlpha = 0.1; +ctx.clearRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests/2d.clearRect.globalcomposite.js b/platforms/ios/www/test/tests/2d.clearRect.globalcomposite.js new file mode 100644 index 0000000..8285119 --- /dev/null +++ b/platforms/ios/www/test/tests/2d.clearRect.globalcomposite.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.globalCompositeOperation = 'destination-atop'; +ctx.clearRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests/2d.clearRect.negative.js b/platforms/ios/www/test/tests/2d.clearRect.negative.js new file mode 100644 index 0000000..a3574f3 --- /dev/null +++ b/platforms/ios/www/test/tests/2d.clearRect.negative.js @@ -0,0 +1,15 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.clearRect(0, 0, 50, 25); +ctx.clearRect(100, 0, -50, 25); +ctx.clearRect(0, 50, 50, -25); +ctx.clearRect(100, 50, -50, -25); +_assertPixel(canvas, 25,12, 0,0,0,0, "25,12", "0,0,0,0"); +_assertPixel(canvas, 75,12, 0,0,0,0, "75,12", "0,0,0,0"); +_assertPixel(canvas, 25,37, 0,0,0,0, "25,37", "0,0,0,0"); +_assertPixel(canvas, 75,37, 0,0,0,0, "75,37", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests/2d.clearRect.path.js b/platforms/ios/www/test/tests/2d.clearRect.path.js new file mode 100644 index 0000000..360372a --- /dev/null +++ b/platforms/ios/www/test/tests/2d.clearRect.path.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.beginPath(); +ctx.rect(0, 0, 100, 50); +ctx.clearRect(0, 0, 16, 16); +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests/2d.clearRect.transform.js b/platforms/ios/www/test/tests/2d.clearRect.transform.js new file mode 100644 index 0000000..6b407f4 --- /dev/null +++ b/platforms/ios/www/test/tests/2d.clearRect.transform.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.scale(10, 10); +ctx.translate(0, 5); +ctx.clearRect(0, -5, 10, 5); +_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0"); + + +}); diff --git a/platforms/ios/www/test/tests/2d.clearRect.zero.js b/platforms/ios/www/test/tests/2d.clearRect.zero.js new file mode 100644 index 0000000..efdde6b --- /dev/null +++ b/platforms/ios/www/test/tests/2d.clearRect.zero.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.clearRect(0, 0, 100, 0); +ctx.clearRect(0, 0, 0, 50); +ctx.clearRect(0, 0, 0, 0); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests/2d.coordinatespace.js b/platforms/ios/www/test/tests/2d.coordinatespace.js new file mode 100644 index 0000000..8220b08 --- /dev/null +++ b/platforms/ios/www/test/tests/2d.coordinatespace.js @@ -0,0 +1,14 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#00f'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0ff'; +ctx.fillRect(0, 0, 50, 25); +_assertPixel(canvas, 25,12, 0,255,255,255, "25,12", "0,255,255,255"); +_assertPixel(canvas, 75,12, 0,0,255,255, "75,12", "0,0,255,255"); +_assertPixel(canvas, 25,37, 0,0,255,255, "25,37", "0,0,255,255"); +_assertPixel(canvas, 75,37, 0,0,255,255, "75,37", "0,0,255,255"); +_requireManualCheck(); // because we can't tell that getPixelData isn't using the wrong coordinate space too + + +}); diff --git a/platforms/ios/www/test/tests/2d.drawImage.3arg.js b/platforms/ios/www/test/tests/2d.drawImage.3arg.js new file mode 100644 index 0000000..45143bb --- /dev/null +++ b/platforms/ios/www/test/tests/2d.drawImage.3arg.js @@ -0,0 +1,26 @@ +_addTest(function(canvas, ctx) { + var redImage = new Image(); + var greenImage = new Image(); + + redImage.src = 'test/images/red.png'; + redImage.onload = function () { + + greenImage.src = 'test/images/green.png'; + greenImage.onload = function () { + draw(); + } + } + + function draw() { + ctx.drawImage(greenImage, 0, 0); + ctx.drawImage(redImage, -100, 0); + ctx.drawImage(redImage, 100, 0); + ctx.drawImage(redImage, 0, -50); + ctx.drawImage(redImage, 0, 50); + + _assertPixelApprox(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2); + _assertPixelApprox(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2); + _assertPixelApprox(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2); + _assertPixelApprox(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2); + } +}); diff --git a/platforms/ios/www/test/tests/2d.drawImage.5arg.js b/platforms/ios/www/test/tests/2d.drawImage.5arg.js new file mode 100644 index 0000000..5035110 --- /dev/null +++ b/platforms/ios/www/test/tests/2d.drawImage.5arg.js @@ -0,0 +1,28 @@ +_addTest(function(canvas, ctx) { + + var redImage = new Image(); + var greenImage = new Image(); + + redImage.src = 'test/images/red.png'; + redImage.onload = function () { + + greenImage.src = 'test/images/green.png'; + greenImage.onload = function () { + draw(); + } + } + + function draw () { + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.drawImage(greenImage, 50, 0, 50, 50); + ctx.drawImage(redImage, 0, 0, 50, 50); + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 50, 50); + + _assertPixelApprox(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2); + _assertPixelApprox(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2); + _assertPixelApprox(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2); + _assertPixelApprox(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2); + } +}); diff --git a/platforms/ios/www/test/tests/2d.drawImage.9arg.basic.js b/platforms/ios/www/test/tests/2d.drawImage.9arg.basic.js new file mode 100644 index 0000000..e080b8b --- /dev/null +++ b/platforms/ios/www/test/tests/2d.drawImage.9arg.basic.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + var greenImage = new Image(); + greenImage.src = 'test/images/green.png'; + greenImage.onload = function () { + draw(); + } + + function draw () { + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.drawImage(greenImage, 0, 0, 100, 50, 0, 0, 100, 50); + _assertPixelApprox(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2); + _assertPixelApprox(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2); + _assertPixelApprox(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2); + _assertPixelApprox(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2); + } +}); diff --git a/platforms/ios/www/test/tests/2d.drawImage.9arg.destpos.js b/platforms/ios/www/test/tests/2d.drawImage.9arg.destpos.js new file mode 100644 index 0000000..fb8f283 --- /dev/null +++ b/platforms/ios/www/test/tests/2d.drawImage.9arg.destpos.js @@ -0,0 +1,28 @@ +_addTest(function(canvas, ctx) { + + var redImage = new Image(); + var greenImage = new Image(); + + redImage.src = 'test/images/red.png'; + redImage.onload = function () { + + greenImage.src = 'test/images/green.png'; + greenImage.onload = function () { + draw(); + } + } + + function draw () { + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.drawImage(greenImage, 0, 0, 100, 50, 0, 0, 100, 50); + ctx.drawImage(redImage, 0, 0, 100, 50, -100, 0, 100, 50); + ctx.drawImage(redImage, 0, 0, 100, 50, 100, 0, 100, 50); + ctx.drawImage(redImage, 0, 0, 100, 50, 0, -50, 100, 50); + ctx.drawImage(redImage, 0, 0, 100, 50, 0, 50, 100, 50); + _assertPixelApprox(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2); + _assertPixelApprox(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2); + _assertPixelApprox(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2); + _assertPixelApprox(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2); + } +}); diff --git a/platforms/ios/www/test/tests/2d.drawImage.9arg.destsize.js b/platforms/ios/www/test/tests/2d.drawImage.9arg.destsize.js new file mode 100644 index 0000000..153be0f --- /dev/null +++ b/platforms/ios/www/test/tests/2d.drawImage.9arg.destsize.js @@ -0,0 +1,28 @@ +_addTest(function(canvas, ctx) { + + var redImage = new Image(); + var greenImage = new Image(); + + redImage.src = 'test/images/red.png'; + redImage.onload = function () { + + greenImage.src = 'test/images/green.png'; + greenImage.onload = function () { + draw(); + } + } + + function draw () { + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.drawImage(greenImage, 1, 1, 1, 1, 0, 0, 100, 50); + ctx.drawImage(redImage, 0, 0, 100, 50, -50, 0, 50, 50); + ctx.drawImage(redImage, 0, 0, 100, 50, 100, 0, 50, 50); + ctx.drawImage(redImage, 0, 0, 100, 50, 0, -25, 100, 25); + ctx.drawImage(redImage, 0, 0, 100, 50, 0, 50, 100, 25); + _assertPixelApprox(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2); + _assertPixelApprox(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2); + _assertPixelApprox(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2); + _assertPixelApprox(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2); + } +}); diff --git a/platforms/ios/www/test/tests/2d.drawImage.9arg.sourcepos.js b/platforms/ios/www/test/tests/2d.drawImage.9arg.sourcepos.js new file mode 100644 index 0000000..1c694cf --- /dev/null +++ b/platforms/ios/www/test/tests/2d.drawImage.9arg.sourcepos.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + + var rgrg = new Image(); + rgrg.src = 'test/images/rgrg-256x256.png'; + rgrg.onload = function () { + draw(); + } + + function draw () { + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.drawImage(rgrg, 140, 20, 100, 50, 0, 0, 100, 50); + _assertPixelApprox(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2); + _assertPixelApprox(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2); + _assertPixelApprox(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2); + _assertPixelApprox(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2); + } +}); diff --git a/platforms/ios/www/test/tests/2d.drawImage.9arg.sourcesize.js b/platforms/ios/www/test/tests/2d.drawImage.9arg.sourcesize.js new file mode 100644 index 0000000..fb240cb --- /dev/null +++ b/platforms/ios/www/test/tests/2d.drawImage.9arg.sourcesize.js @@ -0,0 +1,25 @@ +_addTest(function(canvas, ctx) { + + var rgrg = new Image(); + rgrg.src = 'test/images/rgrg-256x256.png'; + rgrg.onload = function () { + draw(); + } + + function draw () { + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.drawImage(rgrg, 0, 0, 256, 256, 0, 0, 100, 50); + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 51, 26); + ctx.fillRect(49, 24, 51, 26); + _assertPixelApprox(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2); + _assertPixelApprox(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2); + _assertPixelApprox(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2); + _assertPixelApprox(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2); + _assertPixelApprox(canvas, 20,20, 0,255,0,255, "20,20", "0,255,0,255", 2); + _assertPixelApprox(canvas, 80,20, 0,255,0,255, "80,20", "0,255,0,255", 2); + _assertPixelApprox(canvas, 20,30, 0,255,0,255, "20,30", "0,255,0,255", 2); + _assertPixelApprox(canvas, 80,30, 0,255,0,255, "80,30", "0,255,0,255", 2); + } +}); diff --git a/platforms/ios/www/test/tests/2d.drawImage.alpha.js b/platforms/ios/www/test/tests/2d.drawImage.alpha.js new file mode 100644 index 0000000..2a2534d --- /dev/null +++ b/platforms/ios/www/test/tests/2d.drawImage.alpha.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + + var redImage = new Image(); + redImage.src = 'test/images/red.png'; + redImage.onload = function () { + draw(); + } + + function draw () { + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalAlpha = 0; + ctx.drawImage(redImage, 0, 0); + _assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + } + +}); diff --git a/platforms/ios/www/test/tests/2d.drawImage.animated.apng.js b/platforms/ios/www/test/tests/2d.drawImage.animated.apng.js new file mode 100644 index 0000000..87428c5 --- /dev/null +++ b/platforms/ios/www/test/tests/2d.drawImage.animated.apng.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + deferTest(); + var animgr = new Image(); + animgr.src = 'test/images/anim-gr.png'; + animgr.onload = function () { + draw(); + } + + function draw () { + setTimeout(wrapFunction(function () { + ctx.drawImage(animgr, 0, 0); + _assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + }), 500); + } + +}); diff --git a/platforms/ios/www/test/tests/2d.drawImage.animated.poster.js b/platforms/ios/www/test/tests/2d.drawImage.animated.poster.js new file mode 100644 index 0000000..08da7fe --- /dev/null +++ b/platforms/ios/www/test/tests/2d.drawImage.animated.poster.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + + var animgr = new Image(); + animgr.src = 'test/images/anim-poster-gr.png'; + animgr.onload = function () { + draw(); + } + + function draw () { + ctx.drawImage(animgr, 0, 0); + _assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + } +}); diff --git a/platforms/ios/www/test/tests/2d.drawImage.broken.js b/platforms/ios/www/test/tests/2d.drawImage.broken.js new file mode 100644 index 0000000..ebfb204 --- /dev/null +++ b/platforms/ios/www/test/tests/2d.drawImage.broken.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + + var broken = new Image(); + broken.src = 'test/images/broken.png'; + broken.onload = function () { + draw(); + } + + function draw() { + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + var img = broken; + _assertSame(img.complete, false, "img.complete", "false"); + ctx.drawImage(img, 0, 0); + } + +}); diff --git a/platforms/ios/www/test/tests/2d.drawImage.canvas.js b/platforms/ios/www/test/tests/2d.drawImage.canvas.js new file mode 100644 index 0000000..b4a881d --- /dev/null +++ b/platforms/ios/www/test/tests/2d.drawImage.canvas.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = '#0f0'; +ctx2.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#f00'; +ctx.drawImage(canvas2, 0, 0); + +_assertPixelApprox(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2); +_assertPixelApprox(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2); +_assertPixelApprox(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2); +_assertPixelApprox(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests/2d.drawImage.clip.js b/platforms/ios/www/test/tests/2d.drawImage.clip.js new file mode 100644 index 0000000..2eefb56 --- /dev/null +++ b/platforms/ios/www/test/tests/2d.drawImage.clip.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + var redImage = new Image(); + redImage.src = 'test/images/red.png'; + redImage.onload = function () { + draw(); + } + + function draw () { + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + ctx.rect(-10, -10, 1, 1); + ctx.clip(); + ctx.drawImage(redImage, 0, 0); + _assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + } + +}); diff --git a/platforms/ios/www/test/tests/2d.drawImage.composite.js b/platforms/ios/www/test/tests/2d.drawImage.composite.js new file mode 100644 index 0000000..d903439 --- /dev/null +++ b/platforms/ios/www/test/tests/2d.drawImage.composite.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + var redImage = new Image(); + redImage.src = 'test/images/anim-gr.gif'; + redImage.onload = function () { + draw(); + } + + function draw () { + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'destination-over'; + ctx.drawImage(redImage, 0, 0); + _assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + } + +}); diff --git a/platforms/ios/www/test/tests/2d.drawImage.floatsource.js b/platforms/ios/www/test/tests/2d.drawImage.floatsource.js new file mode 100644 index 0000000..30a3fbc --- /dev/null +++ b/platforms/ios/www/test/tests/2d.drawImage.floatsource.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + var greenImage = new Image(); + greenImage.src = 'test/images/green.png'; + greenImage.onload = function () { + draw(); + } + + function draw () { + ctx.drawImage(greenImage, 10.1, 10.1, 0.1, 0.1, 0, 0, 100, 50); + _assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + } + +}); diff --git a/platforms/ios/www/test/tests/2d.drawImage.incomplete.js b/platforms/ios/www/test/tests/2d.drawImage.incomplete.js new file mode 100644 index 0000000..b85c370 --- /dev/null +++ b/platforms/ios/www/test/tests/2d.drawImage.incomplete.js @@ -0,0 +1,9 @@ +_addTest(function(canvas, ctx) { + + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + var img = new Image(); + _assertSame(img.complete, false, "img.complete", "false"); + ctx.drawImage(img, 0, 0); + +}); diff --git a/platforms/ios/www/test/tests/2d.drawImage.negativedest.js b/platforms/ios/www/test/tests/2d.drawImage.negativedest.js new file mode 100644 index 0000000..4a13f12 --- /dev/null +++ b/platforms/ios/www/test/tests/2d.drawImage.negativedest.js @@ -0,0 +1,25 @@ +_addTest(function(canvas, ctx) { + + var ggrr = new Image(); + ggrr.src = 'test/images/ggrr-256x256.png'; + ggrr.onload = function () { + draw(); + } + + function draw () { + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.drawImage(ggrr, 100, 78, 50, 50, 0, 50, 50, -50); + ctx.drawImage(ggrr, 100, 128, 50, -50, 100, 50, -50, -50); + _assertPixelApprox(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255", 2); + _assertPixelApprox(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255", 2); + _assertPixelApprox(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255", 2); + _assertPixelApprox(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255", 2); + _assertPixelApprox(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255", 2); + _assertPixelApprox(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255", 2); + _assertPixelApprox(canvas, 51,1, 0,255,0,255, "51,1", "0,255,0,255", 2); + _assertPixelApprox(canvas, 51,48, 0,255,0,255, "51,48", "0,255,0,255", 2); + _assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2); + _assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2); + } +}); diff --git a/platforms/ios/www/test/tests/2d.drawImage.negativedir.js b/platforms/ios/www/test/tests/2d.drawImage.negativedir.js new file mode 100644 index 0000000..ec07bc7 --- /dev/null +++ b/platforms/ios/www/test/tests/2d.drawImage.negativedir.js @@ -0,0 +1,25 @@ +_addTest(function(canvas, ctx) { + var ggrr = new Image(); + ggrr.src = 'test/images/ggrr-256x256.png'; + ggrr.onload = function () { + draw(); + } + + function draw () { + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.drawImage(ggrr, 0, 178, 50, -100, 0, 0, 50, 100); + ctx.drawImage(ggrr, 0, 78, 50, 100, 50, 100, 50, -100); + _assertPixelApprox(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255", 2); + _assertPixelApprox(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255", 2); + _assertPixelApprox(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255", 2); + _assertPixelApprox(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255", 2); + _assertPixelApprox(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255", 2); + _assertPixelApprox(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255", 2); + _assertPixelApprox(canvas, 51,1, 0,255,0,255, "51,1", "0,255,0,255", 2); + _assertPixelApprox(canvas, 51,48, 0,255,0,255, "51,48", "0,255,0,255", 2); + _assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2); + _assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2); + } + +}); diff --git a/platforms/ios/www/test/tests/2d.drawImage.negativesource.js b/platforms/ios/www/test/tests/2d.drawImage.negativesource.js new file mode 100644 index 0000000..e6c43dd --- /dev/null +++ b/platforms/ios/www/test/tests/2d.drawImage.negativesource.js @@ -0,0 +1,25 @@ +_addTest(function(canvas, ctx) { + var ggrr = new Image(); + ggrr.src = 'test/images/ggrr-256x256.png'; + ggrr.onload = function () { + draw(); + } + + function draw () { + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.drawImage(ggrr, 100, 78, -100, 50, 0, 0, 50, 50); + ctx.drawImage(ggrr, 100, 128, -100, -50, 50, 0, 50, 50); + _assertPixelApprox(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255", 2); + _assertPixelApprox(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255", 2); + _assertPixelApprox(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255", 2); + _assertPixelApprox(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255", 2); + _assertPixelApprox(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255", 2); + _assertPixelApprox(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255", 2); + _assertPixelApprox(canvas, 51,1, 0,255,0,255, "51,1", "0,255,0,255", 2); + _assertPixelApprox(canvas, 51,48, 0,255,0,255, "51,48", "0,255,0,255", 2); + _assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2); + _assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2); + } + +}); diff --git a/platforms/ios/www/test/tests/2d.drawImage.nowrap.js b/platforms/ios/www/test/tests/2d.drawImage.nowrap.js new file mode 100644 index 0000000..ecd9374 --- /dev/null +++ b/platforms/ios/www/test/tests/2d.drawImage.nowrap.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + var transparentImage = new Image(); + transparentImage.src = 'test/images/redtransparent.png'; + transparentImage.onload = function () { + draw(); + } + + function draw () { + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + ctx.drawImage(transparentImage, -1950, 0, 2000, 50); + _assertPixelApprox(canvas, 45,25, 0,255,0,255, "45,25", "0,255,0,255", 2); + _assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + _assertPixelApprox(canvas, 55,25, 0,255,0,255, "55,25", "0,255,0,255", 2); + } + +}); diff --git a/platforms/ios/www/test/tests/2d.drawImage.outsidesource.js b/platforms/ios/www/test/tests/2d.drawImage.outsidesource.js new file mode 100644 index 0000000..0a6ef71 --- /dev/null +++ b/platforms/ios/www/test/tests/2d.drawImage.outsidesource.js @@ -0,0 +1,47 @@ +_addTest(function(canvas, ctx) { + + var redImage = new Image(); + var greenImage = new Image(); + + redImage.src = 'test/images/red.png'; + redImage.onload = function () { + + greenImage.src = 'test/images/green.png'; + greenImage.onload = function () { + draw(); + } + } + + function draw () { + + ctx.drawImage(greenImage, 10.5, 10.5, 89.5, 39.5, 0, 0, 100, 50); + ctx.drawImage(greenImage, 5.5, 5.5, -5.5, -5.5, 0, 0, 100, 50); + ctx.drawImage(greenImage, 100, 50, -5, -5, 0, 0, 100, 50); + try { var _thrown = false; + ctx.drawImage(redImage, -0.001, 0, 100, 50, 0, 0, 100, 50); + } catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), -0.001, 0, 100, 50, 0, 0, 100, 50)"); } + try { var _thrown = false; + ctx.drawImage(redImage, 0, -0.001, 100, 50, 0, 0, 100, 50); + } catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 0, -0.001, 100, 50, 0, 0, 100, 50)"); } + try { var _thrown = false; + ctx.drawImage(redImage, 0, 0, 100.001, 50, 0, 0, 100, 50); + } catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 0, 0, 100.001, 50, 0, 0, 100, 50)"); } + try { var _thrown = false; + ctx.drawImage(redImage, 0, 0, 100, 50.001, 0, 0, 100, 50); + } catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 0, 0, 100, 50.001, 0, 0, 100, 50)"); } + try { var _thrown = false; + ctx.drawImage(redImage, 50, 0, 50.001, 50, 0, 0, 100, 50); + } catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 50, 0, 50.001, 50, 0, 0, 100, 50)"); } + try { var _thrown = false; + ctx.drawImage(redImage, 0, 0, -5, 5, 0, 0, 100, 50); + } catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 0, 0, -5, 5, 0, 0, 100, 50)"); } + try { var _thrown = false; + ctx.drawImage(redImage, 0, 0, 5, -5, 0, 0, 100, 50); + } catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 0, 0, 5, -5, 0, 0, 100, 50)"); } + try { var _thrown = false; + ctx.drawImage(redImage, 110, 60, -20, -20, 0, 0, 100, 50); + } catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 110, 60, -20, -20, 0, 0, 100, 50)"); } + _assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + } + +}); diff --git a/platforms/ios/www/test/tests/2d.drawImage.path.js b/platforms/ios/www/test/tests/2d.drawImage.path.js new file mode 100644 index 0000000..3a9545d --- /dev/null +++ b/platforms/ios/www/test/tests/2d.drawImage.path.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + var redImage = new Image(); + redImage.src = 'test/images/red.png'; + redImage.onload = function () { + draw(); + } + + function draw () { + ctx.fillStyle = '#0f0'; + ctx.rect(0, 0, 100, 50); + ctx.drawImage(redImage, 0, 0); + ctx.fill(); + _assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + } + +}); diff --git a/platforms/ios/www/test/tests/2d.drawImage.transform.js b/platforms/ios/www/test/tests/2d.drawImage.transform.js new file mode 100644 index 0000000..0bd00f3 --- /dev/null +++ b/platforms/ios/www/test/tests/2d.drawImage.transform.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + var redImage = new Image(); + redImage.src = 'test/images/red.png'; + redImage.onload = function () { + draw(); + } + + function draw () { + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + ctx.translate(100, 0); + ctx.drawImage(redImage, 0, 0); + _assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + } + +}); diff --git a/platforms/ios/www/test/tests/2d.fillRect.basic.js b/platforms/ios/www/test/tests/2d.fillRect.basic.js new file mode 100644 index 0000000..d7e98b3 --- /dev/null +++ b/platforms/ios/www/test/tests/2d.fillRect.basic.js @@ -0,0 +1,8 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests/2d.fillRect.clip.js b/platforms/ios/www/test/tests/2d.fillRect.clip.js new file mode 100644 index 0000000..1259f13 --- /dev/null +++ b/platforms/ios/www/test/tests/2d.fillRect.clip.js @@ -0,0 +1,19 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.beginPath(); +ctx.rect(0, 0, 16, 16); +ctx.clip(); + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 16, 16); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests/2d.fillRect.negative.js b/platforms/ios/www/test/tests/2d.fillRect.negative.js new file mode 100644 index 0000000..b582917 --- /dev/null +++ b/platforms/ios/www/test/tests/2d.fillRect.negative.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 50, 25); +ctx.fillRect(100, 0, -50, 25); +ctx.fillRect(0, 50, 50, -25); +ctx.fillRect(100, 50, -50, -25); +_assertPixel(canvas, 25,12, 0,255,0,255, "25,12", "0,255,0,255"); +_assertPixel(canvas, 75,12, 0,255,0,255, "75,12", "0,255,0,255"); +_assertPixel(canvas, 25,37, 0,255,0,255, "25,37", "0,255,0,255"); +_assertPixel(canvas, 75,37, 0,255,0,255, "75,37", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests/2d.fillRect.path.js b/platforms/ios/www/test/tests/2d.fillRect.path.js new file mode 100644 index 0000000..6d5fec5 --- /dev/null +++ b/platforms/ios/www/test/tests/2d.fillRect.path.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.beginPath(); +ctx.rect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 16, 16); +ctx.fillStyle = '#0f0'; +ctx.fill(); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests/2d.fillRect.transform.js b/platforms/ios/www/test/tests/2d.fillRect.transform.js new file mode 100644 index 0000000..d80df06 --- /dev/null +++ b/platforms/ios/www/test/tests/2d.fillRect.transform.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +ctx.scale(10, 10); +ctx.translate(0, 5); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, -5, 10, 5); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests/2d.fillRect.zero.js b/platforms/ios/www/test/tests/2d.fillRect.zero.js new file mode 100644 index 0000000..f600d5e --- /dev/null +++ b/platforms/ios/www/test/tests/2d.fillRect.zero.js @@ -0,0 +1,12 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 0); +ctx.fillRect(0, 0, 0, 50); +ctx.fillRect(0, 0, 0, 0); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests/2d.getcontext.exists.js b/platforms/ios/www/test/tests/2d.getcontext.exists.js new file mode 100644 index 0000000..1576a66 --- /dev/null +++ b/platforms/ios/www/test/tests/2d.getcontext.exists.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertDifferent(canvas.getContext('2d'), null, "canvas.getContext('2d')", "null"); + + +}); diff --git a/platforms/ios/www/test/tests/2d.getcontext.shared.js b/platforms/ios/www/test/tests/2d.getcontext.shared.js new file mode 100644 index 0000000..a18ef07 --- /dev/null +++ b/platforms/ios/www/test/tests/2d.getcontext.shared.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +var ctx2 = canvas.getContext('2d'); +ctx.fillStyle = '#f00'; +ctx2.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests/2d.getcontext.unique.js b/platforms/ios/www/test/tests/2d.getcontext.unique.js new file mode 100644 index 0000000..1d34c7a --- /dev/null +++ b/platforms/ios/www/test/tests/2d.getcontext.unique.js @@ -0,0 +1,6 @@ +_addTest(function(canvas, ctx) { + +_assertSame(canvas.getContext('2d'), canvas.getContext('2d'), "canvas.getContext('2d')", "canvas.getContext('2d')"); + + +}); diff --git a/platforms/ios/www/test/tests/2d.gradient.empty.js b/platforms/ios/www/test/tests/2d.gradient.empty.js new file mode 100644 index 0000000..f204d2b --- /dev/null +++ b/platforms/ios/www/test/tests/2d.gradient.empty.js @@ -0,0 +1,11 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +var g = ctx.createLinearGradient(0, 0, 0, 50); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests/2d.gradient.interpolate.vertical.js b/platforms/ios/www/test/tests/2d.gradient.interpolate.vertical.js new file mode 100644 index 0000000..30bdf8d --- /dev/null +++ b/platforms/ios/www/test/tests/2d.gradient.interpolate.vertical.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +var g = ctx.createLinearGradient(0, 0, 0, 50); +g.addColorStop(0, '#ff0'); +g.addColorStop(1, '#00f'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,12, 191,191,63,255, "50,12", "191,191,63,255", 10); +_assertPixelApprox(canvas, 50,25, 127,127,127,255, "50,25", "127,127,127,255", 5); +_assertPixelApprox(canvas, 50,37, 63,63,191,255, "50,37", "63,63,191,255", 10); + + +}); diff --git a/platforms/ios/www/test/tests/2d.gradient.linear.transform.1.js b/platforms/ios/www/test/tests/2d.gradient.linear.transform.1.js new file mode 100644 index 0000000..297fdc5 --- /dev/null +++ b/platforms/ios/www/test/tests/2d.gradient.linear.transform.1.js @@ -0,0 +1,16 @@ +_addTest(function(canvas, ctx) { + +var g = ctx.createLinearGradient(0, 0, 200, 0); +g.addColorStop(0, '#f00'); +g.addColorStop(0.25, '#0f0'); +g.addColorStop(0.75, '#0f0'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.translate(-50, 0); +ctx.fillRect(50, 0, 100, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests/2d.gradient.linear.transform.2.js b/platforms/ios/www/test/tests/2d.gradient.linear.transform.2.js new file mode 100644 index 0000000..d461074 --- /dev/null +++ b/platforms/ios/www/test/tests/2d.gradient.linear.transform.2.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +ctx.translate(100, 0); +var g = ctx.createLinearGradient(0, 0, 200, 0); +g.addColorStop(0, '#f00'); +g.addColorStop(0.25, '#0f0'); +g.addColorStop(0.75, '#0f0'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.translate(-150, 0); +ctx.fillRect(50, 0, 100, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests/2d.gradient.linear.transform.3.js b/platforms/ios/www/test/tests/2d.gradient.linear.transform.3.js new file mode 100644 index 0000000..152ce92 --- /dev/null +++ b/platforms/ios/www/test/tests/2d.gradient.linear.transform.3.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +var g = ctx.createLinearGradient(0, 0, 200, 0); +g.addColorStop(0, '#f00'); +g.addColorStop(0.25, '#0f0'); +g.addColorStop(0.75, '#0f0'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +ctx.translate(-50, 0); +ctx.fillRect(50, 0, 100, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests/2d.gradient.object.compare.js b/platforms/ios/www/test/tests/2d.gradient.object.compare.js new file mode 100644 index 0000000..d143b9c --- /dev/null +++ b/platforms/ios/www/test/tests/2d.gradient.object.compare.js @@ -0,0 +1,10 @@ +_addTest(function(canvas, ctx) { + +var g1 = ctx.createLinearGradient(0, 0, 100, 0); +var g2 = ctx.createLinearGradient(0, 0, 100, 0); +_assertDifferent(g1, g2, "g1", "g2"); +ctx.fillStyle = g1; +_assertSame(ctx.fillStyle, g1, "ctx.fillStyle", "g1"); + + +}); diff --git a/platforms/ios/www/test/tests/2d.gradient.object.crosscanvas.js b/platforms/ios/www/test/tests/2d.gradient.object.crosscanvas.js new file mode 100644 index 0000000..9a97619 --- /dev/null +++ b/platforms/ios/www/test/tests/2d.gradient.object.crosscanvas.js @@ -0,0 +1,13 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +var g = document.createElement('canvas').getContext('2d').createLinearGradient(0, 0, 100, 0); +g.addColorStop(0, '#0f0'); +g.addColorStop(1, '#0f0'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); diff --git a/platforms/ios/www/test/tests/2d.gradient.radial.cone.behind.js b/platforms/ios/www/test/tests/2d.gradient.radial.cone.behind.js new file mode 100644 index 0000000..6699a5c --- /dev/null +++ b/platforms/ios/www/test/tests/2d.gradient.radial.cone.behind.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(120, 25, 10, 211, 25, 100); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests/2d.gradient.radial.cone.bottom.js b/platforms/ios/www/test/tests/2d.gradient.radial.cone.bottom.js new file mode 100644 index 0000000..d4f3e09 --- /dev/null +++ b/platforms/ios/www/test/tests/2d.gradient.radial.cone.bottom.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(210, 25, 100, 230, 25, 101); +g.addColorStop(0, '#0f0'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests/2d.gradient.radial.cone.cylinder.js b/platforms/ios/www/test/tests/2d.gradient.radial.cone.cylinder.js new file mode 100644 index 0000000..5455012 --- /dev/null +++ b/platforms/ios/www/test/tests/2d.gradient.radial.cone.cylinder.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(210, 25, 100, 230, 25, 100); +g.addColorStop(0, '#0f0'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests/2d.gradient.radial.cone.front.js b/platforms/ios/www/test/tests/2d.gradient.radial.cone.front.js new file mode 100644 index 0000000..54bdcda --- /dev/null +++ b/platforms/ios/www/test/tests/2d.gradient.radial.cone.front.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(311, 25, 10, 210, 25, 100); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#0f0'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests/2d.gradient.radial.cone.shape1.js b/platforms/ios/www/test/tests/2d.gradient.radial.cone.shape1.js new file mode 100644 index 0000000..065fd1a --- /dev/null +++ b/platforms/ios/www/test/tests/2d.gradient.radial.cone.shape1.js @@ -0,0 +1,32 @@ +_addTest(function(canvas, ctx) { + +var tol = 1; // tolerance to avoid antialiasing artifacts + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(30+tol, 40); +ctx.lineTo(110, -20+tol); +ctx.lineTo(110, 100-tol); +ctx.fill(); + +var g = ctx.createRadialGradient(30+10*5/2, 40, 10*3/2, 30+10*15/4, 40, 10*9/4); +g.addColorStop(0, '#0f0'); +g.addColorStop(1, '#0f0'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests/2d.gradient.radial.cone.top.js b/platforms/ios/www/test/tests/2d.gradient.radial.cone.top.js new file mode 100644 index 0000000..c1b4cd2 --- /dev/null +++ b/platforms/ios/www/test/tests/2d.gradient.radial.cone.top.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(230, 25, 100, 100, 25, 101); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#0f0'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests/2d.gradient.radial.inside1.js b/platforms/ios/www/test/tests/2d.gradient.radial.inside1.js new file mode 100644 index 0000000..40747e8 --- /dev/null +++ b/platforms/ios/www/test/tests/2d.gradient.radial.inside1.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(50, 25, 100, 50, 25, 200); +g.addColorStop(0, '#0f0'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests/2d.gradient.radial.outside1.js b/platforms/ios/www/test/tests/2d.gradient.radial.outside1.js new file mode 100644 index 0000000..365d957 --- /dev/null +++ b/platforms/ios/www/test/tests/2d.gradient.radial.outside1.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(200, 25, 10, 200, 25, 20); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#0f0'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests/2d.gradient.radial.touch1.js b/platforms/ios/www/test/tests/2d.gradient.radial.touch1.js new file mode 100644 index 0000000..2761093 --- /dev/null +++ b/platforms/ios/www/test/tests/2d.gradient.radial.touch1.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(150, 25, 50, 200, 25, 100); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests/2d.gradient.radial.touch3.js b/platforms/ios/www/test/tests/2d.gradient.radial.touch3.js new file mode 100644 index 0000000..3c8a546 --- /dev/null +++ b/platforms/ios/www/test/tests/2d.gradient.radial.touch3.js @@ -0,0 +1,23 @@ +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(120, -15, 25, 140, -30, 50); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests/2d.gradient.radial.transform.1.js b/platforms/ios/www/test/tests/2d.gradient.radial.transform.1.js new file mode 100644 index 0000000..bfc0ebc --- /dev/null +++ b/platforms/ios/www/test/tests/2d.gradient.radial.transform.1.js @@ -0,0 +1,17 @@ +_addTest(function(canvas, ctx) { + +var g = ctx.createRadialGradient(0, 0, 0, 0, 0, 11.2); +g.addColorStop(0, '#0f0'); +g.addColorStop(0.5, '#0f0'); +g.addColorStop(0.51, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.translate(50, 25); +ctx.scale(10, 10); +ctx.fillRect(-5, -2.5, 10, 5); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests/2d.gradient.radial.transform.2.js b/platforms/ios/www/test/tests/2d.gradient.radial.transform.2.js new file mode 100644 index 0000000..1603b0b --- /dev/null +++ b/platforms/ios/www/test/tests/2d.gradient.radial.transform.2.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +ctx.translate(100, 0); +var g = ctx.createRadialGradient(0, 0, 0, 0, 0, 11.2); +g.addColorStop(0, '#0f0'); +g.addColorStop(0.5, '#0f0'); +g.addColorStop(0.51, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.translate(-50, 25); +ctx.scale(10, 10); +ctx.fillRect(-5, -2.5, 10, 5); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); diff --git a/platforms/ios/www/test/tests/2d.gradient.radial.transform.3.js b/platforms/ios/www/test/tests/2d.gradient.radial.transform.3.js new file mode 100644 index 0000000..33acdd4 --- /dev/null +++ b/platforms/ios/www/test/tests/2d.gradient.radial.transform.3.js @@ -0,0 +1,18 @@ +_addTest(function(canvas, ctx) { + +var g = ctx.createRadialGradient(0, 0, 0, 0, 0, 11.2); +g.addColorStop(0, '#0f0'); +g.addColorStop(0.5, '#0f0'); +g.addColorStop(0.51, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +ctx.translate(50, 25); +ctx.scale(10, 10); +ctx.fillRect(-5, -2.5, 10, 5); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +});