| <?xml version="1.0" encoding="utf-8"?> |
| <!-- |
| |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| |
| --> |
| <UnitTester testDir="Graphics/Encoders/" xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="Encoder_Tests.mxml"> |
| <!-- this set of lines form a template that must be in each unit test --> |
| <mx:Script> |
| <![CDATA[ |
| public static function init(o:DisplayObject):void |
| { |
| } |
| ]]> |
| </mx:Script> |
| <mx:Metadata> |
| <![CDATA[ |
| [Mixin] |
| ]]> |
| </mx:Metadata> |
| |
| <mx:Script> |
| <![CDATA[ |
| |
| import mx.graphics.codec.JPEGEncoder; |
| import mx.graphics.codec.PNGEncoder; |
| ]]> |
| </mx:Script> |
| <!-- end of set of lines that must be in each unit test --> |
| |
| <testCases> |
| <TestCase testID="JPEGEncoder_Methods_encodeByteArray_bugSDK12164" keywords="[JPEGEncoder, encodeByteArray]" |
| description="this test was created for SDK-12164"> |
| <setup> |
| <RunCode code="application.bitmapData = new BitmapData(600,600)" /> |
| <RunCode code="application.bitmapData.draw(application);" /> |
| </setup> |
| <body> |
| <RunCode code="application.bitmapBytes=application.bitmapData.getPixels(new Rectangle(0, 0, 600, 600));" /> |
| <RunCode code="application.jpgEncoder = new JPEGEncoder();" /> |
| <RunCode code="application.jpegBytes = application.jpgEncoder.encodeByteArray(application.bitmapBytes, 600, 600);" /> |
| <!--Pause timeout="2000" /--> |
| <AssertMethodValue target="jpegBytes" method="value=application.jpegBytes.length > 0" value="true" /> |
| </body> |
| </TestCase> |
| <TestCase testID="PNGEncoder_Methods_encodeByteArray_bugSDK12164" keywords="[PNGEncoder, encodeByteArray]" |
| description="this test was created for SDK-12164"> |
| <setup> |
| <RunCode code="application.bitmapData = new BitmapData(600,600)" /> |
| <RunCode code="application.bitmapData.draw(application);" /> |
| </setup> |
| <body> |
| <RunCode code="application.bitmapBytes=application.bitmapData.getPixels(new Rectangle(0, 0, 600, 600));" /> |
| <RunCode code="application.pngEncoder = new PNGEncoder();" /> |
| <RunCode code="application.pngBytes = application.pngEncoder.encodeByteArray(application.bitmapBytes, 600, 600);" /> |
| <Pause timeout="2000" /> |
| <AssertMethodValue target="pngBytes" method="value=application.pngBytes.length > 0" value="true" /> |
| </body> |
| </TestCase> |
| </testCases> |
| </UnitTester> |