You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by pi...@apache.org on 2014/10/12 23:58:06 UTC

[1/9] Add new tests to AllTestsSuite: BoundsAndAlignmentTest.as, EventOverrideTest.as - all tests marked as Ignore - Need fixes CrossContainerTest.as, ElementOperationTest.as - all works fine

Repository: flex-tlf
Updated Branches:
  refs/heads/develop e57200c50 -> 3a4075c00


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/c1059121/automation_tests/src/UnitTest/Tests/EventOverrideTest.as
----------------------------------------------------------------------
diff --git a/automation_tests/src/UnitTest/Tests/EventOverrideTest.as b/automation_tests/src/UnitTest/Tests/EventOverrideTest.as
index c933f3d..604cedf 100644
--- a/automation_tests/src/UnitTest/Tests/EventOverrideTest.as
+++ b/automation_tests/src/UnitTest/Tests/EventOverrideTest.as
@@ -18,645 +18,372 @@
 ////////////////////////////////////////////////////////////////////////////////
 package UnitTest.Tests
 {
-	import UnitTest.ExtendedClasses.TestSuiteExtended;
-	import UnitTest.ExtendedClasses.VellumTestCase;
-	import UnitTest.Fixtures.TestConfig;
+    import UnitTest.ExtendedClasses.VellumTestCase;
+    import UnitTest.Fixtures.TestConfig;
 
-	import flash.events.*;
-	import flash.ui.KeyLocation;
+    import flash.events.*;
+    import flash.ui.KeyLocation;
 
-	import flashx.textLayout.edit.EditManager;
-	import flashx.textLayout.elements.TextFlow;
-	import flashx.undo.UndoManager;
+    import flashx.textLayout.edit.EditManager;
+    import flashx.undo.UndoManager;
 
     import org.flexunit.asserts.assertTrue;
 
     public class EventOverrideTest extends VellumTestCase
-	{
-		public function EventOverrideTest(methodName:String, testID:String, testConfig:TestConfig, testCaseXML:XML=null)
-		{
-			super(methodName, testID, testConfig, testCaseXML);
-
-			if ( TestData.eventOverride )
-   			{
-   				TestID = TestID + ":" + TestData.eventOverride;
-   			}
-
-   			// Note: These must correspond to a Watson product area (case-sensitive)
-   			metaData.productArea = "Editing";
-		}
-
-		public static function suiteFromXML(testListXML:XML, testConfig:TestConfig, ts:TestSuiteExtended):void
- 		{
- 			var testCaseClass:Class = EventOverrideTest;
- 			VellumTestCase.suiteFromXML(testCaseClass, testListXML, testConfig, ts);
- 		}
-
-   		public override function setUpTest():void
-   		{
-   			/*if ( TestData.eventOverride )
-   			{
-   				TextFlow.defaultConfiguration.manageEventListeners = false;
-   			}*/
-
-   			super.setUpTest();
-
-   			if ( TestData.overrideEditManager == "true" )
-   			{
-	   			var testManager:EditManager = new TestEditManager(new UndoManager());
-	   			SelManager.textFlow.interactionManager = testManager;
-	   			SelManager = testManager;
-	   			SelManager.selectRange(0,0);
-	   		}
-   		}
-
-   		public override function tearDownTest():void
-   		{
-   			/*if ( TestData.eventOverride )
-   			{
-	   			TextFlow.defaultConfiguration.manageEventListeners = true;
-	   			// Make sure we leave without a broken TextFlow
-				loadTestFile("empty.xml");
-   			}*/
-
-   			if ( TestData.overrideEditManager == "true" )
-   			{
-	   			var newManager:EditManager = new EditManager(new UndoManager());
-	   			SelManager.textFlow.interactionManager = newManager;
-	   			SelManager = newManager;
-	   		}
-   		}
-
-   		// Returns the string from begIdx through and including endIdx
-   		private function getText( begIdx:int, endIdx:int ): String
-   		{
-   			var outString:String = "";
-
-   			for ( var x:int = begIdx; x < endIdx; x++ )
-   			{
-   				outString += SelManager.textFlow.getCharAtPosition(x);
-   			}
-
-   			return outString;
-   		}
-
-   		// Returns the text contents of the entire textflow
-   		private function getAllText(): String
-   		{
-   			var begIdx:int = SelManager.textFlow.parentRelativeStart;
-   			var endIdx:int = SelManager.textFlow.parentRelativeEnd-1;
-   			var outString:String = "";
-
-   			for ( var x:int = begIdx; x < endIdx; x++ )
-   			{
-   				outString += SelManager.textFlow.getCharAtPosition(x);
-   			}
-
-   			return outString;
-   		}
-
-/******* Framework for event override tests (Not using derived editmanager ***********************/
-/** Removing for expected ARB-related updates - probably to be removed permanently
- *
-   		private function eventFromText( textID:String, addListener:Boolean, removeListener:Boolean = false ):Event
-   		{
-			var outEvent:Event;
-
-			switch ( textID )
-			{
-				case "MOUSE_DOWN":
-					if ( removeListener )
-					{
-						SelManager.textFlow.removeEventListener( MouseEvent.MOUSE_DOWN, eventHandler );
-					}
-					else if (addListener)
-					{
-						SelManager.textFlow.addEventListener( MouseEvent.MOUSE_DOWN, eventHandler, false, 0, true );
-						return null;
-					}
-					else
-					{
-						outEvent = new MouseEvent( MouseEvent.MOUSE_DOWN, true, false, 0, 0 );
-						return outEvent;
-					}
-					break;
-				case "MOUSE_OVER":
-					if ( removeListener )
-					{
-						SelManager.textFlow.removeEventListener( MouseEvent.MOUSE_OVER, eventHandler );
-					}
-					else if (addListener)
-					{
-						SelManager.textFlow.addEventListener( MouseEvent.MOUSE_OVER, eventHandler, false, 0, true );
-						return null;
-					}
-					else
-					{
-						outEvent = new MouseEvent( MouseEvent.MOUSE_OVER, true, false, 0, 0 );
-						return outEvent;
-					}
-					break;
-				case "MOUSE_OUT":
-					if ( removeListener )
-					{
-						SelManager.textFlow.removeEventListener( MouseEvent.MOUSE_OUT, eventHandler );
-					}
-					else if (addListener)
-					{
-						SelManager.textFlow.addEventListener( MouseEvent.MOUSE_OUT, eventHandler, false, 0, true );
-						return null;
-					}
-					else
-					{
-						outEvent = new MouseEvent( MouseEvent.MOUSE_OUT, true, false, 0, 0 );
-						return outEvent;
-					}
-					break;
-				case "MOUSE_WHEEL":
-					if ( removeListener )
-					{
-						SelManager.textFlow.removeEventListener( MouseEvent.MOUSE_WHEEL, eventHandler );
-					}
-					else if (addListener)
-					{
-						SelManager.textFlow.addEventListener( MouseEvent.MOUSE_WHEEL, eventHandler, false, 0, true );
-						return null;
-					}
-					else
-					{
-						outEvent = new MouseEvent( MouseEvent.MOUSE_WHEEL, true, false, 0, 0 );
-						return outEvent;
-					}
-					break;
-				case "DOUBLE_CLICK":
-					if ( removeListener )
-					{
-						SelManager.textFlow.removeEventListener( MouseEvent.DOUBLE_CLICK, eventHandler );
-					}
-					else if (addListener)
-					{
-						SelManager.textFlow.addEventListener( MouseEvent.DOUBLE_CLICK, eventHandler, false, 0, true );
-						return null;
-					}
-					else
-					{
-						outEvent = new MouseEvent( MouseEvent.DOUBLE_CLICK, true, false, 0, 0 );
-						return outEvent;
-					}
-					break;
-				case "KEY_DOWN":
-					if ( removeListener )
-					{
-						SelManager.textFlow.removeEventListener( KeyboardEvent.KEY_DOWN, eventHandler );
-					}
-					else if (addListener)
-					{
-						SelManager.textFlow.addEventListener( KeyboardEvent.KEY_DOWN, eventHandler, false, 0, true );
-						return null;
-					}
-					else
-					{
-						outEvent = new KeyboardEvent( KeyboardEvent.KEY_DOWN, true, false,
-											 8, 8, KeyLocation.STANDARD, true, false, false);
-						return outEvent;
-					}
-					break;
-				case "FOCUS_IN":
-					if ( removeListener )
-					{
-						SelManager.textFlow.removeEventListener( FocusEvent.FOCUS_IN, eventHandler );
-					}
-					else if (addListener)
-					{
-						SelManager.textFlow.addEventListener( FocusEvent.FOCUS_IN, eventHandler, false, 0, true );
-						return null;
-					}
-					else
-					{
-						outEvent = new FocusEvent( FocusEvent.FOCUS_IN );
-						return outEvent;
-					}
-					break;
-				case "FOCUS_OUT":
-					if ( removeListener )
-					{
-						SelManager.textFlow.removeEventListener( FocusEvent.FOCUS_OUT, eventHandler );
-					}
-					else
-					if (addListener)
-					{
-						SelManager.textFlow.addEventListener( FocusEvent.FOCUS_OUT, eventHandler, false, 0, true );
-						return null;
-					}
-					else
-					{
-						outEvent = new FocusEvent( FocusEvent.FOCUS_OUT );
-						return outEvent;
-					}
-					break;
-				case "TEXT_INPUT":
-					if ( removeListener )
-					{
-						SelManager.textFlow.removeEventListener( TextEvent.TEXT_INPUT, eventHandler );
-					}
-					else if (addListener)
-					{
-						SelManager.textFlow.addEventListener( TextEvent.TEXT_INPUT, eventHandler, false, 0, true );
-						return null;
-					}
-					else
-					{
-						outEvent = new TextEvent( TextEvent.TEXT_INPUT, false, true, "WONTSEEME" );
-						return outEvent;
-					}
-					break;
-				case "ACTIVATE":
-					if ( removeListener )
-					{
-						SelManager.textFlow.removeEventListener( Event.ACTIVATE, eventHandler );
-					}
-					else if (addListener)
-					{
-						SelManager.textFlow.addEventListener( Event.ACTIVATE, eventHandler, false, 0, true );
-						return null;
-					}
-					else
-					{
-						outEvent = new Event( Event.ACTIVATE );
-						return outEvent;
-					}
-					break;
-				case "DEACTIVATE":
-					if ( removeListener )
-					{
-						SelManager.textFlow.removeEventListener( Event.DEACTIVATE, eventHandler );
-					}
-					else if (addListener)
-					{
-						SelManager.textFlow.addEventListener( Event.DEACTIVATE, eventHandler, false, 0, true );
-						return null;
-					}
-					else
-					{
-						outEvent = new Event( Event.DEACTIVATE );
-						return outEvent;
-					}
-					break;
-				case "MENU_SELECT":
-					if ( removeListener )
-					{
-						SelManager.textFlow.removeEventListener( ContextMenuEvent.MENU_SELECT, eventHandler );
-					}
-					else if (addListener)
-					{
-						SelManager.textFlow.addEventListener( ContextMenuEvent.MENU_SELECT, eventHandler, false, 0, true );
-						return null;
-					}
-					else
-					{
-						outEvent = new ContextMenuEvent( ContextMenuEvent.MENU_SELECT );
-						return outEvent;
-					}
-					break;
-				case "SELECT_ALL":
-					if ( removeListener )
-					{
-						SelManager.textFlow.removeEventListener( Event.SELECT_ALL, eventHandler );
-					}
-					else if (addListener)
-					{
-						SelManager.textFlow.addEventListener( Event.SELECT_ALL, eventHandler, false, 0, true );
-						return null;
-					}
-					else
-					{
-						outEvent = new Event( Event.SELECT_ALL );
-						return outEvent;
-					}
-					break;
-				case "COPY":
-					if ( removeListener )
-					{
-						SelManager.textFlow.removeEventListener( Event.COPY, eventHandler );
-					}
-					else if (addListener)
-					{
-						SelManager.textFlow.addEventListener( Event.COPY, eventHandler, false, 0, true );
-						return null;
-					}
-					else
-					{
-						outEvent = new Event( Event.COPY );
-						return outEvent;
-					}
-					break;
-				case "CUT":
-					if ( removeListener )
-					{
-						SelManager.textFlow.removeEventListener( Event.CUT, eventHandler );
-					}
-					else if (addListener)
-					{
-						SelManager.textFlow.addEventListener( Event.CUT, eventHandler, false, 0, true );
-						return null;
-					}
-					else
-					{
-						outEvent = new Event( Event.CUT );
-						return outEvent;
-					}
-					break;
-				case "PASTE":
-					if ( removeListener )
-					{
-						SelManager.textFlow.removeEventListener( Event.PASTE, eventHandler );
-					}
-					else if (addListener)
-					{
-						SelManager.textFlow.addEventListener( Event.PASTE, eventHandler, false, 0, true );
-						return null;
-					}
-					else
-					{
-						outEvent = new Event( Event.PASTE );
-						return outEvent;
-					}
-					break;
-			}
-
-			return null;
-   		}
-
-   		// Generic event handler
-   		// How can this be made more even specific?
-   		private function eventHandler( event:Event ):void
-   		{
-   			SelManager.insertText("EVENT");
-   		}
-
-   		// Generic test case for all event overrides
-   		public function testEventOverride():void
-   		{
-   			SelManager.insertText("StillHere");
-   			SelManager.selectRange(9,9);
-
-   			// Add event listener
-   			eventFromText( TestData.eventOverride, true );
-
-   			var newEvent:Event = eventFromText( TestData.eventOverride, false );
-   			assertTrue( "Test Case Failure: Unable to find event specified in XML",
-   						newEvent != null );
-   			SelManager.textFlow.dispatchEvent(newEvent);
-
-   			SelManager.flushPendingOperations();
-   			assertTrue( TestData.eventOverride + " event was not executed after override",
-						getAllText() == "StillHereEVENT" );
-			assertTrue( TestData.eventOverride + " event shouldn't change selection",
-						SelManager.activePosition == 14 && SelManager.anchorPosition == 14 );
-
-			// Remove event listener
-			eventFromText( TestData.eventOverride, false, true );
-   		}
-*/
-/************** TESTS USING DERIVED EDITMANAGER **************************************************/
-
-   		public function keyDownDerivedTest():void
-   		{
-   			SelManager.insertText("StillHere");
-   			SelManager.selectRange(9,9);
-
-   			// Send a Ctrl-Backspace
-   			var kEvent:KeyboardEvent = new KeyboardEvent( KeyboardEvent.KEY_DOWN,
-				true, false, 8, 8, KeyLocation.STANDARD, true, false, false);
-			TestFrame.container["dispatchEvent"](kEvent);
-
-			SelManager.flushPendingOperations();
-
-			assertTrue( "Keyboard event executed normally when overridden",
-						getText(0,9) == "StillHere" );
-
-			assertTrue( "Keyboard event override was not executed",
-						getAllText() == "StillHereKEYDOWN" );
-   		}
-
-   		public function mouseDownDerivedTest():void
-   		{
-   			var kEvent:MouseEvent = new MouseEvent( MouseEvent.MOUSE_DOWN, true, false, 0, 0 );
-			TestFrame.container["dispatchEvent"](kEvent);
-
-			SelManager.flushPendingOperations();
-
-			assertTrue( "Mouse Down event override was not executed",
-						getAllText() == "MOUSEDOWN" );
-   		}
-
-   		public function mouseMoveDerivedTest():void
-   		{
-   			(SelManager as TestEditManager).mouseMoved = false;
-   			var kEvent:MouseEvent = new MouseEvent( MouseEvent.MOUSE_DOWN, true, false, 0, 0 );
-			TestFrame.container["dispatchEvent"](kEvent);
-   			var mEvent:MouseEvent = new MouseEvent( MouseEvent.MOUSE_MOVE, true, false,
-   											 20, 20 );
-			TestFrame.container["dispatchEvent"](mEvent);
-
-			SelManager.flushPendingOperations();
-
-			assertTrue( "Mouse Move event override was not executed",
-						getAllText() == "MOUSEDOWNMOUSEMOVE" );
-   		}
-
-   		public function textEventDerivedTest():void
-   		{
-   			// Send 'a' string
-   			var kEvent:TextEvent = new TextEvent( TextEvent.TEXT_INPUT, false, false, "a" );
-			TestFrame.container["dispatchEvent"](kEvent);
+    {
+        public function EventOverrideTest()
+        {
+            super("", "EventOverrideTest", TestConfig.getInstance());
+
+            if (TestData.eventOverride)
+            {
+                TestID = TestID + ":" + TestData.eventOverride;
+            }
+            metaData = {};
+            // Note: These must correspond to a Watson product area (case-sensitive)
+            metaData.productArea = "Editing";
+        }
+
+        [Before]
+        public override function setUpTest():void
+        {
+            super.setUpTest();
+
+            if (TestData.overrideEditManager == "true")
+            {
+                var testManager:EditManager = new TestEditManager(new UndoManager());
+                SelManager.textFlow.interactionManager = testManager;
+                SelManager = testManager;
+                SelManager.selectRange(0, 0);
+            }
+        }
+
+        [After]
+        public override function tearDownTest():void
+        {
+            if (TestData.overrideEditManager == "true")
+            {
+                var newManager:EditManager = new EditManager(new UndoManager());
+                SelManager.textFlow.interactionManager = newManager;
+                SelManager = newManager;
+            }
+        }
+
+        /************** TESTS USING DERIVED EDITMANAGER **************************************************/
+
+        [Test]
+        [Ignore]
+        public function keyDownDerivedTest():void
+        {
+            SelManager.insertText("StillHere");
+            SelManager.selectRange(9, 9);
+
+            // Send a Ctrl-Backspace
+            var kEvent:KeyboardEvent = new KeyboardEvent(KeyboardEvent.KEY_DOWN,
+                    true, false, 8, 8, KeyLocation.STANDARD, true, false, false);
+            TestFrame.container["dispatchEvent"](kEvent);
+
+            SelManager.flushPendingOperations();
+
+            assertTrue("Keyboard event executed normally when overridden",
+                    getText(0, 9) == "StillHere");
+
+            assertTrue("Keyboard event override was not executed",
+                    getAllText() == "StillHereKEYDOWN");
+        }
+
+        [Test]
+        [Ignore]
+        public function mouseDownDerivedTest():void
+        {
+            var kEvent:MouseEvent = new MouseEvent(MouseEvent.MOUSE_DOWN, true, false, 0, 0);
+            TestFrame.container["dispatchEvent"](kEvent);
+
+            SelManager.flushPendingOperations();
+
+            assertTrue("Mouse Down event override was not executed",
+                    getAllText() == "MOUSEDOWN");
+        }
+
+        [Test]
+        [Ignore]
+        public function mouseMoveDerivedTest():void
+        {
+            (SelManager as TestEditManager).mouseMoved = false;
+            var kEvent:MouseEvent = new MouseEvent(MouseEvent.MOUSE_DOWN, true, false, 0, 0);
+            TestFrame.container["dispatchEvent"](kEvent);
+            var mEvent:MouseEvent = new MouseEvent(MouseEvent.MOUSE_MOVE, true, false,
+                    20, 20);
+            TestFrame.container["dispatchEvent"](mEvent);
+
+            SelManager.flushPendingOperations();
+
+            assertTrue("Mouse Move event override was not executed",
+                    getAllText() == "MOUSEDOWNMOUSEMOVE");
+        }
+
+        [Test]
+        [Ignore]
+        public function textEventDerivedTest():void
+        {
+            // Send 'a' string
+            var kEvent:TextEvent = new TextEvent(TextEvent.TEXT_INPUT, false, false, "a");
+            TestFrame.container["dispatchEvent"](kEvent);
+
+            SelManager.flushPendingOperations();
+
+            assertTrue("Text Event override was not executed",
+                    getAllText() == "TEXTEVENT");
+        }
+
+        [Test]
+        [Ignore]
+        public function focusInDerivedTest():void
+        {
+            var kEvent:FocusEvent = new FocusEvent(FocusEvent.FOCUS_IN);
+            TestFrame.container["dispatchEvent"](kEvent);
+
+            SelManager.flushPendingOperations();
+
+            assertTrue("Focus In override was not executed",
+                    getAllText() == "FOCUSIN");
+        }
+
+        [Test]
+        [Ignore]
+        public function focusOutDerivedTest():void
+        {
+            var kEvent:FocusEvent = new FocusEvent(FocusEvent.FOCUS_OUT);
+            TestFrame.container["dispatchEvent"](kEvent);
+
+            SelManager.flushPendingOperations();
 
-			SelManager.flushPendingOperations();
+            assertTrue("Focus Out override was not executed",
+                    getAllText() == "FOCUSOUT");
+        }
 
-			assertTrue( "Text Event override was not executed",
-						getAllText() == "TEXTEVENT" );
-   		}
+        [Test]
+        [Ignore]
+        public function activateDerivedTest():void
+        {
+            var kEvent:Event = new Event(Event.ACTIVATE);
+            TestFrame.container["dispatchEvent"](kEvent);
 
-   		public function focusInDerivedTest():void
-   		{
-   			var kEvent:FocusEvent = new FocusEvent( FocusEvent.FOCUS_IN );
-			TestFrame.container["dispatchEvent"](kEvent);
+            SelManager.flushPendingOperations();
 
-			SelManager.flushPendingOperations();
+            assertTrue("Activate override was not executed",
+                    getAllText() == "ACTIVATE");
+        }
 
-			assertTrue( "Focus In override was not executed",
-						getAllText() == "FOCUSIN" );
-   		}
+        [Test]
+        [Ignore]
+        public function deactivateDerivedTest():void
+        {
+            var kEvent:Event = new Event(Event.DEACTIVATE);
+            TestFrame.container["dispatchEvent"](kEvent);
 
-   		public function focusOutDerivedTest():void
-   		{
-   			var kEvent:FocusEvent = new FocusEvent( FocusEvent.FOCUS_OUT );
-			TestFrame.container["dispatchEvent"](kEvent);
+            SelManager.flushPendingOperations();
 
-			SelManager.flushPendingOperations();
+            assertTrue("Deactivate override was not executed",
+                    getAllText() == "DEACTIVATE");
+        }
 
-			assertTrue( "Focus Out override was not executed",
-						getAllText() == "FOCUSOUT" );
-   		}
+        [Test]
+        [Ignore]
+        public function deleteNextDerivedTest():void
+        {
+            (SelManager as TestEditManager).useDefaultKeyDown = true;
 
-   		public function activateDerivedTest():void
-   		{
-   			var kEvent:Event = new Event( Event.ACTIVATE );
-			TestFrame.container["dispatchEvent"](kEvent);
+            var kEvent:KeyboardEvent = new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 127, 46);
+            TestFrame.container["dispatchEvent"](kEvent);
 
-			SelManager.flushPendingOperations();
+            SelManager.flushPendingOperations();
 
-			assertTrue( "Activate override was not executed",
-						getAllText() == "ACTIVATE" );
-   		}
+            assertTrue("Delete Next override was not executed by pressing 'Delete'",
+                    getAllText() == "DELETENEXT");
 
-   		public function deactivateDerivedTest():void
-   		{
-   			var kEvent:Event = new Event( Event.DEACTIVATE );
-			TestFrame.container["dispatchEvent"](kEvent);
+            (SelManager as TestEditManager).useDefaultKeyDown = false;
+        }
 
-			SelManager.flushPendingOperations();
+        [Test]
+        [Ignore]
+        public function deletePreviousDerivedTest():void
+        {
+            (SelManager as TestEditManager).useDefaultKeyDown = true;
 
-			assertTrue( "Deactivate override was not executed",
-						getAllText() == "DEACTIVATE" );
-   		}
+            var kEvent:KeyboardEvent = new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 8, 8);
+            TestFrame.container["dispatchEvent"](kEvent);
 
-   		public function deleteNextDerivedTest():void
-   		{
-   			(SelManager as TestEditManager).useDefaultKeyDown = true;
+            SelManager.flushPendingOperations();
 
-   			var kEvent:KeyboardEvent = new KeyboardEvent( KeyboardEvent.KEY_DOWN, true, false, 127, 46 );
-			TestFrame.container["dispatchEvent"](kEvent);
+            assertTrue("Delete Previous override was not executed by pressing 'Backspace'",
+                    getAllText() == "DELETEPREVIOUS");
 
-			SelManager.flushPendingOperations();
+            (SelManager as TestEditManager).useDefaultKeyDown = false;
+        }
 
-			assertTrue( "Delete Next override was not executed by pressing 'Delete'",
-						getAllText() == "DELETENEXT" );
+        [Test]
+        [Ignore]
+        public function deleteNextWordDerivedTest():void
+        {
+            (SelManager as TestEditManager).useDefaultKeyDown = true;
 
-			(SelManager as TestEditManager).useDefaultKeyDown = false;
-   		}
+            var kEvent:KeyboardEvent = new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 127, 46, 0, true);
+            TestFrame.container["dispatchEvent"](kEvent);
 
-   		public function deletePreviousDerivedTest():void
-   		{
-   			(SelManager as TestEditManager).useDefaultKeyDown = true;
+            SelManager.flushPendingOperations();
 
-   			var kEvent:KeyboardEvent = new KeyboardEvent( KeyboardEvent.KEY_DOWN, true, false, 8, 8 );
-			TestFrame.container["dispatchEvent"](kEvent);
+            assertTrue("Delete Next override was not executed by pressing 'Ctrl-Delete'",
+                    getAllText() == "DELETENEXTWORD");
 
-			SelManager.flushPendingOperations();
+            (SelManager as TestEditManager).useDefaultKeyDown = false;
+        }
 
-			assertTrue( "Delete Previous override was not executed by pressing 'Backspace'",
-						getAllText() == "DELETEPREVIOUS" );
+        [Test]
+        [Ignore]
+        public function deletePreviousWordDerivedTest():void
+        {
+            (SelManager as TestEditManager).useDefaultKeyDown = true;
 
-			(SelManager as TestEditManager).useDefaultKeyDown = false;
-   		}
+            var kEvent:KeyboardEvent = new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 8, 8, 0, true);
+            TestFrame.container["dispatchEvent"](kEvent);
 
-   		public function deleteNextWordDerivedTest():void
-   		{
-   			(SelManager as TestEditManager).useDefaultKeyDown = true;
+            SelManager.flushPendingOperations();
 
-   			var kEvent:KeyboardEvent = new KeyboardEvent( KeyboardEvent.KEY_DOWN, true, false, 127, 46, 0, true );
-			TestFrame.container["dispatchEvent"](kEvent);
+            assertTrue("Delete Previous override was not executed by pressing 'Ctrl-Backspace'",
+                    getAllText() == "DELETEPREVIOUSWORD");
 
-			SelManager.flushPendingOperations();
+            (SelManager as TestEditManager).useDefaultKeyDown = false;
+        }
 
-			assertTrue( "Delete Next override was not executed by pressing 'Ctrl-Delete'",
-						getAllText() == "DELETENEXTWORD" );
 
-			(SelManager as TestEditManager).useDefaultKeyDown = false;
-   		}
+        // Returns the string from begIdx through and including endIdx
+        private function getText(begIdx:int, endIdx:int):String
+        {
+            var outString:String = "";
 
-   		public function deletePreviousWordDerivedTest():void
-   		{
-   			(SelManager as TestEditManager).useDefaultKeyDown = true;
+            var tt:String = SelManager.textFlow.getText();
 
-   			var kEvent:KeyboardEvent = new KeyboardEvent( KeyboardEvent.KEY_DOWN, true, false, 8, 8, 0, true );
-			TestFrame.container["dispatchEvent"](kEvent);
+            for (var x:int = begIdx; x < endIdx; x++)
+            {
+                outString += SelManager.textFlow.getCharAtPosition(x);
+            }
 
-			SelManager.flushPendingOperations();
+            return outString;
+        }
 
-			assertTrue( "Delete Previous override was not executed by pressing 'Ctrl-Backspace'",
-						getAllText() == "DELETEPREVIOUSWORD" );
+        // Returns the text contents of the entire textflow
+        private function getAllText():String
+        {
+            var begIdx:int = SelManager.textFlow.parentRelativeStart;
+            var endIdx:int = SelManager.textFlow.parentRelativeEnd - 1;
+            var outString:String = "";
 
-			(SelManager as TestEditManager).useDefaultKeyDown = false;
-   		}
-	}
+            for (var x:int = begIdx; x < endIdx; x++)
+            {
+                outString += SelManager.textFlow.getCharAtPosition(x);
+            }
+
+            return outString;
+        }
+    }
 }
 
 /********Editmanager for overriding events - Internal Helper Class**********************************/
 
-import flashx.textLayout.edit.EditManager;
-import flashx.undo.IUndoManager;
+import flash.events.Event;
+import flash.events.FocusEvent;
 import flash.events.KeyboardEvent;
 import flash.events.MouseEvent;
 import flash.events.TextEvent;
-import flash.events.FocusEvent;
-import flash.events.Event;
+
+import flashx.textLayout.edit.EditManager;
 import flashx.textLayout.edit.SelectionState;
+import flashx.undo.IUndoManager;
 
 internal class TestEditManager extends EditManager
 {
-	public var mouseMoved:Boolean;
-	public var useDefaultKeyDown:Boolean;
-
-	public function TestEditManager(undo:IUndoManager = null)
-	{
-		super(undo);
-
-		useDefaultKeyDown = false;
-
-		// Don't react to this event and ruin a different test
-		mouseMoved = true;
-	}
-
-	public override function keyDownHandler(event:KeyboardEvent):void
-	{
-		if ( useDefaultKeyDown == true )
-			super.keyDownHandler(event);
-		else
-			insertText("KEYDOWN");
-	}
-
-	public override function mouseDownHandler(event:MouseEvent):void
-	{ insertText("MOUSEDOWN"); }
-
-	public override function mouseMoveHandler(event:MouseEvent):void
-	{
-		// Don't react to this event more than once
-		if ( !mouseMoved)
-		{
-			insertText("MOUSEMOVE");
-			mouseMoved = true;
-		}
-	}
-
-	public override function textInputHandler(event:TextEvent):void
-	{ insertText("TEXTEVENT"); }
-
-	public override function focusInHandler(event:FocusEvent):void
-	{ insertText("FOCUSIN"); }
-
-	public override function focusOutHandler(event:FocusEvent):void
-	{ insertText("FOCUSOUT"); }
-
-	public override function activateHandler(event:Event):void
-	{ insertText("ACTIVATE"); }
-
-	public override function deactivateHandler(event:Event):void
-	{ insertText("DEACTIVATE"); }
-
-	/***** EDITMANAGER OVERRIDES *****/
-
-	public override function deleteNextCharacter(operationState:SelectionState=null):void
-	{ insertText("DELETENEXT"); }
-
-	public override function deletePreviousCharacter(operationState:SelectionState=null):void
-	{ insertText("DELETEPREVIOUS"); }
-
-	public override function deleteNextWord(operationState:SelectionState=null):void
-	{ insertText("DELETENEXTWORD"); }
-
-	public override function deletePreviousWord(operationState:SelectionState=null):void
-	{ insertText("DELETEPREVIOUSWORD"); }
+    public var mouseMoved:Boolean;
+    public var useDefaultKeyDown:Boolean;
+
+    public function TestEditManager(undo:IUndoManager = null)
+    {
+        super(undo);
+
+        useDefaultKeyDown = false;
+
+        // Don't react to this event and ruin a different test
+        mouseMoved = true;
+    }
+
+    public override function keyDownHandler(event:KeyboardEvent):void
+    {
+        if (useDefaultKeyDown == true)
+            super.keyDownHandler(event);
+        else
+            insertText("KEYDOWN");
+    }
+
+    public override function mouseDownHandler(event:MouseEvent):void
+    {
+        insertText("MOUSEDOWN");
+    }
+
+    public override function mouseMoveHandler(event:MouseEvent):void
+    {
+        // Don't react to this event more than once
+        if (!mouseMoved)
+        {
+            insertText("MOUSEMOVE");
+            mouseMoved = true;
+        }
+    }
+
+    public override function textInputHandler(event:TextEvent):void
+    {
+        insertText("TEXTEVENT");
+    }
+
+    public override function focusInHandler(event:FocusEvent):void
+    {
+        insertText("FOCUSIN");
+    }
+
+    public override function focusOutHandler(event:FocusEvent):void
+    {
+        insertText("FOCUSOUT");
+    }
+
+    public override function activateHandler(event:Event):void
+    {
+        insertText("ACTIVATE");
+    }
+
+    public override function deactivateHandler(event:Event):void
+    {
+        insertText("DEACTIVATE");
+    }
+
+    /***** EDITMANAGER OVERRIDES *****/
+
+    public override function deleteNextCharacter(operationState:SelectionState = null):void
+    {
+        insertText("DELETENEXT");
+    }
+
+    public override function deletePreviousCharacter(operationState:SelectionState = null):void
+    {
+        insertText("DELETEPREVIOUS");
+    }
+
+    public override function deleteNextWord(operationState:SelectionState = null):void
+    {
+        insertText("DELETENEXTWORD");
+    }
+
+    public override function deletePreviousWord(operationState:SelectionState = null):void
+    {
+        insertText("DELETEPREVIOUSWORD");
+    }
 
 }


[4/9] git commit: [flex-tlf] [refs/heads/develop] - Add new tests to AllTestsSuite: BoundsAndAlignmentTest.as, EventOverrideTest.as - all tests marked as Ignore - Need fixes CrossContainerTest.as, ElementOperationTest.as - all works fine

Posted by pi...@apache.org.
Add new tests to AllTestsSuite:
BoundsAndAlignmentTest.as, EventOverrideTest.as - all tests marked as Ignore - Need fixes
CrossContainerTest.as, ElementOperationTest.as - all works fine


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

Branch: refs/heads/develop
Commit: c105912118f6e3e064db62141f3760226fdabe49
Parents: 6cc1110
Author: piotrz <pi...@gmail.com>
Authored: Sun Oct 12 11:05:22 2014 +0200
Committer: piotrz <pi...@gmail.com>
Committed: Sun Oct 12 11:05:22 2014 +0200

----------------------------------------------------------------------
 automation_tests/src/AllTestsSuite.as           |    9 +-
 .../UnitTest/Tests/BoundsAndAlignmentTest.as    |  278 +---
 automation_tests/src/UnitTest/Tests/BoxTest.as  |   51 +-
 .../src/UnitTest/Tests/ContainerTypeTest.as     |    8 -
 .../src/UnitTest/Tests/CrossContainerTest.as    |  430 +++---
 .../src/UnitTest/Tests/ElementOperationTest.as  | 1192 +++++++++++++++++
 .../src/UnitTest/Tests/ElementOperationTests.as | 1228 ------------------
 .../src/UnitTest/Tests/EventOverrideTest.as     |  905 +++++--------
 8 files changed, 1744 insertions(+), 2357 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/c1059121/automation_tests/src/AllTestsSuite.as
----------------------------------------------------------------------
diff --git a/automation_tests/src/AllTestsSuite.as b/automation_tests/src/AllTestsSuite.as
index b24715b..a13ac01 100644
--- a/automation_tests/src/AllTestsSuite.as
+++ b/automation_tests/src/AllTestsSuite.as
@@ -25,10 +25,14 @@ package
     import UnitTest.Tests.AllEventTest;
     import UnitTest.Tests.AllParaAttributeTest;
     import UnitTest.Tests.AttributeTest;
+    import UnitTest.Tests.BoundsAndAlignmentTest;
     import UnitTest.Tests.BoxTest;
     import UnitTest.Tests.CompositionTest;
     import UnitTest.Tests.ContainerAttributeTest;
     import UnitTest.Tests.ContainerTypeTest;
+    import UnitTest.Tests.CrossContainerTest;
+    import UnitTest.Tests.ElementOperationTest;
+    import UnitTest.Tests.EventOverrideTest;
     import UnitTest.Tests.FloatTest;
     import UnitTest.Tests.OperationTest;
     import UnitTest.Tests.ScrollingTest;
@@ -50,7 +54,10 @@ package
         public var operationTest:OperationTest;
         public var scrollingTest:ScrollingTest;
         public var containerAttributeTest:ContainerAttributeTest;
-
+        public var boundsAndAlignmentTest:BoundsAndAlignmentTest;
+        public var crossContainerTest:CrossContainerTest;
+        public var elementOperationTest:ElementOperationTest;
+        public var eventOverrideTest:EventOverrideTest;
     }
 
 }

http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/c1059121/automation_tests/src/UnitTest/Tests/BoundsAndAlignmentTest.as
----------------------------------------------------------------------
diff --git a/automation_tests/src/UnitTest/Tests/BoundsAndAlignmentTest.as b/automation_tests/src/UnitTest/Tests/BoundsAndAlignmentTest.as
index 6daafda..026ba5f 100644
--- a/automation_tests/src/UnitTest/Tests/BoundsAndAlignmentTest.as
+++ b/automation_tests/src/UnitTest/Tests/BoundsAndAlignmentTest.as
@@ -30,7 +30,6 @@ package UnitTest.Tests
     import flash.events.EventDispatcher;
     import flash.events.IEventDispatcher;
     import flash.geom.Rectangle;
-    import flash.text.engine.TextLine;
 
     import flashx.textLayout.compose.StandardFlowComposer;
     import flashx.textLayout.container.ContainerController;
@@ -38,8 +37,6 @@ package UnitTest.Tests
     import flashx.textLayout.conversion.TextConverter;
     import flashx.textLayout.edit.EditManager;
     import flashx.textLayout.edit.IEditManager;
-    import flashx.textLayout.elements.FlowLeafElement;
-    import flashx.textLayout.elements.InlineGraphicElement;
     import flashx.textLayout.elements.InlineGraphicElementStatus;
     import flashx.textLayout.elements.TextFlow;
     import flashx.textLayout.events.StatusChangeEvent;
@@ -47,9 +44,7 @@ package UnitTest.Tests
     import flashx.textLayout.factory.TextFlowTextLineFactory;
     import flashx.textLayout.formats.BlockProgression;
     import flashx.textLayout.formats.Direction;
-    import flashx.textLayout.formats.TextAlign;
     import flashx.textLayout.formats.TextLayoutFormat;
-    import flashx.textLayout.formats.VerticalAlign;
 
     import mx.containers.Canvas;
 
@@ -61,7 +56,6 @@ package UnitTest.Tests
     {
         // Creation Types
         private static const USE_FLOW:String = "textFlow";
-        private static const USE_FACTORY_STRING:String = "factoryStr";
         private static const USE_FACTORY_FLOW:String = "factoryTF";
 
         private static var textAlignArray:Array = ["left", "center", "right", "start", "end" ];
@@ -110,11 +104,6 @@ package UnitTest.Tests
             ]
         ];
 
-        private const logicalWidth:Number = 400;
-        private const logicalHeight:Number = 400;
-
-        private var w:Number = 210;
-        private var h:Number = 40;
         private var width:Number;
         private var height:Number;
 
@@ -127,7 +116,6 @@ package UnitTest.Tests
         // bounds and format of last sprite for comparison function
         private var compareBounds:Rectangle;
 
-        private var fFactBounds:Rectangle;
         private var tFlowBounds:Rectangle;
 
         private var notReadyGraphicsCount:int;
@@ -171,14 +159,6 @@ package UnitTest.Tests
             var labelFormat:TextLayoutFormat = new TextLayoutFormat();
             labelFormat.fontSize = 12;
             labelFactory.spanFormat = labelFormat;
-
-          /*  testData = <TestCase>
-                <TestData name="measureType">{measureType}</TestData>
-                <TestData name="lineBreak">{lineBreak}</TestData>
-                <TestData name="id">{methodName}-{measureType}-{lineBreak}</TestData>
-                <TestData name="verticalAlign">{verticalAlign}</TestData>
-                <TestData name="textAlign">{textAlign}</TestData>
-            </TestCase>; */
         }
 
         [AfterClass]
@@ -211,8 +191,9 @@ package UnitTest.Tests
 
         /********************** Tests Start Here ***************************/
 
-        [Test(dataProvider="data")]
-        public function simpleMultiParagraph(measureType:Object):void
+        [Test]
+        [Ignore]
+        public function simpleMultiParagraph():void
         {
             // This is a subset of simple.xml
             // Exposed Watson bug 2559210
@@ -224,6 +205,21 @@ package UnitTest.Tests
             runSingleTest(markup, insertText);
         }
 
+        [Test]
+        [Ignore]
+        public function simpleMultiParagraphNoTextIndent():void
+        {
+            // This is a subset of simple.xml, and has NO first line indent applied to the paragraphs.
+            var markup:String = '<flow:TextFlow xmlns:flow="http://ns.adobe.com/textLayout/2008" fontSize="14" paddingTop="4" paddingLeft="4" fontFamily="Times New Roman">' +
+                    '<flow:p paragraphSpaceAfter="15"><flow:span>There are many </flow:span><flow:span fontStyle="italic">such</flow:span><flow:span> lime-kilns in that tract of country, for the purpose of burning the white marble which composes a large part of the substance of the hills. Some of them, built years ago, and long deserted, with weeds growing in the vacant round of the interior, which is open to the sky, and grass and wild-flowers rooting themselves into the chinks of the stones, look already like relics of antiquity, and may yet be overspread with the lichens of centuries to come. Sentences removed.</flow:span></flow:p>' +
+                    '<flow:p paragraphSpaceAfter="15"><flow:span>The man who now watched the fire was of a different order, and troubled himself with no thoughts save the very few that were requisite to his business. At frequent intervals, he flung back the clashing weight of the iron door, and, turning his face from the insufferable glare, thrust in huge logs of oak, or stirred the immense brands with a long pole. Sentences removed.</flow:span></flow:p>' +
+                    '</flow:TextFlow>';
+
+            runSingleTest(markup);
+        }
+
+        [Test]
+        [Ignore]
         public function longSimpleMultiParagraph():void
         {
             // This is a longer version of simple.xml, so the text overflows the visible area and scrolls
@@ -241,17 +237,8 @@ package UnitTest.Tests
             runSingleTest(markup, insertText);
         }
 
-        public function simpleMultiParagraphNoTextIndent():void
-        {
-            // This is a subset of simple.xml, and has NO first line indent applied to the paragraphs.
-            var markup:String = '<flow:TextFlow xmlns:flow="http://ns.adobe.com/textLayout/2008" fontSize="14" paddingTop="4" paddingLeft="4" fontFamily="Times New Roman">' +
-                    '<flow:p paragraphSpaceAfter="15"><flow:span>There are many </flow:span><flow:span fontStyle="italic">such</flow:span><flow:span> lime-kilns in that tract of country, for the purpose of burning the white marble which composes a large part of the substance of the hills. Some of them, built years ago, and long deserted, with weeds growing in the vacant round of the interior, which is open to the sky, and grass and wild-flowers rooting themselves into the chinks of the stones, look already like relics of antiquity, and may yet be overspread with the lichens of centuries to come. Sentences removed.</flow:span></flow:p>' +
-                    '<flow:p paragraphSpaceAfter="15"><flow:span>The man who now watched the fire was of a different order, and troubled himself with no thoughts save the very few that were requisite to his business. At frequent intervals, he flung back the clashing weight of the iron door, and, turning his face from the insufferable glare, thrust in huge logs of oak, or stirred the immense brands with a long pole. Sentences removed.</flow:span></flow:p>' +
-                    '</flow:TextFlow>';
-
-            runSingleTest(markup);
-        }
-
+        [Test]
+        [Ignore]
         public function simpleMultiParagraphNegTextIndent():void
         {
             // This is a subset of simple.xml, and has NO first line indent applied to the paragraphs.
@@ -263,6 +250,8 @@ package UnitTest.Tests
             runSingleTest(markup);
         }
 
+        [Test]
+        [Ignore]
         public function simpleWithPaddingTopLeft():void
         {
             // This is a subset of simple.xml, and has NO first line indent applied to the paragraphs.
@@ -274,6 +263,8 @@ package UnitTest.Tests
             runSingleTest(markup);
         }
 
+        [Test]
+        [Ignore]
         public function simpleWithPaddingBottomRight():void
         {
             // This is a subset of simple.xml, and has NO first line indent applied to the paragraphs.
@@ -312,39 +303,6 @@ package UnitTest.Tests
 
         // end of IEventDispatcher functions
 
-        private function setUpMeasureType(measureObj:Object):void
-        {
-            width = logicalWidth;
-            height = logicalHeight;
-
-            switch (measureObj.measureType)
-            {
-                case MeasureConstants.MEASURE_BOTH:
-                    width = NaN;
-                    height = NaN;
-                    break;
-
-                case MeasureConstants.MEASURE_WIDTH:
-                    width = NaN;
-                    break;
-
-                case MeasureConstants.MEASURE_HEIGHT:
-                    height = NaN;
-                    break;
-            }
-
-            if (_blockProgression == BlockProgression.RL)		// swap coordinates if we're vertical
-            {
-                var tmp:Number = width;
-                width = height;
-                height = tmp;
-
-                tmp = w;
-                w = h;
-                h = tmp;
-            }
-        }
-
         private function insertText(textFlow:TextFlow):void
         {
             textFlow.interactionManager = editManager;
@@ -365,59 +323,6 @@ package UnitTest.Tests
             }
         }
 
-        private function clearCanvas():void
-        {
-            TestDisplayObject = testApp.getDisplayObject();
-            if (TestDisplayObject)
-            {
-                testCanvas = Canvas(TestDisplayObject);
-                while (testCanvas.rawChildren.numChildren > 0)
-                    testCanvas.rawChildren.removeChildAt(0);
-            }
-        }
-
-        // These tests run flow &  textFlowfactory creation types (they don't work on string factory)
-        private static var testsToRunOnFlowAndTFFactory:Array = [
-            "simpleMultiParagraph",
-            "simpleMultiParagraphNoTextIndent",
-            "simpleWithPaddingTopLeft",
-            "simpleWithPaddingBottomRight",
-            "simpleMultiParagraphNegTextIndent",
-            "longSimpleMultiParagraph",
-        ];
-
-        private function createDefaultTextLayoutFormat():TextLayoutFormat
-        {
-            var format:TextLayoutFormat = new TextLayoutFormat();
-            format.fontFamily = "Arial";
-            format.fontSize = 20;
-            format.direction = _direction;
-            format.blockProgression = _blockProgression;
-            return format;
-        }
-
-        private function createTextFlow(markup:String):TextFlow
-        {
-            if (markup.length <= 0 || markup.charAt(0) != "<")
-                return TextConverter.importToFlow(markup, TextConverter.PLAIN_TEXT_FORMAT);
-
-            var textFlow:TextFlow = TextConverter.importToFlow(markup, TextConverter.TEXT_LAYOUT_FORMAT);
-            var flowNotReadyGraphicsCount:int = 0;
-
-            // check for inlines
-            for (var leaf:FlowLeafElement = textFlow.getFirstLeaf(); leaf != null; leaf = leaf.getNextLeaf())
-                if (leaf is InlineGraphicElement && InlineGraphicElement(leaf).status != InlineGraphicElementStatus.READY)
-                    flowNotReadyGraphicsCount++;
-            if (flowNotReadyGraphicsCount != 0)
-            {
-                textFlow.addEventListener(StatusChangeEvent.INLINE_GRAPHIC_STATUS_CHANGE, statusChangeHandler, false, 0, true);
-                textFlow.flowComposer.addController(new ContainerController(new Sprite()));	// add dummy controller so we get status change events
-                textFlow.flowComposer.updateAllControllers();
-                notReadyGraphicsCount += flowNotReadyGraphicsCount;
-            }
-            return textFlow;
-        }
-
         // Track the completion of loading inlines, dispatch a completion event when its done
         private function statusChangeHandler(obj:Event):void
         {
@@ -449,47 +354,6 @@ package UnitTest.Tests
             }
         }
 
-        private function addTextFactoryFromFlowSprite(x:Number, y:Number, width:Number, height:Number, textFlow:TextFlow):Sprite
-        {
-            // trace("addTextFactoryFromFlowSprite",x,y,width,height,textAlign,verticalAlign,lineBreak);
-
-            var factorySprite:Sprite = new Sprite();
-            factorySprite.x = x;
-            factorySprite.y = y;
-
-            addToCanvas(factorySprite);
-
-            textFlowFactory.compositionBounds = new Rectangle(0, 0, width ? width : NaN, height ? height : NaN);
-
-            textFlowFactory.createTextLines(callback, textFlow);
-            clearCanvas();
-            addToCanvas(factorySprite);
-
-            function callback(tl:TextLine):void
-            {
-                factorySprite.addChild(tl);
-            }
-
-            // composition bounds in black
-            // contentBounds in red
-            // put it in another sprite on top
-            sprite = new Sprite();
-            sprite.x = x;
-            sprite.y = y;
-            addToCanvas(sprite);
-
-            compareBounds = textFlowFactory.getContentBounds();
-            var g:Graphics = sprite.graphics;
-            drawCircle(g, 0xff00, 0, 0, 3);
-            strokeRect(g, 1, 0x0, 0, 0, width, height);
-            strokeRect(g, 1, 0xFF0000, compareBounds.left, compareBounds.top, compareBounds.width, compareBounds.height);
-            // trace("addTextFactoryFromFlowSprite is running");
-            fFactBounds = textFlowFactory.getContentBounds();
-
-            // trace("bounds",sFactBounds);
-            return factorySprite;
-        }
-
         private function addTextFlowSprite(parentSprite:Sprite, x:Number, y:Number, width:Number, height:Number, textFlow:TextFlow):Sprite
         {
             sprite = new Sprite();
@@ -558,100 +422,6 @@ package UnitTest.Tests
             g.endFill();
         }
 
-
-        private function validateContentBounds(s:Sprite, contentBounds:Rectangle, marginOfError:Number):void
-        {
-            // Check that the content bounds includes all the places within the container that have text
-            s.graphics.clear();
-            var bbox:Rectangle = s.getBounds(s);
-
-            // The content bounds should always include the inked bounds, or be very close to it. In practice, how far it may be off by is proportional to the text size.
-            assertTrue("contentBounds left doesn't match sprite inked bounds", contentBounds.left <= bbox.left || Math.abs(contentBounds.left - bbox.left) < marginOfError);
-            assertTrue("contentBounds top doesn't match sprite inked bounds", contentBounds.top <= bbox.top || Math.abs(contentBounds.top - bbox.top) < marginOfError);
-            assertTrue("contentBounds right doesn't match sprite inked bounds", contentBounds.right >= bbox.right || Math.abs(contentBounds.right - bbox.right) < marginOfError);
-            assertTrue("contentBounds bottom doesn't match sprite inked bounds", contentBounds.bottom >= bbox.bottom || Math.abs(contentBounds.bottom - bbox.bottom) < marginOfError);
-        }
-
-        private function validateAlignment(verticalAlign:String, textAlign:String, textFlow:TextFlow, compositionBounds:Rectangle, contentBounds:Rectangle, expectContentsToFit:Boolean, marginOfError:Number):void
-        {
-            // Check that the text was put in the appropriate area of the container, given the vertical & horizontal alignment values
-            if (expectContentsToFit)
-            {
-                assertTrue("contents expected to fit, but overflow in height", contentBounds.height <= compositionBounds.height || contentBounds.height - compositionBounds.height < 1);
-                assertTrue("contents expected to fit, but overflow in width", contentBounds.width <= compositionBounds.width || contentBounds.width - compositionBounds.width < 1);
-            }
-
-            // Resolve direction dependent alignment
-            if (textAlign == TextAlign.START)
-                textAlign = textFlow.computedFormat.direction == Direction.LTR ? TextAlign.LEFT : TextAlign.RIGHT;
-            if (textAlign == TextAlign.END)
-                textAlign = textFlow.computedFormat.direction == Direction.RTL ? TextAlign.LEFT : TextAlign.RIGHT;
-
-            // Swap alignment values for validate call if text is rotated (vertical text)
-            if (_blockProgression == BlockProgression.RL)
-            {
-                var originalTextAlign:String = textAlign;
-                switch (verticalAlign)
-                {
-                    case VerticalAlign.TOP:
-                        textAlign = TextAlign.RIGHT;
-                        break;
-                    case VerticalAlign.MIDDLE:
-                        textAlign = TextAlign.CENTER;
-                        break;
-                    case VerticalAlign.BOTTOM:
-                        textAlign = TextAlign.LEFT;
-                        break;
-                    default:
-                        break;
-                }
-                switch (originalTextAlign)
-                {
-                    case TextAlign.LEFT:
-                        verticalAlign = VerticalAlign.TOP;
-                        break;
-                    case TextAlign.CENTER:
-                        verticalAlign = VerticalAlign.MIDDLE;
-                        break;
-                    case TextAlign.RIGHT:
-                        verticalAlign = VerticalAlign.BOTTOM;
-                        break;
-                    default:
-                        break;
-                }
-            }
-
-            switch (verticalAlign)
-            {
-                case VerticalAlign.TOP:
-                    assertTrue("Vertical alignment top - content not at top", Math.abs(contentBounds.top - compositionBounds.top) < marginOfError);
-                    break;
-                case VerticalAlign.MIDDLE:
-                    assertTrue("Vertical alignment middle - content not at middle", Math.abs(Math.abs(contentBounds.top - compositionBounds.top) - Math.abs(contentBounds.bottom - compositionBounds.bottom)) < marginOfError);
-                    break;
-                case VerticalAlign.BOTTOM:
-                    assertTrue("Vertical alignment bottom - content not at bottom", Math.abs(contentBounds.bottom - compositionBounds.bottom) < marginOfError);
-                    break;
-                default:
-                    break;
-            }
-            switch (textAlign)
-            {
-                case TextAlign.LEFT:
-                    assertTrue("Horizontal alignment left - content not at left", Math.abs(contentBounds.left - compositionBounds.left) < marginOfError);
-                    break;
-                case TextAlign.CENTER:
-                    assertTrue("Horizontal alignment center - content not at center", Math.abs(Math.abs(contentBounds.left - compositionBounds.left) - Math.abs(contentBounds.right - compositionBounds.right)) < marginOfError);
-                    break;
-                case TextAlign.RIGHT:
-                    assertTrue("Horizontal alignment right - content not at right", Math.abs(contentBounds.right - compositionBounds.right) < marginOfError);
-                    break;
-                default:
-                    break;
-            }
-        }
-
-
         /** Run a single markup description in vertical alignment (top, middle, bottom) * horizontal alignment (left, center, right) in
          * both the full compose using ContainerController and a TextFlow Factory case. Compare the results to make sure the text falls
          * in the correct area of the container, that the content bounds is no smaller than the inked bounds, and that the full compose

http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/c1059121/automation_tests/src/UnitTest/Tests/BoxTest.as
----------------------------------------------------------------------
diff --git a/automation_tests/src/UnitTest/Tests/BoxTest.as b/automation_tests/src/UnitTest/Tests/BoxTest.as
index e0512c5..6340382 100644
--- a/automation_tests/src/UnitTest/Tests/BoxTest.as
+++ b/automation_tests/src/UnitTest/Tests/BoxTest.as
@@ -76,31 +76,6 @@ package UnitTest.Tests
             metaData.productArea = "Text Composition";
         }
 
-        /*  public static function suite(testConfig:TestConfig, ts:TestSuiteExtended):void
-         {
-         ts.addTestDescriptor(new TestDescriptor(BoxTest, "paddingAndMarginOnDiv", testConfig, null));
-         ts.addTestDescriptor(new TestDescriptor(BoxTest, "negativePaddingAndMarginOnDiv", testConfig, null));
-         ts.addTestDescriptor(new TestDescriptor(BoxTest, "verticalSpaceCollapse", testConfig, null));
-
-         ts.addTestDescriptor(new TestDescriptor(BoxTest, "ilgMarginsAndPaddingStart", testConfig, null));
-         ts.addTestDescriptor(new TestDescriptor(BoxTest, "ilgMarginsAndPaddingEnd", testConfig, null));
-         ts.addTestDescriptor(new TestDescriptor(BoxTest, "ilgMarginsAndPaddingBeforeAndAfter", testConfig, null));
-         ts.addTestDescriptor(new TestDescriptor(BoxTest, "ilgMarginsAndPaddingStartStrikeAndUnderline", testConfig, null));
-         ts.addTestDescriptor(new TestDescriptor(BoxTest, "ilgMarginsAndPaddingEndStrikeAndUnderline", testConfig, null));
-         ts.addTestDescriptor(new TestDescriptor(BoxTest, "ilgMarginsAndPaddingBeforeAndAfterStrikeAndUnderline", testConfig, null));
-         ts.addTestDescriptor(new TestDescriptor(BoxTest, "floatMarginsAndPaddingLeftAndRight", testConfig, null));
-         ts.addTestDescriptor(new TestDescriptor(BoxTest, "floatMarginsAndPaddingUpAndDown", testConfig, null));
-
-
-         // We only need one version of these tests, they supply their own markup
-         if (testConfig.writingDirection[0] == BlockProgression.TB && testConfig.writingDirection[1] == Direction.LTR)
-         {
-         ts.addTestDescriptor(new TestDescriptor(BoxTest, "textFlowPadding", testConfig, null));
-         ts.addTestDescriptor(new TestDescriptor(BoxTest, "rlPaddingOnDiv", testConfig, null));
-         ts.addTestDescriptor(new TestDescriptor(BoxTest, "boundsWithPadding", testConfig, null));
-         }
-         }    */
-
         [Before]
         override public function setUpTest():void
         {
@@ -154,28 +129,7 @@ package UnitTest.Tests
                 format.paddingRight = totalRight;
                 format.paddingBottom = totalBottom;
             }
-            /*	if (verticalText)		FOR WHEN MARGINS ARE TURNED BACK ON
-             {
-             format.marginLeft = totalBottom / 2;
-             format.paddingLeft = totalBottom / 2;
-             format.marginTop = totalLeft / 2;
-             format.paddingTop = totalLeft / 2;
-             format.marginRight = totalTop / 2;
-             format.paddingRight = totalTop / 2;
-             format.marginBottom = totalRight / 2;
-             format.paddingBottom = totalRight / 2;
-             }
-             else
-             {
-             format.marginLeft = totalLeft / 2;
-             format.paddingLeft = totalLeft / 2;
-             format.marginTop = totalTop / 2;
-             format.paddingTop = totalTop / 2;
-             format.marginRight = totalRight / 2;
-             format.paddingRight = totalRight / 2;
-             format.marginBottom = totalBottom / 2;
-             format.paddingBottom = totalBottom / 2;
-             } */
+
             element.format = format;
         }
 
@@ -549,9 +503,6 @@ package UnitTest.Tests
             var columnRect:Rectangle = controller.columnState.getColumnAt(tfl.columnIndex);
 
             // Check that graphic leaves a margin on the left side, so its not right up against the container edge
-            //	var globalInlinePt:Point = ilg.graphic.localToGlobal(new Point(0, 0));
-            //	var inlinePt:Point = controller.container.globalToLocal(globalInlinePt);
-            //	var inlineBBox:Rectangle = new Rectangle(inlinePt.x, inlinePt.y, ilg.elementWidth, ilg.elementHeight);
             var inlineBBox:Rectangle = new Rectangle(floatHolder.x, floatHolder.y, ilg.elementWidth, ilg.elementHeight);
 
             if (float == Float.LEFT)

http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/c1059121/automation_tests/src/UnitTest/Tests/ContainerTypeTest.as
----------------------------------------------------------------------
diff --git a/automation_tests/src/UnitTest/Tests/ContainerTypeTest.as b/automation_tests/src/UnitTest/Tests/ContainerTypeTest.as
index 1381e41..5e401c9 100644
--- a/automation_tests/src/UnitTest/Tests/ContainerTypeTest.as
+++ b/automation_tests/src/UnitTest/Tests/ContainerTypeTest.as
@@ -18,8 +18,6 @@
 ////////////////////////////////////////////////////////////////////////////////
 package UnitTest.Tests
 {
-
-    import UnitTest.ExtendedClasses.TestSuiteExtended;
     import UnitTest.ExtendedClasses.VellumTestCase;
     import UnitTest.Fixtures.TestConfig;
 
@@ -71,12 +69,6 @@ package UnitTest.Tests
             markup = getTestMarkup();
         }
 
-        public static function suiteFromXML(testListXML:XML, testConfig:TestConfig, ts:TestSuiteExtended):void
-        {
-            var testCaseClass:Class = ContainerTypeTest;
-            VellumTestCase.suiteFromXML(testCaseClass, testListXML, testConfig, ts);
-        }
-
         [Before]
         override public function setUpTest():void
         {

http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/c1059121/automation_tests/src/UnitTest/Tests/CrossContainerTest.as
----------------------------------------------------------------------
diff --git a/automation_tests/src/UnitTest/Tests/CrossContainerTest.as b/automation_tests/src/UnitTest/Tests/CrossContainerTest.as
index bf9f20b..1d831ec 100644
--- a/automation_tests/src/UnitTest/Tests/CrossContainerTest.as
+++ b/automation_tests/src/UnitTest/Tests/CrossContainerTest.as
@@ -18,240 +18,216 @@
 ////////////////////////////////////////////////////////////////////////////////
 package UnitTest.Tests
 {
-	import UnitTest.ExtendedClasses.TestDescriptor;
-	import UnitTest.ExtendedClasses.TestSuiteExtended;
-	import UnitTest.ExtendedClasses.VellumTestCase;
-	import UnitTest.Fixtures.TestConfig;
-	
-	import flash.display.Sprite;
-	import flash.text.engine.TextBlock;
-	import flash.text.engine.TextLine;
-	
-	import flashx.textLayout.compose.IFlowComposer;
-	import flashx.textLayout.container.ContainerController;
-	import flashx.textLayout.edit.EditManager;
-	import flashx.textLayout.elements.InlineGraphicElement;
-	import flashx.textLayout.elements.ParagraphElement;
-	import flashx.textLayout.elements.SpanElement;
-	import flashx.textLayout.elements.TextFlow;
-	import flashx.textLayout.formats.BlockProgression;
-	import flashx.textLayout.formats.Direction;
-	import flashx.textLayout.formats.TextLayoutFormat;
-	import flashx.textLayout.tlf_internal;
-	
-	import mx.containers.Canvas;
+    import UnitTest.ExtendedClasses.VellumTestCase;
+    import UnitTest.Fixtures.TestConfig;
+
+    import flash.display.Sprite;
+    import flash.text.engine.TextBlock;
+    import flash.text.engine.TextLine;
+
+    import flashx.textLayout.compose.IFlowComposer;
+    import flashx.textLayout.container.ContainerController;
+    import flashx.textLayout.edit.EditManager;
+    import flashx.textLayout.elements.InlineGraphicElement;
+    import flashx.textLayout.elements.ParagraphElement;
+    import flashx.textLayout.elements.SpanElement;
+    import flashx.textLayout.elements.TextFlow;
+    import flashx.textLayout.formats.BlockProgression;
+    import flashx.textLayout.formats.Direction;
+    import flashx.textLayout.formats.TextLayoutFormat;
+    import flashx.textLayout.tlf_internal;
+
+    import mx.containers.Canvas;
 
     import org.flexunit.asserts.assertTrue;
 
     use namespace tlf_internal;
-	
-	public class CrossContainerTest extends VellumTestCase
-	{
+
+    public class CrossContainerTest extends VellumTestCase
+    {
         // Members
         private var _flowComposer:IFlowComposer;
-		private var _textFlow:TextFlow;
-		private var _testXML:XML;
-		private var _verticalText:Boolean;
-		private var _rtlText:Boolean;
-		private var _testCanvas:Canvas;
-		private var _textFlowSprite:Sprite;
-		private var _container1:Sprite;
-		private var _container2:Sprite;
-		private var _container3:Sprite;
-		
-		public function CrossContainerTest(methodName:String, testID:String, testConfig:TestConfig, testXML:XML = null)
-		{
-			super (methodName, testID, testConfig);
-			_testXML = testXML;
-			TestData.fileName = null;
-			
-			// Note: These must correspond to a Watson product area (case-sensitive)
-			metaData.productArea = "Text Composition";
-		}
-		
-		public static function suite(testConfig:TestConfig, ts:TestSuiteExtended):void
-		{
-            addTestCase(ts, testConfig, "crossContainerTest");
-		}
-		
-		private static function addTestCase(ts:TestSuiteExtended, testConfig:TestConfig, methodName:String):void
-		{
-			var testXML:XML = <TestCase>
-								<TestData name="methodName">{methodName}</TestData>
-								<TestData name="id">{methodName}</TestData>
-							</TestCase>;
-
-			ts.addTestDescriptor (new TestDescriptor (CrossContainerTest,"callTestMethod", testConfig, testXML) );
-		}
-		
-		override public function setUpTest() : void
-		{
-			super.setUpTest();
-			setupTextFlow();
-			initializeFlow();
-		}
-		
-		private function setupTextFlow():void
-
-		{
-			var textFlow:TextFlow = new TextFlow();
-			var para1String:String = "In the first paragraph of a "
-			var para1String2:String = "cheap"
-			var para1String3:String ="Western novel, a cowboy meets a saloon girl.";
-			var para2String:String = "In the middle of the cheap novel a really bad guy, "+
-				"who is having a relationship with the saloon girl, sees the cowboy help "+
-				"her onto her horse as she smiles at him warmly."
-			var para3String:String = "In the last paragraph of the cheap novel, the cowboy kills "+
-				"the really bad guy in a shootout in the middle of main street and "+
-				"then rides into the sunset with the saloon girl on the back of his";
-			
-			var controllerOne:ContainerController;
-			var controllerTwo:ContainerController;
-			
-			_container1 = new Sprite();
-			_container2 = new Sprite();
-			
-			controllerOne = new ContainerController(_container1, 200, 210);
-			controllerTwo = new ContainerController(_container2, 200, 220);
-			
-			var textLayoutFormat:TextLayoutFormat = new TextLayoutFormat();
-			var paragraph1:ParagraphElement = new ParagraphElement();
-			
-			var paragraph2:ParagraphElement = new ParagraphElement();
-			var paragraph3:ParagraphElement = new ParagraphElement();
-			
-			var p1Span1:SpanElement = new SpanElement();
-			var p1Span2:SpanElement = new SpanElement();
-			var p1Span3:SpanElement = new SpanElement();
-			var p2Span:SpanElement = new SpanElement();
-			var p3Span:SpanElement = new SpanElement();
-			
-			p1Span1.text = para1String;
-			p1Span2.text = para1String2;
-			p1Span3.text = para1String3;
-			
-			paragraph1.addChild(p1Span1);
-			paragraph1.addChild(p1Span2);
-			paragraph1.addChild(p1Span3);
-			
-			p2Span.text = para2String;
-			paragraph2.addChild(p2Span);
-			
-			p3Span.text = para3String;
-			
-			var img:InlineGraphicElement = new InlineGraphicElement();
-			img.source = "../../test/testFiles/assets/smiley.gif"
-			img.width = 100;
-			img.height = 100;
-			
-			paragraph3.addChild(p3Span);
-			paragraph3.addChild(img);
-			
-			textFlow.addChild(paragraph1);
-			textFlow.addChild(paragraph2);
-			textFlow.addChild(paragraph3);
-			
-			textLayoutFormat.fontSize = 14;
-			textLayoutFormat.textIndent = 15;
-			textLayoutFormat.paragraphSpaceAfter = 15;
-			textLayoutFormat.paddingTop = 4;
-			textLayoutFormat.paddingLeft = 4;
-			
-			textFlow.hostFormat = textLayoutFormat;
-			textFlow.interactionManager = new EditManager();
-			_container1.x = 0;
-			_container1.y = 100;
-			_container2.x = 255;
-			_container2.y = 100; 
-			textFlow.flowComposer.addController(controllerOne);
-			textFlow.flowComposer.addController(controllerTwo);
-			textFlow.flowComposer.updateAllControllers();
-			
-			_container3 = new Sprite();
-			var controllerThree:ContainerController = new ContainerController(_container3, 200, 220);
-			_container3.x = 510;
-			_container3.y = 100; 
-			var textLayoutFormat1:TextLayoutFormat = new TextLayoutFormat();
-			
-			textLayoutFormat1.fontSize = 18;
-			textLayoutFormat1.textIndent = 15;
-			textLayoutFormat1.paragraphSpaceAfter = 15;
-			textLayoutFormat1.paddingTop = 4;
-			textLayoutFormat1.paddingLeft = 4;
-			textFlow.hostFormat = textLayoutFormat1;
-			textFlow.flowComposer.addController(controllerThree);
-			
-			_textFlowSprite = new Sprite();
-			_textFlowSprite.addChild(_container1);
-			_textFlowSprite.addChild(_container2);
-			_textFlowSprite.addChild(_container3);
-		
-			_textFlow = textFlow;
-
-		}
-		
-		override public function tearDownTest(): void
-		{
-			super.tearDownTest();
-		}
-		
-		private function initializeFlow():void
-		{
-			_flowComposer = _textFlow.flowComposer;
-			_testCanvas = myEmptyChilds();
-			_testCanvas.rawChildren.addChild(_textFlowSprite);
-			
+        private var _textFlow:TextFlow;
+        private var _verticalText:Boolean;
+        private var _rtlText:Boolean;
+        private var _testCanvas:Canvas;
+        private var _textFlowSprite:Sprite;
+        private var _container1:Sprite;
+        private var _container2:Sprite;
+        private var _container3:Sprite;
+
+        public function CrossContainerTest()
+        {
+            super("", "CrossContainerTest", TestConfig.getInstance());
+            TestData.fileName = null;
+            metaData = {};
+            // Note: These must correspond to a Watson product area (case-sensitive)
+            metaData.productArea = "Text Composition";
+        }
+
+        [Before]
+        override public function setUpTest():void
+        {
+            super.setUpTest();
+            setupTextFlow();
+            initializeFlow();
+        }
+
+        [After]
+        override public function tearDownTest():void
+        {
+            super.tearDownTest();
+        }
+
+        [Test]
+        public function crossContainerTest():void
+        {
+            var tb:TextBlock = (_textFlow.getChildAt(2) as ParagraphElement).getTextBlock();
+            assertTrue("The _textBlock of the second paragraph should not be null", tb);
+            var fLine:TextLine = tb.firstLine;
+            assertTrue("The first TextLine of the second paragraph should not be null", fLine);
+            assertTrue("The first TextLine of the second paragraph should be on the second container", fLine.parent == _container2);
+        }
+
+        private function setupTextFlow():void
+        {
+            var textFlow:TextFlow = new TextFlow();
+            var para1String:String = "In the first paragraph of a "
+            var para1String2:String = "cheap"
+            var para1String3:String = "Western novel, a cowboy meets a saloon girl.";
+            var para2String:String = "In the middle of the cheap novel a really bad guy, " +
+                    "who is having a relationship with the saloon girl, sees the cowboy help " +
+                    "her onto her horse as she smiles at him warmly."
+            var para3String:String = "In the last paragraph of the cheap novel, the cowboy kills " +
+                    "the really bad guy in a shootout in the middle of main street and " +
+                    "then rides into the sunset with the saloon girl on the back of his";
+
+            var controllerOne:ContainerController;
+            var controllerTwo:ContainerController;
+
+            _container1 = new Sprite();
+            _container2 = new Sprite();
+
+            controllerOne = new ContainerController(_container1, 200, 210);
+            controllerTwo = new ContainerController(_container2, 200, 220);
+
+            var textLayoutFormat:TextLayoutFormat = new TextLayoutFormat();
+            var paragraph1:ParagraphElement = new ParagraphElement();
+
+            var paragraph2:ParagraphElement = new ParagraphElement();
+            var paragraph3:ParagraphElement = new ParagraphElement();
+
+            var p1Span1:SpanElement = new SpanElement();
+            var p1Span2:SpanElement = new SpanElement();
+            var p1Span3:SpanElement = new SpanElement();
+            var p2Span:SpanElement = new SpanElement();
+            var p3Span:SpanElement = new SpanElement();
+
+            p1Span1.text = para1String;
+            p1Span2.text = para1String2;
+            p1Span3.text = para1String3;
+
+            paragraph1.addChild(p1Span1);
+            paragraph1.addChild(p1Span2);
+            paragraph1.addChild(p1Span3);
+
+            p2Span.text = para2String;
+            paragraph2.addChild(p2Span);
+
+            p3Span.text = para3String;
+
+            var img:InlineGraphicElement = new InlineGraphicElement();
+            img.source = "../../test/testFiles/assets/smiley.gif"
+            img.width = 100;
+            img.height = 100;
+
+            paragraph3.addChild(p3Span);
+            paragraph3.addChild(img);
+
+            textFlow.addChild(paragraph1);
+            textFlow.addChild(paragraph2);
+            textFlow.addChild(paragraph3);
+
+            textLayoutFormat.fontSize = 14;
+            textLayoutFormat.textIndent = 15;
+            textLayoutFormat.paragraphSpaceAfter = 15;
+            textLayoutFormat.paddingTop = 4;
+            textLayoutFormat.paddingLeft = 4;
+
+            textFlow.hostFormat = textLayoutFormat;
+            textFlow.interactionManager = new EditManager();
+            _container1.x = 0;
+            _container1.y = 100;
+            _container2.x = 255;
+            _container2.y = 100;
+            textFlow.flowComposer.addController(controllerOne);
+            textFlow.flowComposer.addController(controllerTwo);
+            textFlow.flowComposer.updateAllControllers();
+
+            _container3 = new Sprite();
+            var controllerThree:ContainerController = new ContainerController(_container3, 200, 220);
+            _container3.x = 510;
+            _container3.y = 100;
+            var textLayoutFormat1:TextLayoutFormat = new TextLayoutFormat();
+
+            textLayoutFormat1.fontSize = 18;
+            textLayoutFormat1.textIndent = 15;
+            textLayoutFormat1.paragraphSpaceAfter = 15;
+            textLayoutFormat1.paddingTop = 4;
+            textLayoutFormat1.paddingLeft = 4;
+            textFlow.hostFormat = textLayoutFormat1;
+            textFlow.flowComposer.addController(controllerThree);
+
+            _textFlowSprite = new Sprite();
+            _textFlowSprite.addChild(_container1);
+            _textFlowSprite.addChild(_container2);
+            _textFlowSprite.addChild(_container3);
+
+            _textFlow = textFlow;
+
+        }
+
+        private function initializeFlow():void
+        {
+            _flowComposer = _textFlow.flowComposer;
+            _testCanvas = myEmptyChilds();
+            _testCanvas.rawChildren.addChild(_textFlowSprite);
+
             // Set the writing direction specified by the test
-			_textFlow.blockProgression = writingDirection[0];
-			_textFlow.direction        = writingDirection[1];
-			
+            _textFlow.blockProgression = writingDirection[0];
+            _textFlow.direction = writingDirection[1];
+
             _verticalText = (_textFlow.blockProgression == BlockProgression.RL);
             _rtlText = (_textFlow.direction == Direction.RTL);
-            
-			SelManager = EditManager(_textFlow.interactionManager);
-			if(SelManager) 
-			{
-				SelManager.selectRange(0, 0);
-				//make sure there is never any blinking when running these tests
-				setCaretBlinkRate (0);
-			}
-            
-			_textFlow.flowComposer.updateAllControllers();
-		}
-		
-		private function myEmptyChilds():Canvas
-		{
-			var TestCanvas:Canvas = null;
-			TestDisplayObject = testApp.getDisplayObject();
-			if (TestDisplayObject)
-			{
-				TestCanvas = Canvas(TestDisplayObject);
-				TestCanvas.removeAllChildren();
-				var iCnt:int = TestCanvas.rawChildren.numChildren;
-				for ( var a:int = 0; a < iCnt; a ++ )
-				{
-					TestCanvas.rawChildren.removeChildAt(0);
-				}
-			}
-			
-			return TestCanvas;
-		}
-		
-		public function callTestMethod():void
-		{
-				var TestCase:XML = _testXML;
-				var methodName:String = TestCase.TestData.(@name == "methodName").toString();
-				this[methodName]();
-		}
-		
-		private function crossContainerTest():void
-		{
-			var tb:TextBlock = (_textFlow.getChildAt(2) as ParagraphElement).getTextBlock();
-			assertTrue ("The _textBlock of the second paragraph should not be null",  tb);
-			var fLine:TextLine = tb.firstLine;
-			assertTrue ("The first TextLine of the second paragraph should not be null",  fLine);
-			assertTrue ("The first TextLine of the second paragraph should be on the second container",  fLine.parent == _container2);
-		}
-		
-    } // !class
+
+            SelManager = EditManager(_textFlow.interactionManager);
+            if (SelManager)
+            {
+                SelManager.selectRange(0, 0);
+                //make sure there is never any blinking when running these tests
+                setCaretBlinkRate(0);
+            }
+
+            _textFlow.flowComposer.updateAllControllers();
+        }
+
+        private function myEmptyChilds():Canvas
+        {
+            var TestCanvas:Canvas = null;
+            TestDisplayObject = testApp.getDisplayObject();
+            if (TestDisplayObject)
+            {
+                TestCanvas = Canvas(TestDisplayObject);
+                TestCanvas.removeAllChildren();
+                var iCnt:int = TestCanvas.rawChildren.numChildren;
+                for (var a:int = 0; a < iCnt; a++)
+                {
+                    TestCanvas.rawChildren.removeChildAt(0);
+                }
+            }
+
+            return TestCanvas;
+        }
+
+    }
 }


[7/9] git commit: [flex-tlf] [refs/heads/develop] - Merge branch 'FlexUnit4TestsTLF' into develop

Posted by pi...@apache.org.
Merge branch 'FlexUnit4TestsTLF' into develop


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

Branch: refs/heads/develop
Commit: 0b579456e44aa04488e999c6293e1f004b2ece5e
Parents: e57200c 7961f33
Author: piotrz <pi...@gmail.com>
Authored: Sun Oct 12 23:15:34 2014 +0200
Committer: piotrz <pi...@gmail.com>
Committed: Sun Oct 12 23:15:34 2014 +0200

----------------------------------------------------------------------
 automation_tests/src/AllTestsSuite.as           |   13 +-
 automation_tests/src/MinimalTestsSuite.as       |    4 +-
 .../UnitTest/Tests/BoundsAndAlignmentTest.as    |  278 +--
 automation_tests/src/UnitTest/Tests/BoxTest.as  |   51 +-
 .../src/UnitTest/Tests/ContainerTypeTest.as     |    8 -
 .../src/UnitTest/Tests/CrossContainerTest.as    |  430 ++--
 .../src/UnitTest/Tests/ElementOperationTest.as  | 1192 +++++++++++
 .../src/UnitTest/Tests/ElementOperationTests.as | 1228 -----------
 .../src/UnitTest/Tests/EventOverrideTest.as     |  905 +++------
 .../src/UnitTest/Tests/FactoryImportTest.as     |  250 +--
 .../src/UnitTest/Tests/FloatTest.as             |   84 -
 .../src/UnitTest/Tests/FlowModelTest.as         | 1920 +++++++++---------
 12 files changed, 2845 insertions(+), 3518 deletions(-)
----------------------------------------------------------------------



[6/9] git commit: [flex-tlf] [refs/heads/develop] - Add FactoryImportTest.as and FlowModelTest.as

Posted by pi...@apache.org.
Add FactoryImportTest.as and FlowModelTest.as


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

Branch: refs/heads/develop
Commit: 7961f3323e965e10bbff8947affddab8936c5f95
Parents: c105912
Author: piotrz <pi...@gmail.com>
Authored: Sun Oct 12 23:12:35 2014 +0200
Committer: piotrz <pi...@gmail.com>
Committed: Sun Oct 12 23:12:35 2014 +0200

----------------------------------------------------------------------
 automation_tests/src/AllTestsSuite.as           |    4 +
 automation_tests/src/MinimalTestsSuite.as       |    4 +-
 .../src/UnitTest/Tests/FactoryImportTest.as     |  250 +--
 .../src/UnitTest/Tests/FloatTest.as             |   84 -
 .../src/UnitTest/Tests/FlowModelTest.as         | 1920 +++++++++---------
 5 files changed, 1101 insertions(+), 1161 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/7961f332/automation_tests/src/AllTestsSuite.as
----------------------------------------------------------------------
diff --git a/automation_tests/src/AllTestsSuite.as b/automation_tests/src/AllTestsSuite.as
index a13ac01..f6f8045 100644
--- a/automation_tests/src/AllTestsSuite.as
+++ b/automation_tests/src/AllTestsSuite.as
@@ -33,7 +33,9 @@ package
     import UnitTest.Tests.CrossContainerTest;
     import UnitTest.Tests.ElementOperationTest;
     import UnitTest.Tests.EventOverrideTest;
+    import UnitTest.Tests.FactoryImportTest;
     import UnitTest.Tests.FloatTest;
+    import UnitTest.Tests.FlowModelTest;
     import UnitTest.Tests.OperationTest;
     import UnitTest.Tests.ScrollingTest;
 
@@ -41,6 +43,7 @@ package
     [RunWith("org.flexunit.runners.Suite")]
     public dynamic class AllTestsSuite
     {
+        public var factoryImportTest:FactoryImportTest;
         public var accessibilityMethodsTest:AccessibilityMethodsTest;
         public var allChartAttributeTest:AllCharAttributeTest;
         public var allContAttirbuteTest:AllContAttributeTest;
@@ -58,6 +61,7 @@ package
         public var crossContainerTest:CrossContainerTest;
         public var elementOperationTest:ElementOperationTest;
         public var eventOverrideTest:EventOverrideTest;
+        public var flowModelTest:FlowModelTest;
     }
 
 }

http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/7961f332/automation_tests/src/MinimalTestsSuite.as
----------------------------------------------------------------------
diff --git a/automation_tests/src/MinimalTestsSuite.as b/automation_tests/src/MinimalTestsSuite.as
index 3122012..93ef569 100644
--- a/automation_tests/src/MinimalTestsSuite.as
+++ b/automation_tests/src/MinimalTestsSuite.as
@@ -19,13 +19,13 @@
 package
 {
 
-    import UnitTest.Tests.AccessibilityMethodsTest;
+    import UnitTest.Tests.FactoryImportTest;
 
     [Suite]
     [RunWith("org.flexunit.runners.Suite")]
     public dynamic class MinimalTestsSuite
     {
-        public var accessibilityMethodsTest:AccessibilityMethodsTest;
+        public var factoryImportTest:FactoryImportTest;
     }
 
 }

http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/7961f332/automation_tests/src/UnitTest/Tests/FactoryImportTest.as
----------------------------------------------------------------------
diff --git a/automation_tests/src/UnitTest/Tests/FactoryImportTest.as b/automation_tests/src/UnitTest/Tests/FactoryImportTest.as
index 17e2220..b8bb3dc 100644
--- a/automation_tests/src/UnitTest/Tests/FactoryImportTest.as
+++ b/automation_tests/src/UnitTest/Tests/FactoryImportTest.as
@@ -18,132 +18,134 @@
 ////////////////////////////////////////////////////////////////////////////////
 package UnitTest.Tests
 {
-	import UnitTest.ExtendedClasses.TestSuiteExtended;
-	import UnitTest.ExtendedClasses.VellumTestCase;
-	import UnitTest.Fixtures.FileRepository;
-	import UnitTest.Fixtures.TestConfig;
-	
-	import flash.display.*;
-	import flash.geom.Rectangle;
-	import flash.text.engine.TextLine;
-	
-	import flashx.textLayout.conversion.ITextImporter;
-	import flashx.textLayout.conversion.TextConverter;
-	import flashx.textLayout.elements.FlowLeafElement;
-	import flashx.textLayout.elements.InlineGraphicElement;
-	import flashx.textLayout.elements.TextFlow;
-	import flashx.textLayout.factory.TextFlowTextLineFactory;
-	
-	import mx.containers.Canvas;
+    import UnitTest.ExtendedClasses.VellumTestCase;
+    import UnitTest.Fixtures.FileRepository;
+    import UnitTest.Fixtures.TestConfig;
 
-    import org.flexunit.asserts.fail;
+    import flash.display.*;
+    import flash.geom.Rectangle;
+    import flash.text.engine.TextLine;
+
+    import flashx.textLayout.conversion.ITextImporter;
+    import flashx.textLayout.conversion.TextConverter;
+    import flashx.textLayout.elements.FlowLeafElement;
+    import flashx.textLayout.elements.InlineGraphicElement;
+    import flashx.textLayout.elements.TextFlow;
+    import flashx.textLayout.factory.TextFlowTextLineFactory;
 
+    import mx.containers.Canvas;
+
+    import org.flexunit.asserts.fail;
 
     public class FactoryImportTest extends VellumTestCase
-	{
-		private var ItemsToRemove:Array;
-		private var TestCanvas:Canvas = null;
-		private var fileForFactory:String;
-		private var flowFromXML:TextFlow;
-
-		public function FactoryImportTest(fileToImport:String, testID:String, testConfig:TestConfig, testCaseXML:XML=null)
-		{
-			super ("doThis", testID, testConfig, testCaseXML);
-			containerType = "custom";
-			fileForFactory = fileToImport;
-
-			// Note: These must correspond to a Watson product area (case-sensitive)
-			metaData.productArea = "Import/Export";
-		}
-
-		public function doThis():void
-		{
-			var xmlRoot:XML = FileRepository.getFileAsXML(baseURL,"../../test/testFiles/markup/tlf/" + fileForFactory);
-			if (!xmlRoot)
-			{
-				fail("File not loaded -- timeout?");
-				return;
-			}
-			var parser:ITextImporter = testDataImportParser;
-			flowFromXML = parser.importToFlow(xmlRoot);
-			processInlines(flowFromXML);
-			buildVellumFactory();
-			//TestCanvas.rawChildren.addChild(_rslt);
-		}
-
-		public static function suiteFromXML(testListXML:XML, testConfig:TestConfig, ts:TestSuiteExtended):void
- 		{
- 			var testCaseClass:Class = FactoryImportTest;
- 			VellumTestCase.suiteFromXML(testCaseClass, testListXML, testConfig, ts);
- 		}
-
-		override public function setUpTest() : void
-		{
-			cleanUpTestApp();
-			ItemsToRemove = [];
-			TestDisplayObject = testApp.getDisplayObject();
-			if (TestDisplayObject)
-			{
-				TestCanvas = Canvas(TestDisplayObject);
-			}
-			else
-			{
-				fail ("Did not get a blank canvas to work with");
-			}
-		}
-
-		private static function getExtension(fileName:String):String
-		{
-			var dotPos:int = fileName.lastIndexOf(".");
-			if (dotPos >= 0)
-				return fileName.substring(dotPos + 1);
-			return fileName;
-		}
-
-		protected function get testDataImportParser():ITextImporter
-		{
-			var extension:String = getExtension(fileForFactory);
-			if (extension == "xml")
-				extension = TextConverter.TEXT_LAYOUT_FORMAT;
-			else if (extension == "txt")
-				extension = TextConverter.PLAIN_TEXT_FORMAT;
-			return TextConverter.getImporter(extension);
-		}
-		
-		private function processInlines(textFlow:TextFlow):void
-		{
-			for (var leaf:FlowLeafElement = textFlow.getFirstLeaf(); leaf; leaf = leaf.getNextLeaf())
-			{
-				if (leaf is InlineGraphicElement /* && InlineGraphicElement(leaf).source == null */)
-				{
-					var ilg:InlineGraphicElement = InlineGraphicElement(leaf);
-
-					// Create a filler inline, simple filled rect
-					var displayObject:Sprite = new Sprite();
-					var g:Graphics = displayObject.graphics;
-					g.beginFill(0xFF0000);
-					g.drawRect(0, 0, Number(ilg.width), Number(ilg.height));
-					g.endFill();
-					ilg.source = displayObject;
-				}
-			}
-		}
-
-		public function callback(dispObj:DisplayObject):void
-		{
-			TestCanvas.rawChildren.addChild(dispObj);
-
-			if(dispObj is TextLine)
-			{
-				ItemsToRemove.push (dispObj as TextLine);
-			}
-		}
-		/** use the vellum factory via the callback */
-		public function buildVellumFactory():void //DisplayObject
-		{
-			var factory:TextFlowTextLineFactory = new TextFlowTextLineFactory();
-			factory.compositionBounds = new Rectangle(0, 0, TestCanvas.width, TestCanvas.height);
-			factory.createTextLines(callback,flowFromXML);
-		}
-	}
+    {
+        private var ItemsToRemove:Array;
+        private var TestCanvas:Canvas = null;
+        private var fileForFactory:String;
+        private var flowFromXML:TextFlow;
+
+        public function FactoryImportTest()
+        {
+            super("", "EventOverrideTest", TestConfig.getInstance());
+
+            containerType = "custom";
+            fileForFactory = "simple.xml";
+
+            metaData = {};
+            // Note: These must correspond to a Watson product area (case-sensitive)
+            metaData.productArea = "Import/Export";
+        }
+
+        [Before]
+        override public function setUpTest():void
+        {
+            cleanUpTestApp();
+            ItemsToRemove = [];
+            TestDisplayObject = testApp.getDisplayObject();
+            if (TestDisplayObject)
+            {
+                TestCanvas = Canvas(TestDisplayObject);
+            }
+            else
+            {
+                fail("Did not get a blank canvas to work with");
+            }
+        }
+
+        [After]
+        override public function tearDownTest():void
+        {
+            super.tearDownTest();
+        }
+
+        [Test]
+        public function importTest():void
+        {
+            var xmlRoot:XML = FileRepository.getFileAsXML(baseURL, "../../test/testFiles/markup/tlf/" + fileForFactory);
+            if (!xmlRoot)
+            {
+                fail("File not loaded -- timeout?");
+                return;
+            }
+            var parser:ITextImporter = testDataImportParser;
+            flowFromXML = parser.importToFlow(xmlRoot);
+            processInlines(flowFromXML);
+            buildVellumFactory();
+        }
+
+        private static function getExtension(fileName:String):String
+        {
+            var dotPos:int = fileName.lastIndexOf(".");
+            if (dotPos >= 0)
+                return fileName.substring(dotPos + 1);
+            return fileName;
+        }
+
+        protected function get testDataImportParser():ITextImporter
+        {
+            var extension:String = getExtension(fileForFactory);
+            if (extension == "xml")
+                extension = TextConverter.TEXT_LAYOUT_FORMAT;
+            else if (extension == "txt")
+                extension = TextConverter.PLAIN_TEXT_FORMAT;
+            return TextConverter.getImporter(extension);
+        }
+
+        private function processInlines(textFlow:TextFlow):void
+        {
+            for (var leaf:FlowLeafElement = textFlow.getFirstLeaf(); leaf; leaf = leaf.getNextLeaf())
+            {
+                if (leaf is InlineGraphicElement /* && InlineGraphicElement(leaf).source == null */)
+                {
+                    var ilg:InlineGraphicElement = InlineGraphicElement(leaf);
+
+                    // Create a filler inline, simple filled rect
+                    var displayObject:Sprite = new Sprite();
+                    var g:Graphics = displayObject.graphics;
+                    g.beginFill(0xFF0000);
+                    g.drawRect(0, 0, Number(ilg.width), Number(ilg.height));
+                    g.endFill();
+                    ilg.source = displayObject;
+                }
+            }
+        }
+
+        private function callback(dispObj:DisplayObject):void
+        {
+            TestCanvas.rawChildren.addChild(dispObj);
+
+            if (dispObj is TextLine)
+            {
+                ItemsToRemove.push(dispObj as TextLine);
+            }
+        }
+
+        /** use the vellum factory via the callback */
+        private function buildVellumFactory():void //DisplayObject
+        {
+            var factory:TextFlowTextLineFactory = new TextFlowTextLineFactory();
+            factory.compositionBounds = new Rectangle(0, 0, TestCanvas.width, TestCanvas.height);
+            factory.createTextLines(callback, flowFromXML);
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/7961f332/automation_tests/src/UnitTest/Tests/FloatTest.as
----------------------------------------------------------------------
diff --git a/automation_tests/src/UnitTest/Tests/FloatTest.as b/automation_tests/src/UnitTest/Tests/FloatTest.as
index da7a19a..2f105a6 100644
--- a/automation_tests/src/UnitTest/Tests/FloatTest.as
+++ b/automation_tests/src/UnitTest/Tests/FloatTest.as
@@ -104,90 +104,6 @@ package UnitTest.Tests
             _floatColor = 0xFF0000;
         }
 
-        /*
-         public static function suite(testConfig:TestConfig, ts:TestSuiteExtended):void
-         {
-         addTestCase(ts, testConfig, "atFlowStart");
-         addTestCase(ts, testConfig, "atFlowStartSpaceBefore");
-         addTestCase(ts, testConfig, "atParagraphStart");
-         addTestCase(ts, testConfig, "atParagraphStartSpaceBefore");
-         addTestCase(ts, testConfig, "atParagraphEnd");
-         addTestCase(ts, testConfig, "atLineStart");
-         addTestCase(ts, testConfig, "atLineMiddle");
-         addTestCase(ts, testConfig, "atLineEnd");
-         addTestCase(ts, testConfig, "stackedFloats");
-         addTestCase(ts, testConfig, "onTwoSidesSameLine");
-         addTestCase(ts, testConfig, "onTwoSidesSuccessiveLines");
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"fillsColumn", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"noEmergencyBreakByFloat", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"fillsColumnRecursion", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"widerThanColumn", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"widerThanColumnScroll", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"contentHeightCheck", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"noFloatsWithMeasureOrExplicit", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"floatOnly", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"noVJ", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"verticalAlignMiddleFloatAtEnd", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"verticalAlignMiddleTextAtEnd", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"verticalAlignBottomFloatAtEnd", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"verticalAlignBottomTextAtEnd", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"verticalAlignBottomFloat2636122", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"textAlignRightAtStart", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"textAlignRightInMiddle", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"leftIndent", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"rightIndent", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"leftBigIndent", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"rightBigIndent", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"clearOneAll", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"clearTwoAll", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"paddingAndMargins", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"negativePaddingAndMargins", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"rightIndentWithTab", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"leftIndentWithTab", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"hoistFailure", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"clearNoPrecedingFloatAll", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"stackedLeftFloats", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"stackedRightFloats", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"smallFloatBigText", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"lineHeightIgnoredOnFloatingImages", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"convertFloatToInline", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"cursorByAnchor", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"insertTextBeforeFloat", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"atControllerEnd", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"resizeControllerWithFloats", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"textIndentAfterFloat", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"composeAcrossControllers", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"deleteAtStart", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"measureWidth", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"inlineWideAndFloat", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"narrowColumnFloat", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"infiniteLoop2769562", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest, "verticalAlignInline", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest, "pasteManyFloatsWithLoading", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"contentBoundsWithFactoryComposition", testConfig, null) );
-         // We only need one version of these tests
-         if (testConfig.writingDirection[0] == BlockProgression.TB && testConfig.writingDirection[1] == Direction.LTR)
-         {
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"inlineAndFloat", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"htmlImportTest", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"overFlowAtStart", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"caretOnEmptyInlineGraphic", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"restartComposeFromStart", testConfig, null) );
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"convertInlineToFloat", testConfig, null) );
-
-         }
-         }
-
-         private static function addTestCase(ts:TestSuiteExtended, testConfig:TestConfig, methodName:String):void
-         {
-         //ts.addTestDescriptor (new TestDescriptor (MeasurementGridTest,methodName, testConfig, creationType, measureType, lineBreak) );
-         var testXML:XML = <TestCase>
-         <TestData name="methodName">{methodName}</TestData>
-         <TestData name="id">{methodName}</TestData>
-         </TestCase>;
-
-         ts.addTestDescriptor (new TestDescriptor (FloatTest,"callTestMethod", testConfig, testXML) );
-         }    */
         [BeforeClass]
         public static function setUpClass():void
         {


[5/9] Add FactoryImportTest.as and FlowModelTest.as

Posted by pi...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/7961f332/automation_tests/src/UnitTest/Tests/FlowModelTest.as
----------------------------------------------------------------------
diff --git a/automation_tests/src/UnitTest/Tests/FlowModelTest.as b/automation_tests/src/UnitTest/Tests/FlowModelTest.as
index ea0d482..0af28df 100644
--- a/automation_tests/src/UnitTest/Tests/FlowModelTest.as
+++ b/automation_tests/src/UnitTest/Tests/FlowModelTest.as
@@ -18,967 +18,985 @@
 ////////////////////////////////////////////////////////////////////////////////
 package UnitTest.Tests
 {
-	import UnitTest.ExtendedClasses.TestDescriptor;
-	import UnitTest.ExtendedClasses.TestSuiteExtended;
-	import UnitTest.ExtendedClasses.VellumTestCase;
-	import UnitTest.Fixtures.TestConfig;
-	
-	import flash.display.Bitmap;
-	import flash.display.BitmapData;
-	import flash.display.DisplayObjectContainer;
-	import flash.display.Sprite;
-	import flash.geom.Rectangle;
-	import flash.text.engine.FontDescription;
-	import flash.text.engine.FontWeight;
-	import flash.text.engine.TextLine;
-	import flash.utils.ByteArray;
-	import flash.utils.getTimer;
-	
-	import flashx.textLayout.compose.StandardFlowComposer;
-	import flashx.textLayout.compose.TextFlowLine;
-	import flashx.textLayout.container.ContainerController;
-	import flashx.textLayout.edit.EditManager;
-	import flashx.textLayout.edit.IEditManager;
-	import flashx.textLayout.elements.Configuration;
-	import flashx.textLayout.elements.DivElement;
-	import flashx.textLayout.elements.FlowElement;
-	import flashx.textLayout.elements.FlowLeafElement;
-	import flashx.textLayout.elements.GlobalSettings;
-	import flashx.textLayout.elements.InlineGraphicElement;
-	import flashx.textLayout.elements.LinkElement;
-	import flashx.textLayout.elements.ListElement;
-	import flashx.textLayout.elements.ListItemElement;
-	import flashx.textLayout.elements.ParagraphElement;
-	import flashx.textLayout.elements.SpanElement;
-	import flashx.textLayout.elements.TCYElement;
-	import flashx.textLayout.elements.TextFlow;
-	import flashx.textLayout.formats.BlockProgression;
-	import flashx.textLayout.formats.Direction;
-	import flashx.textLayout.formats.FormatValue;
-	import flashx.textLayout.formats.ITextLayoutFormat;
-	import flashx.textLayout.formats.ListStyleType;
-	import flashx.textLayout.formats.TextAlign;
-	import flashx.textLayout.formats.TextLayoutFormat;
-	import flashx.textLayout.property.*;
-	import flashx.textLayout.tlf_internal;
-	import flashx.undo.IUndoManager;
-	import flashx.undo.UndoManager;
-	
-	import mx.core.FTETextField;
-	import mx.utils.LoaderUtil;
+    import UnitTest.ExtendedClasses.TestDescriptor;
+    import UnitTest.ExtendedClasses.TestSuiteExtended;
+    import UnitTest.ExtendedClasses.VellumTestCase;
+    import UnitTest.Fixtures.TestConfig;
+
+    import flash.display.Bitmap;
+    import flash.display.BitmapData;
+    import flash.display.DisplayObjectContainer;
+    import flash.display.Sprite;
+    import flash.geom.Rectangle;
+    import flash.text.engine.FontDescription;
+    import flash.text.engine.FontWeight;
+    import flash.text.engine.TextLine;
+    import flash.utils.ByteArray;
+    import flash.utils.getTimer;
+
+    import flashx.textLayout.compose.StandardFlowComposer;
+    import flashx.textLayout.compose.TextFlowLine;
+    import flashx.textLayout.container.ContainerController;
+    import flashx.textLayout.edit.EditManager;
+    import flashx.textLayout.edit.IEditManager;
+    import flashx.textLayout.elements.Configuration;
+    import flashx.textLayout.elements.DivElement;
+    import flashx.textLayout.elements.FlowElement;
+    import flashx.textLayout.elements.FlowLeafElement;
+    import flashx.textLayout.elements.GlobalSettings;
+    import flashx.textLayout.elements.InlineGraphicElement;
+    import flashx.textLayout.elements.LinkElement;
+    import flashx.textLayout.elements.ListElement;
+    import flashx.textLayout.elements.ListItemElement;
+    import flashx.textLayout.elements.ParagraphElement;
+    import flashx.textLayout.elements.SpanElement;
+    import flashx.textLayout.elements.TCYElement;
+    import flashx.textLayout.elements.TextFlow;
+    import flashx.textLayout.formats.BlockProgression;
+    import flashx.textLayout.formats.Direction;
+    import flashx.textLayout.formats.FormatValue;
+    import flashx.textLayout.formats.ITextLayoutFormat;
+    import flashx.textLayout.formats.ListStyleType;
+    import flashx.textLayout.formats.TextAlign;
+    import flashx.textLayout.formats.TextLayoutFormat;
+    import flashx.textLayout.property.*;
+    import flashx.textLayout.tlf_internal;
+    import flashx.undo.IUndoManager;
+    import flashx.undo.UndoManager;
+
+    import mx.core.FTETextField;
+    import mx.utils.LoaderUtil;
 
     import org.flexunit.asserts.assertTrue;
 
     use namespace tlf_internal;
 
-	public class FlowModelTest extends VellumTestCase
-	{
-		public function FlowModelTest(methodName:String, testID:String, testConfig:TestConfig, testXML:XML = null)
-		{
-			super(methodName, testID, testConfig);
-
-			// Note: These must correspond to a Watson product area (case-sensitive)
-			metaData.productArea = "Text Container";
-			metaData.productSubArea = "Flow";
-		}
-
-		public static function suite(testConfig:TestConfig, ts:TestSuiteExtended):void
-		{
-			if (testConfig.writingDirection[0] == BlockProgression.TB && testConfig.writingDirection[1] == Direction.LTR)
-			{
-	   			ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "basicAPITest1", testConfig ) );
-	   			ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "basicAPITest2", testConfig ) );
-	   			ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "basicAPITest3", testConfig ) );
-	   			ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "basicAPITest4", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "basicAPITest5", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "textFlowHostCharacterFormat", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "iterateParagraphForward", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "iterateParagraphBackward", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "cascadeValidation", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "elementMovingTest", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "emptyTextFlowTests", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "emptyElementCopyTests", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "fontMappingTest", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "insertLinkNoUpdateAPI", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "insertLinkNoUpdateViaEditManager", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "testUndo", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "testFindControllerIndexAtPosition", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "testFTETextField", testConfig ) );
-				
-				ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "listItemInsertion", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "replaceChildrenTest", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "resolveFontLookupTest", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "bindableSpan", testConfig ) );
-				//ts.addTestDescriptor (new TestDescriptor (FlowModelTest, "softKeyboardFlagTest", testConfig ) );
-			}
-   		}
-
-   		private var beginTime:int;
-   		private function beginAPITest():void
-   		{
-   			beginTime = getTimer();
-			SelManager.selectRange(-1,-1);
-   		}
-   		private function endAPITest():void
-   		{
-			SelManager.selectRange(0,0);
-			SelManager.textFlow.flowComposer.updateAllControllers();
-   		}
-
-		/**
-		 * Direct usage of the flow APIs. No validation - just look for crashes.
-		 * This test changes the color of the entire text.
-		 */
-		public function basicAPITest1():void
-		{
-			// set the color on the entire flow
-			beginAPITest();
-			SelManager.textFlow.color = 0xff0000;
-			endAPITest();
-		}
-
-		/**
-		 * Direct usage of the flow APIs. No validation - just look for crashes.
-		 * This test deletes every other character in the entire text.
-		 */
-		public function basicAPITest2():void
-		{
-			// delete every other character in the textflow
-			beginAPITest();
-
-			var idx:int = 0;
-			while (idx < SelManager.textFlow.textLength)
-			{
-				var span:SpanElement = SelManager.textFlow.findLeaf(idx) as SpanElement;
-				if (span)
-				{
-					var spanStart:int = span.getAbsoluteStart();
-					span.replaceText(idx-spanStart,idx-spanStart+1,null);
-				}
-				idx++;
-
-			}
-			endAPITest();
-		}
-
-		/**
-		 * Direct usage of the flow APIs. No validation - just look for crashes.
-		 * This test adds another paragraph to the flow containing the text "Hello World"
-		 * in 24 point font.
-		 */
-		public function basicAPITest3():void
-		{
-			// add a paragraph
-			beginAPITest();
-			var p:ParagraphElement = new ParagraphElement();
-			var s:SpanElement = new SpanElement();
-			s.text = "Hello world";
-			s.fontSize = 24;
-			p.replaceChildren(0,0,s);
-			SelManager.textFlow.replaceChildren(SelManager.textFlow.numChildren,SelManager.textFlow.numChildren,p);
-			endAPITest();
-		}
-
-		/**
-		 * This test performs a series of changes and validates the changes after they're performed.
-		 */
-		public function basicAPITest4():void
-		{
-			// more comprehensive set of tests - several manipulations to the flow and then display it
-
-			// generic begin to an API test
-			beginAPITest();
-
-			// get the textflow
-			var textFlow:TextFlow = SelManager.textFlow;
-
-			// remove all the textflow children
-			textFlow.replaceChildren(0,textFlow.numChildren);
-			assertTrue("expected no elements on the flow, but found " + textFlow.numChildren,
-						textFlow.numChildren == 0);
-
-			// create a paragraph
-			var p:ParagraphElement = new ParagraphElement();
-
-			// create a span
-			var s:SpanElement = new SpanElement();
-			s.text = "Hello world. ";
-			s.fontSize = 24;
-
-			// split the span
-			var nextSpan:SpanElement = s.splitAtPosition(6) as SpanElement;
-			// set the color - color can be a string or an unsigned integer
-			nextSpan.color = "0xff";
-			assertTrue("expected that the color would be 255, but found " + uint(nextSpan.format.color),
-						uint(nextSpan.format.color) == 255);
-
-			// put the two spans in the paragraph
-			p.replaceChildren(0,0,s);
-			/*CONFIG::debug { assertTrue("debugCheckFlowElement() failed after adding one span",
-										p.debugCheckFlowElement() == 0); }     */
-			p.replaceChildren(1,1,nextSpan);
-			/*CONFIG::debug { assertTrue("debugCheckFlowElement() failed after adding second span",
-										p.debugCheckFlowElement() == 0); }  */
-			assertTrue("expected the element count to be 2, but it was " + p.numChildren,
-						p.numChildren == 2);
-
-			// add another span
-			s = new SpanElement();
-			s.text = "Start:"
-			p.replaceChildren(0,0,s);
-		/*	CONFIG::debug { assertTrue("debugCheckFlowElement() failed after adding third span",
-										p.debugCheckFlowElement() == 0); }      */
-
-			// put the paragraph in the TextFlow
-			textFlow.replaceChildren(0,0,p);
-			assertTrue("text flow should have one element but has " + textFlow.numChildren,
-						textFlow.numChildren == 1);
-		/*	CONFIG::debug { assertTrue("debugCheckFlowElement() failed after adding para to flow",
-										textFlow.debugCheckFlowElement() == 0) }   */
-
-			// make another paragraph
-			p = new ParagraphElement();
-			s = new SpanElement();
-			p.replaceChildren(0,0,s);
-			s.text="NEW FIRST PARAGRAPH";
-
-			// set the paragraph attributes directly
-			p.textIndent = 20;
-			// set the paragraph attributes via clone and set
-			var pa:TextLayoutFormat = new TextLayoutFormat(p.format);
-			pa.textAlign = TextAlign.RIGHT;
-			p.format = pa;
-
-			// into the textFlow at the beginning
-			textFlow.replaceChildren(0,0,p);
-			/*CONFIG::debug {assertTrue("debugCheckFlowElement() failed after adding para to beginning",
-										textFlow.debugCheckFlowElement() == 0); }     */
-
-			// generic end to an API test
-			endAPITest();
-		}
-
-		/**
-		 * This test inserts an FE in the middle of a paragraph
-		 */
-		public function basicAPITest5():void
-		{
-			// more comprehensive set of tests - several manipulations to the flow and then display it
-
-			// generic begin to an API test
-			beginAPITest();
-
-			// get the textflow
-			var textFlow:TextFlow = SelManager.textFlow;
-
-			// create a paragraph empty the flow and insert it
-			var p:ParagraphElement = new ParagraphElement();
-			textFlow.replaceChildren(0,textFlow.numChildren,p);
-
-			// create a span
-			var s:SpanElement = new SpanElement();
-			s.text = "Hello world. ";
-			s.fontSize = 24;
-
-			// put it in the paragraph
-			p.replaceChildren(0,0,s);
-
-			// split the span
-			var nextSpanElement:SpanElement = s.splitAtPosition(6) as SpanElement;
-			assertTrue("Incorrect elementCount after split", p.numChildren == 2);
-
-			// create and insert an image between the spans
-			var image:InlineGraphicElement = new InlineGraphicElement();
-			image.width = 19;
-			image.height = 19;
-			image.source = LoaderUtil.createAbsoluteURL(baseURL,"../../test/testFiles/assets/surprised.png");
-			p.replaceChildren(1,1,image);
-
-			assertTrue("failed length on new InlineGraphicElement", image.textLength == 1);
-			assertTrue("failed elementCount after image insert", p.numChildren == 3);
-			assertTrue("bad first child",p.getChildAt(0) is SpanElement);
-			assertTrue("bad first child",p.getChildAt(1) is InlineGraphicElement);
-			assertTrue("bad first child",p.getChildAt(2) is SpanElement);
-			
-			// set a userStyle on a ContainerController
-			var saveFormat:ITextLayoutFormat = ContainerController.containerControllerInitialFormat;
-			try
-			{
-				ContainerController.containerControllerInitialFormat = null;
-				var controller:ContainerController = new ContainerController(new Sprite());
-				controller.setStyle("foo","blah");
-			}
-			catch (e:Error)
-			{
-				ContainerController.containerControllerInitialFormat = saveFormat;
-				throw(e);			
-			}
-			ContainerController.containerControllerInitialFormat = saveFormat;
-
-			// generic end to an API test
-			endAPITest();
-		}
-
-		/** Test setting hostCharacterFormat on the TextFlow */
-		public function textFlowHostCharacterFormat():void
-		{
-			// generic begin to an API test
-			beginAPITest();
-
-			// get the textflow
-			var textFlow:TextFlow = SelManager.textFlow;
-			var leaf:FlowLeafElement = textFlow.getFirstLeaf();
-
-			// make it red
-			var cf:TextLayoutFormat = new TextLayoutFormat();
-			cf.color = 0xff0000;
-			textFlow.hostFormat = cf;
-			assertTrue("host character format set color failed",leaf.computedFormat.color == 0xff0000);
-
-			// make it blue
-			textFlow.color = 0xff;
-			assertTrue("textFlow character format color override failed",leaf.computedFormat.color == 0xff);
-
-			// clear the blue
-			textFlow.color = undefined;
-			assertTrue("textFlow color clear failed",leaf.computedFormat.color == 0xff0000);
-
-			// clear the hostCharacterFormat
-			textFlow.hostFormat = null;
-			assertTrue("host character format clear failed",leaf.computedFormat.color == 0);
-
-			endAPITest();
-		}
-
-		private function initTextFlowAAA():TextFlow
-		{
-			var textFlow:TextFlow = new TextFlow();
-			var p:ParagraphElement = new ParagraphElement();
-			var span:SpanElement = new SpanElement();
-			span.text = "aaa";
-			p.replaceChildren(0, 0, span);
-			textFlow.replaceChildren(0, 0, p);
-			return textFlow;
-		}
-
-		// Insert a link to a paragraph that hasn't ever been updated.
-		public function insertLinkNoUpdateAPI():void
-		{
-			var textFlow:TextFlow = new TextFlow();
-			var p:ParagraphElement = new ParagraphElement();
-			var link:LinkElement = new LinkElement();
-			link.href = "http://www.cnn.com";
-			link.target = "_self";
-			var span:SpanElement = new SpanElement();
-			span.text = "aaa";
-			link.replaceChildren(0, 0, span);
-			p.replaceChildren(0, 0, link);
-			textFlow.replaceChildren(0, 0, p);
-		}
-
-		// Insert a link to a paragraph that hasn't ever been updated.
-		public function insertLinkNoUpdateViaEditManager():void
-		{
-			var textFlow:TextFlow = initTextFlowAAA();
-			var editManager:IEditManager = new EditManager();
-			textFlow.interactionManager = editManager;
-
-			editManager.selectRange(1,2);
-			editManager.applyLink("http://livedocs.adobe.com/", "_self", true);
-		}
-
-		// undo in a flow that has no controllers
-		public function testUndo():void
-		{
-			var textFlow:TextFlow = initTextFlowAAA();
-			var undoManager:IUndoManager = new UndoManager();
-			var editManager:IEditManager = new EditManager(undoManager);
-			textFlow.interactionManager = editManager;
-
-			editManager.selectRange(1,2);
-			var format:TextLayoutFormat = new TextLayoutFormat();
-			format.fontWeight = FontWeight.BOLD;
-			editManager.applyLeafFormat(format);
-
-			undoManager.undo();
-		}
-
-		private function createParaIterationModel():TextFlow
-		{
-			// Creates 3 divs, each have 4 paras
-			const paraTotal:int = 4;
-			var paraCount:int;
-			const divTotal:int = 3;
-			var divCount:int;
-
-			var flow:TextFlow = new TextFlow();
-			for (var j:int = 0; j < divTotal; j++)
-			{
-				var div:DivElement = new DivElement();
-				for (var i:int = 0; i < paraTotal; i++)
-				{
-					var para:ParagraphElement = new ParagraphElement();
-					var span:SpanElement = new SpanElement();
-					span.text = paraCount.toString();
-					para.addChild(span);
-					div.addChild(para);
-					paraCount++;
-				}
-				flow.addChild(div);
-			}
-			return flow;
-		}
-
-		public function iterateParagraphForward():void
-		{
-			var flow:TextFlow = createParaIterationModel();
-			var para:ParagraphElement = flow.getFirstLeaf().getParagraph();
-			var i:int = 0;
-			while (para != null)
-			{
-				var cStr:String = para.getText();
-				assertTrue("Text not as expected", int(cStr) == i);
-				para = para.getNextParagraph();
-				i++;
-			}
-			assertTrue("Unexpected paragraph count", i == 12);
-		}
-
-		public function iterateParagraphBackward():void
-		{
-			//const kParaTerminator:String = '\u2029';
-
-			var flow:TextFlow = createParaIterationModel();
-			var para:ParagraphElement = flow.getLastLeaf().getParagraph();
-			var i:int = 11;
-			//These two tests are no longer valid due to PARB changes to removed the terminator
-			//parameter from getText on a paragraph element.
-			//
-			//var terminatorTestStr:String = para.getText("\n");
-			//assertTrue("Should have newline as terminator", terminatorTestStr.substr(terminatorTestStr.length - 1, 1) == '\n');
-			//terminatorTestStr = para.getText();
-			//assertTrue("Should have paragraph terminator as terminator", terminatorTestStr.substr(terminatorTestStr.length - 1, 1) == kParaTerminator);
-			while (para != null)
-			{
-				var cStr:String = para.getText();
-				assertTrue("Text not as expected", int(cStr) == i);
-				para = para.getPreviousParagraph();
-				i--;
-			}
-			assertTrue("Unexpected paragraph count", i == -1);
-		}
-		public function cascadeValidation():void
-		{
-			var flow:TextFlow = new TextFlow();
-			var para:ParagraphElement = new ParagraphElement();
-			var span:SpanElement = new SpanElement();
-			flow.addChild(para);
-			para.addChild(span);
-			flow.backgroundColor = 0xff;
-			assertTrue("backgroundColor should not inherit",TextLayoutFormat.backgroundColorProperty.inherited == false);
-			assertTrue("bad flow backGroundColor", flow.computedFormat.backgroundColor == 0xff);
-			assertTrue("bad para backGroundColor", para.computedFormat.backgroundColor == TextLayoutFormat.backgroundColorProperty.defaultValue);
-			assertTrue("bad span backGroundColor", span.computedFormat.backgroundColor == TextLayoutFormat.backgroundColorProperty.defaultValue);
-		}
-
-		// tests api change to automatically remove a flowelements children when using replaceChildren
-		public function elementMovingTest():void
-		{
-			var lengthBefore:int;
-
-			// this flow should have two paragraphs as children
-			var flow:TextFlow = SelManager.textFlow.deepCopy() as TextFlow;	// clone the flow
-
-			var firstPara:FlowElement = flow.getChildAt(0);
-			lengthBefore = flow.textLength;
-			//firstPara.parent.removeChild(firstPara);	// soon to no longer be needed
-			//assertTrue("elementMovingTest: removing para incorrect lengths",flow.textLength == lengthBefore-firstPara.textLength);
-
-			lengthBefore = SelManager.textFlow.textLength;
-			SelManager.textFlow.addChild(firstPara);
-			assertTrue("elementMovingTest: adding para incorrect lengths",SelManager.textFlow.textLength == lengthBefore+firstPara.textLength);
-
-			var lastLeaf:FlowElement = flow.getLastLeaf();
-			var lastLeafLength:int = lastLeaf.textLength;
-			//lastLeaf.parent.removeChild(lastLeaf);	// soon to no longer be needed
-			lengthBefore = SelManager.textFlow.textLength;
-			SelManager.textFlow.getLastLeaf().parent.addChild(lastLeaf);
-			assertTrue("elementMovingTest: adding span incorrect lengths",SelManager.textFlow.textLength == lengthBefore+lastLeafLength-1);
-		}
-
-		// Empty Flow Tests - verify that empty/partially empty TextFlow's are normalized correctly
-		public function emptyTextFlowTests():void
-		{
-			var tf:TextFlow;
-
-			// just an empty TextFlow
-			tf = new TextFlow();
-			tf.flowComposer.addController(new ContainerController(new Sprite()));
-			tf.flowComposer.updateAllControllers();
-
-			// empty TextFlow with paragraph
-			tf = new TextFlow();
-			tf.addChild(new ParagraphElement());
-			tf.flowComposer.addController(new ContainerController(new Sprite()));
-			tf.flowComposer.updateAllControllers();
-
-			// empty TextFlow with paragraph and ILG
-			tf = new TextFlow();
-			var p:ParagraphElement = new ParagraphElement();
-			p.addChild(new InlineGraphicElement());
-			tf.addChild(p);
-			tf.flowComposer.addController(new ContainerController(new Sprite()));
-			tf.flowComposer.updateAllControllers();
-
-			// empty TextFlow with paragraph and empty LinkElement
-			tf = new TextFlow();
-			p = new ParagraphElement();
-			p.addChild(new LinkElement());
-			tf.addChild(p);
-			tf.flowComposer.addController(new ContainerController(new Sprite()));
-			tf.flowComposer.updateAllControllers();
-
-			// empty TextFlow with paragraph and empty TCYElement
-			tf = new TextFlow();
-			p = new ParagraphElement();
-			p.addChild(new TCYElement());
-			tf.addChild(p);
-			tf.flowComposer.addController(new ContainerController(new Sprite()));
-			tf.flowComposer.updateAllControllers();
-
-			// a more complex example
-			tf = new TextFlow();
-			p = new ParagraphElement();
-			var tcy:TCYElement = new TCYElement();
-			tcy.addChild(new InlineGraphicElement());
-			tcy.addChild(new SpanElement());
-			p.addChild(tcy);
-			tf.addChild(p);
-			tcy.removeChildAt(1);
-			tf.flowComposer.addController(new ContainerController(new Sprite()));
-			tf.flowComposer.updateAllControllers();
-
-			// several empty spans
-			tf = new TextFlow();
-			p = new ParagraphElement();
-			tf.addChild(p);
-			p.addChild(new SpanElement());
-			p.addChild(new SpanElement());
-			p.addChild(new SpanElement());
-			tf.flowComposer.addController(new ContainerController(new Sprite()));
-			tf.flowComposer.updateAllControllers();
-		}
-		
-		public function emptyElementCopyTests():void
-		{
-			var elemList:Array = GeneralFunctionsTest.childParentTable[0];
-			for (var idx:int = 1; idx < elemList.length; idx++)
-			{
-				var elem:FlowElement = new elemList[idx];
-				elem.shallowCopy();
-				elem.deepCopy();
-			}
-		}
-
-		private function validateBitmap(actual:Bitmap, expected:Bitmap):Boolean
-		{
-			actual.bitmapData.draw(expected, null, null, "difference");
-			var bounds:Rectangle = new Rectangle(0, 0, actual.width, actual.height);
-			var diffPixels:ByteArray = actual.bitmapData.getPixels(bounds);
-			diffPixels.position = 0;
-			while (diffPixels.bytesAvailable > 0)
-			{
-				if (diffPixels.readByte() > 0)
-					return false;
-			}
-
-			return true;
-		}
-
-		private function myFontMapper(fd:FontDescription):void
-		{
-			if (fd.fontName == "Arial Black")
-			{
-				fd.fontName = "Arial";
-				fd.fontWeight = FontWeight.BOLD;
-			}
-		}
-
-		/** Tests fontMapping */
-		public function fontMappingTest():void
-		{
-			var textFlow:TextFlow = SelManager.textFlow;
-			var container:DisplayObjectContainer = DisplayObjectContainer(textFlow.flowComposer.getControllerAt(0).container);
-
-			textFlow.fontFamily = "Arial";
-			textFlow.fontWeight = FontWeight.BOLD;
-			textFlow.flowComposer.updateAllControllers();
-
-			var arialBoldBits:BitmapData = new BitmapData(container.width,container.height);
-			arialBoldBits.draw(container as DisplayObjectContainer);
-			var arialBoldData:Bitmap = new Bitmap(arialBoldBits);
-
-			textFlow.fontFamily = "Arial Black";
-			textFlow.fontWeight = undefined;
-			textFlow.flowComposer.updateAllControllers();
-
-			var arialBlackBits:BitmapData = new BitmapData(container.width,container.height);
-			arialBlackBits.draw(container as DisplayObjectContainer);
-			var arialBlackData:Bitmap = new Bitmap(arialBlackBits);
-
-			GlobalSettings.fontMapperFunction = myFontMapper;
-			textFlow.invalidateAllFormats();
-
-			try
-			{
-				textFlow.flowComposer.updateAllControllers();
-			}
-			finally
-			{
-				GlobalSettings.fontMapperFunction = null;
-				textFlow.invalidateAllFormats();
-			}
-
-			var mappedBits:BitmapData = new BitmapData(container.width,container.height);
-			mappedBits.draw(container as DisplayObjectContainer);
-			var mappedData:Bitmap = new Bitmap(mappedBits);
-
-			assertTrue("font mapping failed", validateBitmap(mappedData, arialBoldData));
-
-			textFlow.flowComposer.updateAllControllers();
-
-			var mappingClearedBits:BitmapData = new BitmapData(container.width,container.height);
-			mappingClearedBits.draw(container as DisplayObjectContainer);
-			var mappingClearedData:Bitmap = new Bitmap(mappingClearedBits);
-
-			assertTrue("clearing font mapping failed", validateBitmap(mappingClearedData, arialBlackData));
-
-		}
-
-		/** test the binary search algorithm which in findControllerIndexAtPosition - tricky bits wrt handling of zero length containers */
-		public function testFindControllerIndexAtPosition():void
-		{
-			var s:Sprite = new Sprite();	// scratch
-			var controller:ContainerController;	// scratch
-			var composer:StandardFlowComposer = new StandardFlowComposer();
-			// ideally shouldn't need TextFlow but because containercontrollers find their owning composer via the textflow its needed
-			var textFlow:TextFlow = new TextFlow();
-			textFlow.flowComposer = composer;
-			textFlow.mxmlChildren = [ "012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678" ];
-
-			controller = new ContainerController(s);
-			controller.verticalScrollPolicy = "off";
-			composer.addController(controller);
-			controller.setTextLength(100);
-			controller.verticalScrollPolicy = "off";
-
-			assertTrue("Bad result in findControllerIndexAtPosition 9",composer.findControllerIndexAtPosition(0)== 0);
-			assertTrue("Bad result in findControllerIndexAtPosition 10",composer.findControllerIndexAtPosition(100,true)== 0);
-			assertTrue("Bad result in findControllerIndexAtPosition 11",composer.findControllerIndexAtPosition(100,false)== -1);
-
-			for (var idx1:int  = 0; idx1 < 4; idx1++)
-			{
-				for (var idx2:int = 0; idx2 < 4 ; idx2++)
-				{
-					var idx:int;
-
-					composer = new StandardFlowComposer();
-					textFlow = new TextFlow();
-					textFlow.flowComposer = composer;
-					textFlow.mxmlChildren = [ "012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678" ];
-
-					// add some empties
-					for (idx = 0; idx < idx1; idx++)
-						composer.addController(new ContainerController(s));
-					// add one of length one
-					controller = new ContainerController(s);
-					controller.verticalScrollPolicy = "off";	// scrolling confuses it
-					composer.addController(controller);
-					controller.setTextLength(100);				// internal API
-					// add some empties
-					for (idx = 0; idx < idx2; idx++)
-						composer.addController(new ContainerController(s));
-					assertTrue("Bad result in findControllerIndexAtPosition 1",composer.findControllerIndexAtPosition(0)== 0);
-					assertTrue("Bad result in findControllerIndexAtPosition 2",composer.findControllerIndexAtPosition(0,true)== 0);
-					assertTrue("Bad result in findControllerIndexAtPosition 3",composer.findControllerIndexAtPosition(100,true)== idx1);
-					assertTrue("Bad result in findControllerIndexAtPosition 4",composer.findControllerIndexAtPosition(100,false)== -1);
-					// add one with some length
-					textFlow.mxmlChildren = [ "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678" ];
-					controller.setTextLength(100);
-					controller = new ContainerController(s);
-					controller.verticalScrollPolicy = "off";	// scrolling confuses it
-					composer.addController(controller);
-					controller.setTextLength(100);				// internal API
-					assertTrue("Bad result in findControllerIndexAtPosition 5",composer.findControllerIndexAtPosition(100,true)== idx1);
-					assertTrue("Bad result in findControllerIndexAtPosition 6",composer.findControllerIndexAtPosition(100,false)== idx1+1);
-					assertTrue("Bad result in findControllerIndexAtPosition 7",composer.findControllerIndexAtPosition(200,true)== idx1+idx2+1);
-					assertTrue("Bad result in findControllerIndexAtPosition 8",composer.findControllerIndexAtPosition(200,false)== -1);
-				}
-			}
-
-		}
-
-		
-		private static function checkListLines(textFlow:TextFlow,numLines:int,prefix:String):void
-		{
-			for (var idx:int = 0; idx < numLines; idx++)
-			{
-				var tfl:TextFlowLine = textFlow.flowComposer.getLineAt(idx);
-				assertTrue(prefix+": Missing TextFlowLine: "+idx,tfl != null);
-				var textLine:TextLine = tfl.getTextLine();
-				assertTrue(prefix+": Missing TextLine: "+idx,textLine != null);
-				var numberLine:TextLine = textLine.getChildAt(0) as TextLine;
-				assertTrue(prefix+": Missing NumberLine: "+idx,numberLine != null);
-				/* var numberString:String = numberLine.userData as String;
-				var expectedString:String = (idx+1).toString() + ".";	// for numeric lists
-				assertTrue(prefix+": NumberLine missing userData: "+idx,numberString != null);
-				assertTrue(prefix+": Incorrect NumberLine userData: "+idx,numberLine.userData as String == expectedString); 
-				assertTrue(prefix+": Incorrect NumberLine rawTextLength: "+idx,numberString.length+1 == numberLine.rawTextLength); */
-			}
-		}
-		
-		public function listItemInsertion():void
-		{
-			// some validations that ensure ListElement is correctly setup for list processing
-			
-			// every ListStyleType must have an entry in ListElement.listSuffixes
-			var handler:EnumPropertyHandler = TextLayoutFormat.listStyleTypeProperty.findHandler(EnumPropertyHandler) as EnumPropertyHandler;
-			assertTrue("listItemInsertion: missing handler for ListStyleType", handler != null && handler.range != null);
-
-			var	range:Object = handler.range;
-			var value:String;
-			
-			var numberedListStyles:Object = { };
-			for (value in ListElement.algorithmicListStyles)
-			{
-				assertTrue("listItemInsertion: table entry duplicated",numberedListStyles[value] === undefined);
-				numberedListStyles[value] = ListElement.algorithmicListStyles[value];
-			}
-			for (value in ListElement.numericListStyles)
-			{
-				assertTrue("listItemInsertion: table entry duplicated",numberedListStyles[value] === undefined);
-				numberedListStyles[value] = ListElement.numericListStyles[value];
-			}
-			for (value in ListElement.alphabeticListStyles)
-			{
-				assertTrue("listItemInsertion: table entry duplicated",numberedListStyles[value] === undefined);
-				numberedListStyles[value] = ListElement.alphabeticListStyles[value];
-			}
-			
-			for (value in range)
-			{
-				if (value != FormatValue.INHERIT)
-				{
-					// must be a numbered list or an unnumbered list but not both
-					assertTrue("listItemInsertion: listStyleType must be numbered or unnumbered but not both: "+value,
-						numberedListStyles[value] !== undefined && ListElement.constantListStyles[value] === undefined
-						|| numberedListStyles[value] === undefined && ListElement.constantListStyles[value] !== undefined)
-					// numbered lists must have a suffix
-					if ( ListElement.constantListStyles[value] === undefined)
-						assertTrue("listItemInsertion: missing suffix property: " + value,ListElement.listSuffixes[value] !== undefined);
-				}
-			}
-			
-			// verify that all constantListStyles are in range
-			for (value in ListElement.constantListStyles)
-				assertTrue("listItemInsertion: invalid value in constantListStyles: " + value, range[value] !== undefined);
-			// verify that all numberedListStyles are in range
-			for (value in numberedListStyles)
-				assertTrue("listItemInsertion: invalid value in numberedListStyles: " + value, range[value] !== undefined);
-			// verify that all listSuffixes are in range
-			for (value in ListElement.listSuffixes)
-				assertTrue("listItemInsertion: invalid value in listSuffixes: " + value, range[value] !== undefined);			
-				
-			SelManager.selectRange(0,0);
-
-			// remove all the children and put in a list
-			var textFlow:TextFlow = SelManager.textFlow;
-			
-			textFlow.replaceChildren(0,textFlow.numChildren);
-			
-			var list:ListElement = new ListElement();
-			list.listStyleType = ListStyleType.DECIMAL;
-			
-			textFlow.addChild(list);
-			var item:ListItemElement = new ListItemElement();
-			list.addChild(item);
-			
-			textFlow.flowComposer.updateAllControllers();
-			
-			assertTrue("listItemInsertion: incorrect normalize",textFlow.findAbsoluteParagraph(0).parent == item);
-			
-			// append two items and compose
-			list.addChild(new ListItemElement());
-			list.addChild(new ListItemElement());
-			textFlow.flowComposer.updateAllControllers();
-			
-			// check the three textlines
-			checkListLines(textFlow,3,"listItemInsertion1");
-			
-			// now insert a brand new ListItem at the head and verify
-			list.replaceChildren(0,0,new ListItemElement());
-			textFlow.flowComposer.updateAllControllers();
-			
-			// check four textlines
-			checkListLines(textFlow,4,"listItemInsertion2");
-			
-			// remove a list item
-			list.removeChildAt(1);
-			textFlow.flowComposer.updateAllControllers();
-			
-			// check three textLines
-			checkListLines(textFlow,3,"listItemInsertion3");
-			
-			// add another list in the first ListItemElement
-			item = list.getChildAt(0) as ListItemElement;
-			var newList:ListElement = new ListElement();
-			item.addChild(newList);
-			textFlow.flowComposer.updateAllControllers();
-			
-			// assert the empty list is deleted
-			assertTrue("listItemInsertion: newList not normalized",newList.numChildren == 1);
-
-		}
-		
-		public function testFTETextField():void
-		{
-			// use the TextFlow's container
-			var fieldParent:Sprite = SelManager.textFlow.flowComposer.getControllerAt(0).container;
-			// remove the controller so the the textFlow isn't displayed in it
-			SelManager.textFlow.flowComposer.removeControllerAt(0);
-			
-			var field:FTETextField = new FTETextField();
-			field.htmlText = "Hello world";
-			fieldParent.addChild(field);
-		}
-		
-		public function replaceChildrenTest():void
-		{
-			SelManager.selectRange(0,0);
-			
-			// remove all the children 
-			var textFlow:TextFlow = SelManager.textFlow;
-			textFlow.replaceChildren(0,textFlow.numChildren);
-			
-			var p:ParagraphElement = new ParagraphElement();
-			textFlow.addChild(p);
-			
-			var link:LinkElement = new LinkElement();
-			link.href = "XXX";
-			p.addChild(link);
-			var span:SpanElement = new SpanElement();
-			span.text = "Hello, ";
-			span.fontSize = 24;
-			link.addChild(span);
-			
-			var link2:LinkElement = new LinkElement();
-			link2.href = "YYY";
-			p.addChild(link2);
-			
-			var span2:SpanElement = new SpanElement();
-			span2.text = "world ";
-			span2.fontSize = 24;
-			link2.addChild(span2);
-			
-			textFlow.flowComposer.updateAllControllers();
-			
-			link.replaceChildren(link2.numChildren,link2.numChildren,link2.mxmlChildren);
-			p.removeChild(link2);
-			textFlow.flowComposer.updateAllControllers();
-			
-			assertTrue("replaceChildrenTest: extra line - look for extra terminator",textFlow.flowComposer.numLines == 1);
-		}
-		
-		private function myFontLookup(context:mySwfContext, tlf:ITextLayoutFormat):Function
-		{
-			return myFontLookup;
-		}
-		
-		public function resolveFontLookupTest():void
-		{
-			var textFlow:TextFlow = SelManager.textFlow;
-			
-			textFlow.fontFamily = "Arial";
-			textFlow.fontWeight = FontWeight.BOLD;
-			textFlow.fontLookup = "device";
-			textFlow.flowComposer.updateAllControllers();
-			
-			var swfContext:mySwfContext = new mySwfContext();
-			try
-			{
-				GlobalSettings.resolveFontLookupFunction = myFontLookup(swfContext, textFlow.format);
-				textFlow.flowComposer.updateAllControllers();
-				assertTrue ("fontLookup not matched.", textFlow.fontLookup = swfContext.myFontlookup);
-			}
-			finally
-			{
-				GlobalSettings.resolveFontLookupFunction = null;
-			}
-		}
-		
-		public function bindableSpan():void
-		{
-			// Bindable span should not lose its formatting
-			var textFlow:TextFlow = new TextFlow();
-			var paragraph:ParagraphElement =  new ParagraphElement();
-			var span1:SpanElement = new SpanElement();
-			var span2:SpanElement = new SpanElement();
-			var format:TextLayoutFormat = new TextLayoutFormat();
-			format.fontWeight = FontWeight.BOLD;
-			span2.format = format;
-			paragraph.mxmlChildren = [ span1, span2 ];
-			textFlow.mxmlChildren = [ paragraph ];
-			textFlow.flowComposer.addController(new ContainerController(new Sprite()));
-			textFlow.flowComposer.compose();		// force normalize
-			assertTrue("Spans should not be merged!", span2.parent == span1.parent && paragraph.numChildren == 2);
-			assertTrue("Formatting on second span should be preserved!", span2.fontWeight == FontWeight.BOLD);
-		}
-		
-		// This test does not work in our current build environment, since playerEnablesSpicyFeatures will always be false.
-		// Once we have a method of compiling VellumUnit as a 10.2 swf, this test should be enabled.
-		public function softKeyboardFlagTest():void
-		{
-			if (Configuration.playerEnablesSpicyFeatures)	// only run the rest of the test if we're in 10.2 or higher
-			{
-				// test 1 - add controller, then interaction manager
-				var sprite:Sprite = new Sprite();
-				var textFlow:TextFlow = new TextFlow();
-				textFlow.flowComposer.addController(new ContainerController(sprite));
-				textFlow.interactionManager = new EditManager();
-				assertTrue("needsSoftKeyboard should be true after adding EditManager", sprite["needsSoftKeyboard"] == true);
-				// test 2 - add another controller
-				var sprite1:Sprite = new Sprite();
-				textFlow.flowComposer.addController(new ContainerController(sprite1));
-				assertTrue("needsSoftKeyboard should be true for a second container", sprite1["needsSoftKeyboard"] == true);		
-
-				// test 3 - add interaction manager, then controller
-				var sprite2:Sprite = new Sprite();
-				var textFlow2:TextFlow = new TextFlow();
-				textFlow2.interactionManager = new EditManager();
-				textFlow2.flowComposer.addController(new ContainerController(sprite2));
-				assertTrue("needsSoftKeyboard should be true after adding controller", sprite2["needsSoftKeyboard"] == true);
-			}
-		}
-	}
+    public class FlowModelTest extends VellumTestCase
+    {
+        private var beginTime:int;
+
+        public function FlowModelTest()
+        {
+            super("", "FlowModelTest", TestConfig.getInstance());
+
+            metaData = {};
+            // Note: These must correspond to a Watson product area (case-sensitive)
+            metaData.productArea = "Text Container";
+            metaData.productSubArea = "Flow";
+        }
+
+        [Before]
+        override public function setUpTest():void
+        {
+            super.setUpTest();
+        }
+
+        [After]
+        override public function tearDownTest():void
+        {
+            super.tearDownTest();
+        }
+
+        [Test]
+        /**
+         * Direct usage of the flow APIs. No validation - just look for crashes.
+         * This test changes the color of the entire text.
+         */
+        public function basicAPITest1():void
+        {
+            // set the color on the entire flow
+            beginAPITest();
+            SelManager.textFlow.color = 0xff0000;
+            endAPITest();
+        }
+
+        [Test]
+        /**
+         * Direct usage of the flow APIs. No validation - just look for crashes.
+         * This test deletes every other character in the entire text.
+         */
+        public function basicAPITest2():void
+        {
+            // delete every other character in the textflow
+            beginAPITest();
+
+            var idx:int = 0;
+            while (idx < SelManager.textFlow.textLength)
+            {
+                var span:SpanElement = SelManager.textFlow.findLeaf(idx) as SpanElement;
+                if (span)
+                {
+                    var spanStart:int = span.getAbsoluteStart();
+                    span.replaceText(idx - spanStart, idx - spanStart + 1, null);
+                }
+                idx++;
+
+            }
+            endAPITest();
+        }
+
+        [Test]
+        /**
+         * Direct usage of the flow APIs. No validation - just look for crashes.
+         * This test adds another paragraph to the flow containing the text "Hello World"
+         * in 24 point font.
+         */
+        public function basicAPITest3():void
+        {
+            // add a paragraph
+            beginAPITest();
+            var p:ParagraphElement = new ParagraphElement();
+            var s:SpanElement = new SpanElement();
+            s.text = "Hello world";
+            s.fontSize = 24;
+            p.replaceChildren(0, 0, s);
+            SelManager.textFlow.replaceChildren(SelManager.textFlow.numChildren, SelManager.textFlow.numChildren, p);
+            endAPITest();
+        }
+
+        [Test]
+        /**
+         * This test performs a series of changes and validates the changes after they're performed.
+         */
+        public function basicAPITest4():void
+        {
+            // more comprehensive set of tests - several manipulations to the flow and then display it
+
+            // generic begin to an API test
+            beginAPITest();
+
+            // get the textflow
+            var textFlow:TextFlow = SelManager.textFlow;
+
+            // remove all the textflow children
+            textFlow.replaceChildren(0, textFlow.numChildren);
+            assertTrue("expected no elements on the flow, but found " + textFlow.numChildren,
+                    textFlow.numChildren == 0);
+
+            // create a paragraph
+            var p:ParagraphElement = new ParagraphElement();
+
+            // create a span
+            var s:SpanElement = new SpanElement();
+            s.text = "Hello world. ";
+            s.fontSize = 24;
+
+            // split the span
+            var nextSpan:SpanElement = s.splitAtPosition(6) as SpanElement;
+            // set the color - color can be a string or an unsigned integer
+            nextSpan.color = "0xff";
+            assertTrue("expected that the color would be 255, but found " + uint(nextSpan.format.color),
+                    uint(nextSpan.format.color) == 255);
+
+            // put the two spans in the paragraph
+            p.replaceChildren(0, 0, s);
+            p.replaceChildren(1, 1, nextSpan);
+
+            assertTrue("expected the element count to be 2, but it was " + p.numChildren,
+                    p.numChildren == 2);
+
+            // add another span
+            s = new SpanElement();
+            s.text = "Start:"
+            p.replaceChildren(0, 0, s);
+
+            // put the paragraph in the TextFlow
+            textFlow.replaceChildren(0, 0, p);
+            assertTrue("text flow should have one element but has " + textFlow.numChildren,
+                    textFlow.numChildren == 1);
+
+            // make another paragraph
+            p = new ParagraphElement();
+            s = new SpanElement();
+            p.replaceChildren(0, 0, s);
+            s.text = "NEW FIRST PARAGRAPH";
+
+            // set the paragraph attributes directly
+            p.textIndent = 20;
+            // set the paragraph attributes via clone and set
+            var pa:TextLayoutFormat = new TextLayoutFormat(p.format);
+            pa.textAlign = TextAlign.RIGHT;
+            p.format = pa;
+
+            // into the textFlow at the beginning
+            textFlow.replaceChildren(0, 0, p);
+
+            // generic end to an API test
+            endAPITest();
+        }
+
+        [Test]
+        /**
+         * This test inserts an FE in the middle of a paragraph
+         */
+        public function basicAPITest5():void
+        {
+            // more comprehensive set of tests - several manipulations to the flow and then display it
+
+            // generic begin to an API test
+            beginAPITest();
+
+            // get the textflow
+            var textFlow:TextFlow = SelManager.textFlow;
+
+            // create a paragraph empty the flow and insert it
+            var p:ParagraphElement = new ParagraphElement();
+            textFlow.replaceChildren(0, textFlow.numChildren, p);
+
+            // create a span
+            var s:SpanElement = new SpanElement();
+            s.text = "Hello world. ";
+            s.fontSize = 24;
+
+            // put it in the paragraph
+            p.replaceChildren(0, 0, s);
+
+            // split the span
+            var nextSpanElement:SpanElement = s.splitAtPosition(6) as SpanElement;
+            assertTrue("Incorrect elementCount after split", p.numChildren == 2);
+
+            // create and insert an image between the spans
+            var image:InlineGraphicElement = new InlineGraphicElement();
+            image.width = 19;
+            image.height = 19;
+            image.source = LoaderUtil.createAbsoluteURL(baseURL, "../../test/testFiles/assets/surprised.png");
+            p.replaceChildren(1, 1, image);
+
+            assertTrue("failed length on new InlineGraphicElement", image.textLength == 1);
+            assertTrue("failed elementCount after image insert", p.numChildren == 3);
+            assertTrue("bad first child", p.getChildAt(0) is SpanElement);
+            assertTrue("bad first child", p.getChildAt(1) is InlineGraphicElement);
+            assertTrue("bad first child", p.getChildAt(2) is SpanElement);
+
+            // set a userStyle on a ContainerController
+            var saveFormat:ITextLayoutFormat = ContainerController.containerControllerInitialFormat;
+            try
+            {
+                ContainerController.containerControllerInitialFormat = null;
+                var controller:ContainerController = new ContainerController(new Sprite());
+                controller.setStyle("foo", "blah");
+            }
+            catch (e:Error)
+            {
+                ContainerController.containerControllerInitialFormat = saveFormat;
+                throw(e);
+            }
+            ContainerController.containerControllerInitialFormat = saveFormat;
+
+            // generic end to an API test
+            endAPITest();
+        }
+
+        [Test]
+        /**
+         * Test setting hostCharacterFormat on the TextFlow
+         */
+        public function textFlowHostCharacterFormat():void
+        {
+            // generic begin to an API test
+            beginAPITest();
+
+            // get the textflow
+            var textFlow:TextFlow = SelManager.textFlow;
+            var leaf:FlowLeafElement = textFlow.getFirstLeaf();
+
+            // make it red
+            var cf:TextLayoutFormat = new TextLayoutFormat();
+            cf.color = 0xff0000;
+            textFlow.hostFormat = cf;
+            assertTrue("host character format set color failed", leaf.computedFormat.color == 0xff0000);
+
+            // make it blue
+            textFlow.color = 0xff;
+            assertTrue("textFlow character format color override failed", leaf.computedFormat.color == 0xff);
+
+            // clear the blue
+            textFlow.color = undefined;
+            assertTrue("textFlow color clear failed", leaf.computedFormat.color == 0xff0000);
+
+            // clear the hostCharacterFormat
+            textFlow.hostFormat = null;
+            assertTrue("host character format clear failed", leaf.computedFormat.color == 0);
+
+            endAPITest();
+        }
+
+        [Test]
+        /**
+         * Insert a link to a paragraph that hasn't ever been updated.
+         */
+        public function insertLinkNoUpdateAPI():void
+        {
+            var textFlow:TextFlow = new TextFlow();
+            var p:ParagraphElement = new ParagraphElement();
+            var link:LinkElement = new LinkElement();
+            link.href = "http://www.cnn.com";
+            link.target = "_self";
+            var span:SpanElement = new SpanElement();
+            span.text = "aaa";
+            link.replaceChildren(0, 0, span);
+            p.replaceChildren(0, 0, link);
+            textFlow.replaceChildren(0, 0, p);
+        }
+
+        [Test]
+        /**
+         *
+         */
+        public function insertLinkNoUpdateViaEditManager():void
+        {
+            var textFlow:TextFlow = initTextFlowAAA();
+            var editManager:IEditManager = new EditManager();
+            textFlow.interactionManager = editManager;
+
+            editManager.selectRange(1, 2);
+            editManager.applyLink("http://livedocs.adobe.com/", "_self", true);
+        }
+
+        [Test]
+        /**
+         * undo in a flow that has no controllers
+         */
+        public function testUndo():void
+        {
+            var textFlow:TextFlow = initTextFlowAAA();
+            var undoManager:IUndoManager = new UndoManager();
+            var editManager:IEditManager = new EditManager(undoManager);
+            textFlow.interactionManager = editManager;
+
+            editManager.selectRange(1, 2);
+            var format:TextLayoutFormat = new TextLayoutFormat();
+            format.fontWeight = FontWeight.BOLD;
+            editManager.applyLeafFormat(format);
+
+            undoManager.undo();
+        }
+
+        [Test]
+        public function iterateParagraphForward():void
+        {
+            var flow:TextFlow = createParaIterationModel();
+            var para:ParagraphElement = flow.getFirstLeaf().getParagraph();
+            var i:int = 0;
+            while (para != null)
+            {
+                var cStr:String = para.getText();
+                assertTrue("Text not as expected", int(cStr) == i);
+                para = para.getNextParagraph();
+                i++;
+            }
+            assertTrue("Unexpected paragraph count", i == 12);
+        }
+
+        [Test]
+        public function iterateParagraphBackward():void
+        {
+            //const kParaTerminator:String = '\u2029';
+
+            var flow:TextFlow = createParaIterationModel();
+            var para:ParagraphElement = flow.getLastLeaf().getParagraph();
+            var i:int = 11;
+            //These two tests are no longer valid due to PARB changes to removed the terminator
+            //parameter from getText on a paragraph element.
+            //
+            //var terminatorTestStr:String = para.getText("\n");
+            //assertTrue("Should have newline as terminator", terminatorTestStr.substr(terminatorTestStr.length - 1, 1) == '\n');
+            //terminatorTestStr = para.getText();
+            //assertTrue("Should have paragraph terminator as terminator", terminatorTestStr.substr(terminatorTestStr.length - 1, 1) == kParaTerminator);
+            while (para != null)
+            {
+                var cStr:String = para.getText();
+                assertTrue("Text not as expected", int(cStr) == i);
+                para = para.getPreviousParagraph();
+                i--;
+            }
+            assertTrue("Unexpected paragraph count", i == -1);
+        }
+
+        [Test]
+        public function cascadeValidation():void
+        {
+            var flow:TextFlow = new TextFlow();
+            var para:ParagraphElement = new ParagraphElement();
+            var span:SpanElement = new SpanElement();
+            flow.addChild(para);
+            para.addChild(span);
+            flow.backgroundColor = 0xff;
+            assertTrue("backgroundColor should not inherit", TextLayoutFormat.backgroundColorProperty.inherited == false);
+            assertTrue("bad flow backGroundColor", flow.computedFormat.backgroundColor == 0xff);
+            assertTrue("bad para backGroundColor", para.computedFormat.backgroundColor == TextLayoutFormat.backgroundColorProperty.defaultValue);
+            assertTrue("bad span backGroundColor", span.computedFormat.backgroundColor == TextLayoutFormat.backgroundColorProperty.defaultValue);
+        }
+
+        [Test]
+        /**
+         * tests api change to automatically remove a flowelements children when using replaceChildren
+         */
+        public function elementMovingTest():void
+        {
+            var lengthBefore:int;
+
+            // this flow should have two paragraphs as children
+            var flow:TextFlow = SelManager.textFlow.deepCopy() as TextFlow;	// clone the flow
+
+            var firstPara:FlowElement = flow.getChildAt(0);
+            lengthBefore = flow.textLength;
+            //firstPara.parent.removeChild(firstPara);	// soon to no longer be needed
+            //assertTrue("elementMovingTest: removing para incorrect lengths",flow.textLength == lengthBefore-firstPara.textLength);
+
+            lengthBefore = SelManager.textFlow.textLength;
+            SelManager.textFlow.addChild(firstPara);
+            assertTrue("elementMovingTest: adding para incorrect lengths", SelManager.textFlow.textLength == lengthBefore + firstPara.textLength);
+
+            var lastLeaf:FlowElement = flow.getLastLeaf();
+            var lastLeafLength:int = lastLeaf.textLength;
+            //lastLeaf.parent.removeChild(lastLeaf);	// soon to no longer be needed
+            lengthBefore = SelManager.textFlow.textLength;
+            SelManager.textFlow.getLastLeaf().parent.addChild(lastLeaf);
+            assertTrue("elementMovingTest: adding span incorrect lengths", SelManager.textFlow.textLength == lengthBefore + lastLeafLength - 1);
+        }
+
+        [Test]
+        /**
+         * Empty Flow Tests - verify that empty/partially empty TextFlow's are normalized correctly
+         */
+        public function emptyTextFlowTests():void
+        {
+            var tf:TextFlow;
+
+            // just an empty TextFlow
+            tf = new TextFlow();
+            tf.flowComposer.addController(new ContainerController(new Sprite()));
+            tf.flowComposer.updateAllControllers();
+
+            // empty TextFlow with paragraph
+            tf = new TextFlow();
+            tf.addChild(new ParagraphElement());
+            tf.flowComposer.addController(new ContainerController(new Sprite()));
+            tf.flowComposer.updateAllControllers();
+
+            // empty TextFlow with paragraph and ILG
+            tf = new TextFlow();
+            var p:ParagraphElement = new ParagraphElement();
+            p.addChild(new InlineGraphicElement());
+            tf.addChild(p);
+            tf.flowComposer.addController(new ContainerController(new Sprite()));
+            tf.flowComposer.updateAllControllers();
+
+            // empty TextFlow with paragraph and empty LinkElement
+            tf = new TextFlow();
+            p = new ParagraphElement();
+            p.addChild(new LinkElement());
+            tf.addChild(p);
+            tf.flowComposer.addController(new ContainerController(new Sprite()));
+            tf.flowComposer.updateAllControllers();
+
+            // empty TextFlow with paragraph and empty TCYElement
+            tf = new TextFlow();
+            p = new ParagraphElement();
+            p.addChild(new TCYElement());
+            tf.addChild(p);
+            tf.flowComposer.addController(new ContainerController(new Sprite()));
+            tf.flowComposer.updateAllControllers();
+
+            // a more complex example
+            tf = new TextFlow();
+            p = new ParagraphElement();
+            var tcy:TCYElement = new TCYElement();
+            tcy.addChild(new InlineGraphicElement());
+            tcy.addChild(new SpanElement());
+            p.addChild(tcy);
+            tf.addChild(p);
+            tcy.removeChildAt(1);
+            tf.flowComposer.addController(new ContainerController(new Sprite()));
+            tf.flowComposer.updateAllControllers();
+
+            // several empty spans
+            tf = new TextFlow();
+            p = new ParagraphElement();
+            tf.addChild(p);
+            p.addChild(new SpanElement());
+            p.addChild(new SpanElement());
+            p.addChild(new SpanElement());
+            tf.flowComposer.addController(new ContainerController(new Sprite()));
+            tf.flowComposer.updateAllControllers();
+        }
+
+        [Test]
+        public function emptyElementCopyTests():void
+        {
+            var elemList:Array = GeneralFunctionsTest.childParentTable[0];
+            for (var idx:int = 1; idx < elemList.length; idx++)
+            {
+                var elem:FlowElement = new elemList[idx];
+                elem.shallowCopy();
+                elem.deepCopy();
+            }
+        }
+
+        [Test]
+        /**
+         * Tests fontMapping
+         */
+        public function fontMappingTest():void
+        {
+            var textFlow:TextFlow = SelManager.textFlow;
+            var container:DisplayObjectContainer = DisplayObjectContainer(textFlow.flowComposer.getControllerAt(0).container);
+
+            textFlow.fontFamily = "Arial";
+            textFlow.fontWeight = FontWeight.BOLD;
+            textFlow.flowComposer.updateAllControllers();
+
+            var arialBoldBits:BitmapData = new BitmapData(container.width, container.height);
+            arialBoldBits.draw(container as DisplayObjectContainer);
+            var arialBoldData:Bitmap = new Bitmap(arialBoldBits);
+
+            textFlow.fontFamily = "Arial Black";
+            textFlow.fontWeight = undefined;
+            textFlow.flowComposer.updateAllControllers();
+
+            var arialBlackBits:BitmapData = new BitmapData(container.width, container.height);
+            arialBlackBits.draw(container as DisplayObjectContainer);
+            var arialBlackData:Bitmap = new Bitmap(arialBlackBits);
+
+            GlobalSettings.fontMapperFunction = myFontMapper;
+            textFlow.invalidateAllFormats();
+
+            try
+            {
+                textFlow.flowComposer.updateAllControllers();
+            }
+            finally
+            {
+                GlobalSettings.fontMapperFunction = null;
+                textFlow.invalidateAllFormats();
+            }
+
+            var mappedBits:BitmapData = new BitmapData(container.width, container.height);
+            mappedBits.draw(container as DisplayObjectContainer);
+            var mappedData:Bitmap = new Bitmap(mappedBits);
+
+            assertTrue("font mapping failed", validateBitmap(mappedData, arialBoldData));
+
+            textFlow.flowComposer.updateAllControllers();
+
+            var mappingClearedBits:BitmapData = new BitmapData(container.width, container.height);
+            mappingClearedBits.draw(container as DisplayObjectContainer);
+            var mappingClearedData:Bitmap = new Bitmap(mappingClearedBits);
+
+            assertTrue("clearing font mapping failed", validateBitmap(mappingClearedData, arialBlackData));
+
+        }
+
+        [Test]
+        /**
+         * test the binary search algorithm which in findControllerIndexAtPosition - tricky bits wrt handling of zero length containers
+         */
+        public function testFindControllerIndexAtPosition():void
+        {
+            var s:Sprite = new Sprite();	// scratch
+            var controller:ContainerController;	// scratch
+            var composer:StandardFlowComposer = new StandardFlowComposer();
+            // ideally shouldn't need TextFlow but because containercontrollers find their owning composer via the textflow its needed
+            var textFlow:TextFlow = new TextFlow();
+            textFlow.flowComposer = composer;
+            textFlow.mxmlChildren = [ "012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678" ];
+
+            controller = new ContainerController(s);
+            controller.verticalScrollPolicy = "off";
+            composer.addController(controller);
+            controller.setTextLength(100);
+            controller.verticalScrollPolicy = "off";
+
+            assertTrue("Bad result in findControllerIndexAtPosition 9", composer.findControllerIndexAtPosition(0) == 0);
+            assertTrue("Bad result in findControllerIndexAtPosition 10", composer.findControllerIndexAtPosition(100, true) == 0);
+            assertTrue("Bad result in findControllerIndexAtPosition 11", composer.findControllerIndexAtPosition(100, false) == -1);
+
+            for (var idx1:int = 0; idx1 < 4; idx1++)
+            {
+                for (var idx2:int = 0; idx2 < 4; idx2++)
+                {
+                    var idx:int;
+
+                    composer = new StandardFlowComposer();
+                    textFlow = new TextFlow();
+                    textFlow.flowComposer = composer;
+                    textFlow.mxmlChildren = [ "012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678" ];
+
+                    // add some empties
+                    for (idx = 0; idx < idx1; idx++)
+                        composer.addController(new ContainerController(s));
+                    // add one of length one
+                    controller = new ContainerController(s);
+                    controller.verticalScrollPolicy = "off";	// scrolling confuses it
+                    composer.addController(controller);
+                    controller.setTextLength(100);				// internal API
+                    // add some empties
+                    for (idx = 0; idx < idx2; idx++)
+                        composer.addController(new ContainerController(s));
+                    assertTrue("Bad result in findControllerIndexAtPosition 1", composer.findControllerIndexAtPosition(0) == 0);
+                    assertTrue("Bad result in findControllerIndexAtPosition 2", composer.findControllerIndexAtPosition(0, true) == 0);
+                    assertTrue("Bad result in findControllerIndexAtPosition 3", composer.findControllerIndexAtPosition(100, true) == idx1);
+                    assertTrue("Bad result in findControllerIndexAtPosition 4", composer.findControllerIndexAtPosition(100, false) == -1);
+                    // add one with some length
+                    textFlow.mxmlChildren = [ "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678" ];
+                    controller.setTextLength(100);
+                    controller = new ContainerController(s);
+                    controller.verticalScrollPolicy = "off";	// scrolling confuses it
+                    composer.addController(controller);
+                    controller.setTextLength(100);				// internal API
+                    assertTrue("Bad result in findControllerIndexAtPosition 5", composer.findControllerIndexAtPosition(100, true) == idx1);
+                    assertTrue("Bad result in findControllerIndexAtPosition 6", composer.findControllerIndexAtPosition(100, false) == idx1 + 1);
+                    assertTrue("Bad result in findControllerIndexAtPosition 7", composer.findControllerIndexAtPosition(200, true) == idx1 + idx2 + 1);
+                    assertTrue("Bad result in findControllerIndexAtPosition 8", composer.findControllerIndexAtPosition(200, false) == -1);
+                }
+            }
+
+        }
+
+        [Test]
+        public function listItemInsertion():void
+        {
+            // some validations that ensure ListElement is correctly setup for list processing
+
+            // every ListStyleType must have an entry in ListElement.listSuffixes
+            var handler:EnumPropertyHandler = TextLayoutFormat.listStyleTypeProperty.findHandler(EnumPropertyHandler) as EnumPropertyHandler;
+            assertTrue("listItemInsertion: missing handler for ListStyleType", handler != null && handler.range != null);
+
+            var range:Object = handler.range;
+            var value:String;
+
+            var numberedListStyles:Object = { };
+            for (value in ListElement.algorithmicListStyles)
+            {
+                assertTrue("listItemInsertion: table entry duplicated", numberedListStyles[value] === undefined);
+                numberedListStyles[value] = ListElement.algorithmicListStyles[value];
+            }
+            for (value in ListElement.numericListStyles)
+            {
+                assertTrue("listItemInsertion: table entry duplicated", numberedListStyles[value] === undefined);
+                numberedListStyles[value] = ListElement.numericListStyles[value];
+            }
+            for (value in ListElement.alphabeticListStyles)
+            {
+                assertTrue("listItemInsertion: table entry duplicated", numberedListStyles[value] === undefined);
+                numberedListStyles[value] = ListElement.alphabeticListStyles[value];
+            }
+
+            for (value in range)
+            {
+                if (value != FormatValue.INHERIT)
+                {
+                    // must be a numbered list or an unnumbered list but not both
+                    assertTrue("listItemInsertion: listStyleType must be numbered or unnumbered but not both: " + value,
+                            numberedListStyles[value] !== undefined && ListElement.constantListStyles[value] === undefined
+                                    || numberedListStyles[value] === undefined && ListElement.constantListStyles[value] !== undefined)
+                    // numbered lists must have a suffix
+                    if (ListElement.constantListStyles[value] === undefined)
+                        assertTrue("listItemInsertion: missing suffix property: " + value, ListElement.listSuffixes[value] !== undefined);
+                }
+            }
+
+            // verify that all constantListStyles are in range
+            for (value in ListElement.constantListStyles)
+                assertTrue("listItemInsertion: invalid value in constantListStyles: " + value, range[value] !== undefined);
+            // verify that all numberedListStyles are in range
+            for (value in numberedListStyles)
+                assertTrue("listItemInsertion: invalid value in numberedListStyles: " + value, range[value] !== undefined);
+            // verify that all listSuffixes are in range
+            for (value in ListElement.listSuffixes)
+                assertTrue("listItemInsertion: invalid value in listSuffixes: " + value, range[value] !== undefined);
+
+            SelManager.selectRange(0, 0);
+
+            // remove all the children and put in a list
+            var textFlow:TextFlow = SelManager.textFlow;
+
+            textFlow.replaceChildren(0, textFlow.numChildren);
+
+            var list:ListElement = new ListElement();
+            list.listStyleType = ListStyleType.DECIMAL;
+
+            textFlow.addChild(list);
+            var item:ListItemElement = new ListItemElement();
+            list.addChild(item);
+
+            textFlow.flowComposer.updateAllControllers();
+
+            assertTrue("listItemInsertion: incorrect normalize", textFlow.findAbsoluteParagraph(0).parent == item);
+
+            // append two items and compose
+            list.addChild(new ListItemElement());
+            list.addChild(new ListItemElement());
+            textFlow.flowComposer.updateAllControllers();
+
+            // check the three textlines
+            checkListLines(textFlow, 3, "listItemInsertion1");
+
+            // now insert a brand new ListItem at the head and verify
+            list.replaceChildren(0, 0, new ListItemElement());
+            textFlow.flowComposer.updateAllControllers();
+
+            // check four textlines
+            checkListLines(textFlow, 4, "listItemInsertion2");
+
+            // remove a list item
+            list.removeChildAt(1);
+            textFlow.flowComposer.updateAllControllers();
+
+            // check three textLines
+            checkListLines(textFlow, 3, "listItemInsertion3");
+
+            // add another list in the first ListItemElement
+            item = list.getChildAt(0) as ListItemElement;
+            var newList:ListElement = new ListElement();
+            item.addChild(newList);
+            textFlow.flowComposer.updateAllControllers();
+
+            // assert the empty list is deleted
+            assertTrue("listItemInsertion: newList not normalized", newList.numChildren == 1);
+
+        }
+
+        [Test]
+        public function testFTETextField():void
+        {
+            // use the TextFlow's container
+            var fieldParent:Sprite = SelManager.textFlow.flowComposer.getControllerAt(0).container;
+            // remove the controller so the the textFlow isn't displayed in it
+            SelManager.textFlow.flowComposer.removeControllerAt(0);
+
+            var field:FTETextField = new FTETextField();
+            field.htmlText = "Hello world";
+            fieldParent.addChild(field);
+        }
+
+        [Test]
+        public function replaceChildrenTest():void
+        {
+            SelManager.selectRange(0, 0);
+
+            // remove all the children
+            var textFlow:TextFlow = SelManager.textFlow;
+            textFlow.replaceChildren(0, textFlow.numChildren);
+
+            var p:ParagraphElement = new ParagraphElement();
+            textFlow.addChild(p);
+
+            var link:LinkElement = new LinkElement();
+            link.href = "XXX";
+            p.addChild(link);
+            var span:SpanElement = new SpanElement();
+            span.text = "Hello, ";
+            span.fontSize = 24;
+            link.addChild(span);
+
+            var link2:LinkElement = new LinkElement();
+            link2.href = "YYY";
+            p.addChild(link2);
+
+            var span2:SpanElement = new SpanElement();
+            span2.text = "world ";
+            span2.fontSize = 24;
+            link2.addChild(span2);
+
+            textFlow.flowComposer.updateAllControllers();
+
+            link.replaceChildren(link2.numChildren, link2.numChildren, link2.mxmlChildren);
+            p.removeChild(link2);
+            textFlow.flowComposer.updateAllControllers();
+
+            assertTrue("replaceChildrenTest: extra line - look for extra terminator", textFlow.flowComposer.numLines == 1);
+        }
+
+        [Test]
+        public function resolveFontLookupTest():void
+        {
+            var textFlow:TextFlow = SelManager.textFlow;
+
+            textFlow.fontFamily = "Arial";
+            textFlow.fontWeight = FontWeight.BOLD;
+            textFlow.fontLookup = "device";
+            textFlow.flowComposer.updateAllControllers();
+
+            var swfContext:mySwfContext = new mySwfContext();
+            try
+            {
+                GlobalSettings.resolveFontLookupFunction = myFontLookup(swfContext, textFlow.format);
+                textFlow.flowComposer.updateAllControllers();
+                assertTrue("fontLookup not matched.", textFlow.fontLookup = swfContext.myFontlookup);
+            }
+            finally
+            {
+                GlobalSettings.resolveFontLookupFunction = null;
+            }
+        }
+
+        [Test]
+        public function bindableSpan():void
+        {
+            // Bindable span should not lose its formatting
+            var textFlow:TextFlow = new TextFlow();
+            var paragraph:ParagraphElement = new ParagraphElement();
+            var span1:SpanElement = new SpanElement();
+            var span2:SpanElement = new SpanElement();
+            var format:TextLayoutFormat = new TextLayoutFormat();
+            format.fontWeight = FontWeight.BOLD;
+            span2.format = format;
+            paragraph.mxmlChildren = [ span1, span2 ];
+            textFlow.mxmlChildren = [ paragraph ];
+            textFlow.flowComposer.addController(new ContainerController(new Sprite()));
+            textFlow.flowComposer.compose();		// force normalize
+            assertTrue("Spans should not be merged!", span2.parent == span1.parent && paragraph.numChildren == 2);
+            assertTrue("Formatting on second span should be preserved!", span2.fontWeight == FontWeight.BOLD);
+        }
+
+        [Test]
+        /**
+         *  This test does not work in our current build environment, since playerEnablesSpicyFeatures will always be false.
+         *  Once we have a method of compiling VellumUnit as a 10.2 swf, this test should be enabled.
+         */
+        public function softKeyboardFlagTest():void
+        {
+            if (Configuration.playerEnablesSpicyFeatures)	// only run the rest of the test if we're in 10.2 or higher
+            {
+                // test 1 - add controller, then interaction manager
+                var sprite:Sprite = new Sprite();
+                var textFlow:TextFlow = new TextFlow();
+                textFlow.flowComposer.addController(new ContainerController(sprite));
+                textFlow.interactionManager = new EditManager();
+                assertTrue("needsSoftKeyboard should be true after adding EditManager", sprite["needsSoftKeyboard"] == true);
+                // test 2 - add another controller
+                var sprite1:Sprite = new Sprite();
+                textFlow.flowComposer.addController(new ContainerController(sprite1));
+                assertTrue("needsSoftKeyboard should be true for a second container", sprite1["needsSoftKeyboard"] == true);
+
+                // test 3 - add interaction manager, then controller
+                var sprite2:Sprite = new Sprite();
+                var textFlow2:TextFlow = new TextFlow();
+                textFlow2.interactionManager = new EditManager();
+                textFlow2.flowComposer.addController(new ContainerController(sprite2));
+                assertTrue("needsSoftKeyboard should be true after adding controller", sprite2["needsSoftKeyboard"] == true);
+            }
+        }
+
+
+        private function beginAPITest():void
+        {
+            beginTime = getTimer();
+            SelManager.selectRange(-1, -1);
+        }
+
+        private function endAPITest():void
+        {
+            SelManager.selectRange(0, 0);
+            SelManager.textFlow.flowComposer.updateAllControllers();
+        }
+
+        private function initTextFlowAAA():TextFlow
+        {
+            var textFlow:TextFlow = new TextFlow();
+            var p:ParagraphElement = new ParagraphElement();
+            var span:SpanElement = new SpanElement();
+            span.text = "aaa";
+            p.replaceChildren(0, 0, span);
+            textFlow.replaceChildren(0, 0, p);
+            return textFlow;
+        }
+
+        private function createParaIterationModel():TextFlow
+        {
+            // Creates 3 divs, each have 4 paras
+            const paraTotal:int = 4;
+            var paraCount:int;
+            const divTotal:int = 3;
+            var divCount:int;
+
+            var flow:TextFlow = new TextFlow();
+            for (var j:int = 0; j < divTotal; j++)
+            {
+                var div:DivElement = new DivElement();
+                for (var i:int = 0; i < paraTotal; i++)
+                {
+                    var para:ParagraphElement = new ParagraphElement();
+                    var span:SpanElement = new SpanElement();
+                    span.text = paraCount.toString();
+                    para.addChild(span);
+                    div.addChild(para);
+                    paraCount++;
+                }
+                flow.addChild(div);
+            }
+            return flow;
+        }
+
+        private function myFontLookup(context:mySwfContext, tlf:ITextLayoutFormat):Function
+        {
+            return myFontLookup;
+        }
+
+
+        private static function checkListLines(textFlow:TextFlow, numLines:int, prefix:String):void
+        {
+            for (var idx:int = 0; idx < numLines; idx++)
+            {
+                var tfl:TextFlowLine = textFlow.flowComposer.getLineAt(idx);
+                assertTrue(prefix + ": Missing TextFlowLine: " + idx, tfl != null);
+                var textLine:TextLine = tfl.getTextLine();
+                assertTrue(prefix + ": Missing TextLine: " + idx, textLine != null);
+                var numberLine:TextLine = textLine.getChildAt(0) as TextLine;
+                assertTrue(prefix + ": Missing NumberLine: " + idx, numberLine != null);
+                /* var numberString:String = numberLine.userData as String;
+                 var expectedString:String = (idx+1).toString() + ".";	// for numeric lists
+                 assertTrue(prefix+": NumberLine missing userData: "+idx,numberString != null);
+                 assertTrue(prefix+": Incorrect NumberLine userData: "+idx,numberLine.userData as String == expectedString);
+                 assertTrue(prefix+": Incorrect NumberLine rawTextLength: "+idx,numberString.length+1 == numberLine.rawTextLength); */
+            }
+        }
+
+
+        private function validateBitmap(actual:Bitmap, expected:Bitmap):Boolean
+        {
+            actual.bitmapData.draw(expected, null, null, "difference");
+            var bounds:Rectangle = new Rectangle(0, 0, actual.width, actual.height);
+            var diffPixels:ByteArray = actual.bitmapData.getPixels(bounds);
+            diffPixels.position = 0;
+            while (diffPixels.bytesAvailable > 0)
+            {
+                if (diffPixels.readByte() > 0)
+                    return false;
+            }
+
+            return true;
+        }
+
+        private function myFontMapper(fd:FontDescription):void
+        {
+            if (fd.fontName == "Arial Black")
+            {
+                fd.fontName = "Arial";
+                fd.fontWeight = FontWeight.BOLD;
+            }
+        }
+    }
 }
 
 import flash.text.engine.FontLookup;
+
 import flashx.textLayout.compose.ISWFContext;
-import flashx.textLayout.elements.FlowElement;
 import flashx.textLayout.elements.TextFlow;
-import flashx.textLayout.formats.TextLayoutFormat;
 
 class mySwfContext implements ISWFContext
-{	
-	public var myFontlookup:String = FontLookup.EMBEDDED_CFF;
-	
-	public function callInContext(fn:Function, thisArg:Object, argsArray:Array, returns:Boolean=true):*
-	{
-		var tf:TextFlow = thisArg as TextFlow;
-		tf.fontLookup = FontLookup.EMBEDDED_CFF;
-		if (returns)
-			return fn.apply(thisArg, argsArray);
-		fn.apply(thisArg, argsArray);
-	}
-	
+{
+    public var myFontlookup:String = FontLookup.EMBEDDED_CFF;
+
+    public function callInContext(fn:Function, thisArg:Object, argsArray:Array, returns:Boolean = true):*
+    {
+        var tf:TextFlow = thisArg as TextFlow;
+        tf.fontLookup = FontLookup.EMBEDDED_CFF;
+        if (returns)
+            return fn.apply(thisArg, argsArray);
+        fn.apply(thisArg, argsArray);
+    }
+
 }


[9/9] git commit: [flex-tlf] [refs/heads/develop] - Merge branch 'FlexUnit4TestsTLF' into develop

Posted by pi...@apache.org.
Merge branch 'FlexUnit4TestsTLF' into develop


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

Branch: refs/heads/develop
Commit: 3a4075c0060b0402c904a7346cd5fea219d2d914
Parents: 0b57945 895152c
Author: piotrz <pi...@gmail.com>
Authored: Sun Oct 12 23:51:51 2014 +0200
Committer: piotrz <pi...@gmail.com>
Committed: Sun Oct 12 23:51:51 2014 +0200

----------------------------------------------------------------------
 automation_core/src/AutomationCoreClasses.as                   | 2 ++
 automation_core/src/UnitTest/ExtendedClasses/VellumTestCase.as | 1 -
 2 files changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------



[3/9] Add new tests to AllTestsSuite: BoundsAndAlignmentTest.as, EventOverrideTest.as - all tests marked as Ignore - Need fixes CrossContainerTest.as, ElementOperationTest.as - all works fine

Posted by pi...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/c1059121/automation_tests/src/UnitTest/Tests/ElementOperationTest.as
----------------------------------------------------------------------
diff --git a/automation_tests/src/UnitTest/Tests/ElementOperationTest.as b/automation_tests/src/UnitTest/Tests/ElementOperationTest.as
new file mode 100644
index 0000000..47a836d
--- /dev/null
+++ b/automation_tests/src/UnitTest/Tests/ElementOperationTest.as
@@ -0,0 +1,1192 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.
+//
+////////////////////////////////////////////////////////////////////////////////
+package UnitTest.Tests
+{
+    import UnitTest.ExtendedClasses.VellumTestCase;
+    import UnitTest.Fixtures.TestConfig;
+
+    import flash.text.engine.FontWeight;
+
+    import flashx.textLayout.conversion.TextConverter;
+    import flashx.textLayout.edit.EditManager;
+    import flashx.textLayout.elements.DivElement;
+    import flashx.textLayout.elements.FlowGroupElement;
+    import flashx.textLayout.elements.LinkElement;
+    import flashx.textLayout.elements.ListElement;
+    import flashx.textLayout.elements.ParagraphElement;
+    import flashx.textLayout.elements.SpanElement;
+    import flashx.textLayout.elements.TextFlow;
+    import flashx.textLayout.formats.TextAlign;
+    import flashx.textLayout.formats.TextLayoutFormat;
+    import flashx.textLayout.operations.ApplyElementIDOperation;
+    import flashx.textLayout.operations.ApplyElementStyleNameOperation;
+    import flashx.textLayout.operations.ApplyElementTypeNameOperation;
+    import flashx.textLayout.operations.ApplyElementUserStyleOperation;
+    import flashx.textLayout.operations.ApplyFormatToElementOperation;
+
+    import org.flexunit.asserts.assertTrue;
+
+    public class ElementOperationTest extends VellumTestCase
+    {
+        private static const listItemMarkup:String = "<TextFlow xmlns='http://ns.adobe.com/textLayout/2008'><list listStylePosition='inside'><li><p textAlign='left'><span fontWeight='bold'>item</span></p></li></list></TextFlow>";
+        private static const divTestMarkup:String = "<TextFlow whiteSpaceCollapse='preserve' xmlns='http://ns.adobe.com/textLayout/2008'><div><p><span>asd</span></p></div><p><span>asd</span></p></TextFlow>";
+
+        public function ElementOperationTest()
+        {
+            super("", "ElementOperationTests", TestConfig.getInstance());
+
+            metaData = {};
+            // Note: These must correspond to a Watson product area (case-sensitive)
+            metaData.productArea = "Editing";
+        }
+
+        [Before]
+        override public function setUpTest():void
+        {
+            super.setUpTest();
+        }
+
+        [After]
+        override public function tearDownTest():void
+        {
+            super.tearDownTest();
+        }
+
+        [Test]
+        public function changeTextFlowIdTest():void
+        {
+            var tf:TextFlow = SelManager.textFlow;
+            var origId:String = tf.id;
+            var newId:String = "newTFId";
+
+            SelManager.doOperation(new ApplyElementIDOperation(SelManager.getSelectionState(), tf, newId));
+            assertTrue("changeTextFlowIdTest doOperation error", tf.id == newId);
+            SelManager.undo();
+            assertTrue("changeTextFlowIdTest undo error", tf.id == origId);
+            SelManager.redo();
+            assertTrue("changeTextFlowIdTest redo error", tf.id == newId);
+        }
+
+        [Test]
+        public function changeFirstParagraphIdTest():void
+        {
+            var p:ParagraphElement = SelManager.textFlow.getChildAt(0) as ParagraphElement;
+            var origId:String = p.id;
+            var newId:String = "newParaId";
+
+            SelManager.doOperation(new ApplyElementIDOperation(SelManager.getSelectionState(), p, newId));
+            assertTrue("changeFirstParagraphIdTest doOperation error", p.id == newId);
+            SelManager.undo();
+            assertTrue("changeFirstParagraphIdTest undo error", p.id == origId);
+            SelManager.redo();
+            assertTrue("changeFirstParagraphIdTest redo error", p.id == newId);
+        }
+
+        [Test]
+        public function changePartialParagraphIdTest():void
+        {
+            var tf:TextFlow = SelManager.textFlow;
+            var numParas:int = tf.numChildren;
+            var totalLength:int = tf.textLength;
+
+            var p:ParagraphElement = tf.getChildAt(0) as ParagraphElement;
+            var origId:String = p.id;
+            var origTextLength:int = p.textLength;
+            var newId:String = "newParaId";
+
+            // creates two new paragraphs
+            SelManager.doOperation(new ApplyElementIDOperation(SelManager.getSelectionState(), p, newId, 10, 20));
+            p = tf.findLeaf(11).getParagraph();	// prev para gets a terminator added
+            assertTrue("changePartialParagraphIdTest doOperation error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
+            assertTrue("changePartialParagraphIdTest doOperation error id", p.id == newId);
+            assertTrue("changePartialParagraphIdTest doOperation error numParas", tf.numChildren == numParas + 2);
+            assertTrue("changePartialParagraphIdTest doOperation error totalLength", tf.textLength == totalLength + 2);
+
+            SelManager.undo();
+            p = tf.findLeaf(10).getParagraph();
+            assertTrue("changePartialParagraphIdTest undo error", p.id == origId && p.textLength == origTextLength);
+            assertTrue("changePartialParagraphIdTest undo error numParas", tf.numChildren == numParas);
+            assertTrue("changePartialParagraphIdTest undo error totalLength", tf.textLength == totalLength);
+
+            SelManager.redo();
+            p = tf.findLeaf(11).getParagraph();
+            assertTrue("changePartialParagraphIdTest redo error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
+            assertTrue("changePartialParagraphIdTest redo error", p.id == newId);
+            assertTrue("changePartialParagraphIdTest redo error numParas", tf.numChildren == numParas + 2);
+            assertTrue("changePartialParagraphIdTest redo error totalLength", tf.textLength == totalLength + 2);
+        }
+
+        [Test]
+        public function changePartialSpanIdTest():void
+        {
+            var tf:TextFlow = SelManager.textFlow;
+            var numParas:int = tf.numChildren;
+            var totalLength:int = tf.textLength;
+
+            var span:SpanElement = tf.getLastLeaf() as SpanElement;
+            assertTrue("changePartialSpanIdTest span is too short for the test", span.textLength > 20);
+            var spanStart:int = span.getAbsoluteStart();
+
+            var origId:String = span.id;
+            var origSpanLength:int = span.textLength;
+            var newId:String = "newSpanId";
+
+            // splits the span
+            SelManager.doOperation(new ApplyElementIDOperation(SelManager.getSelectionState(), span, newId, 10, 20));
+
+            span = tf.findLeaf(spanStart + 10) as SpanElement;
+            assertTrue("changePartialSpanIdTest doOperation error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
+            assertTrue("changePartialSpanIdTest doOperation error id", span.id == newId);
+            assertTrue("changePartialSpanIdTest doOperation error totalLength", tf.textLength == totalLength);
+
+            SelManager.undo();
+            span = tf.findLeaf(spanStart) as SpanElement;
+            assertTrue("changePartialSpanIdTest undo error", span.id == origId && span.textLength == origSpanLength);
+            assertTrue("changePartialSpanIdTest undo error totalLength", tf.textLength == totalLength);
+
+            SelManager.redo();
+            span = tf.findLeaf(spanStart + 10) as SpanElement;
+            assertTrue("changePartialSpanIdTest redo error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
+            assertTrue("changePartialSpanIdTest redo error", span.id == newId);
+            assertTrue("changePartialSpanIdTest redo error totalLength", tf.textLength == totalLength);
+        }
+
+        [Test]
+        public function changeTextFlowStyleNameTest():void
+        {
+            var tf:TextFlow = SelManager.textFlow;
+            var origStyleName:String = tf.styleName;
+            var newStyleName:String = "newTFStyleName";
+
+            // ApplyElementStyleNameOperation is deprecated
+            SelManager.doOperation(new ApplyElementStyleNameOperation(SelManager.getSelectionState(), tf, newStyleName));
+            assertTrue("changeTextFlowStyleNameTest doOperation error", tf.styleName == newStyleName);
+            SelManager.undo();
+            assertTrue("changeTextFlowStyleNameTest undo error", tf.styleName == origStyleName);
+            SelManager.redo();
+            assertTrue("changeTextFlowStyleNameTest redo error", tf.styleName == newStyleName);
+
+            SelManager.undo();
+            assertTrue("changeTextFlowStyleNameTest undo error", tf.styleName == origStyleName);
+
+            // test using the replacement class
+            SelManager.doOperation(new ApplyFormatToElementOperation(SelManager.getSelectionState(), tf, TextLayoutFormat.createTextLayoutFormat({styleName: newStyleName})));
+            assertTrue("changeTextFlowStyleNameTest doOperation error", tf.styleName == newStyleName);
+            SelManager.undo();
+            assertTrue("changeTextFlowStyleNameTest undo error", tf.styleName == origStyleName);
+            SelManager.redo();
+            assertTrue("changeTextFlowStyleNameTest redo error", tf.styleName == newStyleName);
+
+        }
+
+        [Test]
+        public function changeFirstParagraphStyleNameTest():void
+        {
+            var p:ParagraphElement = SelManager.textFlow.getChildAt(0) as ParagraphElement;
+            var origStyleName:String = p.styleName;
+            var newStyleName:String = "newParaStyleName";
+
+            // ApplyElementStyleNameOperation is deprecated
+            SelManager.doOperation(new ApplyElementStyleNameOperation(SelManager.getSelectionState(), p, newStyleName));
+            assertTrue("changeFirstParagraphStyleNameTest doOperation error", p.styleName == newStyleName);
+            SelManager.undo();
+            assertTrue("changeFirstParagraphStyleNameTest undo error", p.styleName == origStyleName);
+            SelManager.redo();
+            assertTrue("changeFirstParagraphStyleNameTest redo error", p.styleName == newStyleName);
+
+            SelManager.undo();
+            assertTrue("changeFirstParagraphStyleNameTest undo error", p.styleName == origStyleName);
+
+            // test using the replacement class
+            SelManager.doOperation(new ApplyFormatToElementOperation(SelManager.getSelectionState(), p, TextLayoutFormat.createTextLayoutFormat({styleName: newStyleName})));
+            assertTrue("changeFirstParagraphStyleNameTest doOperation error", p.styleName == newStyleName);
+            SelManager.undo();
+            assertTrue("changeFirstParagraphStyleNameTest undo error", p.styleName == origStyleName);
+            SelManager.redo();
+            assertTrue("changeFirstParagraphStyleNameTest redo error", p.styleName == newStyleName);
+
+        }
+
+        [Test]
+        public function changeTextFlowTypeNameTest():void
+        {
+            var tf:TextFlow = SelManager.textFlow;
+            var origTypeName:String = tf.typeName;
+            var newTypeName:String = "newTFTypeName";
+
+            SelManager.doOperation(new ApplyElementTypeNameOperation(SelManager.getSelectionState(), tf, newTypeName));
+            assertTrue("changeTextFlowTypeNameTest doOperation error", tf.typeName == newTypeName);
+            SelManager.undo();
+            assertTrue("changeTextFlowTypeNameTest undo error", tf.typeName == origTypeName);
+            SelManager.redo();
+            assertTrue("changeTextFlowTypeNameTest redo error", tf.typeName == newTypeName);
+        }
+
+        [Test]
+        public function changeFirstParagraphTypeNameTest():void
+        {
+            var p:ParagraphElement = SelManager.textFlow.getChildAt(0) as ParagraphElement;
+            var origTypeName:String = p.typeName;
+            var newTypeName:String = "newParaTypeName";
+
+            SelManager.doOperation(new ApplyElementTypeNameOperation(SelManager.getSelectionState(), p, newTypeName));
+            assertTrue("changeFirstParagraphTypeNameTest doOperation error", p.typeName == newTypeName);
+            SelManager.undo();
+            assertTrue("changeFirstParagraphTypeNameTest undo error", p.typeName == origTypeName);
+            SelManager.redo();
+            assertTrue("changeFirstParagraphTypeNameTest redo error", p.typeName == newTypeName);
+        }
+
+        [Test]
+        public function changePartialParagraphStyleNameTest():void
+        {
+            var tf:TextFlow = SelManager.textFlow;
+            var numParas:int = tf.numChildren;
+            var totalLength:int = tf.textLength;
+
+            var p:ParagraphElement = tf.getChildAt(0) as ParagraphElement;
+            var origStyleName:String = p.styleName;
+            var origTextLength:int = p.textLength;
+            var newStyleName:String = "newParaStyleName";
+
+            // ApplyElementStyleNameOperation is deprecated
+            // creates two new paragraphs
+            SelManager.doOperation(new ApplyElementStyleNameOperation(SelManager.getSelectionState(), p, newStyleName, 10, 20));
+            p = tf.findLeaf(11).getParagraph();	// prev para gets a terminator added
+            assertTrue("changePartialParagraphStyleNameTest doOperation error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
+            assertTrue("changePartialParagraphStyleNameTest doOperation error", p.styleName == newStyleName);
+            assertTrue("changePartialParagraphStyleNameTest doOperation error numParas", tf.numChildren == numParas + 2);
+            assertTrue("changePartialParagraphStyleNameTest doOperation error totalLength", tf.textLength == totalLength + 2);
+
+            SelManager.undo();
+            p = tf.findLeaf(10).getParagraph();
+            assertTrue("changePartialParagraphStyleNameTest undo error", p.styleName == origStyleName && p.textLength == origTextLength);
+            assertTrue("changePartialParagraphStyleNameTest undo error numParas", tf.numChildren == numParas);
+            assertTrue("changePartialParagraphStyleNameTest undo error totalLength", tf.textLength == totalLength);
+
+            SelManager.redo();
+            p = tf.findLeaf(11).getParagraph();
+            assertTrue("changePartialParagraphStyleNameTest redo error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
+            assertTrue("changePartialParagraphStyleNameTest redo error", p.styleName == newStyleName);
+            assertTrue("changePartialParagraphStyleNameTest redo error numParas", tf.numChildren == numParas + 2);
+            assertTrue("changePartialParagraphStyleNameTest redo error totalLength", tf.textLength == totalLength + 2);
+
+            // cleanup
+            SelManager.undo();
+            p = tf.findLeaf(10).getParagraph();
+            assertTrue("changePartialParagraphStyleNameTest undo error", p.styleName == origStyleName && p.textLength == origTextLength);
+            assertTrue("changePartialParagraphStyleNameTest undo error numParas", tf.numChildren == numParas);
+            assertTrue("changePartialParagraphStyleNameTest undo error totalLength", tf.textLength == totalLength);
+
+            // test using the replacement class
+            // creates two new paragraphs
+            SelManager.doOperation(new ApplyFormatToElementOperation(SelManager.getSelectionState(), p, TextLayoutFormat.createTextLayoutFormat({styleName: newStyleName}), 10, 20));
+            p = tf.findLeaf(11).getParagraph();	// prev para gets a terminator added
+            assertTrue("changePartialParagraphStyleNameTest doOperation error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
+            assertTrue("changePartialParagraphStyleNameTest doOperation error", p.styleName == newStyleName);
+            assertTrue("changePartialParagraphStyleNameTest doOperation error numParas", tf.numChildren == numParas + 2);
+            assertTrue("changePartialParagraphStyleNameTest doOperation error totalLength", tf.textLength == totalLength + 2);
+
+            SelManager.undo();
+            p = tf.findLeaf(10).getParagraph();
+            assertTrue("changePartialParagraphStyleNameTest undo error", p.styleName == origStyleName && p.textLength == origTextLength);
+            assertTrue("changePartialParagraphStyleNameTest undo error numParas", tf.numChildren == numParas);
+            assertTrue("changePartialParagraphStyleNameTest undo error totalLength", tf.textLength == totalLength);
+
+            SelManager.redo();
+            p = tf.findLeaf(11).getParagraph();
+            assertTrue("changePartialParagraphStyleNameTest redo error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
+            assertTrue("changePartialParagraphStyleNameTest redo error", p.styleName == newStyleName);
+            assertTrue("changePartialParagraphStyleNameTest redo error numParas", tf.numChildren == numParas + 2);
+            assertTrue("changePartialParagraphStyleNameTest redo error totalLength", tf.textLength == totalLength + 2);
+
+        }
+
+        [Test]
+        public function changePartialSpanStyleNameTest():void
+        {
+            var tf:TextFlow = SelManager.textFlow;
+            var numParas:int = tf.numChildren;
+            var totalLength:int = tf.textLength;
+
+            var span:SpanElement = tf.getLastLeaf() as SpanElement;
+            assertTrue("changePartialSpanStyleNameTest span is too short for the test", span.textLength > 20);
+            var spanStart:int = span.getAbsoluteStart();
+
+            var origStyleName:String = span.styleName;
+            var origSpanLength:int = span.textLength;
+            var newStyleName:String = "newSpanStyleName";
+
+            // ApplyElementStyleNameOperation is deprecated
+            // splits the span
+            SelManager.doOperation(new ApplyElementStyleNameOperation(SelManager.getSelectionState(), span, newStyleName, 10, 20));
+
+            span = tf.findLeaf(spanStart + 10) as SpanElement;
+            assertTrue("changePartialSpanStyleNameTest doOperation error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
+            assertTrue("changePartialSpanStyleNameTest doOperation error id", span.styleName == newStyleName);
+            assertTrue("changePartialSpanStyleNameTest doOperation error totalLength", tf.textLength == totalLength);
+
+            SelManager.undo();
+            span = tf.findLeaf(spanStart) as SpanElement;
+            assertTrue("changePartialSpanStyleNameTest undo error", span.styleName == origStyleName && span.textLength == origSpanLength);
+            assertTrue("changePartialSpanStyleNameTest undo error totalLength", tf.textLength == totalLength);
+
+            SelManager.redo();
+            span = tf.findLeaf(spanStart + 10) as SpanElement;
+            assertTrue("changePartialSpanStyleNameTest redo error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
+            assertTrue("changePartialSpanStyleNameTest redo error", span.styleName == newStyleName);
+            assertTrue("changePartialSpanStyleNameTest redo error totalLength", tf.textLength == totalLength);
+
+            // cleanup
+            SelManager.undo();
+            span = tf.findLeaf(spanStart) as SpanElement;
+            assertTrue("changePartialSpanStyleNameTest undo error", span.styleName == origStyleName && span.textLength == origSpanLength);
+            assertTrue("changePartialSpanStyleNameTest undo error totalLength", tf.textLength == totalLength);
+
+            // test using the replacement function
+
+            // splits the span
+            SelManager.doOperation(new ApplyFormatToElementOperation(SelManager.getSelectionState(), span, TextLayoutFormat.createTextLayoutFormat({styleName: newStyleName}), 10, 20));
+
+            span = tf.findLeaf(spanStart + 10) as SpanElement;
+            assertTrue("changePartialSpanStyleNameTest doOperation error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
+            assertTrue("changePartialSpanStyleNameTest doOperation error id", span.styleName == newStyleName);
+            assertTrue("changePartialSpanStyleNameTest doOperation error totalLength", tf.textLength == totalLength);
+
+            SelManager.undo();
+            span = tf.findLeaf(spanStart) as SpanElement;
+            assertTrue("changePartialSpanStyleNameTest undo error", span.styleName == origStyleName && span.textLength == origSpanLength);
+            assertTrue("changePartialSpanStyleNameTest undo error totalLength", tf.textLength == totalLength);
+
+            SelManager.redo();
+            span = tf.findLeaf(spanStart + 10) as SpanElement;
+            assertTrue("changePartialSpanStyleNameTest redo error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
+            assertTrue("changePartialSpanStyleNameTest redo error", span.styleName == newStyleName);
+            assertTrue("changePartialSpanStyleNameTest redo error totalLength", tf.textLength == totalLength);
+        }
+
+        [Test]
+        public function changePartialParagraphTypeNameTest():void
+        {
+            var tf:TextFlow = SelManager.textFlow;
+            var numParas:int = tf.numChildren;
+            var totalLength:int = tf.textLength;
+
+            var p:ParagraphElement = tf.getChildAt(0) as ParagraphElement;
+            var origTypeName:String = p.typeName;
+            var origTextLength:int = p.textLength;
+            var newTypeName:String = "newParaTypeName";
+
+            // creates two new paragraphs
+            SelManager.doOperation(new ApplyElementTypeNameOperation(SelManager.getSelectionState(), p, newTypeName, 10, 20));
+            p = tf.findLeaf(11).getParagraph();	// prev para gets a terminator added
+            assertTrue("changePartialParagraphTypeNameTest doOperation error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
+            assertTrue("changePartialParagraphTypeNameTest doOperation error", p.typeName == newTypeName);
+            assertTrue("changePartialParagraphTypeNameTest doOperation error numParas", tf.numChildren == numParas + 2);
+            assertTrue("changePartialParagraphTypeNameTest doOperation error totalLength", tf.textLength == totalLength + 2);
+
+            SelManager.undo();
+            p = tf.findLeaf(10).getParagraph();
+            assertTrue("changePartialParagraphTypeNameTest undo error", p.typeName == origTypeName && p.textLength == origTextLength);
+            assertTrue("changePartialParagraphTypeNameTest undo error numParas", tf.numChildren == numParas);
+            assertTrue("changePartialParagraphTypeNameTest undo error totalLength", tf.textLength == totalLength);
+
+            SelManager.redo();
+            p = tf.findLeaf(11).getParagraph();
+            assertTrue("changePartialParagraphTypeNameTest redo error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
+            assertTrue("changePartialParagraphTypeNameTest redo error", p.typeName == newTypeName);
+            assertTrue("changePartialParagraphTypeNameTest redo error numParas", tf.numChildren == numParas + 2);
+            assertTrue("changePartialParagraphTypeNameTest redo error totalLength", tf.textLength == totalLength + 2);
+        }
+
+        [Test]
+        public function changePartialSpanTypeNameTest():void
+        {
+            var tf:TextFlow = SelManager.textFlow;
+            var numParas:int = tf.numChildren;
+            var totalLength:int = tf.textLength;
+
+            var span:SpanElement = tf.getLastLeaf() as SpanElement;
+            assertTrue("changePartialSpanTypeNameTest span is too short for the test", span.textLength > 20);
+            var spanStart:int = span.getAbsoluteStart();
+
+            var origTypeName:String = span.typeName;
+            var origSpanLength:int = span.textLength;
+            var newTypeName:String = "newSpanTypeName";
+
+            // splits the span
+            SelManager.doOperation(new ApplyElementTypeNameOperation(SelManager.getSelectionState(), span, newTypeName, 10, 20));
+
+            span = tf.findLeaf(spanStart + 10) as SpanElement;
+            assertTrue("changePartialSpanTypeNameTest doOperation error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
+            assertTrue("changePartialSpanTypeNameTest doOperation error id", span.typeName == newTypeName);
+            assertTrue("changePartialSpanTypeNameTest doOperation error totalLength", tf.textLength == totalLength);
+
+            SelManager.undo();
+            span = tf.findLeaf(spanStart) as SpanElement;
+            assertTrue("changePartialSpanTypeNameTest undo error", span.typeName == origTypeName && span.textLength == origSpanLength);
+            assertTrue("changePartialSpanTypeNameTest undo error totalLength", tf.textLength == totalLength);
+
+            SelManager.redo();
+            span = tf.findLeaf(spanStart + 10) as SpanElement;
+            assertTrue("changePartialSpanTypeNameTest redo error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
+            assertTrue("changePartialSpanTypeNameTest redo error", span.typeName == newTypeName);
+            assertTrue("changePartialSpanTypeNameTest redo error totalLength", tf.textLength == totalLength);
+        }
+
+        [Test]
+        public function changeTextFlowUserStyleTest():void
+        {
+            var tf:TextFlow = SelManager.textFlow;
+            var styleName:String = "userStyleName";
+            var origStyleValue:* = tf.getStyle(styleName);
+            var newStyleValue:String = "newTFStyleValue";
+
+            // ApplyElementUserStyleOperation is deprecated
+            SelManager.doOperation(new ApplyElementUserStyleOperation(SelManager.getSelectionState(), tf, styleName, newStyleValue));
+            assertTrue("changeTextFlowUserStyleTest doOperation error", tf.getStyle(styleName) === newStyleValue);
+            SelManager.undo();
+            assertTrue("changeTextFlowUserStyleTest undo error", tf.getStyle(styleName) === origStyleValue);
+            SelManager.redo();
+            assertTrue("changeTextFlowUserStyleTest redo error", tf.getStyle(styleName) === newStyleValue);
+
+            // cleanup
+            SelManager.undo();
+            assertTrue("changeTextFlowUserStyleTest undo error", tf.getStyle(styleName) === origStyleValue);
+
+            // test using the replacement class
+            var format:TextLayoutFormat = new TextLayoutFormat();
+            format.setStyle(styleName, newStyleValue);
+            SelManager.doOperation(new ApplyFormatToElementOperation(SelManager.getSelectionState(), tf, format));
+            assertTrue("changeTextFlowUserStyleTest doOperation error", tf.getStyle(styleName) === newStyleValue);
+            SelManager.undo();
+            assertTrue("changeTextFlowUserStyleTest undo error", tf.getStyle(styleName) === origStyleValue);
+            SelManager.redo();
+            assertTrue("changeTextFlowUserStyleTest redo error", tf.getStyle(styleName) === newStyleValue);
+        }
+
+        [Test]
+        public function changeFirstParagraphUserStyleTest():void
+        {
+            var p:ParagraphElement = SelManager.textFlow.getChildAt(0) as ParagraphElement;
+            var styleName:String = "userStyleName";
+            var origStyleValue:* = p.getStyle(styleName);
+            var newStyleValue:String = "newParaStyleValue";
+
+            // ApplyElementUserStyleOperation is deprecated
+            SelManager.doOperation(new ApplyElementUserStyleOperation(SelManager.getSelectionState(), p, styleName, newStyleValue));
+            assertTrue("changeFirstParagraphUserStyleTest doOperation error", p.getStyle(styleName) === newStyleValue);
+            SelManager.undo();
+            assertTrue("changeFirstParagraphUserStyleTest undo error", p.getStyle(styleName) === origStyleValue);
+            SelManager.redo();
+            assertTrue("changeFirstParagraphUserStyleTest redo error", p.getStyle(styleName) === newStyleValue);
+
+            // cleanup
+            SelManager.undo();
+            assertTrue("changeFirstParagraphUserStyleTest undo error", p.getStyle(styleName) === origStyleValue);
+
+            // test using the replacement class
+            var format:TextLayoutFormat = new TextLayoutFormat();
+            format.setStyle(styleName, newStyleValue);
+            SelManager.doOperation(new ApplyFormatToElementOperation(SelManager.getSelectionState(), p, format));
+            assertTrue("changeFirstParagraphUserStyleTest doOperation error", p.getStyle(styleName) === newStyleValue);
+            SelManager.undo();
+            assertTrue("changeFirstParagraphUserStyleTest undo error", p.getStyle(styleName) === origStyleValue);
+            SelManager.redo();
+            assertTrue("changeFirstParagraphUserStyleTest redo error", p.getStyle(styleName) === newStyleValue);
+        }
+
+        [Test]
+        public function changePartialParagraphUserStyleTest():void
+        {
+            var tf:TextFlow = SelManager.textFlow;
+            var numParas:int = tf.numChildren;
+            var totalLength:int = tf.textLength;
+
+            var p:ParagraphElement = tf.getChildAt(0) as ParagraphElement;
+            var origTextLength:int = p.textLength;
+
+            var styleName:String = "userStyleName";
+            var origStyleValue:* = p.getStyle(styleName);
+            var newStyleValue:String = "newParaStyleValue";
+
+            // ApplyElementUserStyleOperation is deprecated
+            // creates two new paragraphs
+            SelManager.doOperation(new ApplyElementUserStyleOperation(SelManager.getSelectionState(), p, styleName, newStyleValue, 10, 20));
+            p = tf.findLeaf(11).getParagraph();	// prev para gets a terminator added
+            assertTrue("changePartialParagraphUserStyleTest doOperation error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
+            assertTrue("changePartialParagraphUserStyleTest doOperation error", p.getStyle(styleName) === newStyleValue);
+            assertTrue("changePartialParagraphUserStyleTest doOperation error numParas", tf.numChildren == numParas + 2);
+            assertTrue("changePartialParagraphUserStyleTest doOperation error totalLength", tf.textLength == totalLength + 2);
+
+            SelManager.undo();
+            p = tf.findLeaf(10).getParagraph();
+            assertTrue("changePartialParagraphUserStyleTest undo error", p.getStyle(styleName) === origStyleValue && p.textLength == origTextLength);
+            assertTrue("changePartialParagraphUserStyleTest undo error numParas", tf.numChildren == numParas);
+            assertTrue("changePartialParagraphUserStyleTest undo error totalLength", tf.textLength == totalLength);
+
+            SelManager.redo();
+            p = tf.findLeaf(11).getParagraph();
+            assertTrue("changePartialParagraphStyleNameTest redo error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
+            assertTrue("changePartialParagraphStyleNameTest redo error", p.getStyle(styleName) === newStyleValue);
+            assertTrue("changePartialParagraphStyleNameTest redo error numParas", tf.numChildren == numParas + 2);
+            assertTrue("changePartialParagraphStyleNameTest redo error totalLength", tf.textLength == totalLength + 2);
+
+            // cleanup
+            SelManager.undo();
+            p = tf.findLeaf(10).getParagraph();
+            assertTrue("changePartialParagraphUserStyleTest undo error", p.getStyle(styleName) === origStyleValue && p.textLength == origTextLength);
+            assertTrue("changePartialParagraphUserStyleTest undo error numParas", tf.numChildren == numParas);
+            assertTrue("changePartialParagraphUserStyleTest undo error totalLength", tf.textLength == totalLength);
+
+            // test using the replacement class
+            var format:TextLayoutFormat = new TextLayoutFormat();
+            format.setStyle(styleName, newStyleValue);
+            SelManager.doOperation(new ApplyFormatToElementOperation(SelManager.getSelectionState(), p, format, 10, 20));
+            p = tf.findLeaf(11).getParagraph();	// prev para gets a terminator added
+            assertTrue("changePartialParagraphUserStyleTest doOperation error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
+            assertTrue("changePartialParagraphUserStyleTest doOperation error", p.getStyle(styleName) === newStyleValue);
+            assertTrue("changePartialParagraphUserStyleTest doOperation error numParas", tf.numChildren == numParas + 2);
+            assertTrue("changePartialParagraphUserStyleTest doOperation error totalLength", tf.textLength == totalLength + 2);
+
+            SelManager.undo();
+            p = tf.findLeaf(10).getParagraph();
+            assertTrue("changePartialParagraphUserStyleTest undo error", p.getStyle(styleName) === origStyleValue && p.textLength == origTextLength);
+            assertTrue("changePartialParagraphUserStyleTest undo error numParas", tf.numChildren == numParas);
+            assertTrue("changePartialParagraphUserStyleTest undo error totalLength", tf.textLength == totalLength);
+
+            SelManager.redo();
+            p = tf.findLeaf(11).getParagraph();
+            assertTrue("changePartialParagraphStyleNameTest redo error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
+            assertTrue("changePartialParagraphStyleNameTest redo error", p.getStyle(styleName) === newStyleValue);
+            assertTrue("changePartialParagraphStyleNameTest redo error numParas", tf.numChildren == numParas + 2);
+            assertTrue("changePartialParagraphStyleNameTest redo error totalLength", tf.textLength == totalLength + 2);
+
+        }
+
+        [Test]
+        public function changePartialSpanUserStyleTest():void
+        {
+            var tf:TextFlow = SelManager.textFlow;
+            var numParas:int = tf.numChildren;
+            var totalLength:int = tf.textLength;
+
+            var span:SpanElement = tf.getLastLeaf() as SpanElement;
+            assertTrue("changePartialSpanStyleNameTest span is too short for the test", span.textLength > 20);
+            var spanStart:int = span.getAbsoluteStart();
+            var origSpanLength:int = span.textLength;
+
+            var styleName:String = "userStyleName";
+            var origStyleValue:* = span.getStyle(styleName);
+            var newStyleValue:String = "newSpanStyleValue";
+
+            // ApplyElementUserStyleOperation is deprecated
+            // splits the span
+            SelManager.doOperation(new ApplyElementUserStyleOperation(SelManager.getSelectionState(), span, styleName, newStyleValue, 10, 20));
+
+            span = tf.findLeaf(spanStart + 10) as SpanElement;
+            assertTrue("changePartialSpanUserStyleTest doOperation error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
+            assertTrue("changePartialSpanUserStyleTest doOperation error", span.getStyle(styleName) === newStyleValue);
+            assertTrue("changePartialSpanUserStyleTest doOperation error totalLength", tf.textLength == totalLength);
+
+            SelManager.undo();
+            span = tf.findLeaf(spanStart) as SpanElement;
+            assertTrue("changePartialSpanUserStyleTest undo error", span.getStyle(styleName) === origStyleValue && span.textLength == origSpanLength);
+            assertTrue("changePartialSpanUserStyleTest undo error totalLength", tf.textLength == totalLength);
+
+            SelManager.redo();
+            span = tf.findLeaf(spanStart + 10) as SpanElement;
+            assertTrue("changePartialSpanUserStyleTest redo error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
+            assertTrue("changePartialSpanUserStyleTest redo error", span.getStyle(styleName) === newStyleValue);
+            assertTrue("changePartialSpanUserStyleTest redo error totalLength", tf.textLength == totalLength);
+
+            // cleanup
+            SelManager.undo();
+            span = tf.findLeaf(spanStart) as SpanElement;
+            assertTrue("changePartialSpanUserStyleTest undo error", span.getStyle(styleName) === origStyleValue && span.textLength == origSpanLength);
+            assertTrue("changePartialSpanUserStyleTest undo error totalLength", tf.textLength == totalLength);
+
+            // splits the span
+            var format:TextLayoutFormat = new TextLayoutFormat();
+            format.setStyle(styleName, newStyleValue);
+            SelManager.doOperation(new ApplyFormatToElementOperation(SelManager.getSelectionState(), span, format, 10, 20));
+
+            span = tf.findLeaf(spanStart + 10) as SpanElement;
+            assertTrue("changePartialSpanUserStyleTest doOperation error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
+            assertTrue("changePartialSpanUserStyleTest doOperation error", span.getStyle(styleName) === newStyleValue);
+            assertTrue("changePartialSpanUserStyleTest doOperation error totalLength", tf.textLength == totalLength);
+
+            SelManager.undo();
+            span = tf.findLeaf(spanStart) as SpanElement;
+            assertTrue("changePartialSpanUserStyleTest undo error", span.getStyle(styleName) === origStyleValue && span.textLength == origSpanLength);
+            assertTrue("changePartialSpanUserStyleTest undo error totalLength", tf.textLength == totalLength);
+
+            SelManager.redo();
+            span = tf.findLeaf(spanStart + 10) as SpanElement;
+            assertTrue("changePartialSpanUserStyleTest redo error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
+            assertTrue("changePartialSpanUserStyleTest redo error", span.getStyle(styleName) === newStyleValue);
+            assertTrue("changePartialSpanUserStyleTest redo error totalLength", tf.textLength == totalLength);
+        }
+
+        [Test]
+        public function deleteAcrossDivBoundaryTest():void
+        {
+            var tf:TextFlow = SelManager.textFlow;
+            var selectFlow:TextFlow = TextConverter.importToFlow(divTestMarkup, TextConverter.TEXT_LAYOUT_FORMAT);
+
+            var div:DivElement = selectFlow.getChildAt(0) as DivElement;
+            var para:ParagraphElement = selectFlow.getChildAt(1) as ParagraphElement;
+
+            // setup
+            tf.replaceChildren(0, tf.numChildren, div.deepCopy());
+            tf.replaceChildren(1, tf.numChildren, para.deepCopy());
+            tf.flowComposer.updateAllControllers();
+
+            var lenBefore:int = tf.textLength;
+
+            SelManager.selectRange(3, 4);
+            EditManager(SelManager).deleteText();
+
+            assertTrue("length didn't change after delete across div boundary!", tf.textLength != lenBefore);
+
+        }
+
+        [Test]
+        /**
+         * //Test for bug#2948473, we will not copy the containerBreakAfter, containerBreakBefore
+         * columnBreakAfter, columnBreakBefore attribute to the new paragraph
+         */
+        public function BreaksSplitTest():void
+        {
+            var tf:TextFlow = SelManager.textFlow;
+
+            // a simple styled paragraph - always copy
+            var p:ParagraphElement = new ParagraphElement();
+            p.textAlign = TextAlign.LEFT;
+            p.columnBreakAfter = 'always';
+            p.columnBreakBefore = 'always';
+            p.containerBreakAfter = 'always';
+            p.containerBreakBefore = 'always';
+            var s:SpanElement = new SpanElement();
+            s.fontWeight = FontWeight.BOLD;
+            s.text = "Hello";
+            p.addChild(s);
+
+            // scratch objects
+            var p1:ParagraphElement;
+            var p2:ParagraphElement;
+            var s1:SpanElement;
+            var s2:SpanElement;
+
+
+            // BEGIN SPLIT AT BEGINNING TEST
+
+            // setup
+            tf.replaceChildren(0, tf.numChildren, p.deepCopy(0, p.textLength));
+            tf.flowComposer.updateAllControllers();
+
+            // split at beginning
+            SelManager.selectRange(0, 0);
+            EditManager(SelManager).splitParagraph();
+
+            assertTrue("BreaksSplitTest 1: incorrect number of children after split", tf.numChildren == 2);
+            p1 = tf.getChildAt(0) as ParagraphElement;
+            p2 = tf.getChildAt(1) as ParagraphElement;
+
+            assertTrue("BreaksSplitTest 1: p1 is incorrect after split", p1 && TextLayoutFormat.isEqual(p.format, p1.format) && p1.numChildren == 1);
+            assertTrue("BreaksSplitTest 1: p2 is incorrect after split", p2 && !TextLayoutFormat.isEqual(p.format, p2.format) && p2.numChildren == 1 &&
+                    p2.columnBreakAfter == undefined &&
+                    p2.columnBreakBefore == undefined &&
+                    p2.containerBreakAfter == undefined &&
+                    p2.containerBreakBefore == undefined);
+
+            s1 = p1.getChildAt(0) as SpanElement;
+            s2 = p2.getChildAt(0) as SpanElement;
+
+            assertTrue("BreaksSplitTest 1: s1 is incorrect after split", s1 && TextLayoutFormat.isEqual(s.format, s1.format));
+            assertTrue("BreaksSplitTest 1: s2 is incorrect after split", s2 && TextLayoutFormat.isEqual(s.format, s2.format));
+
+            // END SPLIT AT BEGINNING TEST
+
+            // BEGIN SPLIT AT END TEST
+
+            // setup
+            tf.replaceChildren(0, tf.numChildren, p.deepCopy(0, p.textLength));
+            tf.flowComposer.updateAllControllers();
+
+            // split at end
+            SelManager.selectRange(tf.textLength - 1, tf.textLength - 1);
+            EditManager(SelManager).splitParagraph();
+
+            assertTrue("BreaksSplitTest 2: incorrect number of children after split", tf.numChildren == 2);
+            p1 = tf.getChildAt(0) as ParagraphElement;
+            p2 = tf.getChildAt(1) as ParagraphElement;
+
+            assertTrue("BreaksSplitTest 2: p1 is incorrect after split", p1 && TextLayoutFormat.isEqual(p.format, p1.format) && p1.numChildren == 1);
+            assertTrue("BreaksSplitTest 2: p2 is incorrect after split", p2 && !TextLayoutFormat.isEqual(p.format, p2.format) && p2.numChildren == 1 &&
+                    p2.columnBreakAfter == undefined &&
+                    p2.columnBreakBefore == undefined &&
+                    p2.containerBreakAfter == undefined &&
+                    p2.containerBreakBefore == undefined);
+
+            s1 = p1.getChildAt(0) as SpanElement;
+            s2 = p2.getChildAt(0) as SpanElement;
+
+            assertTrue("BreaksSplitTest 2: s1 is incorrect after split", s1 && TextLayoutFormat.isEqual(s.format, s1.format));
+            assertTrue("BreaksSplitTest 2: s2 is incorrect after split", s2 && TextLayoutFormat.isEqual(s.format, s2.format));
+
+            // END SPLIT AT END TEST
+
+            // BEGIN SPLIT IN MIDDLE TEST
+
+            // setup
+            tf.replaceChildren(0, tf.numChildren, p.deepCopy(0, p.textLength));
+            tf.flowComposer.updateAllControllers();
+
+            // split at middle
+            SelManager.selectRange(2, 2);
+            EditManager(SelManager).splitParagraph();
+
+            assertTrue("BreaksSplitTest 3: incorrect number of children after split", tf.numChildren == 2);
+            p1 = tf.getChildAt(0) as ParagraphElement;
+            p2 = tf.getChildAt(1) as ParagraphElement;
+
+            assertTrue("BreaksSplitTest 3: p1 is incorrect after split", p1 && TextLayoutFormat.isEqual(p.format, p1.format) && p1.numChildren == 1);
+            assertTrue("BreaksSplitTest 3: p2 is incorrect after split", p2 && !TextLayoutFormat.isEqual(p.format, p2.format) && p2.numChildren == 1 &&
+                    p2.columnBreakAfter == undefined &&
+                    p2.columnBreakBefore == undefined &&
+                    p2.containerBreakAfter == undefined &&
+                    p2.containerBreakBefore == undefined);
+
+            s1 = p1.getChildAt(0) as SpanElement;
+            s2 = p2.getChildAt(0) as SpanElement;
+
+            assertTrue("BreaksSplitTest 3: s1 is incorrect after split", s1 && TextLayoutFormat.isEqual(s.format, s1.format));
+            assertTrue("BreaksSplitTest 3: s2 is incorrect after split", s2 && TextLayoutFormat.isEqual(s.format, s2.format));
+
+            // END SPLIT IN MIDDLE TEST
+        }
+
+        [Test]
+        public function splitStyledParagraphTest():void
+        {
+            var tf:TextFlow = SelManager.textFlow;
+
+            // a simple styled paragraph - always copy
+            var p:ParagraphElement = new ParagraphElement();
+            p.textAlign = TextAlign.LEFT;
+            var s:SpanElement = new SpanElement();
+            s.fontWeight = FontWeight.BOLD;
+            s.text = "Hello";
+            p.addChild(s);
+
+            // scratch objects
+            var p1:ParagraphElement;
+            var p2:ParagraphElement;
+            var s1:SpanElement;
+            var s2:SpanElement;
+
+
+            // BEGIN SPLIT AT BEGINNING TEST
+
+            // setup
+            tf.replaceChildren(0, tf.numChildren, p.deepCopy(0, p.textLength));
+            tf.flowComposer.updateAllControllers();
+
+            // split at beginning
+            SelManager.selectRange(0, 0);
+            EditManager(SelManager).splitParagraph();
+
+            assertTrue("splitStyledParagraphTest 1: incorrect number of children after split", tf.numChildren == 2);
+            p1 = tf.getChildAt(0) as ParagraphElement;
+            p2 = tf.getChildAt(1) as ParagraphElement;
+
+            assertTrue("splitStyledParagraphTest 1: p1 is incorrect after split", p1 && TextLayoutFormat.isEqual(p.format, p1.format) && p1.numChildren == 1);
+            assertTrue("splitStyledParagraphTest 1: p2 is incorrect after split", p2 && TextLayoutFormat.isEqual(p.format, p2.format) && p2.numChildren == 1);
+
+            s1 = p1.getChildAt(0) as SpanElement;
+            s2 = p2.getChildAt(0) as SpanElement;
+
+            assertTrue("splitStyledParagraphTest 1: s1 is incorrect after split", s1 && TextLayoutFormat.isEqual(s.format, s1.format));
+            assertTrue("splitStyledParagraphTest 1: s2 is incorrect after split", s2 && TextLayoutFormat.isEqual(s.format, s2.format));
+
+            // END SPLIT AT BEGINNING TEST
+
+            // BEGIN SPLIT AT END TEST
+
+            // setup
+            tf.replaceChildren(0, tf.numChildren, p.deepCopy(0, p.textLength));
+            tf.flowComposer.updateAllControllers();
+
+            // split at end
+            SelManager.selectRange(tf.textLength - 1, tf.textLength - 1);
+            EditManager(SelManager).splitParagraph();
+
+            assertTrue("splitStyledParagraphTest 2: incorrect number of children after split", tf.numChildren == 2);
+            p1 = tf.getChildAt(0) as ParagraphElement;
+            p2 = tf.getChildAt(1) as ParagraphElement;
+
+            assertTrue("splitStyledParagraphTest 2: p1 is incorrect after split", p1 && TextLayoutFormat.isEqual(p.format, p1.format) && p1.numChildren == 1);
+            assertTrue("splitStyledParagraphTest 2: p2 is incorrect after split", p2 && TextLayoutFormat.isEqual(p.format, p2.format) && p2.numChildren == 1);
+
+            s1 = p1.getChildAt(0) as SpanElement;
+            s2 = p2.getChildAt(0) as SpanElement;
+
+            assertTrue("splitStyledParagraphTest 2: s1 is incorrect after split", s1 && TextLayoutFormat.isEqual(s.format, s1.format));
+            assertTrue("splitStyledParagraphTest 2: s2 is incorrect after split", s2 && TextLayoutFormat.isEqual(s.format, s2.format));
+
+            // END SPLIT AT END TEST
+
+            // BEGIN SPLIT IN MIDDLE TEST
+
+            // setup
+            tf.replaceChildren(0, tf.numChildren, p.deepCopy(0, p.textLength));
+            tf.flowComposer.updateAllControllers();
+
+            // split at middle
+            SelManager.selectRange(2, 2);
+            EditManager(SelManager).splitParagraph();
+
+            assertTrue("splitStyledParagraphTest 3: incorrect number of children after split", tf.numChildren == 2);
+            p1 = tf.getChildAt(0) as ParagraphElement;
+            p2 = tf.getChildAt(1) as ParagraphElement;
+
+            assertTrue("splitStyledParagraphTest 3: p1 is incorrect after split", p1 && TextLayoutFormat.isEqual(p.format, p1.format) && p1.numChildren == 1);
+            assertTrue("splitStyledParagraphTest 3: p2 is incorrect after split", p2 && TextLayoutFormat.isEqual(p.format, p2.format) && p2.numChildren == 1);
+
+            s1 = p1.getChildAt(0) as SpanElement;
+            s2 = p2.getChildAt(0) as SpanElement;
+
+            assertTrue("splitStyledParagraphTest 3: s1 is incorrect after split", s1 && TextLayoutFormat.isEqual(s.format, s1.format));
+            assertTrue("splitStyledParagraphTest 3: s2 is incorrect after split", s2 && TextLayoutFormat.isEqual(s.format, s2.format));
+
+            // END SPLIT IN MIDDLE TEST
+        }
+
+        [Test]
+        public function splitStyledAnchorTest():void
+        {
+            var tf:TextFlow = SelManager.textFlow;
+
+            // a simple styled paragraph - always copy
+            var p:ParagraphElement = new ParagraphElement();
+            p.textAlign = TextAlign.LEFT;
+            var s:SpanElement = new SpanElement();
+            s.fontWeight = FontWeight.BOLD;
+            s.text = "Hello";
+            var a:LinkElement = new LinkElement();
+            a.fontSize = 18;
+            a.addChild(s);
+            p.addChild(a);
+
+            // scratch objects
+            var p1:ParagraphElement;
+            var p2:ParagraphElement;
+            var s1:SpanElement;
+            var s2:SpanElement;
+
+
+            // BEGIN SPLIT AT BEGINNING TEST
+
+            // setup
+            tf.replaceChildren(0, tf.numChildren, p.deepCopy(0, p.textLength));
+            tf.flowComposer.updateAllControllers();
+
+            // split at beginning
+            SelManager.selectRange(0, 0);
+            EditManager(SelManager).splitParagraph();
+
+            assertTrue("splitStyledParagraphTest 1: incorrect number of children after split", tf.numChildren == 2);
+            p1 = tf.getChildAt(0) as ParagraphElement;
+            p2 = tf.getChildAt(1) as ParagraphElement;
+
+            assertTrue("splitStyledParagraphTest 1: p1 is incorrect after split", p1 && TextLayoutFormat.isEqual(p.format, p1.format) && p1.numChildren == 1);
+            assertTrue("splitStyledParagraphTest 1: p2 is incorrect after split", p2 && TextLayoutFormat.isEqual(p.format, p2.format) && p2.numChildren == 1);
+
+            s1 = p1.getChildAt(0) as SpanElement;
+            s2 = (p2.getChildAt(0) as FlowGroupElement).getChildAt(0) as SpanElement;
+
+            assertTrue("splitStyledParagraphTest 1: s1 is incorrect after split", s1 && TextLayoutFormat.isEqual(s.format, s1.format));
+            assertTrue("splitStyledParagraphTest 1: s2 is incorrect after split", s2 && TextLayoutFormat.isEqual(s.format, s2.format));
+
+            // END SPLIT AT BEGINNING TEST
+
+            // BEGIN SPLIT AT END TEST
+
+            // setup
+            tf.replaceChildren(0, tf.numChildren, p.deepCopy(0, p.textLength));
+            tf.flowComposer.updateAllControllers();
+
+            // split at end
+            SelManager.selectRange(tf.textLength - 1, tf.textLength - 1);
+            EditManager(SelManager).splitParagraph();
+
+            assertTrue("splitStyledParagraphTest 2: incorrect number of children after split", tf.numChildren == 2);
+            p1 = tf.getChildAt(0) as ParagraphElement;
+            p2 = tf.getChildAt(1) as ParagraphElement;
+
+            assertTrue("splitStyledParagraphTest 2: p1 is incorrect after split", p1 && TextLayoutFormat.isEqual(p.format, p1.format) && p1.numChildren == 1);
+            assertTrue("splitStyledParagraphTest 2: p2 is incorrect after split", p2 && TextLayoutFormat.isEqual(p.format, p2.format) && p2.numChildren == 1);
+
+            s1 = (p1.getChildAt(0) as FlowGroupElement).getChildAt(0) as SpanElement;
+            s2 = p2.getChildAt(0) as SpanElement;
+
+            assertTrue("splitStyledParagraphTest 2: s1 is incorrect after split", s1 && TextLayoutFormat.isEqual(s.format, s1.format));
+            assertTrue("splitStyledParagraphTest 2: s2 is incorrect after split", s2 && TextLayoutFormat.isEqual(s.format, s2.format));
+
+            // END SPLIT AT END TEST
+
+            // BEGIN SPLIT IN MIDDLE TEST
+
+            // setup
+            tf.replaceChildren(0, tf.numChildren, p.deepCopy(0, p.textLength));
+            tf.flowComposer.updateAllControllers();
+
+            // split at middle
+            SelManager.selectRange(2, 2);
+            EditManager(SelManager).splitParagraph();
+
+            assertTrue("splitStyledParagraphTest 3: incorrect number of children after split", tf.numChildren == 2);
+            p1 = tf.getChildAt(0) as ParagraphElement;
+            p2 = tf.getChildAt(1) as ParagraphElement;
+
+            assertTrue("splitStyledParagraphTest 3: p1 is incorrect after split", p1 && TextLayoutFormat.isEqual(p.format, p1.format) && p1.numChildren == 1);
+            assertTrue("splitStyledParagraphTest 3: p2 is incorrect after split", p2 && TextLayoutFormat.isEqual(p.format, p2.format) && p2.numChildren == 1);
+
+            s1 = (p1.getChildAt(0) as FlowGroupElement).getChildAt(0) as SpanElement;
+            s2 = (p2.getChildAt(0) as FlowGroupElement).getChildAt(0) as SpanElement;
+
+            assertTrue("splitStyledParagraphTest 3: s1 is incorrect after split", s1 && TextLayoutFormat.isEqual(s.format, s1.format));
+            assertTrue("splitStyledParagraphTest 3: s2 is incorrect after split", s2 && TextLayoutFormat.isEqual(s.format, s2.format));
+
+            // END SPLIT IN MIDDLE TEST
+        }
+
+        [Test]
+        public function splitStyledListItemTest():void
+        {
+            var tf:TextFlow = SelManager.textFlow;
+
+            var listFlow:TextFlow = TextConverter.importToFlow(listItemMarkup, TextConverter.TEXT_LAYOUT_FORMAT);
+            var list:ListElement = listFlow.getChildAt(0) as ListElement;
+
+            var s:SpanElement = list.getFirstLeaf() as SpanElement;
+            var p:ParagraphElement = s.parent as ParagraphElement;
+
+            // scratch objects
+            var p1:ParagraphElement;
+            var p2:ParagraphElement;
+            var s1:SpanElement;
+            var s2:SpanElement;
+            var listCopy:ListElement;
+
+
+            // BEGIN SPLIT AT BEGINNING TEST
+
+            // setup
+            listCopy = list.deepCopy(0, list.textLength) as ListElement;
+            tf.replaceChildren(0, tf.numChildren, listCopy);
+            tf.flowComposer.updateAllControllers();
+
+            // split at beginning
+            SelManager.selectRange(0, 0);
+            EditManager(SelManager).splitElement(listCopy.getChildAt(0) as FlowGroupElement);
+
+            assertTrue("splitStyledListItemTest 1: incorrect number of children after split", listCopy.numChildren == 2);
+            p1 = (listCopy.getChildAt(0) as FlowGroupElement).getChildAt(0) as ParagraphElement;
+            p2 = (listCopy.getChildAt(1) as FlowGroupElement).getChildAt(0) as ParagraphElement;
+
+            assertTrue("splitStyledListItemTest 1: p1 is incorrect after split", p1 && TextLayoutFormat.isEqual(p.format, p1.format) && p1.numChildren == 1);
+            assertTrue("splitStyledListItemTest 1: p2 is incorrect after split", p2 && TextLayoutFormat.isEqual(p.format, p2.format) && p2.numChildren == 1);
+
+            s1 = p1.getChildAt(0) as SpanElement;
+            s2 = p2.getChildAt(0) as SpanElement;
+
+            assertTrue("splitStyledListItemTest 1: s1 is incorrect after split", s1 && TextLayoutFormat.isEqual(s.format, s1.format));
+            assertTrue("splitStyledListItemTest 1: s2 is incorrect after split", s2 && TextLayoutFormat.isEqual(s.format, s2.format));
+
+            // END SPLIT AT BEGINNING TEST
+
+            // BEGIN SPLIT AT END TEST
+
+            // setup
+            listCopy = list.deepCopy(0, list.textLength) as ListElement;
+            tf.replaceChildren(0, tf.numChildren, listCopy);
+            tf.flowComposer.updateAllControllers();
+
+
+            // split at end
+            SelManager.selectRange(tf.textLength - 1, tf.textLength - 1);
+            EditManager(SelManager).splitElement(listCopy.getChildAt(0) as FlowGroupElement);
+
+            assertTrue("splitStyledListItemTest 2: incorrect number of children after split", listCopy.numChildren == 2);
+            p1 = (listCopy.getChildAt(0) as FlowGroupElement).getChildAt(0) as ParagraphElement;
+            p2 = (listCopy.getChildAt(1) as FlowGroupElement).getChildAt(0) as ParagraphElement;
+
+            assertTrue("splitStyledListItemTest 2: p1 is incorrect after split", p1 && TextLayoutFormat.isEqual(p.format, p1.format) && p1.numChildren == 1);
+            assertTrue("splitStyledListItemTest 2: p2 is incorrect after split", p2 && TextLayoutFormat.isEqual(p.format, p2.format) && p2.numChildren == 1);
+
+            s1 = p1.getChildAt(0) as SpanElement;
+            s2 = p2.getChildAt(0) as SpanElement;
+
+            assertTrue("splitStyledListItemTest 2: s1 is incorrect after split", s1 && TextLayoutFormat.isEqual(s.format, s1.format));
+            assertTrue("splitStyledListItemTest 2: s2 is incorrect after split", s2 && TextLayoutFormat.isEqual(s.format, s2.format));
+
+            // END SPLIT AT END TEST
+
+            // BEGIN SPLIT IN MIDDLE TEST
+
+            // setup
+            listCopy = list.deepCopy(0, list.textLength) as ListElement;
+            tf.replaceChildren(0, tf.numChildren, listCopy);
+            tf.flowComposer.updateAllControllers();
+
+            // split at middle
+            SelManager.selectRange(2, 2);
+            EditManager(SelManager).splitElement(listCopy.getChildAt(0) as FlowGroupElement);
+
+            assertTrue("splitStyledListItemTest 3: incorrect number of children after split", listCopy.numChildren == 2);
+            p1 = (listCopy.getChildAt(0) as FlowGroupElement).getChildAt(0) as ParagraphElement;
+            p2 = (listCopy.getChildAt(1) as FlowGroupElement).getChildAt(0) as ParagraphElement;
+
+            assertTrue("splitStyledListItemTest 3: p1 is incorrect after split", p1 && TextLayoutFormat.isEqual(p.format, p1.format) && p1.numChildren == 1);
+            assertTrue("splitStyledListItemTest 3: p2 is incorrect after split", p2 && TextLayoutFormat.isEqual(p.format, p2.format) && p2.numChildren == 1);
+
+            s1 = p1.getChildAt(0) as SpanElement;
+            s2 = p2.getChildAt(0) as SpanElement;
+
+            assertTrue("splitStyledListItemTest 3: s1 is incorrect after split", s1 && TextLayoutFormat.isEqual(s.format, s1.format));
+            assertTrue("splitStyledListItemTest 3: s2 is incorrect after split", s2 && TextLayoutFormat.isEqual(s.format, s2.format));
+
+            // END SPLIT IN MIDDLE TEST
+        }
+
+        [Test]
+        [Ignore]
+        public function spanElementReplaceTextInvalidPos():void
+        {
+            SelManager.selectAll();
+            SelManager.deleteText();
+
+            var paragraph:ParagraphElement = new ParagraphElement();
+            var span:SpanElement = new SpanElement;
+
+            span.text = "Does this text flow need to be composed?";
+            paragraph.addChild(span);
+            SelManager.textFlow.addChild(paragraph);
+            SelManager.textFlow.flowComposer.updateAllControllers();
+            span.replaceText(5, 9, "your");
+            if (SelManager.textFlow.flowComposer.getControllerAt(0).isDamaged())
+            {
+                span.text += " Yes it does.";
+            }
+
+            //try to replace text at start point <0, should return error
+            try
+            {
+                span.replaceText(-1, 2, "your");
+            } catch (e:Error)
+            {
+                assertTrue("replaceText should return error.", e.message == "Invalid positions passed to SpanElement.replaceText");
+            }
+            //try to replace text at end point > text Length, should return error
+            try
+            {
+                var len:int = SelManager.textFlow.textLength;
+                span.replaceText(5, len + 1, "your");
+            } catch (e:Error)
+            {
+                assertTrue("replaceText should return error.", e.message == "Invalid positions passed to SpanElement.replaceText");
+            }
+            //try to replace text when end point < start point, should return error
+            try
+            {
+                span.replaceText(5, 3, "your");
+            } catch (e:Error)
+            {
+                assertTrue("replaceText should return error.", e.message == "Invalid positions passed to SpanElement.replaceText");
+            }
+            SelManager.textFlow.flowComposer.updateAllControllers();
+        }
+
+        [Test]
+        public function copyErrorMassageTest():void
+        {
+            SelManager.selectAll();
+            SelManager.deleteText();
+
+            var p:ParagraphElement = new ParagraphElement();
+            var span1:SpanElement = new SpanElement();
+            var span2:SpanElement = new SpanElement();
+            span1.text = "1水z𝄞#####%23456789"; //character 水z𝄞 to make badSurrogatePairCopy error
+
+            try
+            {
+                span2 = span1.shallowCopy(7, 6) as SpanElement;
+            } catch (e:Error)
+            {
+                assertTrue("Invalid error message for badShallowCopyRange", e.message = "Bad range in shallowCopy");
+            }
+            try
+            {
+                span2 = span1.shallowCopy(2, 4) as SpanElement;
+            } catch (e:Error)
+            {
+                assertTrue("Invalid error message for badSurrogatePairCopy", e.message = "Copying only half of a surrogate pair in SpanElement.shallowCopy");
+            }
+            p.fontSize = 20;
+            p.addChild(span1);
+            p.addChild(span2);
+
+            SelManager.textFlow.addChild(p);
+            SelManager.textFlow.flowComposer.updateAllControllers();
+        }
+
+        [Test]
+        public function applyFormatToElementOperationFormatTest():void
+        {
+            var tf:TextFlow = SelManager.textFlow;
+            var styleName:String = "userStyleName";
+            var newStyleValue:String = "newUserStyleValue";
+            var format:TextLayoutFormat = new TextLayoutFormat();
+            format.fontSize = 10;
+            format.setStyle(styleName, newStyleValue);
+            var op:ApplyFormatToElementOperation = new ApplyFormatToElementOperation(SelManager.getSelectionState(), tf, format);
+            //test format setter
+            format.fontSize = 20;
+            op.format = format;
+            SelManager.doOperation(op);
+            //test format getter
+            assertTrue("format font size is not set correctly", op.format.fontSize == 20 &&
+                    tf.getStyle(styleName) == "newUserStyleValue");
+        }
+
+        [Test]
+        public function typeNameSetGetTest():void
+        {
+            var tf:TextFlow = SelManager.textFlow;
+            var newTypeName:String = "newTFTypeName1";
+
+            var op:ApplyElementTypeNameOperation = new ApplyElementTypeNameOperation(SelManager.getSelectionState(), tf, newTypeName);
+            op.typeName = "newTFTypeName2";
+            SelManager.doOperation(op);
+            assertTrue("ApplyElementTypeNameOperation doesn't set or get correct typeName", op.typeName == "newTFTypeName2");
+        }
+    }
+}


[8/9] git commit: [flex-tlf] [refs/heads/develop] - Add missing imports to AutomationCoreClasses

Posted by pi...@apache.org.
Add missing imports to AutomationCoreClasses


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

Branch: refs/heads/develop
Commit: 895152c0c5f2b82dd278cfe19c7db999f112c2fb
Parents: 7961f33
Author: piotrz <pi...@gmail.com>
Authored: Sun Oct 12 23:51:06 2014 +0200
Committer: piotrz <pi...@gmail.com>
Committed: Sun Oct 12 23:51:06 2014 +0200

----------------------------------------------------------------------
 automation_core/src/AutomationCoreClasses.as                   | 2 ++
 automation_core/src/UnitTest/ExtendedClasses/VellumTestCase.as | 1 -
 2 files changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/895152c0/automation_core/src/AutomationCoreClasses.as
----------------------------------------------------------------------
diff --git a/automation_core/src/AutomationCoreClasses.as b/automation_core/src/AutomationCoreClasses.as
index f2da5aa..c7a3faa 100644
--- a/automation_core/src/AutomationCoreClasses.as
+++ b/automation_core/src/AutomationCoreClasses.as
@@ -31,6 +31,8 @@ package
         import UnitTest.Validation.FlowElementMouseEventValidator; FlowElementMouseEventValidator;
         import UnitTest.Validation.EventValidator; EventValidator;
         import UnitTest.Validation.UpdateCompleteEventValidator; UpdateCompleteEventValidator;
+        import UnitTest.Fixtures.TestEditManager; TestEditManager;
+        import UnitTest.Fixtures.MeasureConstants; MeasureConstants;
 
 		/*import UnitTest.ExtendedClasses.TestDescriptor; TestDescriptor;
 		import UnitTest.ExtendedClasses.TestSuiteExtended; TestSuiteExtended;

http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/895152c0/automation_core/src/UnitTest/ExtendedClasses/VellumTestCase.as
----------------------------------------------------------------------
diff --git a/automation_core/src/UnitTest/ExtendedClasses/VellumTestCase.as b/automation_core/src/UnitTest/ExtendedClasses/VellumTestCase.as
index d15c275..d1fca70 100644
--- a/automation_core/src/UnitTest/ExtendedClasses/VellumTestCase.as
+++ b/automation_core/src/UnitTest/ExtendedClasses/VellumTestCase.as
@@ -34,7 +34,6 @@ package UnitTest.ExtendedClasses
     import flash.display.IBitmapDrawable;
     import flash.display.Sprite;
     import flash.utils.ByteArray;
-    import flash.utils.getTimer;
 
     import flashx.textLayout.container.ContainerController;
     import flashx.textLayout.container.ScrollPolicy;


[2/9] Add new tests to AllTestsSuite: BoundsAndAlignmentTest.as, EventOverrideTest.as - all tests marked as Ignore - Need fixes CrossContainerTest.as, ElementOperationTest.as - all works fine

Posted by pi...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-tlf/blob/c1059121/automation_tests/src/UnitTest/Tests/ElementOperationTests.as
----------------------------------------------------------------------
diff --git a/automation_tests/src/UnitTest/Tests/ElementOperationTests.as b/automation_tests/src/UnitTest/Tests/ElementOperationTests.as
deleted file mode 100644
index 5c3860d..0000000
--- a/automation_tests/src/UnitTest/Tests/ElementOperationTests.as
+++ /dev/null
@@ -1,1228 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  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.
-//
-////////////////////////////////////////////////////////////////////////////////
-package UnitTest.Tests
-{
-	import UnitTest.ExtendedClasses.TestDescriptor;
-	import UnitTest.ExtendedClasses.TestSuiteExtended;
-	import UnitTest.ExtendedClasses.VellumTestCase;
-	import UnitTest.Fixtures.TestConfig;
-	
-	import flash.text.engine.FontWeight;
-	
-	import flashx.textLayout.conversion.TextConverter;
-	import flashx.textLayout.edit.EditManager;
-	import flashx.textLayout.elements.DivElement;
-	import flashx.textLayout.elements.FlowGroupElement;
-	import flashx.textLayout.elements.LinkElement;
-	import flashx.textLayout.elements.ListElement;
-	import flashx.textLayout.elements.ParagraphElement;
-	import flashx.textLayout.elements.SpanElement;
-	import flashx.textLayout.elements.TextFlow;
-	import flashx.textLayout.formats.TextAlign;
-	import flashx.textLayout.formats.TextLayoutFormat;
-	import flashx.textLayout.operations.ApplyElementIDOperation;
-	import flashx.textLayout.operations.ApplyElementStyleNameOperation;
-	import flashx.textLayout.operations.ApplyElementTypeNameOperation;
-	import flashx.textLayout.operations.ApplyElementUserStyleOperation;
-	import flashx.textLayout.operations.ApplyFormatToElementOperation;
-
-    import org.flexunit.asserts.assertTrue;
-
-    public class ElementOperationTests extends VellumTestCase
-	{
-		public function ElementOperationTests(methodName:String, testID:String, testConfig:TestConfig, testXML:XML = null)
-		{
-			super(methodName, testID, testConfig);
-
-			// Note: These must correspond to a Watson product area (case-sensitive)
-			metaData.productArea = "Editing";
-		}
-
-		public static function suite(testConfig:TestConfig, ts:TestSuiteExtended):void
-		{
-			if (testConfig.writingDirection[0] == "tb" && testConfig.writingDirection[1] == "ltr")
-			{
-	   			ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "changeTextFlowIdTest", testConfig ) );
-	   			ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "changeFirstParagraphIdTest", testConfig ) );
-	   			ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "changePartialParagraphIdTest", testConfig ) );
-	   			ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "changePartialSpanIdTest", testConfig ) );
-	
-	   			ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "changeTextFlowStyleNameTest", testConfig ) );
-	   			ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "changeFirstParagraphStyleNameTest", testConfig ) );
-	   			ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "changePartialParagraphStyleNameTest", testConfig ) );
-	   			ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "changePartialSpanStyleNameTest", testConfig ) );
-				
-				ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "changeTextFlowTypeNameTest", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "changeFirstParagraphTypeNameTest", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "changePartialParagraphTypeNameTest", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "changePartialSpanTypeNameTest", testConfig ) );
-	
-	   			ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "changeTextFlowUserStyleTest", testConfig ) );
-	   			ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "changeFirstParagraphUserStyleTest", testConfig ) );
-	   			ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "changePartialParagraphUserStyleTest", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "changePartialSpanUserStyleTest", testConfig ) );
-	
-				ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "deleteAcrossDivBoundaryTest", testConfig ) );
-				
-				ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "splitStyledParagraphTest", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "BreaksSplitTest", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "splitStyledListItemTest", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "splitStyledAnchorTest", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "spanElementReplaceTextInvalidPos", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "copyErrorMassageTest", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "applyFormatToElementOperationFormatTest", testConfig ) );
-				ts.addTestDescriptor (new TestDescriptor (ElementOperationTests, "typeNameSetGetTest", testConfig ) );
-			}
-   		}
-
-		/**
-		 */
-		public function changeTextFlowIdTest():void
-		{
-			var tf:TextFlow = SelManager.textFlow;
-			var origId:String = tf.id;
-			var newId:String = "newTFId";
-
-			SelManager.doOperation(new ApplyElementIDOperation(SelManager.getSelectionState(),tf,newId));
-			assertTrue("changeTextFlowIdTest doOperation error", tf.id == newId);
-			SelManager.undo();
-			assertTrue("changeTextFlowIdTest undo error", tf.id == origId);
-			SelManager.redo();
-			assertTrue("changeTextFlowIdTest redo error", tf.id == newId);
-		}
-
-		/**
-		 */
-		public function changeFirstParagraphIdTest():void
-		{
-			var p:ParagraphElement = SelManager.textFlow.getChildAt(0) as ParagraphElement;
-			var origId:String = p.id;
-			var newId:String = "newParaId";
-
-			SelManager.doOperation(new ApplyElementIDOperation(SelManager.getSelectionState(),p,newId));
-			assertTrue("changeFirstParagraphIdTest doOperation error", p.id == newId);
-			SelManager.undo();
-			assertTrue("changeFirstParagraphIdTest undo error", p.id == origId);
-			SelManager.redo();
-			assertTrue("changeFirstParagraphIdTest redo error", p.id == newId);
-		}
-
-		/**
-		 */
-		public function changePartialParagraphIdTest():void
-		{
-			var tf:TextFlow = SelManager.textFlow;
-			var numParas:int = tf.numChildren;
-			var totalLength:int = tf.textLength;
-
-			var p:ParagraphElement = tf.getChildAt(0) as ParagraphElement;
-			var origId:String = p.id;
-			var origTextLength:int = p.textLength;
-			var newId:String = "newParaId";
-
-			// creates two new paragraphs
-			SelManager.doOperation(new ApplyElementIDOperation(SelManager.getSelectionState(),p,newId,10,20));
-			p = tf.findLeaf(11).getParagraph();	// prev para gets a terminator added
-			assertTrue("changePartialParagraphIdTest doOperation error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
-			assertTrue("changePartialParagraphIdTest doOperation error id", p.id == newId);
-			assertTrue("changePartialParagraphIdTest doOperation error numParas", tf.numChildren == numParas+2);
-			assertTrue("changePartialParagraphIdTest doOperation error totalLength", tf.textLength == totalLength+2);
-
-			SelManager.undo();
-			p = tf.findLeaf(10).getParagraph();
-			assertTrue("changePartialParagraphIdTest undo error", p.id == origId && p.textLength == origTextLength);
-			assertTrue("changePartialParagraphIdTest undo error numParas", tf.numChildren == numParas);
-			assertTrue("changePartialParagraphIdTest undo error totalLength", tf.textLength == totalLength);
-
-			SelManager.redo();
-			p = tf.findLeaf(11).getParagraph();
-			assertTrue("changePartialParagraphIdTest redo error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
-			assertTrue("changePartialParagraphIdTest redo error", p.id == newId);
-			assertTrue("changePartialParagraphIdTest redo error numParas", tf.numChildren == numParas+2);
-			assertTrue("changePartialParagraphIdTest redo error totalLength", tf.textLength == totalLength+2);
-		}
-
-		/**
-		 */
-		public function changePartialSpanIdTest():void
-		{
-			var tf:TextFlow = SelManager.textFlow;
-			var numParas:int = tf.numChildren;
-			var totalLength:int = tf.textLength;
-
-			var span:SpanElement = tf.getLastLeaf() as SpanElement;
-			assertTrue("changePartialSpanIdTest span is too short for the test",span.textLength > 20);
-			var spanStart:int = span.getAbsoluteStart();
-
-			var origId:String = span.id;
-			var origSpanLength:int = span.textLength;
-			var newId:String = "newSpanId";
-
-			// splits the span
-			SelManager.doOperation(new ApplyElementIDOperation(SelManager.getSelectionState(),span,newId,10,20));
-
-			span = tf.findLeaf(spanStart+10) as SpanElement;
-			assertTrue("changePartialSpanIdTest doOperation error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
-			assertTrue("changePartialSpanIdTest doOperation error id", span.id == newId);
-			assertTrue("changePartialSpanIdTest doOperation error totalLength", tf.textLength == totalLength);
-
-			SelManager.undo();
-			span = tf.findLeaf(spanStart) as SpanElement;
-			assertTrue("changePartialSpanIdTest undo error", span.id == origId && span.textLength == origSpanLength);
-			assertTrue("changePartialSpanIdTest undo error totalLength", tf.textLength == totalLength);
-
-			SelManager.redo();
-			span = tf.findLeaf(spanStart+10) as SpanElement;
-			assertTrue("changePartialSpanIdTest redo error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
-			assertTrue("changePartialSpanIdTest redo error", span.id == newId);
-			assertTrue("changePartialSpanIdTest redo error totalLength", tf.textLength == totalLength);
-		}
-
-		/**
-		 */
-		public function changeTextFlowStyleNameTest():void
-		{
-			var tf:TextFlow = SelManager.textFlow;
-			var origStyleName:String = tf.styleName;
-			var newStyleName:String = "newTFStyleName";
-
-			// ApplyElementStyleNameOperation is deprecated
-			SelManager.doOperation(new ApplyElementStyleNameOperation(SelManager.getSelectionState(),tf,newStyleName));
-			assertTrue("changeTextFlowStyleNameTest doOperation error", tf.styleName == newStyleName);
-			SelManager.undo();
-			assertTrue("changeTextFlowStyleNameTest undo error", tf.styleName == origStyleName);
-			SelManager.redo();
-			assertTrue("changeTextFlowStyleNameTest redo error", tf.styleName == newStyleName);
-			
-			SelManager.undo();
-			assertTrue("changeTextFlowStyleNameTest undo error", tf.styleName == origStyleName);
-			
-			// test using the replacement class
-			SelManager.doOperation(new ApplyFormatToElementOperation(SelManager.getSelectionState(),tf,TextLayoutFormat.createTextLayoutFormat({styleName:newStyleName})));
-			assertTrue("changeTextFlowStyleNameTest doOperation error", tf.styleName == newStyleName);
-			SelManager.undo();
-			assertTrue("changeTextFlowStyleNameTest undo error", tf.styleName == origStyleName);
-			SelManager.redo();
-			assertTrue("changeTextFlowStyleNameTest redo error", tf.styleName == newStyleName);
-
-		}
-
-		/**
-		 */
-		public function changeFirstParagraphStyleNameTest():void
-		{
-			var p:ParagraphElement = SelManager.textFlow.getChildAt(0) as ParagraphElement;
-			var origStyleName:String = p.styleName;
-			var newStyleName:String = "newParaStyleName";
-
-			// ApplyElementStyleNameOperation is deprecated
-			SelManager.doOperation(new ApplyElementStyleNameOperation(SelManager.getSelectionState(),p,newStyleName));
-			assertTrue("changeFirstParagraphStyleNameTest doOperation error", p.styleName == newStyleName);
-			SelManager.undo();
-			assertTrue("changeFirstParagraphStyleNameTest undo error", p.styleName == origStyleName);
-			SelManager.redo();
-			assertTrue("changeFirstParagraphStyleNameTest redo error", p.styleName == newStyleName);
-			
-			SelManager.undo();
-			assertTrue("changeFirstParagraphStyleNameTest undo error", p.styleName == origStyleName);
-
-			// test using the replacement class
-			SelManager.doOperation(new ApplyFormatToElementOperation(SelManager.getSelectionState(),p,TextLayoutFormat.createTextLayoutFormat({styleName:newStyleName})));
-			assertTrue("changeFirstParagraphStyleNameTest doOperation error", p.styleName == newStyleName);
-			SelManager.undo();
-			assertTrue("changeFirstParagraphStyleNameTest undo error", p.styleName == origStyleName);
-			SelManager.redo();
-			assertTrue("changeFirstParagraphStyleNameTest redo error", p.styleName == newStyleName);
-			
-		}
-		
-		/**
-		 */
-		public function changeTextFlowTypeNameTest():void
-		{
-			var tf:TextFlow = SelManager.textFlow;
-			var origTypeName:String = tf.typeName;
-			var newTypeName:String = "newTFTypeName";
-			
-			SelManager.doOperation(new ApplyElementTypeNameOperation(SelManager.getSelectionState(),tf,newTypeName));
-			assertTrue("changeTextFlowTypeNameTest doOperation error", tf.typeName == newTypeName);
-			SelManager.undo();
-			assertTrue("changeTextFlowTypeNameTest undo error", tf.typeName == origTypeName);
-			SelManager.redo();
-			assertTrue("changeTextFlowTypeNameTest redo error", tf.typeName == newTypeName);
-		}
-		
-		/**
-		 */
-		public function changeFirstParagraphTypeNameTest():void
-		{
-			var p:ParagraphElement = SelManager.textFlow.getChildAt(0) as ParagraphElement;
-			var origTypeName:String = p.typeName;
-			var newTypeName:String = "newParaTypeName";
-			
-			SelManager.doOperation(new ApplyElementTypeNameOperation(SelManager.getSelectionState(),p,newTypeName));
-			assertTrue("changeFirstParagraphTypeNameTest doOperation error", p.typeName == newTypeName);
-			SelManager.undo();
-			assertTrue("changeFirstParagraphTypeNameTest undo error", p.typeName == origTypeName);
-			SelManager.redo();
-			assertTrue("changeFirstParagraphTypeNameTest redo error", p.typeName == newTypeName);
-		}
-
-		/**
-		 */
-		public function changePartialParagraphStyleNameTest():void
-		{
-			var tf:TextFlow = SelManager.textFlow;
-			var numParas:int = tf.numChildren;
-			var totalLength:int = tf.textLength;
-
-			var p:ParagraphElement = tf.getChildAt(0) as ParagraphElement;
-			var origStyleName:String = p.styleName;
-			var origTextLength:int = p.textLength;
-			var newStyleName:String = "newParaStyleName";
-
-			// ApplyElementStyleNameOperation is deprecated
-			// creates two new paragraphs
-			SelManager.doOperation(new ApplyElementStyleNameOperation(SelManager.getSelectionState(),p,newStyleName,10,20));
-			p = tf.findLeaf(11).getParagraph();	// prev para gets a terminator added
-			assertTrue("changePartialParagraphStyleNameTest doOperation error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
-			assertTrue("changePartialParagraphStyleNameTest doOperation error", p.styleName == newStyleName);
-			assertTrue("changePartialParagraphStyleNameTest doOperation error numParas", tf.numChildren == numParas+2);
-			assertTrue("changePartialParagraphStyleNameTest doOperation error totalLength", tf.textLength == totalLength+2);
-
-			SelManager.undo();
-			p = tf.findLeaf(10).getParagraph();
-			assertTrue("changePartialParagraphStyleNameTest undo error", p.styleName == origStyleName && p.textLength == origTextLength);
-			assertTrue("changePartialParagraphStyleNameTest undo error numParas", tf.numChildren == numParas);
-			assertTrue("changePartialParagraphStyleNameTest undo error totalLength", tf.textLength == totalLength);
-
-			SelManager.redo();
-			p = tf.findLeaf(11).getParagraph();
-			assertTrue("changePartialParagraphStyleNameTest redo error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
-			assertTrue("changePartialParagraphStyleNameTest redo error", p.styleName == newStyleName);
-			assertTrue("changePartialParagraphStyleNameTest redo error numParas", tf.numChildren == numParas+2);
-			assertTrue("changePartialParagraphStyleNameTest redo error totalLength", tf.textLength == totalLength+2);
-
-			// cleanup
-			SelManager.undo();
-			p = tf.findLeaf(10).getParagraph();
-			assertTrue("changePartialParagraphStyleNameTest undo error", p.styleName == origStyleName && p.textLength == origTextLength);
-			assertTrue("changePartialParagraphStyleNameTest undo error numParas", tf.numChildren == numParas);
-			assertTrue("changePartialParagraphStyleNameTest undo error totalLength", tf.textLength == totalLength);
-
-			// test using the replacement class
-			// creates two new paragraphs
-			SelManager.doOperation(new ApplyFormatToElementOperation(SelManager.getSelectionState(),p,TextLayoutFormat.createTextLayoutFormat({styleName:newStyleName}),10,20));
-			p = tf.findLeaf(11).getParagraph();	// prev para gets a terminator added
-			assertTrue("changePartialParagraphStyleNameTest doOperation error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
-			assertTrue("changePartialParagraphStyleNameTest doOperation error", p.styleName == newStyleName);
-			assertTrue("changePartialParagraphStyleNameTest doOperation error numParas", tf.numChildren == numParas+2);
-			assertTrue("changePartialParagraphStyleNameTest doOperation error totalLength", tf.textLength == totalLength+2);
-			
-			SelManager.undo();
-			p = tf.findLeaf(10).getParagraph();
-			assertTrue("changePartialParagraphStyleNameTest undo error", p.styleName == origStyleName && p.textLength == origTextLength);
-			assertTrue("changePartialParagraphStyleNameTest undo error numParas", tf.numChildren == numParas);
-			assertTrue("changePartialParagraphStyleNameTest undo error totalLength", tf.textLength == totalLength);
-			
-			SelManager.redo();
-			p = tf.findLeaf(11).getParagraph();
-			assertTrue("changePartialParagraphStyleNameTest redo error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
-			assertTrue("changePartialParagraphStyleNameTest redo error", p.styleName == newStyleName);
-			assertTrue("changePartialParagraphStyleNameTest redo error numParas", tf.numChildren == numParas+2);
-			assertTrue("changePartialParagraphStyleNameTest redo error totalLength", tf.textLength == totalLength+2);
-
-		}
-
-		/**
-		 */
-		public function changePartialSpanStyleNameTest():void
-		{
-			var tf:TextFlow = SelManager.textFlow;
-			var numParas:int = tf.numChildren;
-			var totalLength:int = tf.textLength;
-
-			var span:SpanElement = tf.getLastLeaf() as SpanElement;
-			assertTrue("changePartialSpanStyleNameTest span is too short for the test",span.textLength > 20);
-			var spanStart:int = span.getAbsoluteStart();
-
-			var origStyleName:String = span.styleName;
-			var origSpanLength:int = span.textLength;
-			var newStyleName:String = "newSpanStyleName";
-
-			// ApplyElementStyleNameOperation is deprecated
-			// splits the span
-			SelManager.doOperation(new ApplyElementStyleNameOperation(SelManager.getSelectionState(),span,newStyleName,10,20));
-
-			span = tf.findLeaf(spanStart+10) as SpanElement;
-			assertTrue("changePartialSpanStyleNameTest doOperation error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
-			assertTrue("changePartialSpanStyleNameTest doOperation error id", span.styleName == newStyleName);
-			assertTrue("changePartialSpanStyleNameTest doOperation error totalLength", tf.textLength == totalLength);
-
-			SelManager.undo();
-			span = tf.findLeaf(spanStart) as SpanElement;
-			assertTrue("changePartialSpanStyleNameTest undo error", span.styleName == origStyleName && span.textLength == origSpanLength);
-			assertTrue("changePartialSpanStyleNameTest undo error totalLength", tf.textLength == totalLength);
-
-			SelManager.redo();
-			span = tf.findLeaf(spanStart+10) as SpanElement;
-			assertTrue("changePartialSpanStyleNameTest redo error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
-			assertTrue("changePartialSpanStyleNameTest redo error", span.styleName == newStyleName);
-			assertTrue("changePartialSpanStyleNameTest redo error totalLength", tf.textLength == totalLength);
-			
-			// cleanup
-			SelManager.undo();
-			span = tf.findLeaf(spanStart) as SpanElement;
-			assertTrue("changePartialSpanStyleNameTest undo error", span.styleName == origStyleName && span.textLength == origSpanLength);
-			assertTrue("changePartialSpanStyleNameTest undo error totalLength", tf.textLength == totalLength);
-
-			// test using the replacement function
-			
-			// splits the span
-			SelManager.doOperation(new ApplyFormatToElementOperation(SelManager.getSelectionState(),span,TextLayoutFormat.createTextLayoutFormat({styleName:newStyleName}),10,20));
-			
-			span = tf.findLeaf(spanStart+10) as SpanElement;
-			assertTrue("changePartialSpanStyleNameTest doOperation error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
-			assertTrue("changePartialSpanStyleNameTest doOperation error id", span.styleName == newStyleName);
-			assertTrue("changePartialSpanStyleNameTest doOperation error totalLength", tf.textLength == totalLength);
-			
-			SelManager.undo();
-			span = tf.findLeaf(spanStart) as SpanElement;
-			assertTrue("changePartialSpanStyleNameTest undo error", span.styleName == origStyleName && span.textLength == origSpanLength);
-			assertTrue("changePartialSpanStyleNameTest undo error totalLength", tf.textLength == totalLength);
-			
-			SelManager.redo();
-			span = tf.findLeaf(spanStart+10) as SpanElement;
-			assertTrue("changePartialSpanStyleNameTest redo error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
-			assertTrue("changePartialSpanStyleNameTest redo error", span.styleName == newStyleName);
-			assertTrue("changePartialSpanStyleNameTest redo error totalLength", tf.textLength == totalLength);
-		}
-
-		/**
-		 */
-		public function changePartialParagraphTypeNameTest():void
-		{
-			var tf:TextFlow = SelManager.textFlow;
-			var numParas:int = tf.numChildren;
-			var totalLength:int = tf.textLength;
-			
-			var p:ParagraphElement = tf.getChildAt(0) as ParagraphElement;
-			var origTypeName:String = p.typeName;
-			var origTextLength:int = p.textLength;
-			var newTypeName:String = "newParaTypeName";
-			
-			// creates two new paragraphs
-			SelManager.doOperation(new ApplyElementTypeNameOperation(SelManager.getSelectionState(),p,newTypeName,10,20));
-			p = tf.findLeaf(11).getParagraph();	// prev para gets a terminator added
-			assertTrue("changePartialParagraphTypeNameTest doOperation error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
-			assertTrue("changePartialParagraphTypeNameTest doOperation error", p.typeName == newTypeName);
-			assertTrue("changePartialParagraphTypeNameTest doOperation error numParas", tf.numChildren == numParas+2);
-			assertTrue("changePartialParagraphTypeNameTest doOperation error totalLength", tf.textLength == totalLength+2);
-			
-			SelManager.undo();
-			p = tf.findLeaf(10).getParagraph();
-			assertTrue("changePartialParagraphTypeNameTest undo error", p.typeName == origTypeName && p.textLength == origTextLength);
-			assertTrue("changePartialParagraphTypeNameTest undo error numParas", tf.numChildren == numParas);
-			assertTrue("changePartialParagraphTypeNameTest undo error totalLength", tf.textLength == totalLength);
-			
-			SelManager.redo();
-			p = tf.findLeaf(11).getParagraph();
-			assertTrue("changePartialParagraphTypeNameTest redo error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
-			assertTrue("changePartialParagraphTypeNameTest redo error", p.typeName == newTypeName);
-			assertTrue("changePartialParagraphTypeNameTest redo error numParas", tf.numChildren == numParas+2);
-			assertTrue("changePartialParagraphTypeNameTest redo error totalLength", tf.textLength == totalLength+2);
-		}
-		
-		/**
-		 */
-		public function changePartialSpanTypeNameTest():void
-		{
-			var tf:TextFlow = SelManager.textFlow;
-			var numParas:int = tf.numChildren;
-			var totalLength:int = tf.textLength;
-			
-			var span:SpanElement = tf.getLastLeaf() as SpanElement;
-			assertTrue("changePartialSpanTypeNameTest span is too short for the test",span.textLength > 20);
-			var spanStart:int = span.getAbsoluteStart();
-			
-			var origTypeName:String = span.typeName;
-			var origSpanLength:int = span.textLength;
-			var newTypeName:String = "newSpanTypeName";
-			
-			// splits the span
-			SelManager.doOperation(new ApplyElementTypeNameOperation(SelManager.getSelectionState(),span,newTypeName,10,20));
-			
-			span = tf.findLeaf(spanStart+10) as SpanElement;
-			assertTrue("changePartialSpanTypeNameTest doOperation error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
-			assertTrue("changePartialSpanTypeNameTest doOperation error id", span.typeName == newTypeName);
-			assertTrue("changePartialSpanTypeNameTest doOperation error totalLength", tf.textLength == totalLength);
-			
-			SelManager.undo();
-			span = tf.findLeaf(spanStart) as SpanElement;
-			assertTrue("changePartialSpanTypeNameTest undo error", span.typeName == origTypeName && span.textLength == origSpanLength);
-			assertTrue("changePartialSpanTypeNameTest undo error totalLength", tf.textLength == totalLength);
-			
-			SelManager.redo();
-			span = tf.findLeaf(spanStart+10) as SpanElement;
-			assertTrue("changePartialSpanTypeNameTest redo error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
-			assertTrue("changePartialSpanTypeNameTest redo error", span.typeName == newTypeName);
-			assertTrue("changePartialSpanTypeNameTest redo error totalLength", tf.textLength == totalLength);
-		}
-		
-		/**
-		 */
-		public function changeTextFlowUserStyleTest():void
-		{
-			var tf:TextFlow = SelManager.textFlow;
-			var styleName:String = "userStyleName";
-			var origStyleValue:* = tf.getStyle(styleName);
-			var newStyleValue:String = "newTFStyleValue";
-
-			// ApplyElementUserStyleOperation is deprecated
-			SelManager.doOperation(new ApplyElementUserStyleOperation(SelManager.getSelectionState(),tf,styleName,newStyleValue));
-			assertTrue("changeTextFlowUserStyleTest doOperation error", tf.getStyle(styleName) === newStyleValue);
-			SelManager.undo();
-			assertTrue("changeTextFlowUserStyleTest undo error", tf.getStyle(styleName) === origStyleValue);
-			SelManager.redo();
-			assertTrue("changeTextFlowUserStyleTest redo error", tf.getStyle(styleName) === newStyleValue);
-			
-			// cleanup
-			SelManager.undo();
-			assertTrue("changeTextFlowUserStyleTest undo error", tf.getStyle(styleName) === origStyleValue);
-
-			// test using the replacement class
-			var format:TextLayoutFormat = new TextLayoutFormat();
-			format.setStyle(styleName,newStyleValue);
-			SelManager.doOperation(new ApplyFormatToElementOperation(SelManager.getSelectionState(),tf,format));
-			assertTrue("changeTextFlowUserStyleTest doOperation error", tf.getStyle(styleName) === newStyleValue);
-			SelManager.undo();
-			assertTrue("changeTextFlowUserStyleTest undo error", tf.getStyle(styleName) === origStyleValue);
-			SelManager.redo();
-			assertTrue("changeTextFlowUserStyleTest redo error", tf.getStyle(styleName) === newStyleValue);
-		}
-
-		/**
-		 */
-		public function changeFirstParagraphUserStyleTest():void
-		{
-			var p:ParagraphElement = SelManager.textFlow.getChildAt(0) as ParagraphElement;
-			var styleName:String = "userStyleName";
-			var origStyleValue:* = p.getStyle(styleName);
-			var newStyleValue:String = "newParaStyleValue";
-
-			// ApplyElementUserStyleOperation is deprecated
-			SelManager.doOperation(new ApplyElementUserStyleOperation(SelManager.getSelectionState(),p,styleName,newStyleValue));
-			assertTrue("changeFirstParagraphUserStyleTest doOperation error", p.getStyle(styleName) === newStyleValue);
-			SelManager.undo();
-			assertTrue("changeFirstParagraphUserStyleTest undo error", p.getStyle(styleName) === origStyleValue);
-			SelManager.redo();
-			assertTrue("changeFirstParagraphUserStyleTest redo error", p.getStyle(styleName) === newStyleValue);
-			
-			// cleanup
-			SelManager.undo();
-			assertTrue("changeFirstParagraphUserStyleTest undo error", p.getStyle(styleName) === origStyleValue);
-			
-			// test using the replacement class
-			var format:TextLayoutFormat = new TextLayoutFormat();
-			format.setStyle(styleName,newStyleValue);
-			SelManager.doOperation(new ApplyFormatToElementOperation(SelManager.getSelectionState(),p,format));
-			assertTrue("changeFirstParagraphUserStyleTest doOperation error", p.getStyle(styleName) === newStyleValue);
-			SelManager.undo();
-			assertTrue("changeFirstParagraphUserStyleTest undo error", p.getStyle(styleName) === origStyleValue);
-			SelManager.redo();
-			assertTrue("changeFirstParagraphUserStyleTest redo error", p.getStyle(styleName) === newStyleValue);			
-		}
-		/**
-		 */
-		public function changePartialParagraphUserStyleTest():void
-		{
-			var tf:TextFlow = SelManager.textFlow;
-			var numParas:int = tf.numChildren;
-			var totalLength:int = tf.textLength;
-
-			var p:ParagraphElement = tf.getChildAt(0) as ParagraphElement;
-			var origTextLength:int = p.textLength;
-
-			var styleName:String = "userStyleName";
-			var origStyleValue:* = p.getStyle(styleName);
-			var newStyleValue:String = "newParaStyleValue";
-
-			// ApplyElementUserStyleOperation is deprecated
-			// creates two new paragraphs
-			SelManager.doOperation(new ApplyElementUserStyleOperation(SelManager.getSelectionState(),p,styleName,newStyleValue,10,20));
-			p = tf.findLeaf(11).getParagraph();	// prev para gets a terminator added
-			assertTrue("changePartialParagraphUserStyleTest doOperation error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
-			assertTrue("changePartialParagraphUserStyleTest doOperation error", p.getStyle(styleName) === newStyleValue);
-			assertTrue("changePartialParagraphUserStyleTest doOperation error numParas", tf.numChildren == numParas+2);
-			assertTrue("changePartialParagraphUserStyleTest doOperation error totalLength", tf.textLength == totalLength+2);
-
-			SelManager.undo();
-			p = tf.findLeaf(10).getParagraph();
-			assertTrue("changePartialParagraphUserStyleTest undo error", p.getStyle(styleName) === origStyleValue && p.textLength == origTextLength);
-			assertTrue("changePartialParagraphUserStyleTest undo error numParas", tf.numChildren == numParas);
-			assertTrue("changePartialParagraphUserStyleTest undo error totalLength", tf.textLength == totalLength);
-
-			SelManager.redo();
-			p = tf.findLeaf(11).getParagraph();
-			assertTrue("changePartialParagraphStyleNameTest redo error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
-			assertTrue("changePartialParagraphStyleNameTest redo error", p.getStyle(styleName) === newStyleValue);
-			assertTrue("changePartialParagraphStyleNameTest redo error numParas", tf.numChildren == numParas+2);
-			assertTrue("changePartialParagraphStyleNameTest redo error totalLength", tf.textLength == totalLength+2);
-			
-			// cleanup
-			SelManager.undo();
-			p = tf.findLeaf(10).getParagraph();
-			assertTrue("changePartialParagraphUserStyleTest undo error", p.getStyle(styleName) === origStyleValue && p.textLength == origTextLength);
-			assertTrue("changePartialParagraphUserStyleTest undo error numParas", tf.numChildren == numParas);
-			assertTrue("changePartialParagraphUserStyleTest undo error totalLength", tf.textLength == totalLength);
-
-			// test using the replacement class
-			var format:TextLayoutFormat = new TextLayoutFormat();
-			format.setStyle(styleName,newStyleValue);
-			SelManager.doOperation(new ApplyFormatToElementOperation(SelManager.getSelectionState(),p,format,10,20));
-			p = tf.findLeaf(11).getParagraph();	// prev para gets a terminator added
-			assertTrue("changePartialParagraphUserStyleTest doOperation error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
-			assertTrue("changePartialParagraphUserStyleTest doOperation error", p.getStyle(styleName) === newStyleValue);
-			assertTrue("changePartialParagraphUserStyleTest doOperation error numParas", tf.numChildren == numParas+2);
-			assertTrue("changePartialParagraphUserStyleTest doOperation error totalLength", tf.textLength == totalLength+2);
-			
-			SelManager.undo();
-			p = tf.findLeaf(10).getParagraph();
-			assertTrue("changePartialParagraphUserStyleTest undo error", p.getStyle(styleName) === origStyleValue && p.textLength == origTextLength);
-			assertTrue("changePartialParagraphUserStyleTest undo error numParas", tf.numChildren == numParas);
-			assertTrue("changePartialParagraphUserStyleTest undo error totalLength", tf.textLength == totalLength);
-			
-			SelManager.redo();
-			p = tf.findLeaf(11).getParagraph();
-			assertTrue("changePartialParagraphStyleNameTest redo error p wrong size", p.textLength == 11 && p.parentRelativeStart == 11);
-			assertTrue("changePartialParagraphStyleNameTest redo error", p.getStyle(styleName) === newStyleValue);
-			assertTrue("changePartialParagraphStyleNameTest redo error numParas", tf.numChildren == numParas+2);
-			assertTrue("changePartialParagraphStyleNameTest redo error totalLength", tf.textLength == totalLength+2);
-			
-		}
-
-		/**
-		 */
-		public function changePartialSpanUserStyleTest():void
-		{
-			var tf:TextFlow = SelManager.textFlow;
-			var numParas:int = tf.numChildren;
-			var totalLength:int = tf.textLength;
-
-			var span:SpanElement = tf.getLastLeaf() as SpanElement;
-			assertTrue("changePartialSpanStyleNameTest span is too short for the test",span.textLength > 20);
-			var spanStart:int = span.getAbsoluteStart();
-			var origSpanLength:int = span.textLength;
-
-			var styleName:String = "userStyleName";
-			var origStyleValue:* = span.getStyle(styleName);
-			var newStyleValue:String = "newSpanStyleValue";
-
-			// ApplyElementUserStyleOperation is deprecated
-			// splits the span
-			SelManager.doOperation(new ApplyElementUserStyleOperation(SelManager.getSelectionState(),span,styleName,newStyleValue,10,20));
-
-			span = tf.findLeaf(spanStart+10) as SpanElement;
-			assertTrue("changePartialSpanUserStyleTest doOperation error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
-			assertTrue("changePartialSpanUserStyleTest doOperation error", span.getStyle(styleName) === newStyleValue);
-			assertTrue("changePartialSpanUserStyleTest doOperation error totalLength", tf.textLength == totalLength);
-
-			SelManager.undo();
-			span = tf.findLeaf(spanStart) as SpanElement;
-			assertTrue("changePartialSpanUserStyleTest undo error", span.getStyle(styleName) === origStyleValue && span.textLength == origSpanLength);
-			assertTrue("changePartialSpanUserStyleTest undo error totalLength", tf.textLength == totalLength);
-
-			SelManager.redo();
-			span = tf.findLeaf(spanStart+10) as SpanElement;
-			assertTrue("changePartialSpanUserStyleTest redo error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
-			assertTrue("changePartialSpanUserStyleTest redo error", span.getStyle(styleName) === newStyleValue);
-			assertTrue("changePartialSpanUserStyleTest redo error totalLength", tf.textLength == totalLength);
-			
-			// cleanup
-			SelManager.undo();
-			span = tf.findLeaf(spanStart) as SpanElement;
-			assertTrue("changePartialSpanUserStyleTest undo error", span.getStyle(styleName) === origStyleValue && span.textLength == origSpanLength);
-			assertTrue("changePartialSpanUserStyleTest undo error totalLength", tf.textLength == totalLength);
-
-			// splits the span
-			var format:TextLayoutFormat = new TextLayoutFormat();
-			format.setStyle(styleName,newStyleValue);
-			SelManager.doOperation(new ApplyFormatToElementOperation(SelManager.getSelectionState(),span,format,10,20));
-			
-			span = tf.findLeaf(spanStart+10) as SpanElement;
-			assertTrue("changePartialSpanUserStyleTest doOperation error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
-			assertTrue("changePartialSpanUserStyleTest doOperation error", span.getStyle(styleName) === newStyleValue);
-			assertTrue("changePartialSpanUserStyleTest doOperation error totalLength", tf.textLength == totalLength);
-			
-			SelManager.undo();
-			span = tf.findLeaf(spanStart) as SpanElement;
-			assertTrue("changePartialSpanUserStyleTest undo error", span.getStyle(styleName) === origStyleValue && span.textLength == origSpanLength);
-			assertTrue("changePartialSpanUserStyleTest undo error totalLength", tf.textLength == totalLength);
-			
-			SelManager.redo();
-			span = tf.findLeaf(spanStart+10) as SpanElement;
-			assertTrue("changePartialSpanUserStyleTest redo error span wrong size", span.textLength == 10 && span.parentRelativeStart == 10);
-			assertTrue("changePartialSpanUserStyleTest redo error", span.getStyle(styleName) === newStyleValue);
-			assertTrue("changePartialSpanUserStyleTest redo error totalLength", tf.textLength == totalLength);			
-		}
-		
-		private static const divTestMarkup:String = "<TextFlow whiteSpaceCollapse='preserve' xmlns='http://ns.adobe.com/textLayout/2008'><div><p><span>asd</span></p></div><p><span>asd</span></p></TextFlow>";
-
-		/**
-		 */
-		public function deleteAcrossDivBoundaryTest():void
-		{
-			var tf:TextFlow = SelManager.textFlow;
-			var selectFlow:TextFlow = TextConverter.importToFlow(divTestMarkup,TextConverter.TEXT_LAYOUT_FORMAT);
-			
-			var div:DivElement = selectFlow.getChildAt(0) as DivElement;
-			var para:ParagraphElement = selectFlow.getChildAt(1) as ParagraphElement;
-			
-			// setup
-			tf.replaceChildren(0,tf.numChildren, div.deepCopy());
-			tf.replaceChildren(1,tf.numChildren, para.deepCopy());
-			tf.flowComposer.updateAllControllers();
-			
-			var lenBefore:int = tf.textLength;
-
-			SelManager.selectRange(3,4);
-			EditManager(SelManager).deleteText();
-			
-			assertTrue("length didn't change after delete across div boundary!", tf.textLength != lenBefore);
-			
-		}
-
-		/**
-		 */
-		//Test for bug#2948473, we will not copy the containerBreakAfter, containerBreakBefore
-		//columnBreakAfter, columnBreakBefore attribute to the new paragraph
-		public function BreaksSplitTest():void
-		{
-			var tf:TextFlow = SelManager.textFlow;
-			
-			// a simple styled paragraph - always copy
-			var p:ParagraphElement = new ParagraphElement();
-			p.textAlign = TextAlign.LEFT;
-			p.columnBreakAfter = 'always';
-			p.columnBreakBefore = 'always';
-			p.containerBreakAfter = 'always';
-			p.containerBreakBefore = 'always';
-			var s:SpanElement = new SpanElement();
-			s.fontWeight = FontWeight.BOLD;
-			s.text = "Hello";
-			p.addChild(s);
-			
-			// scratch objects
-			var p1:ParagraphElement;
-			var p2:ParagraphElement;
-			var s1:SpanElement;
-			var s2:SpanElement;
-			
-			
-			// BEGIN SPLIT AT BEGINNING TEST
-			
-			// setup
-			tf.replaceChildren(0,tf.numChildren,p.deepCopy(0,p.textLength));
-			tf.flowComposer.updateAllControllers();
-			
-			// split at beginning
-			SelManager.selectRange(0,0);
-			EditManager(SelManager).splitParagraph();
-			
-			assertTrue("BreaksSplitTest 1: incorrect number of children after split",tf.numChildren == 2);
-			p1 = tf.getChildAt(0) as ParagraphElement;
-			p2 = tf.getChildAt(1) as ParagraphElement;
-			
-			assertTrue("BreaksSplitTest 1: p1 is incorrect after split",p1 && TextLayoutFormat.isEqual(p.format,p1.format) && p1.numChildren == 1);
-			assertTrue("BreaksSplitTest 1: p2 is incorrect after split",p2 && !TextLayoutFormat.isEqual(p.format,p2.format) && p2.numChildren == 1 && 
-				p2.columnBreakAfter == undefined &&
-				p2.columnBreakBefore == undefined &&
-				p2.containerBreakAfter == undefined &&
-				p2.containerBreakBefore == undefined);
-			
-			s1 = p1.getChildAt(0) as SpanElement;
-			s2 = p2.getChildAt(0) as SpanElement;
-			
-			assertTrue("BreaksSplitTest 1: s1 is incorrect after split",s1 && TextLayoutFormat.isEqual(s.format,s1.format));
-			assertTrue("BreaksSplitTest 1: s2 is incorrect after split",s2 && TextLayoutFormat.isEqual(s.format,s2.format));
-			
-			// END SPLIT AT BEGINNING TEST
-			
-			// BEGIN SPLIT AT END TEST
-			
-			// setup
-			tf.replaceChildren(0,tf.numChildren,p.deepCopy(0,p.textLength));
-			tf.flowComposer.updateAllControllers();			
-			
-			// split at end
-			SelManager.selectRange(tf.textLength-1,tf.textLength-1);
-			EditManager(SelManager).splitParagraph();
-			
-			assertTrue("BreaksSplitTest 2: incorrect number of children after split",tf.numChildren == 2);
-			p1 = tf.getChildAt(0) as ParagraphElement;
-			p2 = tf.getChildAt(1) as ParagraphElement;
-			
-			assertTrue("BreaksSplitTest 2: p1 is incorrect after split",p1 && TextLayoutFormat.isEqual(p.format,p1.format) && p1.numChildren == 1);
-			assertTrue("BreaksSplitTest 2: p2 is incorrect after split",p2 && !TextLayoutFormat.isEqual(p.format,p2.format) && p2.numChildren == 1 &&
-				p2.columnBreakAfter == undefined &&
-				p2.columnBreakBefore == undefined &&
-				p2.containerBreakAfter == undefined &&
-				p2.containerBreakBefore == undefined);
-			
-			s1 = p1.getChildAt(0) as SpanElement;
-			s2 = p2.getChildAt(0) as SpanElement;
-			
-			assertTrue("BreaksSplitTest 2: s1 is incorrect after split",s1 && TextLayoutFormat.isEqual(s.format,s1.format));
-			assertTrue("BreaksSplitTest 2: s2 is incorrect after split",s2 && TextLayoutFormat.isEqual(s.format,s2.format));
-			
-			// END SPLIT AT END TEST
-			
-			// BEGIN SPLIT IN MIDDLE TEST
-			
-			// setup
-			tf.replaceChildren(0,tf.numChildren,p.deepCopy(0,p.textLength));
-			tf.flowComposer.updateAllControllers();			
-			
-			// split at middle
-			SelManager.selectRange(2,2);
-			EditManager(SelManager).splitParagraph();
-			
-			assertTrue("BreaksSplitTest 3: incorrect number of children after split",tf.numChildren == 2);
-			p1 = tf.getChildAt(0) as ParagraphElement;
-			p2 = tf.getChildAt(1) as ParagraphElement;
-			
-			assertTrue("BreaksSplitTest 3: p1 is incorrect after split",p1 && TextLayoutFormat.isEqual(p.format,p1.format) && p1.numChildren == 1);
-			assertTrue("BreaksSplitTest 3: p2 is incorrect after split",p2 && !TextLayoutFormat.isEqual(p.format,p2.format) && p2.numChildren == 1 &&
-				p2.columnBreakAfter == undefined &&
-				p2.columnBreakBefore == undefined &&
-				p2.containerBreakAfter == undefined &&
-				p2.containerBreakBefore == undefined);
-			
-			s1 = p1.getChildAt(0) as SpanElement;
-			s2 = p2.getChildAt(0) as SpanElement;
-			
-			assertTrue("BreaksSplitTest 3: s1 is incorrect after split",s1 && TextLayoutFormat.isEqual(s.format,s1.format));
-			assertTrue("BreaksSplitTest 3: s2 is incorrect after split",s2 && TextLayoutFormat.isEqual(s.format,s2.format));
-			
-			// END SPLIT IN MIDDLE TEST
-		}
-		/**
-		 */
-		public function splitStyledParagraphTest():void
-		{
-			var tf:TextFlow = SelManager.textFlow;
-			
-			// a simple styled paragraph - always copy
-			var p:ParagraphElement = new ParagraphElement();
-			p.textAlign = TextAlign.LEFT;
-			var s:SpanElement = new SpanElement();
-			s.fontWeight = FontWeight.BOLD;
-			s.text = "Hello";
-			p.addChild(s);
-			
-			// scratch objects
-			var p1:ParagraphElement;
-			var p2:ParagraphElement;
-			var s1:SpanElement;
-			var s2:SpanElement;
-			
-			
-			// BEGIN SPLIT AT BEGINNING TEST
-			
-			// setup
-			tf.replaceChildren(0,tf.numChildren,p.deepCopy(0,p.textLength));
-			tf.flowComposer.updateAllControllers();
-			
-			// split at beginning
-			SelManager.selectRange(0,0);
-			EditManager(SelManager).splitParagraph();
-			
-			assertTrue("splitStyledParagraphTest 1: incorrect number of children after split",tf.numChildren == 2);
-			p1 = tf.getChildAt(0) as ParagraphElement;
-			p2 = tf.getChildAt(1) as ParagraphElement;
-			
-			assertTrue("splitStyledParagraphTest 1: p1 is incorrect after split",p1 && TextLayoutFormat.isEqual(p.format,p1.format) && p1.numChildren == 1);
-			assertTrue("splitStyledParagraphTest 1: p2 is incorrect after split",p2 && TextLayoutFormat.isEqual(p.format,p2.format) && p2.numChildren == 1);
-			
-			s1 = p1.getChildAt(0) as SpanElement;
-			s2 = p2.getChildAt(0) as SpanElement;
-			
-			assertTrue("splitStyledParagraphTest 1: s1 is incorrect after split",s1 && TextLayoutFormat.isEqual(s.format,s1.format));
-			assertTrue("splitStyledParagraphTest 1: s2 is incorrect after split",s2 && TextLayoutFormat.isEqual(s.format,s2.format));
-			
-			// END SPLIT AT BEGINNING TEST
-			
-			// BEGIN SPLIT AT END TEST
-			
-			// setup
-			tf.replaceChildren(0,tf.numChildren,p.deepCopy(0,p.textLength));
-			tf.flowComposer.updateAllControllers();			
-
-			// split at end
-			SelManager.selectRange(tf.textLength-1,tf.textLength-1);
-			EditManager(SelManager).splitParagraph();
-
-			assertTrue("splitStyledParagraphTest 2: incorrect number of children after split",tf.numChildren == 2);
-			p1 = tf.getChildAt(0) as ParagraphElement;
-			p2 = tf.getChildAt(1) as ParagraphElement;
-			
-			assertTrue("splitStyledParagraphTest 2: p1 is incorrect after split",p1 && TextLayoutFormat.isEqual(p.format,p1.format) && p1.numChildren == 1);
-			assertTrue("splitStyledParagraphTest 2: p2 is incorrect after split",p2 && TextLayoutFormat.isEqual(p.format,p2.format) && p2.numChildren == 1);
-			
-			s1 = p1.getChildAt(0) as SpanElement;
-			s2 = p2.getChildAt(0) as SpanElement;
-			
-			assertTrue("splitStyledParagraphTest 2: s1 is incorrect after split",s1 && TextLayoutFormat.isEqual(s.format,s1.format));
-			assertTrue("splitStyledParagraphTest 2: s2 is incorrect after split",s2 && TextLayoutFormat.isEqual(s.format,s2.format));
-			
-			// END SPLIT AT END TEST
-			
-			// BEGIN SPLIT IN MIDDLE TEST
-			
-			// setup
-			tf.replaceChildren(0,tf.numChildren,p.deepCopy(0,p.textLength));
-			tf.flowComposer.updateAllControllers();			
-			
-			// split at middle
-			SelManager.selectRange(2,2);
-			EditManager(SelManager).splitParagraph();
-			
-			assertTrue("splitStyledParagraphTest 3: incorrect number of children after split",tf.numChildren == 2);
-			p1 = tf.getChildAt(0) as ParagraphElement;
-			p2 = tf.getChildAt(1) as ParagraphElement;
-			
-			assertTrue("splitStyledParagraphTest 3: p1 is incorrect after split",p1 && TextLayoutFormat.isEqual(p.format,p1.format) && p1.numChildren == 1);
-			assertTrue("splitStyledParagraphTest 3: p2 is incorrect after split",p2 && TextLayoutFormat.isEqual(p.format,p2.format) && p2.numChildren == 1);
-			
-			s1 = p1.getChildAt(0) as SpanElement;
-			s2 = p2.getChildAt(0) as SpanElement;
-			
-			assertTrue("splitStyledParagraphTest 3: s1 is incorrect after split",s1 && TextLayoutFormat.isEqual(s.format,s1.format));
-			assertTrue("splitStyledParagraphTest 3: s2 is incorrect after split",s2 && TextLayoutFormat.isEqual(s.format,s2.format));
-			
-			// END SPLIT IN MIDDLE TEST
-		}
-		
-		/**
-		 */
-		public function splitStyledAnchorTest():void
-		{
-			var tf:TextFlow = SelManager.textFlow;
-			
-			// a simple styled paragraph - always copy
-			var p:ParagraphElement = new ParagraphElement();
-			p.textAlign = TextAlign.LEFT;
-			var s:SpanElement = new SpanElement();
-			s.fontWeight = FontWeight.BOLD;
-			s.text = "Hello";
-			var a:LinkElement = new LinkElement();
-			a.fontSize = 18;
-			a.addChild(s);
-			p.addChild(a);
-			
-			// scratch objects
-			var p1:ParagraphElement;
-			var p2:ParagraphElement;
-			var s1:SpanElement;
-			var s2:SpanElement;
-			
-			
-			// BEGIN SPLIT AT BEGINNING TEST
-			
-			// setup
-			tf.replaceChildren(0,tf.numChildren,p.deepCopy(0,p.textLength));
-			tf.flowComposer.updateAllControllers();
-			
-			// split at beginning
-			SelManager.selectRange(0,0);
-			EditManager(SelManager).splitParagraph();
-			
-			assertTrue("splitStyledParagraphTest 1: incorrect number of children after split",tf.numChildren == 2);
-			p1 = tf.getChildAt(0) as ParagraphElement;
-			p2 = tf.getChildAt(1) as ParagraphElement;
-			
-			assertTrue("splitStyledParagraphTest 1: p1 is incorrect after split",p1 && TextLayoutFormat.isEqual(p.format,p1.format) && p1.numChildren == 1);
-			assertTrue("splitStyledParagraphTest 1: p2 is incorrect after split",p2 && TextLayoutFormat.isEqual(p.format,p2.format) && p2.numChildren == 1);
-			
-			s1 = p1.getChildAt(0) as SpanElement;
-			s2 = (p2.getChildAt(0) as FlowGroupElement).getChildAt(0) as SpanElement;
-			
-			assertTrue("splitStyledParagraphTest 1: s1 is incorrect after split",s1 && TextLayoutFormat.isEqual(s.format,s1.format));
-			assertTrue("splitStyledParagraphTest 1: s2 is incorrect after split",s2 && TextLayoutFormat.isEqual(s.format,s2.format));
-			
-			// END SPLIT AT BEGINNING TEST
-			
-			// BEGIN SPLIT AT END TEST
-			
-			// setup
-			tf.replaceChildren(0,tf.numChildren,p.deepCopy(0,p.textLength));
-			tf.flowComposer.updateAllControllers();			
-			
-			// split at end
-			SelManager.selectRange(tf.textLength-1,tf.textLength-1);
-			EditManager(SelManager).splitParagraph();
-			
-			assertTrue("splitStyledParagraphTest 2: incorrect number of children after split",tf.numChildren == 2);
-			p1 = tf.getChildAt(0) as ParagraphElement;
-			p2 = tf.getChildAt(1) as ParagraphElement;
-			
-			assertTrue("splitStyledParagraphTest 2: p1 is incorrect after split",p1 && TextLayoutFormat.isEqual(p.format,p1.format) && p1.numChildren == 1);
-			assertTrue("splitStyledParagraphTest 2: p2 is incorrect after split",p2 && TextLayoutFormat.isEqual(p.format,p2.format) && p2.numChildren == 1);
-			
-			s1 = (p1.getChildAt(0) as FlowGroupElement).getChildAt(0) as SpanElement;
-			s2 = p2.getChildAt(0) as SpanElement;
-			
-			assertTrue("splitStyledParagraphTest 2: s1 is incorrect after split",s1 && TextLayoutFormat.isEqual(s.format,s1.format));
-			assertTrue("splitStyledParagraphTest 2: s2 is incorrect after split",s2 && TextLayoutFormat.isEqual(s.format,s2.format));
-			
-			// END SPLIT AT END TEST
-			
-			// BEGIN SPLIT IN MIDDLE TEST
-			
-			// setup
-			tf.replaceChildren(0,tf.numChildren,p.deepCopy(0,p.textLength));
-			tf.flowComposer.updateAllControllers();			
-			
-			// split at middle
-			SelManager.selectRange(2,2);
-			EditManager(SelManager).splitParagraph();
-			
-			assertTrue("splitStyledParagraphTest 3: incorrect number of children after split",tf.numChildren == 2);
-			p1 = tf.getChildAt(0) as ParagraphElement;
-			p2 = tf.getChildAt(1) as ParagraphElement;
-			
-			assertTrue("splitStyledParagraphTest 3: p1 is incorrect after split",p1 && TextLayoutFormat.isEqual(p.format,p1.format) && p1.numChildren == 1);
-			assertTrue("splitStyledParagraphTest 3: p2 is incorrect after split",p2 && TextLayoutFormat.isEqual(p.format,p2.format) && p2.numChildren == 1);
-			
-			s1 = (p1.getChildAt(0) as FlowGroupElement).getChildAt(0) as SpanElement;
-			s2 = (p2.getChildAt(0) as FlowGroupElement).getChildAt(0) as SpanElement;
-
-			assertTrue("splitStyledParagraphTest 3: s1 is incorrect after split",s1 && TextLayoutFormat.isEqual(s.format,s1.format));
-			assertTrue("splitStyledParagraphTest 3: s2 is incorrect after split",s2 && TextLayoutFormat.isEqual(s.format,s2.format));
-			
-			// END SPLIT IN MIDDLE TEST
-		}
-		
-		private static const listItemMarkup:String = "<TextFlow xmlns='http://ns.adobe.com/textLayout/2008'><list listStylePosition='inside'><li><p textAlign='left'><span fontWeight='bold'>item</span></p></li></list></TextFlow>";
-		/**
-		 */
-		public function splitStyledListItemTest():void
-		{
-			var tf:TextFlow = SelManager.textFlow;
-			
-			var listFlow:TextFlow = TextConverter.importToFlow(listItemMarkup,TextConverter.TEXT_LAYOUT_FORMAT);
-			var list:ListElement = listFlow.getChildAt(0) as ListElement;
-			
-			var s:SpanElement = list.getFirstLeaf() as SpanElement;
-			var p:ParagraphElement = s.parent as ParagraphElement;
-			
-			// scratch objects
-			var p1:ParagraphElement;
-			var p2:ParagraphElement;
-			var s1:SpanElement;
-			var s2:SpanElement;
-			var listCopy:ListElement;
-			
-			
-			// BEGIN SPLIT AT BEGINNING TEST
-			
-			// setup
-			listCopy = list.deepCopy(0,list.textLength) as ListElement;
-			tf.replaceChildren(0,tf.numChildren,listCopy);
-			tf.flowComposer.updateAllControllers();
-			
-			// split at beginning
-			SelManager.selectRange(0,0);
-			EditManager(SelManager).splitElement(listCopy.getChildAt(0) as FlowGroupElement);
-			
-			assertTrue("splitStyledListItemTest 1: incorrect number of children after split",listCopy.numChildren == 2);
-			p1 = (listCopy.getChildAt(0) as FlowGroupElement).getChildAt(0) as ParagraphElement;
-			p2 = (listCopy.getChildAt(1) as FlowGroupElement).getChildAt(0) as ParagraphElement;
-			
-			assertTrue("splitStyledListItemTest 1: p1 is incorrect after split",p1 && TextLayoutFormat.isEqual(p.format,p1.format) && p1.numChildren == 1);
-			assertTrue("splitStyledListItemTest 1: p2 is incorrect after split",p2 && TextLayoutFormat.isEqual(p.format,p2.format) && p2.numChildren == 1);
-			
-			s1 = p1.getChildAt(0) as SpanElement;
-			s2 = p2.getChildAt(0) as SpanElement;
-			
-			assertTrue("splitStyledListItemTest 1: s1 is incorrect after split",s1 && TextLayoutFormat.isEqual(s.format,s1.format));
-			assertTrue("splitStyledListItemTest 1: s2 is incorrect after split",s2 && TextLayoutFormat.isEqual(s.format,s2.format));
-			
-			// END SPLIT AT BEGINNING TEST
-			
-			// BEGIN SPLIT AT END TEST
-			
-			// setup
-			listCopy = list.deepCopy(0,list.textLength) as ListElement;
-			tf.replaceChildren(0,tf.numChildren,listCopy);
-			tf.flowComposer.updateAllControllers();	
-			
-			
-			// split at end
-			SelManager.selectRange(tf.textLength-1,tf.textLength-1);
-			EditManager(SelManager).splitElement(listCopy.getChildAt(0) as FlowGroupElement);
-			
-			assertTrue("splitStyledListItemTest 2: incorrect number of children after split",listCopy.numChildren == 2);
-			p1 = (listCopy.getChildAt(0) as FlowGroupElement).getChildAt(0) as ParagraphElement;
-			p2 = (listCopy.getChildAt(1) as FlowGroupElement).getChildAt(0) as ParagraphElement;
-			
-			assertTrue("splitStyledListItemTest 2: p1 is incorrect after split",p1 && TextLayoutFormat.isEqual(p.format,p1.format) && p1.numChildren == 1);
-			assertTrue("splitStyledListItemTest 2: p2 is incorrect after split",p2 && TextLayoutFormat.isEqual(p.format,p2.format) && p2.numChildren == 1);
-			
-			s1 = p1.getChildAt(0) as SpanElement;
-			s2 = p2.getChildAt(0) as SpanElement;
-			
-			assertTrue("splitStyledListItemTest 2: s1 is incorrect after split",s1 && TextLayoutFormat.isEqual(s.format,s1.format));
-			assertTrue("splitStyledListItemTest 2: s2 is incorrect after split",s2 && TextLayoutFormat.isEqual(s.format,s2.format));
-			
-			// END SPLIT AT END TEST
-			
-			// BEGIN SPLIT IN MIDDLE TEST
-			
-			// setup
-			listCopy = list.deepCopy(0,list.textLength) as ListElement;
-			tf.replaceChildren(0,tf.numChildren,listCopy);
-			tf.flowComposer.updateAllControllers();			
-			
-			// split at middle
-			SelManager.selectRange(2,2);
-			EditManager(SelManager).splitElement(listCopy.getChildAt(0) as FlowGroupElement);
-			
-			assertTrue("splitStyledListItemTest 3: incorrect number of children after split",listCopy.numChildren == 2);
-			p1 = (listCopy.getChildAt(0) as FlowGroupElement).getChildAt(0) as ParagraphElement;
-			p2 = (listCopy.getChildAt(1) as FlowGroupElement).getChildAt(0) as ParagraphElement;
-			
-			assertTrue("splitStyledListItemTest 3: p1 is incorrect after split",p1 && TextLayoutFormat.isEqual(p.format,p1.format) && p1.numChildren == 1);
-			assertTrue("splitStyledListItemTest 3: p2 is incorrect after split",p2 && TextLayoutFormat.isEqual(p.format,p2.format) && p2.numChildren == 1);
-			
-			s1 = p1.getChildAt(0) as SpanElement;
-			s2 = p2.getChildAt(0) as SpanElement;
-			
-			assertTrue("splitStyledListItemTest 3: s1 is incorrect after split",s1 && TextLayoutFormat.isEqual(s.format,s1.format));
-			assertTrue("splitStyledListItemTest 3: s2 is incorrect after split",s2 && TextLayoutFormat.isEqual(s.format,s2.format));
-			
-			// END SPLIT IN MIDDLE TEST
-		}
-		
-		public function spanElementReplaceTextInvalidPos():void
-		{
-			SelManager.selectAll();
-			SelManager.deleteText();
-			
-			var paragraph:ParagraphElement = new ParagraphElement();
-			var span:SpanElement = new SpanElement;
-			
-			span.text = "Does this text flow need to be composed?";
-			paragraph.addChild(span);
-			SelManager.textFlow.addChild(paragraph);         	
-			SelManager.textFlow.flowComposer.updateAllControllers();
-			span.replaceText(5, 9, "your");
-			if(SelManager.textFlow.flowComposer.getControllerAt(0).isDamaged())
-			{
-				span.text += " Yes it does.";
-			}
-		
-			//try to replace text at start point <0, should return error
-			try
-			{
-				span.replaceText(-1, 2, "your");
-			} catch(e:Error)
-			{
-				assertTrue ("replaceText should return error.", e.message == "Invalid positions passed to SpanElement.replaceText");
-			}
-			//try to replace text at end point > text Length, should return error
-			try
-			{
-				var len:int = SelManager.textFlow.textLength;
-				span.replaceText(5, len + 1, "your");
-			} catch(e:Error)
-			{
-				assertTrue ("replaceText should return error.", e.message == "Invalid positions passed to SpanElement.replaceText");
-			}
-			//try to replace text when end point < start point, should return error
-			try
-			{
-				span.replaceText(5, 3, "your");
-			} catch(e:Error)
-			{
-				assertTrue ("replaceText should return error.", e.message == "Invalid positions passed to SpanElement.replaceText");
-			}
-			SelManager.textFlow.flowComposer.updateAllControllers();   
-		}
-		
-		public function copyErrorMassageTest():void
-		{
-			SelManager.selectAll();
-			SelManager.deleteText();
-			
-			var p:ParagraphElement = new ParagraphElement();
-			var span1:SpanElement = new SpanElement();
-			var span2:SpanElement = new SpanElement();
-			span1.text = "1水z𝄞#####%23456789"; //character 水z𝄞 to make badSurrogatePairCopy error
-			
-			try{
-				span2 = span1.shallowCopy(7, 6) as SpanElement;
-			}catch (e:Error)
-			{
-				assertTrue("Invalid error message for badShallowCopyRange", e.message = "Bad range in shallowCopy");
-			}
-			try{
-				span2 = span1.shallowCopy(2, 4) as SpanElement;
-			}catch (e:Error)
-			{
-				assertTrue("Invalid error message for badSurrogatePairCopy", e.message = "Copying only half of a surrogate pair in SpanElement.shallowCopy");
-			}
-			p.fontSize = 20;
-			p.addChild(span1);
-			p.addChild(span2);
-		
-			SelManager.textFlow.addChild(p);
-			SelManager.textFlow.flowComposer.updateAllControllers();   
-		}
-		
-		public function applyFormatToElementOperationFormatTest():void
-		{
-			var tf:TextFlow = SelManager.textFlow;
-			var styleName:String = "userStyleName";
-			var newStyleValue:String = "newUserStyleValue";
-			var format:TextLayoutFormat = new TextLayoutFormat();
-			format.fontSize = 10;
-			format.setStyle(styleName,newStyleValue);
-			var op:ApplyFormatToElementOperation = new ApplyFormatToElementOperation(SelManager.getSelectionState(),tf,format);
-			//test format setter
-			format.fontSize = 20;
-			op.format = format;
-			SelManager.doOperation(op);
-			//test format getter
-			assertTrue("format font size is not set correctly", op.format.fontSize == 20 &&
-			           tf.getStyle(styleName) == "newUserStyleValue" );
-		}
-		
-		public function typeNameSetGetTest():void
-		{
-			var tf:TextFlow = SelManager.textFlow;
-			var newTypeName:String = "newTFTypeName1";
-			
-			var op:ApplyElementTypeNameOperation = new ApplyElementTypeNameOperation(SelManager.getSelectionState(),tf,newTypeName);
-			op.typeName = "newTFTypeName2";
-			SelManager.doOperation(op);
-			assertTrue("ApplyElementTypeNameOperation doesn't set or get correct typeName", op.typeName == "newTFTypeName2");
-		}
-	}
-}