incubator-flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject svn commit: r1369946 - in /incubator/flex/trunk/mustella/tests/Graphics: ./ Encoders/ Encoders/JPEGEncoder_PNGEncoder_Script.mxml SWFs/ SWFs/Encoder_Tests.mxml
Date Mon, 06 Aug 2012 19:38:30 GMT
Author: pent
Date: Mon Aug  6 19:38:29 2012
New Revision: 1369946

URL: http://svn.apache.org/viewvc?rev=1369946&view=rev
Log:
Mustella submission

Added:
    incubator/flex/trunk/mustella/tests/Graphics/
    incubator/flex/trunk/mustella/tests/Graphics/Encoders/
    incubator/flex/trunk/mustella/tests/Graphics/Encoders/JPEGEncoder_PNGEncoder_Script.mxml
    incubator/flex/trunk/mustella/tests/Graphics/SWFs/
    incubator/flex/trunk/mustella/tests/Graphics/SWFs/Encoder_Tests.mxml

Added: incubator/flex/trunk/mustella/tests/Graphics/Encoders/JPEGEncoder_PNGEncoder_Script.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/Graphics/Encoders/JPEGEncoder_PNGEncoder_Script.mxml?rev=1369946&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/Graphics/Encoders/JPEGEncoder_PNGEncoder_Script.mxml
(added)
+++ incubator/flex/trunk/mustella/tests/Graphics/Encoders/JPEGEncoder_PNGEncoder_Script.mxml
Mon Aug  6 19:38:29 2012
@@ -0,0 +1,74 @@
+<?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>

Added: incubator/flex/trunk/mustella/tests/Graphics/SWFs/Encoder_Tests.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/mustella/tests/Graphics/SWFs/Encoder_Tests.mxml?rev=1369946&view=auto
==============================================================================
--- incubator/flex/trunk/mustella/tests/Graphics/SWFs/Encoder_Tests.mxml (added)
+++ incubator/flex/trunk/mustella/tests/Graphics/SWFs/Encoder_Tests.mxml Mon Aug  6 19:38:29
2012
@@ -0,0 +1,41 @@
+<?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.
+
+-->
+<mx:Application backgroundColor="0xFFFFFF"  xmlns:mx="http://www.adobe.com/2006/mxml"
width="600" height="600"> 
+    
+    <mx:Script>
+    <![CDATA[
+    
+        import mx.graphics.codec.JPEGEncoder;
+        import mx.graphics.codec.PNGEncoder;
+        
+        public var bitmapData:BitmapData;
+        public var bitmapBytes:ByteArray; 
+        public var jpgEncoder:JPEGEncoder;
+        public var jpegBytes:ByteArray; 
+        
+        public var pngEncoder:PNGEncoder;
+        public var pngBytes:ByteArray; 
+        
+    
+    ]]>
+    </mx:Script>
+
+    
+</mx:Application> 



Mime
View raw message