You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by cf...@apache.org on 2013/01/14 17:31:10 UTC

svn commit: r1432981 - in /flex/sdk/branches/develop: frameworks/projects/mobilecomponents/src/spark/components/DateSpinner.as mustella/tests/mobile/components/DateSpinner/properties/DS_properties_displayMode_tester.mxml

Author: cframpton
Date: Mon Jan 14 16:31:09 2013
New Revision: 1432981

URL: http://svn.apache.org/viewvc?rev=1432981&view=rev
Log:
Refix FLEX-33347.  Add DS_mode_date_time_forward_date_to_month_with_fewer_days test.  The trick is to set the month and the day with one method call so that if we're going from a month with more days to a month with fewer days or vice versa the date verfication doesn't happen until both parts are set.

Modified:
    flex/sdk/branches/develop/frameworks/projects/mobilecomponents/src/spark/components/DateSpinner.as
    flex/sdk/branches/develop/mustella/tests/mobile/components/DateSpinner/properties/DS_properties_displayMode_tester.mxml

Modified: flex/sdk/branches/develop/frameworks/projects/mobilecomponents/src/spark/components/DateSpinner.as
URL: http://svn.apache.org/viewvc/flex/sdk/branches/develop/frameworks/projects/mobilecomponents/src/spark/components/DateSpinner.as?rev=1432981&r1=1432980&r2=1432981&view=diff
==============================================================================
--- flex/sdk/branches/develop/frameworks/projects/mobilecomponents/src/spark/components/DateSpinner.as (original)
+++ flex/sdk/branches/develop/frameworks/projects/mobilecomponents/src/spark/components/DateSpinner.as Mon Jan 14 16:31:09 2013
@@ -1900,8 +1900,7 @@ public class DateSpinner extends Skinnab
                     {
                         var spinnerDate:Date = new Date(newValue.data);
                         newDate.fullYear = spinnerDate.fullYear;
-                        newDate.date = spinnerDate.date;
-                        newDate.month = spinnerDate.month;
+                        newDate.setMonth(spinnerDate.month, spinnerDate.date);
                     }
                     else if (!dateRolledBack) // don't tamper with date if we already rolled it back
                     {

Modified: flex/sdk/branches/develop/mustella/tests/mobile/components/DateSpinner/properties/DS_properties_displayMode_tester.mxml
URL: http://svn.apache.org/viewvc/flex/sdk/branches/develop/mustella/tests/mobile/components/DateSpinner/properties/DS_properties_displayMode_tester.mxml?rev=1432981&r1=1432980&r2=1432981&view=diff
==============================================================================
--- flex/sdk/branches/develop/mustella/tests/mobile/components/DateSpinner/properties/DS_properties_displayMode_tester.mxml (original)
+++ flex/sdk/branches/develop/mustella/tests/mobile/components/DateSpinner/properties/DS_properties_displayMode_tester.mxml Mon Jan 14 16:31:09 2013
@@ -377,7 +377,7 @@
 			</body>
 		</TestCase>
 				
-		<TestCase testID="DS_mode_date_time_change_date_to_month_with_fewer_days" description="dateAndTime mode, scroll from Jan 31 to Feb 1" keywords="[DateSpinner, mode, FLEX-33347]">
+		<TestCase testID="DS_mode_date_time_forward_date_to_month_with_fewer_days" description="dateAndTime mode, scroll from Jan 31 to Feb 1" keywords="[DateSpinner, mode, FLEX-33347]">
 			<setup>
 				<ResetComponent target="navigator" className="comps.QANavigator" waitEvent="viewChangeComplete" />
 				<RunCode code="application.navigator.pushView(views.DisplayModeView)" 
@@ -405,6 +405,34 @@
 			</body>
 		</TestCase>
 
+		<TestCase testID="DS_mode_date_time_back_date_to_month_with_more_days" description="dateAndTime mode, scroll from Feb 1 to Jan 31" keywords="[DateSpinner, mode, FLEX-33347]">
+			<setup>
+				<ResetComponent target="navigator" className="comps.QANavigator" waitEvent="viewChangeComplete" />
+				<RunCode code="application.navigator.pushView(views.DisplayModeView)" 
+						 waitTarget="navigator" waitEvent="viewChangeComplete" timeout="18000" /> 
+				<SetProperty propertyName="displayMode" target="navigator.activeView.ds_binding" valueExpression="value=DateSelectorDisplayMode.DATE_AND_TIME" waitEvent="updateComplete"/>
+				<!--Programatically date to Feb 1, 2013. -->
+				<RunCode code="application.navigator.activeView.bindableDate = new Date(2013,1,1,9,15,55)" waitEvent="valueCommit" waitTarget="navigator.activeView.ds_binding" />
+			</setup>
+			<body>
+				<AssertPropertyValue target="navigator.activeView.ds_binding" propertyName="displayMode" valueExpression="value=DateSelectorDisplayMode.DATE_AND_TIME" />
+				<AssertPropertyValue target="navigator.activeView.ds_binding" propertyName="selectedDate" valueExpression="value=new Date(2013,1,1,9,15,55)" />
+				
+				<!-- mouse click to move list up to Jan 31 -->
+				<SimulateMouseGesture target="navigator.activeView.ds_binding" 
+									  dragYFrom="10" dragYTo="50" dragXFrom="56" dragXTo="56" 
+									  recordedDPI="160" waitEvent="change" />
+				
+				<AssertPropertyValue target="navigator.activeView.ds_binding" propertyName="selectedDate" 
+									 valueExpression="value=new Date(2013,0,31,9,15,55)"/>
+
+				<AssertMethodValue method="value=application.navigator.activeView.ds_binding.getDateRenderer(0).label" value="Thu, Jan 31" />
+				<AssertMethodValue method="value=application.navigator.activeView.ds_binding.getHourRenderer(0).label" value="9" />
+				<AssertMethodValue method="value=application.navigator.activeView.ds_binding.getMinuteRenderer(0).label" value="15" />
+				<AssertMethodValue method="value=application.navigator.activeView.ds_binding.getMeridianRenderer(0).label" value="AM" />
+			</body>
+		</TestCase>
+
 		<TestCase testID="DS_mode_date_time_change_hours_minutes_meridian" description="dateAndTime mode, change hours,minutes,meridian, verify the date retained the original value" keywords="[DateSpinner, mode]">
 			<setup>
 				<ResetComponent target="navigator" className="comps.QANavigator" waitEvent="viewChangeComplete" />