You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2013/05/15 21:00:24 UTC

[04/17] git commit: [flex-sdk] [refs/heads/develop] - More fixes to compensation for TextInput delaying setting actual focus

More fixes to compensation for TextInput delaying setting actual focus


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

Branch: refs/heads/develop
Commit: b56dc4f60cf65ce2a1210c08ab1997fc78a48f04
Parents: 57b3298
Author: Alex Harui <ah...@apache.org>
Authored: Mon May 13 23:48:09 2013 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Wed May 15 11:57:21 2013 -0700

----------------------------------------------------------------------
 mustella/as3/src/mustella/DispatchKeyEvent.as |    6 +++---
 mustella/as3/src/mustella/UnitTester.as       |   13 +++++++++++--
 2 files changed, 14 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b56dc4f6/mustella/as3/src/mustella/DispatchKeyEvent.as
----------------------------------------------------------------------
diff --git a/mustella/as3/src/mustella/DispatchKeyEvent.as b/mustella/as3/src/mustella/DispatchKeyEvent.as
index 15830db..b2b1d83 100644
--- a/mustella/as3/src/mustella/DispatchKeyEvent.as
+++ b/mustella/as3/src/mustella/DispatchKeyEvent.as
@@ -146,7 +146,7 @@ public class DispatchKeyEvent extends TestStep
                     event.keyCode = keySequence[j];
                     event.keyLocation = keyLocation;
 
-                    if (waitEvent == "focusIn" && keySequence[j] == Keyboard.TAB)
+                    if (keySequence[j] == Keyboard.TAB)
                     {
                         // if we don't see a focusIn, focus is being set
                         // asynchronously so we need to wait.
@@ -328,7 +328,7 @@ public class DispatchKeyEvent extends TestStep
         for (var i:int = currentRepeat; i < repeatCount; i++)
         {
             var m:int = charSequence.length;
-            for (var j:int = currentKey++; j < m; j++)
+            for (var j:int = currentKey + 1; j < m; j++)
             {
                 var event:KeyboardEvent = new KeyboardEvent(type, true, cancelable); // all keyboard events bubble
                 event.ctrlKey = ctrlKey;
@@ -337,7 +337,7 @@ public class DispatchKeyEvent extends TestStep
                 event.keyCode = keySequence[j];
                 event.keyLocation = keyLocation;
                 
-                if (waitEvent == "focusIn" && keySequence[j] == Keyboard.TAB)
+                if (keySequence[j] == Keyboard.TAB)
                 {
                     currentRepeat = i;
                     currentKey = j;

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b56dc4f6/mustella/as3/src/mustella/UnitTester.as
----------------------------------------------------------------------
diff --git a/mustella/as3/src/mustella/UnitTester.as b/mustella/as3/src/mustella/UnitTester.as
index 6e37a68..fa3c774 100644
--- a/mustella/as3/src/mustella/UnitTester.as
+++ b/mustella/as3/src/mustella/UnitTester.as
@@ -102,6 +102,11 @@ public class UnitTester extends EventDispatcher
       */
      public static var waitEvent : String;
      
+     /**
+      * UIComponentGlobals.
+      */
+     public static var uiComponentGlobals : Object;
+     
 	/**
 	 * additional wait before exit for coverage
 	 */
@@ -300,7 +305,10 @@ public class UnitTester extends EventDispatcher
 
 		var g:Class = Class(appdom.getDefinition("mx.core.UIComponentGlobals"));
 		if (g)
+        {
 			g["catchCallLaterExceptions"] = true;
+            uiComponentGlobals = g;
+        }
 
 		if (eventScripts != null)
 		{
@@ -1087,9 +1095,10 @@ public class UnitTester extends EventDispatcher
 	private static function focusBlockingHandler(event:FocusEvent):void
 	{
         // yes, there is a chance that you've clicked on the test
-        // just as it is waiting for a focusIn event
+        // just as it is waiting for a focusIn event or
+        // deferring focus assignment
         // but I think that's the best we can do for now
-        if (waitEvent == "focusIn")
+        if (waitEvent == "focusIn" || uiComponentGlobals.nextFocusObject != null)
             return;
         
 		if (blockFocusEvents && event.relatedObject == null)