From 9865d7bdd52cb4220f57143314f438600bb9fb12 Mon Sep 17 00:00:00 2001 From: Jonathan Puckey Date: Sun, 17 Mar 2013 18:13:55 +0100 Subject: [PATCH] Add raster constructor tests, add async test helper function and test image. --- test/lib/helpers.js | 10 ++++++++ test/resources/paper-js.gif | Bin 0 -> 4703 bytes test/tests/Raster.js | 45 ++++++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 test/resources/paper-js.gif diff --git a/test/lib/helpers.js b/test/lib/helpers.js index 4c4cf666..90311c80 100644 --- a/test/lib/helpers.js +++ b/test/lib/helpers.js @@ -49,6 +49,16 @@ function test(testName, expected) { }); } +function asyncTest(testName, expected) { + return QUnit.asyncTest(testName, function() { + var project = new Project(); + expected(function() { + project.remove(); + start(); + }); + }); +} + function compareNumbers(number1, number2, message) { equals(Format.number(number1, 2), Format.number(number2, 2), message); } diff --git a/test/resources/paper-js.gif b/test/resources/paper-js.gif new file mode 100644 index 0000000000000000000000000000000000000000..e6775a4a75de654218cae71aab08ddb56d746adb GIT binary patch literal 4703 zcmaJ>dmxkT-`~j`W}5T4W^>MA4#SAdHd>{SoW`LI!4kYYz4^9XV z#!*o_?T|Zo);wkulg6bWdCUk_v^CEbMWIFp(X2P;zm|qO{~4&wY#eHcwHwj# zKe;v|TNItkjj}d2j*E*kiZe5c z6qganLjF>u1VzShZBd(*{&x$^sDETx(MEr_V-y_8H0DvFj7^L%zgqeYbawv#p-kpK z=xDAR?SJb1KZT>+Vrf)IP9zigcgxm{ zf3Jo3uX_LCQvbCUBI#eb#+$_$|JvC9wb8$qHr?}U`j2flgMW-qV{N*fvuSJK#$P{w zeE;@!eQov2%ID=zOCLYHUwrp=VgAkB?9A)wS5q%1C&piljXocFHazs_;M0L8k015_ z(bwDau)C|Xqy0hK{nmSTTkhO$zSVT|M&tE{`fFFOT&}CFxl~=wWSYBg|hstv^Y zsDOMIUhE@fwh)`Pr=ZOSRGSm4<R`qF9bqM0|K~3vV2gLm-w`2<;)AfG`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