incubator-flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject svn commit: r1399358 - in /incubator/flex/sdk/branches/develop/mustella: as3/src/mustella/UnitTester.as tests/resources/ResourceManager/Methods/ResourceManager_Methods_loadResourceModule.mxml
Date Wed, 17 Oct 2012 17:36:19 GMT
Author: aharui
Date: Wed Oct 17 17:36:19 2012
New Revision: 1399358

URL: http://svn.apache.org/viewvc?rev=1399358&view=rev
Log:
Allow use of getInstance() to wait for the right event.

Modified:
    incubator/flex/sdk/branches/develop/mustella/as3/src/mustella/UnitTester.as
    incubator/flex/sdk/branches/develop/mustella/tests/resources/ResourceManager/Methods/ResourceManager_Methods_loadResourceModule.mxml

Modified: incubator/flex/sdk/branches/develop/mustella/as3/src/mustella/UnitTester.as
URL: http://svn.apache.org/viewvc/incubator/flex/sdk/branches/develop/mustella/as3/src/mustella/UnitTester.as?rev=1399358&r1=1399357&r2=1399358&view=diff
==============================================================================
--- incubator/flex/sdk/branches/develop/mustella/as3/src/mustella/UnitTester.as (original)
+++ incubator/flex/sdk/branches/develop/mustella/as3/src/mustella/UnitTester.as Wed Oct 17
17:36:19 2012
@@ -1618,6 +1618,10 @@ public class UnitTester extends EventDis
 					{
 						obj = obj.getTextFormat();
 					}
+					else if (s is String && s == "getInstance()")
+					{
+						obj = obj.getInstance();
+					}
                     else if (s is String && s == "info()")
                     {
                         obj = obj.info();

Modified: incubator/flex/sdk/branches/develop/mustella/tests/resources/ResourceManager/Methods/ResourceManager_Methods_loadResourceModule.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/sdk/branches/develop/mustella/tests/resources/ResourceManager/Methods/ResourceManager_Methods_loadResourceModule.mxml?rev=1399358&r1=1399357&r2=1399358&view=diff
==============================================================================
--- incubator/flex/sdk/branches/develop/mustella/tests/resources/ResourceManager/Methods/ResourceManager_Methods_loadResourceModule.mxml
(original)
+++ incubator/flex/sdk/branches/develop/mustella/tests/resources/ResourceManager/Methods/ResourceManager_Methods_loadResourceModule.mxml
Wed Oct 17 17:36:19 2012
@@ -147,7 +147,7 @@ General approach:
                 <RunCode code="ed1=ResourceManager.getInstance().loadResourceModule('assets/bundles/custom/resMod_loadResourceModule_enUS_bundle1_002.swf')"
/>
                 <RunCode code="ed1.addEventListener(ResourceEvent.ERROR, handleErrorEvent)"
/>
                 <RunCode code="ed1.addEventListener(ResourceEvent.COMPLETE, handleCompleteEvent)"
/>
-                <AssertEvent target="script:ed1" eventName="complete" eventClass="mx.events::ResourceEvent"
/>
+				<WaitForEvent target="mx.resources::ResourceManager.getInstance()" eventName="change"
timeout="1000" />
                 <AssertMethodValue method="value=ResourceManager.getInstance().getLocales().length"
value="1" />
                 <AssertMethodValue method="value=ResourceManager.getInstance().getLocales()[0]"
value="en_US" />
                 <AssertMethodValue method="value=ResourceManager.getInstance().getString('bundle1','SHUTDOWN')"
value="Shut down" />
@@ -165,7 +165,7 @@ General approach:
                 <RunCode code="ed8=ResourceManager.getInstance().loadResourceModule('assets/bundles/custom/resMod_loadResourceModule_enUS_bundles1,2,3_001.swf')"
/>
                 <RunCode code="ed8.addEventListener(ResourceEvent.ERROR, handleErrorEvent)"
/>
                 <RunCode code="ed8.addEventListener(ResourceEvent.COMPLETE, handleCompleteEvent)"
/>
-                <AssertEvent target="script:ed8" eventName="complete" eventClass="mx.events::ResourceEvent"
/>
+				<WaitForEvent target="mx.resources::ResourceManager.getInstance()" eventName="change"
timeout="1000" />
                 <AssertMethodValue method="value=ResourceManager.getInstance().getLocales().length"
value="1" />
                 <AssertMethodValue method="value=ResourceManager.getInstance().getLocales()[0]"
value="en_US" />
                 <AssertMethodValue method="value=ResourceManager.getInstance().getString('bundle1','SHUTDOWN')"
value="Shut down" />
@@ -185,11 +185,11 @@ General approach:
                 <RunCode code="ed2=ResourceManager.getInstance().loadResourceModule('assets/bundles/custom/resMod_loadResourceModule_enUS_bundle1_003.swf')"
/>
                 <RunCode code="ed2.addEventListener(ResourceEvent.ERROR, handleErrorEvent)"
/>
                 <RunCode code="ed2.addEventListener(ResourceEvent.COMPLETE, handleCompleteEvent)"
/>
-                <AssertEvent target="script:ed2" eventName="complete" eventClass="mx.events::ResourceEvent"
/>
+				<WaitForEvent target="mx.resources::ResourceManager.getInstance()" eventName="change"
timeout="1000" />
                 <RunCode code="ed3=ResourceManager.getInstance().loadResourceModule('assets/bundles/custom/resMod_loadResourceModule_enUS_bundles1,2,3_002.swf')"
/>
                 <RunCode code="ed3.addEventListener(ResourceEvent.ERROR, handleErrorEvent)"
/>
                 <RunCode code="ed3.addEventListener(ResourceEvent.COMPLETE, handleCompleteEvent)"
/>
-                <AssertEvent target="script:ed3" eventName="complete" eventClass="mx.events::ResourceEvent"
/>
+				<WaitForEvent target="mx.resources::ResourceManager.getInstance()" eventName="change"
timeout="1000" />
                 <AssertMethodValue method="value=ResourceManager.getInstance().getLocales().length"
value="1" />
                 <AssertMethodValue method="value=ResourceManager.getInstance().getLocales()[0]"
value="en_US" />
                 <AssertMethodValue method="value=ResourceManager.getInstance().getString('bundle1','SHUTDOWN')"
value="Shut down" />
@@ -208,11 +208,11 @@ General approach:
                 <RunCode code="ed4=ResourceManager.getInstance().loadResourceModule('assets/bundles/custom/resMod_loadResourceModule_enUS_bundle1_004.swf')"
/>
                 <RunCode code="ed4.addEventListener(ResourceEvent.ERROR, handleErrorEvent)"
/>
                 <RunCode code="ed4.addEventListener(ResourceEvent.COMPLETE, handleCompleteEvent)"
/>
-                <AssertEvent target="script:ed4" eventName="complete" eventClass="mx.events::ResourceEvent"
/>
+				<WaitForEvent target="mx.resources::ResourceManager.getInstance()" eventName="change"
timeout="1000" />
                 <RunCode code="ed5=ResourceManager.getInstance().loadResourceModule('assets/bundles/custom2/resMod_loadResourceModule_enUS_bundle1_005.swf')"
/>
                 <RunCode code="ed5.addEventListener(ResourceEvent.ERROR, handleErrorEvent)"
/>
                 <RunCode code="ed5.addEventListener(ResourceEvent.COMPLETE, handleCompleteEvent)"
/>
-                <AssertEvent target="script:ed5" eventName="complete" eventClass="mx.events::ResourceEvent"
/>
+				<WaitForEvent target="mx.resources::ResourceManager.getInstance()" eventName="change"
timeout="1000" />
                 <AssertMethodValue method="value=ResourceManager.getInstance().getLocales().length"
value="1" />
                 <AssertMethodValue method="value=ResourceManager.getInstance().getLocales()[0]"
value="en_US" />
                 <AssertMethodValue method="value=ResourceManager.getInstance().getString('bundle1','SHUTDOWN')"
value="Shut down" />
@@ -231,11 +231,11 @@ General approach:
                 <RunCode code="ed6=ResourceManager.getInstance().loadResourceModule('assets/bundles/custom/resMod_loadResourceModule_enUS_bundle1_006.swf')"
/>
                 <RunCode code="ed6.addEventListener(ResourceEvent.ERROR, handleErrorEvent)"
/>
                 <RunCode code="ed6.addEventListener(ResourceEvent.COMPLETE, handleCompleteEvent)"
/>
-                <AssertEvent target="script:ed6" eventName="complete" eventClass="mx.events::ResourceEvent"
/>
+				<WaitForEvent target="mx.resources::ResourceManager.getInstance()" eventName="change"
timeout="1000" />
                 <RunCode code="ed7=ResourceManager.getInstance().loadResourceModule('assets/bundles/custom/resMod_loadResourceModule_frFR_bundle2.swf')"
/>
                 <RunCode code="ed7.addEventListener(ResourceEvent.ERROR, handleErrorEvent)"
/>
                 <RunCode code="ed7.addEventListener(ResourceEvent.COMPLETE, handleCompleteEvent)"
/>
-                <AssertEvent target="script:ed7" eventName="complete" eventClass="mx.events::ResourceEvent"
/>
+				<WaitForEvent target="mx.resources::ResourceManager.getInstance()" eventName="change"
timeout="1000" />
                 <AssertMethodValue method="value=ResourceManager.getInstance().getLocales().length"
value="2" />
                 <AssertMethodValue method="value=ResourceManager.getInstance().getLocales().indexOf('en_US')
!= -1" value="true" />
                 <AssertMethodValue method="value=ResourceManager.getInstance().getLocales().indexOf('fr_FR')
!= -1" value="true" />
@@ -255,11 +255,11 @@ General approach:
                 <RunCode code="ed9=ResourceManager.getInstance().loadResourceModule('assets/bundles/custom/resMod_loadResourceModule_enUS_bundle1_007.swf')"
/>
                 <RunCode code="ed9.addEventListener(ResourceEvent.ERROR, handleErrorEvent)"
/>
                 <RunCode code="ed9.addEventListener(ResourceEvent.COMPLETE, handleCompleteEvent)"
/>
-                <AssertEvent target="script:ed9" eventName="complete" eventClass="mx.events::ResourceEvent"
/>
+				<WaitForEvent target="mx.resources::ResourceManager.getInstance()" eventName="change"
timeout="1000" />
                 <RunCode code="ed10=ResourceManager.getInstance().loadResourceModule('assets/bundles/custom/resMod_loadResourceModule_enUS,frFR,jaJP_bundles1,2,3.swf')"
/>
                 <RunCode code="ed10.addEventListener(ResourceEvent.ERROR, handleErrorEvent)"
/>
                 <RunCode code="ed10.addEventListener(ResourceEvent.COMPLETE, handleCompleteEvent)"
/>
-                <AssertEvent target="script:ed10" eventName="complete" eventClass="mx.events::ResourceEvent"
/>
+				<WaitForEvent target="mx.resources::ResourceManager.getInstance()" eventName="change"
timeout="1000" />
                 <AssertMethodValue method="value=ResourceManager.getInstance().getLocales().length"
value="3" />
                 <AssertMethodValue method="value=ResourceManager.getInstance().getLocales().indexOf('en_US')
!= -1" value="true" />
                 <AssertMethodValue method="value=ResourceManager.getInstance().getLocales().indexOf('fr_FR')
!= -1" value="true" />



Mime
View raw message