flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmcl...@apache.org
Subject [05/41] git commit: [flex-sdk] [refs/heads/develop] - Added new 160 and 640 dpi tests
Date Sun, 01 Sep 2013 23:40:07 GMT
Added new 160 and 640 dpi tests


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/9dcffe17
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/9dcffe17
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/9dcffe17

Branch: refs/heads/develop
Commit: 9dcffe17020e746ad3fe3356a944b25f2d1380bd
Parents: 651b2ed
Author: Justin Mclean <jmclean@apache.org>
Authored: Sat Aug 10 04:37:02 2013 +1000
Committer: Justin Mclean <jmclean@apache.org>
Committed: Sat Aug 10 04:37:02 2013 +1000

----------------------------------------------------------------------
 .../swfs/ViewNavigatorApplication120dpi.mxml    |  29 +++++
 .../swfs/ViewNavigatorApplication640dpi.mxml    |  29 +++++
 .../tests/applicationDPI_120.mxml               | 117 ++++++++++++++++++
 .../tests/applicationDPI_640.mxml               | 123 +++++++++++++++++++
 4 files changed, 298 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/9dcffe17/mustella/tests/mobile/DensityIndependentScaling/swfs/ViewNavigatorApplication120dpi.mxml
----------------------------------------------------------------------
diff --git a/mustella/tests/mobile/DensityIndependentScaling/swfs/ViewNavigatorApplication120dpi.mxml
b/mustella/tests/mobile/DensityIndependentScaling/swfs/ViewNavigatorApplication120dpi.mxml
new file mode 100644
index 0000000..a0b4fa8
--- /dev/null
+++ b/mustella/tests/mobile/DensityIndependentScaling/swfs/ViewNavigatorApplication120dpi.mxml
@@ -0,0 +1,29 @@
+<?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.
+
+-->
+<s:ViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
+							xmlns:s="library://ns.adobe.com/flex/spark" firstView="views.ViewNavigatorApplication160dpiHomeView"
+							applicationDPI="160" applicationComplete="init()">
+	<fx:Declarations>
+		<!-- Place non-visual elements (e.g., services, value objects) here -->
+	</fx:Declarations>
+	
+	<fx:Script source="MyScript.as" />
+
+</s:ViewNavigatorApplication>

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/9dcffe17/mustella/tests/mobile/DensityIndependentScaling/swfs/ViewNavigatorApplication640dpi.mxml
----------------------------------------------------------------------
diff --git a/mustella/tests/mobile/DensityIndependentScaling/swfs/ViewNavigatorApplication640dpi.mxml
b/mustella/tests/mobile/DensityIndependentScaling/swfs/ViewNavigatorApplication640dpi.mxml
new file mode 100644
index 0000000..ebd0f49
--- /dev/null
+++ b/mustella/tests/mobile/DensityIndependentScaling/swfs/ViewNavigatorApplication640dpi.mxml
@@ -0,0 +1,29 @@
+<?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.
+
+-->
+<s:ViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
+							xmlns:s="library://ns.adobe.com/flex/spark" firstView="views.ViewNavigatorApplication320dpiHomeView"
+							applicationDPI="640" applicationComplete="init()">
+	<fx:Declarations>
+		<!-- Place non-visual elements (e.g., services, value objects) here -->
+	</fx:Declarations>
+	
+	<fx:Script source="MyScript.as" />
+
+</s:ViewNavigatorApplication>

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/9dcffe17/mustella/tests/mobile/DensityIndependentScaling/tests/applicationDPI_120.mxml
----------------------------------------------------------------------
diff --git a/mustella/tests/mobile/DensityIndependentScaling/tests/applicationDPI_120.mxml
b/mustella/tests/mobile/DensityIndependentScaling/tests/applicationDPI_120.mxml
new file mode 100644
index 0000000..0f7620b
--- /dev/null
+++ b/mustella/tests/mobile/DensityIndependentScaling/tests/applicationDPI_120.mxml
@@ -0,0 +1,117 @@
+<?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="mobile/DensityIndependentScaling/tests/"  xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns="*"

+			testSWF="ViewNavigatorApplication160dpi.mxml">
+	<!-- this set of lines form a template that must be in each unit test -->
+	<fx:Script>
+		<![CDATA[
+			public static function init(o:DisplayObject):void
+			{
+			}           
+		]]>
+	</fx:Script>
+	
+	<fx:Metadata>
+		<![CDATA[
+		[Mixin]
+		]]>
+	</fx:Metadata>  
+	
+	<!-- end of set of lines that must be in each unit test -->
+	
+	<fx:Script>
+		<![CDATA[
+			//import components.*;
+			import mx.core.FlexGlobals;
+		]]>
+	</fx:Script>
+	
+	<testCases>
+		
+		<TestCase testID="Get_applicationDPI" description="applicationDPI is set to 160 in MXML"
keywords="[ViewNavigatorApplication, properties, applicationDPI]">
+		
+			<body>
+				<AssertPropertyValue target="" propertyName="applicationDPI" value="160" />
+			</body>
+		
+		</TestCase>
+
+		<!-- Set a bogus value. No error but should not be set. -->
+		<TestCase  testID="Set_applicationDPI_at_runtime" description="Should not change the
value." keywords="[ViewNavigatorApplication, properties, applicationDPI]">
+			<setup>
+				<SetProperty target="" propertyName="applicationDPI" value="777" />
+			</setup>
+			<body>
+			<AssertPropertyValue target="" propertyName="applicationDPI" value="160" />
+			</body>
+			
+		</TestCase>
+		
+		<TestCase testID="Check_scaling" description="" keywords="[ViewNavigatorApplication,
properties, applicationDPI]">
+			
+			<body>
+				
+				<AssertPropertyValue target="" propertyName="scalingFactor" value="1" >
+					<ConditionalValue deviceDensity="160" value="1"/>
+					<ConditionalValue deviceDensity="240" value="1.5"/>
+					<ConditionalValue deviceDensity="320" value="2"/>
+					<ConditionalValue deviceDensity="480" value="4"/>
+				</AssertPropertyValue>	
+			
+			</body>
+	
+		</TestCase>
+		
+		<TestCase testID="Check_screen_size" description="" keywords="[ViewNavigatorApplication,
properties, applicationDPI]">
+			
+			<body>
+				
+				<AssertPropertyValue target="" propertyName="screenWidth" value="500">
+					<ConditionalValue deviceDensity="160" valueExpression="value=FlexGlobals.topLevelApplication.stage.stageWidth"/>
+					<ConditionalValue deviceDensity="240" valueExpression="value=FlexGlobals.topLevelApplication.stage.stageWidth/1.5"/>
+					<ConditionalValue deviceDensity="320" valueExpression="value=FlexGlobals.topLevelApplication.stage.stageWidth/2"/>
+					<ConditionalValue deviceDensity="480" valueExpression="value=FlexGlobals.topLevelApplication.stage.stageWidth"/>
+				</AssertPropertyValue>	
+			</body>
+			
+		</TestCase>
+		
+		
+		<TestCase testID="Check_bitmap_160" description="" keywords="[ViewNavigatorApplication,
properties, applicationDPI]">
+					
+			<body>
+						
+				<CompareBitmap target="navigator.activeView.redSquare" url="../tests/baselines">
+					<ConditionalValue deviceDensity="240" os="android" />
+					<ConditionalValue deviceDensity="160" os="win" />
+					<ConditionalValue deviceDensity="320" os="win" />
+					<ConditionalValue deviceDensity="320" os="iphone" />
+					<ConditionalValue deviceDensity="160" os="qnx" />
+					<ConditionalValue deviceDensity="320" os="android" />
+					<ConditionalValue deviceDensity="480" os="android" />
+				</CompareBitmap>	
+			</body>
+					
+		</TestCase>
+		
+		
+	</testCases>
+	
+</UnitTester>

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/9dcffe17/mustella/tests/mobile/DensityIndependentScaling/tests/applicationDPI_640.mxml
----------------------------------------------------------------------
diff --git a/mustella/tests/mobile/DensityIndependentScaling/tests/applicationDPI_640.mxml
b/mustella/tests/mobile/DensityIndependentScaling/tests/applicationDPI_640.mxml
new file mode 100644
index 0000000..cfb6833
--- /dev/null
+++ b/mustella/tests/mobile/DensityIndependentScaling/tests/applicationDPI_640.mxml
@@ -0,0 +1,123 @@
+<?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="mobile/DensityIndependentScaling/tests/"  xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns="*"

+			testSWF="ViewNavigatorApplication640dpi.mxml">
+	<!-- this set of lines form a template that must be in each unit test -->
+	<fx:Script>
+		<![CDATA[
+			public static function init(o:DisplayObject):void
+			{
+			}           
+		]]>
+	</fx:Script>
+	
+	<fx:Metadata>
+		<![CDATA[
+		[Mixin]
+		]]>
+	</fx:Metadata>  
+	
+	<!-- end of set of lines that must be in each unit test -->
+	
+	<fx:Script>
+		<![CDATA[
+			//import components.*;
+			import mx.core.FlexGlobals;
+		]]>
+	</fx:Script>
+	
+	<testCases>
+		
+		<TestCase testID="Get_applicationDPI" description="applicationDPI is set to 320 in MXML"
keywords="[ViewNavigatorApplication, properties, applicationDPI]">
+
+			<body>
+				<AssertPropertyValue target="" propertyName="applicationDPI" value="320" />
+			</body>
+		
+		</TestCase>
+
+		<!-- Set a bogus value. No error but should not be set. -->
+		<TestCase  testID="Set_applicationDPI_at_runtime" description="Should not change the
value." keywords="[ViewNavigatorApplication, properties, applicationDPI]">
+			<setup>
+				<SetProperty target="" propertyName="applicationDPI" value="777" />
+			</setup>
+			<body>
+			<AssertPropertyValue target="" propertyName="applicationDPI" value="320" />
+			</body>
+			
+		</TestCase>
+		
+		<TestCase testID="Check_scaling" description="" keywords="[ViewNavigatorApplication,
properties, applicationDPI]">
+			
+			<body>
+				
+				<AssertPropertyValue target="" propertyName="scalingFactor" value="0.500000" >
+					<ConditionalValue deviceDensity="120" value="0.1875"/>
+					<ConditionalValue deviceDensity="160" value="0.25"/>
+					<ConditionalValue deviceDensity="240" value="0.375"/>
+					<ConditionalValue deviceDensity="320" value="0.5"/>
+					<ConditionalValue deviceDensity="480" value="0.75"/>
+					<ConditionalValue deviceDensity="640" value="1"/>
+				</AssertPropertyValue>	
+			
+			</body>
+	
+		</TestCase>
+		
+		<TestCase testID="Check_screen_size" description="" keywords="[ViewNavigatorApplication,
properties, applicationDPI]">
+			
+			<body>
+				
+				<AssertPropertyValue target="" propertyName="screenWidth" value="1000">
+					<ConditionalValue deviceDensity="120" valueExpression="value=FlexGlobals.topLevelApplication.stage.stageWidth/0.1875"/>
+					<ConditionalValue deviceDensity="160" valueExpression="value=FlexGlobals.topLevelApplication.stage.stageWidth/0.25"/>
+					<ConditionalValue deviceDensity="240" valueExpression="value=FlexGlobals.topLevelApplication.stage.stageWidth/0.375"/>
+					<ConditionalValue deviceDensity="320" valueExpression="value=FlexGlobals.topLevelApplication.stage.stageWidth/0.5"/>
+					<ConditionalValue deviceDensity="480" valueExpression="value=FlexGlobals.topLevelApplication.stage.stageWidth/0.75"/>
+					<ConditionalValue deviceDensity="640" valueExpression="value=FlexGlobals.topLevelApplication.stage.stageWidth"/>
+				</AssertPropertyValue>	
+			</body>
+			
+		</TestCase>
+
+		<TestCase testID="Check_bitmap_640" description="" keywords="[ViewNavigatorApplication,
properties, applicationDPI]">
+					
+			<body>
+				<!-- Noticed pixel differences between win 160 and qnx 160. These really shouldn't
be happening. -->		
+				<CompareBitmap target="navigator.activeView.redSquare" url="../tests/baselines">
+					<ConditionalValue deviceDensity="240" os="android" />
+					<ConditionalValue deviceDensity="160" os="win" />
+					<ConditionalValue deviceDensity="320" os="win" />
+					<ConditionalValue deviceDensity="320" os="iphone" />
+					<ConditionalValue deviceDensity="160" os="qnx" />
+					<ConditionalValue deviceDensity="320" os="android" />
+					<ConditionalValue deviceDensity="480" os="android" />
+					<ConditionalValue deviceDensity="120" os="android" />
+					<ConditionalValue deviceDensity="640" os="android" />
+				</CompareBitmap>	
+			</body>
+					
+		</TestCase>
+
+		
+		
+	</testCases>
+	
+</UnitTester>


Mime
View raw message