Add WritingModeTest, UndoRedoTest, TextFlowEditTest
Remove unused variable from TestDescriptorRunner
diff --git a/automation_apps/src/UnitTest/TestDescriptorRunner.mxml b/automation_apps/src/UnitTest/TestDescriptorRunner.mxml
index c9edada..d1eb0c4 100644
--- a/automation_apps/src/UnitTest/TestDescriptorRunner.mxml
+++ b/automation_apps/src/UnitTest/TestDescriptorRunner.mxml
@@ -26,9 +26,8 @@
private var core:FlexUnitCore;
- public function startTest(isMinimalTests:Boolean = false):void
+ public function startTest():void
{
-
core = new FlexUnitCore();
core.addUncaughtErrorListener( systemManager.loaderInfo );
core.addListener(new RunListener());
diff --git a/automation_tests/src/AllTestsSuite.as b/automation_tests/src/AllTestsSuite.as
index e7f603d..641c924 100644
--- a/automation_tests/src/AllTestsSuite.as
+++ b/automation_tests/src/AllTestsSuite.as
@@ -39,6 +39,9 @@
import UnitTest.Tests.GeneralFunctionsTest;
import UnitTest.Tests.OperationTest;
import UnitTest.Tests.ScrollingTest;
+ import UnitTest.Tests.TextFlowEditTest;
+ import UnitTest.Tests.UndoRedoTest;
+ import UnitTest.Tests.WritingModeTest;
[Suite]
[RunWith("org.flexunit.runners.Suite")]
@@ -64,6 +67,9 @@
public var eventOverrideTest:EventOverrideTest;
public var flowModelTest:FlowModelTest;
public var generalFunctionsTest:GeneralFunctionsTest;
+ public var writingModeTest:WritingModeTest;
+ public var undoRedoTest:UndoRedoTest;
+ public var textFlowEditTest:TextFlowEditTest;
}
}
diff --git a/automation_tests/src/UnitTest/Tests/TextFlowEditTest.as b/automation_tests/src/UnitTest/Tests/TextFlowEditTest.as
index 53f508c..f56746d 100644
--- a/automation_tests/src/UnitTest/Tests/TextFlowEditTest.as
+++ b/automation_tests/src/UnitTest/Tests/TextFlowEditTest.as
@@ -18,155 +18,170 @@
////////////////////////////////////////////////////////////////////////////////
package UnitTest.Tests
{
- import UnitTest.ExtendedClasses.TestDescriptor;
- import UnitTest.ExtendedClasses.TestSuiteExtended;
- import UnitTest.ExtendedClasses.VellumTestCase;
- import UnitTest.Fixtures.TestConfig;
+ import UnitTest.ExtendedClasses.VellumTestCase;
+ import UnitTest.Fixtures.TestConfig;
- import flash.events.*;
+ import flashx.textLayout.edit.*;
+ import flashx.textLayout.elements.FlowElement;
+ import flashx.textLayout.elements.FlowGroupElement;
+ import flashx.textLayout.elements.InlineGraphicElement;
+ import flashx.textLayout.elements.ParagraphElement;
- import flashx.textLayout.*;
- import flashx.textLayout.edit.*;
- import flashx.textLayout.elements.FlowElement;
- import flashx.textLayout.elements.FlowGroupElement;
- import flashx.textLayout.elements.InlineGraphicElement;
- import flashx.textLayout.elements.ParagraphElement;
-
- import mx.utils.LoaderUtil;
+ import mx.utils.LoaderUtil;
import org.flexunit.asserts.assertTrue;
public class TextFlowEditTest extends VellumTestCase
- {
- public function TextFlowEditTest(methodName:String, testID:String, testConfig:TestConfig, testXML:XML = null)
- {
- super(methodName, testID, testConfig);
+ {
+ public function TextFlowEditTest()
+ {
+ super("", "TextFlowEditTest", TestConfig.getInstance())
- // Note: These must correspond to a Watson product area (case-sensitive)
- metaData.productArea = "Editing";
- }
+ metaData = {};
+ // Note: These must correspond to a Watson product area (case-sensitive)
+ metaData.productArea = "Editing";
+ }
- public static function suite(testConfig:TestConfig, ts:TestSuiteExtended):void
- {
- ts.addTestDescriptor (new TestDescriptor (TextFlowEditTest, "simulateClipboardTest", testConfig ) ); //HBS
- ts.addTestDescriptor (new TestDescriptor (TextFlowEditTest, "addChildTest", testConfig ) );
- ts.addTestDescriptor (new TestDescriptor (TextFlowEditTest, "removeChildTest", testConfig ) );
- }
+ [Before]
+ override public function setUpTest():void
+ {
+ super.setUpTest();
+ }
- // Returns the string from begIdx through and including endIdx
- private function getText( begIdx:int, endIdx:int ): String
- {
- var outString:String = "";
+ [After]
+ override public function tearDownTest():void
+ {
+ super.tearDownTest();
+ }
- for ( var x:int = begIdx; x < endIdx; x++ )
- {
- outString += SelManager.textFlow.getCharAtPosition(x);
- }
+ [Test]
+ /**
+ * Tests FlowGroupElement's addChild and addChildAt on TextFlow
+ */
+ public function addChildTest():void
+ {
+ var origLength:int = SelManager.textFlow.textLength;
+ var firstPara:FlowElement = SelManager.textFlow.getChildAt(0).deepCopy();
- return outString;
- }
+ // Test addChild
+ SelManager.textFlow.removeChildAt(0);
+ var flowLength:int = SelManager.textFlow.textLength;
+ var tempPara:FlowElement = SelManager.textFlow.getChildAt(0).deepCopy();
+ SelManager.textFlow.addChild(tempPara);
+ flowLength *= 2;
+ assertTrue("addChild failed on textFlow",
+ flowLength == SelManager.textFlow.textLength);
- // Tests FlowGroupElement's addChild and addChildAt on TextFlow
- public function addChildTest():void
- {
- var origLength:int = SelManager.textFlow.textLength;
- var firstPara:FlowElement = SelManager.textFlow.getChildAt(0).deepCopy();
+ // Try to add an already added element this should simply replace it
+ SelManager.textFlow.addChild(tempPara);
+ assertTrue("readdChild failed on textFlow",
+ flowLength == SelManager.textFlow.textLength && tempPara.parent == SelManager.textFlow && tempPara == SelManager.textFlow.getChildAt(SelManager.textFlow.numChildren - 1));
- // Test addChild
- SelManager.textFlow.removeChildAt(0);
- var flowLength:int = SelManager.textFlow.textLength;
- var tempPara:FlowElement = SelManager.textFlow.getChildAt(0).deepCopy();
- SelManager.textFlow.addChild(tempPara);
- flowLength *= 2;
- assertTrue( "addChild failed on textFlow",
- flowLength == SelManager.textFlow.textLength );
+ // Test addChildAt
+ SelManager.textFlow.addChildAt(1, firstPara);
+ SelManager.textFlow.removeChildAt(2);
+ assertTrue("addChildAt failed on textFlow",
+ origLength == SelManager.textFlow.textLength);
+ assertTrue("addChildAt failed to place child at correct position",
+ getText(0, 7) == "The man");
+ }
- // Try to add an already added element this should simply replace it
- SelManager.textFlow.addChild(tempPara);
- assertTrue( "readdChild failed on textFlow",
- flowLength == SelManager.textFlow.textLength && tempPara.parent == SelManager.textFlow && tempPara == SelManager.textFlow.getChildAt(SelManager.textFlow.numChildren-1));
+ [Test]
+ /**
+ * Tests FlowGroupElement's removeChild and removeChildAt on TextFlow
+ */
+ public function removeChildTest():void
+ {
+ SelManager.textFlow.removeChildAt(0);
+ assertTrue("Removing first child paragraph failed",
+ SelManager.textFlow.getChildAt(1) == null);
- // Test addChildAt
- SelManager.textFlow.addChildAt(1,firstPara);
- SelManager.textFlow.removeChildAt(2);
- assertTrue( "addChildAt failed on textFlow",
- origLength == SelManager.textFlow.textLength );
- assertTrue ( "addChildAt failed to place child at correct position",
- getText(0,7) == "The man" );
- }
+ SelManager.selectRange(25, 25);
+ SelManager.insertInlineGraphic(LoaderUtil.createAbsoluteURL(baseURL, "../../test/testFiles/assets/gremlin.jpg"), 20, 20);
- // Tests FlowGroupElement's removeChild and removeChildAt on TextFlow
- public function removeChildTest():void
- {
- SelManager.textFlow.removeChildAt(0);
- assertTrue( "Removing first child paragraph failed",
- SelManager.textFlow.getChildAt(1) == null );
+ var paraElem:FlowGroupElement = SelManager.textFlow.getChildAt(0) as ParagraphElement;
+ var imgElem:FlowElement = paraElem.getChildAt(paraElem.findChildIndexAtPosition(25));
+ assertTrue("Expected InlineImageElement not found", imgElem is InlineGraphicElement);
+ paraElem.removeChild(imgElem);
- SelManager.selectRange(25,25);
- SelManager.insertInlineGraphic(LoaderUtil.createAbsoluteURL(baseURL,"../../test/testFiles/assets/gremlin.jpg"), 20, 20 );
+ assertTrue("FlowGroupElement method removeChild failed to remove InlineGraphic",
+ !(paraElem.getChildAt(
+ paraElem.findChildIndexAtPosition(25))
+ is InlineGraphicElement))
- var paraElem:FlowGroupElement = SelManager.textFlow.getChildAt(0) as ParagraphElement;
- var imgElem:FlowElement = paraElem.getChildAt(paraElem.findChildIndexAtPosition(25));
- assertTrue("Expected InlineImageElement not found", imgElem is InlineGraphicElement );
- paraElem.removeChild(imgElem);
+ // Try to remove an element that isn't here
+ var gotError:Boolean = false;
+ try
+ {
+ SelManager.textFlow.removeChild(imgElem);
+ }
+ catch (e:ArgumentError)
+ {
+ gotError = true;
+ }
- assertTrue("FlowGroupElement method removeChild failed to remove InlineGraphic",
- !(paraElem.getChildAt(
- paraElem.findChildIndexAtPosition(25))
- is InlineGraphicElement) )
+ assertTrue("Removing invalid child element failed to throw error",
+ gotError);
+ }
- // Try to remove an element that isn't here
- var gotError:Boolean = false;
- try
- {
- SelManager.textFlow.removeChild(imgElem);
- }
- catch ( e:ArgumentError )
- {
- gotError = true;
- }
+ [Test]
+ /**
+ * Selects the characters between the 10th and 50th characters and does a cut. It then
+ * does an undo, redo, and another undo of the cut operation.
+ * Verifies that there is the correct amount of characters on the clipboard after the cut operation.
+ * Verifies that the correct amount of characters are left in the document after the cut operation.
+ * Verifies that the correct amount of characters are left in the doucment after undoing the cut operation.
+ * Verifies that the correct amount of characters are left in the document after redoing the cut operation.
+ * Verifies that the correct amount of characters are left in the document after re-undoing the cut operation.
+ */
+ public function simulateClipboardTest():void //HBS
+ {
+ var startIndx:int = 10;
+ var endIndx:int = 50;
- assertTrue( "Removing invalid child element failed to throw error",
- gotError );
- }
+ SelManager.selectRange(startIndx, endIndx);
+ var initLength:uint = SelManager.textFlow.textLength;
+ var peudoClipboard:TextScrap = SelManager.cutTextScrap();
+ var endLength:uint = SelManager.textFlow.textLength;
+ assertTrue("Text length is incorrect after a cut operation", endLength == initLength - (endIndx - startIndx));
- /**
- * Selects the characters between the 10th and 50th characters and does a cut. It then
- * does an undo, redo, and another undo of the cut operation.
- * Verifies that there is the correct amount of characters on the clipboard after the cut operation.
- * Verifies that the correct amount of characters are left in the document after the cut operation.
- * Verifies that the correct amount of characters are left in the doucment after undoing the cut operation.
- * Verifies that the correct amount of characters are left in the document after redoing the cut operation.
- * Verifies that the correct amount of characters are left in the document after re-undoing the cut operation.
- */
- public function simulateClipboardTest():void //HBS
- {
- var startIndx:int = 10;
- var endIndx:int = 50;
+ SelManager.undo();
+ var afterUndoLength:uint = SelManager.textFlow.textLength;
+ assertTrue("Text length is incorrect after undoing a cut operation", afterUndoLength == initLength);
- SelManager.selectRange(startIndx,endIndx);
- var initLength:uint = SelManager.textFlow.textLength;
- var peudoClipboard:TextScrap = SelManager.cutTextScrap();
- var endLength:uint = SelManager.textFlow.textLength;
- assertTrue("Text length is incorrect after a cut operation", endLength == initLength - (endIndx - startIndx) );
+ //everything is ok so far if we get down here. Now, redo the undo operation and
+ //make suer the flow goes back to the endLength
- SelManager.undo();
- var afterUndoLength:uint = SelManager.textFlow.textLength;
- assertTrue("Text length is incorrect after undoing a cut operation", afterUndoLength == initLength);
+ SelManager.redo();
+ var afterRedoLength:uint = SelManager.textFlow.textLength;
+ assertTrue("Text length is incorrect after redoing a cut operation", afterRedoLength == endLength);
- //everything is ok so far if we get down here. Now, redo the undo operation and
- //make suer the flow goes back to the endLength
+ //everything is ok so far if we get down here. Now, do an undo again to get
+ //the doc back to it's original state so that we can go on with tests.
- SelManager.redo();
- var afterRedoLength:uint = SelManager.textFlow.textLength;
- assertTrue("Text length is incorrect after redoing a cut operation", afterRedoLength == endLength);
+ SelManager.undo();
+ afterUndoLength = SelManager.textFlow.textLength;
+ assertTrue("Text length is incorrect after undoing a cut operation", afterUndoLength == initLength);
+ }
- //everything is ok so far if we get down here. Now, do an undo again to get
- //the doc back to it's original state so that we can go on with tests.
- SelManager.undo();
- afterUndoLength = SelManager.textFlow.textLength;
- assertTrue("Text length is incorrect after undoing a cut operation", afterUndoLength == initLength);
- }
- }
+ /**
+ * Returns the string from begIdx through and including endIdx
+ *
+ * @param begIdx
+ * @param endIdx
+ * @return
+ */
+ 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;
+ }
+ }
}
diff --git a/automation_tests/src/UnitTest/Tests/UndoRedoTest.as b/automation_tests/src/UnitTest/Tests/UndoRedoTest.as
index b0bfcee..54ac062 100644
--- a/automation_tests/src/UnitTest/Tests/UndoRedoTest.as
+++ b/automation_tests/src/UnitTest/Tests/UndoRedoTest.as
@@ -18,88 +18,87 @@
////////////////////////////////////////////////////////////////////////////////
package UnitTest.Tests
{
- import UnitTest.ExtendedClasses.VellumTestCase;
- import UnitTest.Fixtures.TestEditManager;
- import UnitTest.Fixtures.TestConfig;
- import UnitTest.ExtendedClasses.TestSuiteExtended;
+ import UnitTest.ExtendedClasses.TestSuiteExtended;
+ import UnitTest.ExtendedClasses.VellumTestCase;
+ import UnitTest.Fixtures.TestConfig;
+ import UnitTest.Fixtures.TestEditManager;
- import flash.display.Sprite;
- import flashx.textLayout.container.ContainerController;
- import flashx.textLayout.conversion.ConversionType;
- import flashx.textLayout.conversion.TextConverter;
- import flashx.textLayout.edit.IEditManager;
- import flashx.textLayout.edit.EditManager;
- import flashx.textLayout.elements.TextFlow;
- import flashx.undo.IUndoManager;
- import flashx.undo.UndoManager;
- import flashx.textLayout.operations.ApplyLinkOperation;
-
- import flashx.textLayout.tlf_internal;
+ import flash.display.Sprite;
+
+ import flashx.textLayout.container.ContainerController;
+ import flashx.textLayout.conversion.TextConverter;
+ import flashx.textLayout.elements.TextFlow;
+ import flashx.textLayout.operations.ApplyLinkOperation;
+ import flashx.textLayout.tlf_internal;
+ import flashx.undo.IUndoManager;
+ import flashx.undo.UndoManager;
import org.flexunit.asserts.assertTrue;
use namespace tlf_internal;
- /** Test the state of selection after each operation is done, undone, and redone.
- */
- public class UndoRedoTest extends VellumTestCase
- {
- public function UndoRedoTest(methodName:String, testID:String, testConfig:TestConfig, testCaseXML:XML=null)
- {
- super(methodName, testID, testConfig, testCaseXML);
- }
- public static function suiteFromXML(testListXML:XML, testConfig:TestConfig, ts:TestSuiteExtended):void
- {
- var testCaseClass:Class = UndoRedoTest;
- VellumTestCase.suiteFromXML(testCaseClass, testListXML, testConfig, ts);
- }
-
- private var container:Sprite;
- //private const ANY_URL:String = "http://livedocs.adobe.com/";
-
- protected function get initialImport():XML {
- return <TextFlow color="#000000" fontFamily="Tahoma" fontSize="14" fontStyle="normal" fontWeight="normal" lineHeight="130%" textDecoration="none" whiteSpaceCollapse="preserve" xmlns="http://ns.adobe.com/textLayout/2008">
- <p>
- <span>aaa</span>
- </p>
- <p styleName="h1">
- <span>bbb</span>
- </p>
- </TextFlow>
- }
-
- protected function get initialImportString():String {
- return null
- }
-
- protected var initialImportXMLString:String = initialImport.normalize().toXMLString();
- protected var editManager:TestEditManager;
- protected var undoManager:IUndoManager;
- protected var textFlow:TextFlow ;
-
- private function setup():void
- {
- container = new Sprite();
- var controllerOne:ContainerController = new ContainerController(container, 500, 500);
- textFlow = TextConverter.importToFlow(initialImport, TextConverter.TEXT_LAYOUT_FORMAT);
- undoManager = new UndoManager();
- editManager = new TestEditManager(undoManager);
- textFlow.interactionManager = editManager;
- textFlow.flowComposer.addController(controllerOne);
- textFlow.flowComposer.updateAllControllers();
- }
-
- public function undoRedoLinkTest():void
- {
- setup();
- //position > 3 will be in 2nd paragraph, cause error #2549628, no fix for now so the range is set to 3 to let the test case pass
- var posOfSelection:int = TestData.posOfSelection;
- editManager.selectRange(1,posOfSelection);
- editManager.doOperation(new ApplyLinkOperation(editManager.getSelectionState(), "http://www.yahoo.com", "_self", true));
- var resultString:String = editManager.errors;
- assertTrue("Undo and Redo not successfully. " + resultString, resultString == "");
- }
+ /** Test the state of selection after each operation is done, undone, and redone.
+ */
+ public class UndoRedoTest extends VellumTestCase
+ {
+ private var container:Sprite;
+ protected var editManager:TestEditManager;
+ protected var undoManager:IUndoManager;
+ protected var textFlow:TextFlow;
-
- }
+ public function UndoRedoTest()
+ {
+ super("", "UndoRedoTest", TestConfig.getInstance());
+ }
+
+ protected function get initialImport():XML
+ {
+ return <TextFlow color="#000000" fontFamily="Tahoma" fontSize="14" fontStyle="normal" fontWeight="normal" lineHeight="130%" textDecoration="none" whiteSpaceCollapse="preserve" xmlns="http://ns.adobe.com/textLayout/2008">
+ <p>
+ <span>aaa</span>
+ </p>
+ <p styleName="h1">
+ <span>bbb</span>
+ </p>
+ </TextFlow>
+ }
+
+ [Before]
+ override public function setUpTest():void
+ {
+ super.setUpTest();
+
+ container = new Sprite();
+ var controllerOne:ContainerController = new ContainerController(container, 500, 500);
+ textFlow = TextConverter.importToFlow(initialImport, TextConverter.TEXT_LAYOUT_FORMAT);
+ undoManager = new UndoManager();
+ editManager = new TestEditManager(undoManager);
+ textFlow.interactionManager = editManager;
+ textFlow.flowComposer.addController(controllerOne);
+ textFlow.flowComposer.updateAllControllers();
+ }
+
+ [After]
+ override public function tearDownTest():void
+ {
+ super.tearDownTest();
+
+ container = null;
+ undoManager = null;
+ editManager = null;
+ textFlow = null;
+ }
+
+ [Test]
+ public function undoRedoLinkTest():void
+ {
+ //position > 3 will be in 2nd paragraph, cause error #2549628, no fix for now so the range is set to 3 to let the test case pass
+ var posOfSelection:int = TestData.posOfSelection;
+ editManager.selectRange(1, posOfSelection);
+ editManager.doOperation(new ApplyLinkOperation(editManager.getSelectionState(), "http://flex.apache.org", "_self", true));
+ var resultString:String = editManager.errors;
+ assertTrue("Undo and Redo not successfully. " + resultString, resultString == "");
+ }
+
+ }
}
diff --git a/automation_tests/src/UnitTest/Tests/WritingModeTest.as b/automation_tests/src/UnitTest/Tests/WritingModeTest.as
index 7b35e35..43891c5 100644
--- a/automation_tests/src/UnitTest/Tests/WritingModeTest.as
+++ b/automation_tests/src/UnitTest/Tests/WritingModeTest.as
@@ -18,388 +18,427 @@
////////////////////////////////////////////////////////////////////////////////
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.display.DisplayObject;
- import flash.text.engine.TextLine;
+ import flash.display.DisplayObject;
+ import flash.text.engine.TextLine;
- import flashx.textLayout.container.ContainerController;
- import flashx.textLayout.formats.BlockProgression;
- import flashx.textLayout.formats.Direction;
+ import flashx.textLayout.formats.BlockProgression;
+ import flashx.textLayout.formats.Direction;
import org.flexunit.asserts.assertTrue;
public class WritingModeTest extends VellumTestCase
- {
- public function WritingModeTest(methodName:String, testID:String, testConfig:TestConfig, testCaseXML:XML=null)
- {
- super(methodName, testID, testConfig, testCaseXML);
+ {
+ public function WritingModeTest()
+ {
+ super("", "WritingModeTest", TestConfig.getInstance());
- // Note: These must correspond to a Watson product area (case-sensitive)
- metaData.productArea = "Text Container";
- metaData.productSubArea = "Text Direction";
- }
+ metaData = {};
+ // Note: These must correspond to a Watson product area (case-sensitive)
+ metaData.productArea = "Text Container";
+ metaData.productSubArea = "Text Direction";
+ }
- public static function suiteFromXML(testListXML:XML, testConfig:TestConfig, ts:TestSuiteExtended):void
- {
- var testCaseClass:Class = WritingModeTest;
- VellumTestCase.suiteFromXML(testCaseClass, testListXML, testConfig, ts);
- }
+ [Before]
+ override public function setUpTest():void
+ {
+ super.setUpTest();
+ }
- // test each writingMode with two columns setting them on the TextFlow
- // have to clear any container overrides - not sure how they got there.
+ [After]
+ override public function tearDownTest():void
+ {
+ super.tearDownTest();
+ }
- public function japaneseAttrib():void
- {
- SelManager.selectRange(0,0);
- SelManager.flushPendingOperations();
+ [Test]
+ /**
+ * test each writingMode with two columns setting them on the TextFlow
+ * have to clear any container overrides - not sure how they got there
+ */
+ public function japaneseAttrib():void
+ {
+ SelManager.selectRange(0, 0);
+ SelManager.flushPendingOperations();
- SelManager.textFlow.blockProgression = BlockProgression.RL;
- SelManager.textFlow.columnCount = 2;
- SelManager.textFlow.direction = Direction.LTR;
+ SelManager.textFlow.blockProgression = BlockProgression.RL;
+ SelManager.textFlow.columnCount = 2;
+ SelManager.textFlow.direction = Direction.LTR;
- assertTrue(true, SelManager.textFlow.format.blockProgression == BlockProgression.RL);
- assertTrue(true, SelManager.textFlow.computedFormat.blockProgression == BlockProgression.RL);
- }
+ assertTrue(true, SelManager.textFlow.format.blockProgression == BlockProgression.RL);
+ assertTrue(true, SelManager.textFlow.computedFormat.blockProgression == BlockProgression.RL);
+ }
- public function arabicAttrib():void
- {
- SelManager.selectRange(0,0);
- SelManager.flushPendingOperations();
+ [Test]
+ public function arabicAttrib():void
+ {
+ SelManager.selectRange(0, 0);
+ SelManager.flushPendingOperations();
- SelManager.textFlow.blockProgression = BlockProgression.TB;
- SelManager.textFlow.columnCount = 2;
- SelManager.textFlow.direction = Direction.RTL;
+ SelManager.textFlow.blockProgression = BlockProgression.TB;
+ SelManager.textFlow.columnCount = 2;
+ SelManager.textFlow.direction = Direction.RTL;
- assertTrue(true, SelManager.textFlow.format.blockProgression == BlockProgression.TB );
- assertTrue(true, SelManager.textFlow.computedFormat.blockProgression == BlockProgression.TB );
- }
+ assertTrue(true, SelManager.textFlow.format.blockProgression == BlockProgression.TB);
+ assertTrue(true, SelManager.textFlow.computedFormat.blockProgression == BlockProgression.TB);
+ }
- public function romanAttrib():void
- {
- SelManager.selectRange(0,0);
- SelManager.flushPendingOperations();
+ [Test]
+ public function romanAttrib():void
+ {
+ SelManager.selectRange(0, 0);
+ SelManager.flushPendingOperations();
- SelManager.textFlow.blockProgression = BlockProgression.TB;
- SelManager.textFlow.columnCount = 2;
- SelManager.textFlow.direction = Direction.LTR;
+ SelManager.textFlow.blockProgression = BlockProgression.TB;
+ SelManager.textFlow.columnCount = 2;
+ SelManager.textFlow.direction = Direction.LTR;
- assertTrue(true, SelManager.textFlow.format.blockProgression == BlockProgression.TB );
- assertTrue(true, SelManager.textFlow.computedFormat.blockProgression == BlockProgression.TB );
- }
+ assertTrue(true, SelManager.textFlow.format.blockProgression == BlockProgression.TB);
+ assertTrue(true, SelManager.textFlow.computedFormat.blockProgression == BlockProgression.TB);
+ }
- // No writing system uses this, but it's still a possible combination
- public function rtlAttrib():void
- {
- SelManager.selectRange(0,0);
- SelManager.flushPendingOperations();
+ [Test]
+ /**
+ * No writing system uses this, but it's still a possible combination
+ */
+ public function rtlAttrib():void
+ {
+ SelManager.selectRange(0, 0);
+ SelManager.flushPendingOperations();
- SelManager.textFlow.blockProgression = BlockProgression.RL;
- SelManager.textFlow.columnCount = 2;
- SelManager.textFlow.direction = Direction.RTL;
+ SelManager.textFlow.blockProgression = BlockProgression.RL;
+ SelManager.textFlow.columnCount = 2;
+ SelManager.textFlow.direction = Direction.RTL;
- assertTrue(true, SelManager.textFlow.format.blockProgression == BlockProgression.RL);
- assertTrue(true, SelManager.textFlow.computedFormat.blockProgression == BlockProgression.RL);
- }
+ assertTrue(true, SelManager.textFlow.format.blockProgression == BlockProgression.RL);
+ assertTrue(true, SelManager.textFlow.computedFormat.blockProgression == BlockProgression.RL);
+ }
- // Test BlockProgression.RL + Direction.LTR
- public function japanesePositioning():void
- {
- // Force the intended text positioning
- SelManager.textFlow.blockProgression = BlockProgression.RL;
- SelManager.textFlow.direction = Direction.LTR;
- SelManager.textFlow.paddingBottom = 0;
- SelManager.textFlow.paddingLeft = 0;
- SelManager.textFlow.paddingRight = 0;
- SelManager.textFlow.paddingTop = 0;
- SelManager.textFlow.columnCount = 2;
- SelManager.textFlow.columnGap = 0;
+ [Test]
+ /**
+ * Test BlockProgression.RL + Direction.LTR
+ */
+ public function japanesePositioning():void
+ {
+ // Force the intended text positioning
+ SelManager.textFlow.blockProgression = BlockProgression.RL;
+ SelManager.textFlow.direction = Direction.LTR;
+ SelManager.textFlow.paddingBottom = 0;
+ SelManager.textFlow.paddingLeft = 0;
+ SelManager.textFlow.paddingRight = 0;
+ SelManager.textFlow.paddingTop = 0;
+ SelManager.textFlow.columnCount = 2;
+ SelManager.textFlow.columnGap = 0;
- // Create a new paragraph in the second column
- SelManager.selectRange(1842,1842);
- SelManager.splitParagraph();
+ // Create a new paragraph in the second column
+ SelManager.selectRange(1842, 1842);
+ SelManager.splitParagraph();
- SelManager.flushPendingOperations();
+ SelManager.flushPendingOperations();
- // Get the posititioning of the first and second columns
- var x1:int = SelManager.textFlow.flowComposer.findLineAtPosition(0).x;
- var y1:int = SelManager.textFlow.flowComposer.findLineAtPosition(0).y;
- var x2:int = SelManager.textFlow.flowComposer.findLineAtPosition(1843).x;
- var y2:int = SelManager.textFlow.flowComposer.findLineAtPosition(1843).y;
+ // Get the posititioning of the first and second columns
+ var x1:int = SelManager.textFlow.flowComposer.findLineAtPosition(0).x;
+ var y1:int = SelManager.textFlow.flowComposer.findLineAtPosition(0).y;
+ var x2:int = SelManager.textFlow.flowComposer.findLineAtPosition(1843).x;
+ var y2:int = SelManager.textFlow.flowComposer.findLineAtPosition(1843).y;
- assertTrue(
- "BlockProgression: BP: R to L, Direction: L to R placed text in an incorrect direction.",
- x1 == x2
- );
- assertTrue(
- "BlockProgression: BP: R to L, Direction: L to R placed text in an incorrect direction.",
- y1 < y2
- );
- }
+ assertTrue(
+ "BlockProgression: BP: R to L, Direction: L to R placed text in an incorrect direction.",
+ x1 == x2
+ );
+ assertTrue(
+ "BlockProgression: BP: R to L, Direction: L to R placed text in an incorrect direction.",
+ y1 < y2
+ );
+ }
- // Test BlockProgression.TB + Direction.LTR
- public function romanPositioning():void
- {
- // Force the intended text positioning
- SelManager.textFlow.blockProgression = BlockProgression.TB;
- SelManager.textFlow.direction = Direction.LTR;
- SelManager.textFlow.paddingBottom = 0;
- SelManager.textFlow.paddingLeft = 0;
- SelManager.textFlow.paddingRight = 0;
- SelManager.textFlow.paddingTop = 0;
- SelManager.textFlow.columnCount = 2;
- SelManager.textFlow.columnGap = 0;
+ [Test]
+ /**
+ * Test BlockProgression.TB + Direction.LTR
+ */
+ public function romanPositioning():void
+ {
+ // Force the intended text positioning
+ SelManager.textFlow.blockProgression = BlockProgression.TB;
+ SelManager.textFlow.direction = Direction.LTR;
+ SelManager.textFlow.paddingBottom = 0;
+ SelManager.textFlow.paddingLeft = 0;
+ SelManager.textFlow.paddingRight = 0;
+ SelManager.textFlow.paddingTop = 0;
+ SelManager.textFlow.columnCount = 2;
+ SelManager.textFlow.columnGap = 0;
- // Create a new paragraph in the second column
- SelManager.selectRange(1862,1862);
- SelManager.splitParagraph();
+ // Create a new paragraph in the second column
+ SelManager.selectRange(1862, 1862);
+ SelManager.splitParagraph();
- SelManager.flushPendingOperations();
+ SelManager.flushPendingOperations();
- // Get the posititioning of the first and second columns
- var x1:int = SelManager.textFlow.flowComposer.findLineAtPosition(0).x;
- var y1:int = SelManager.textFlow.flowComposer.findLineAtPosition(0).y;
- var x2:int = SelManager.textFlow.flowComposer.findLineAtPosition(1873).x;
- var y2:int = SelManager.textFlow.flowComposer.findLineAtPosition(1873).y;
+ // Get the posititioning of the first and second columns
+ var x1:int = SelManager.textFlow.flowComposer.findLineAtPosition(0).x;
+ var y1:int = SelManager.textFlow.flowComposer.findLineAtPosition(0).y;
+ var x2:int = SelManager.textFlow.flowComposer.findLineAtPosition(1873).x;
+ var y2:int = SelManager.textFlow.flowComposer.findLineAtPosition(1873).y;
- assertTrue(
- "BlockProgression: BP: T to B, Direction: L to R placed text in an incorrect direction.",
- x1 < x2
- );
- assertTrue(
- "BlockProgression: BP: T to B, Direction: L to R placed text in an incorrect direction.",
- y1 == y2
- );
- }
+ assertTrue(
+ "BlockProgression: BP: T to B, Direction: L to R placed text in an incorrect direction.",
+ x1 < x2
+ );
+ assertTrue(
+ "BlockProgression: BP: T to B, Direction: L to R placed text in an incorrect direction.",
+ y1 == y2
+ );
+ }
- // Test BlockProgression.RL + Direction.RTL
- public function rtlPositioning():void
- {
- // Force the intended text positioning
- SelManager.textFlow.blockProgression = BlockProgression.RL;
- SelManager.textFlow.direction = Direction.RTL;
- SelManager.textFlow.paddingBottom = 0;
- SelManager.textFlow.paddingLeft = 0;
- SelManager.textFlow.paddingRight = 0;
- SelManager.textFlow.paddingTop = 0;
- SelManager.textFlow.columnCount = 2;
- SelManager.textFlow.columnGap = 0;
+ [Test]
+ /**
+ * Test BlockProgression.RL + Direction.RTL
+ */
+ public function rtlPositioning():void
+ {
+ // Force the intended text positioning
+ SelManager.textFlow.blockProgression = BlockProgression.RL;
+ SelManager.textFlow.direction = Direction.RTL;
+ SelManager.textFlow.paddingBottom = 0;
+ SelManager.textFlow.paddingLeft = 0;
+ SelManager.textFlow.paddingRight = 0;
+ SelManager.textFlow.paddingTop = 0;
+ SelManager.textFlow.columnCount = 2;
+ SelManager.textFlow.columnGap = 0;
- // Create a new paragraph in the second column
- SelManager.selectRange(1842,1842);
- SelManager.splitParagraph();
+ // Create a new paragraph in the second column
+ SelManager.selectRange(1842, 1842);
+ SelManager.splitParagraph();
- SelManager.flushPendingOperations();
+ SelManager.flushPendingOperations();
- // Get the posititioning of the first and second columns
- var x1:int = SelManager.textFlow.flowComposer.findLineAtPosition(0).x;
- var y1:int = SelManager.textFlow.flowComposer.findLineAtPosition(0).y;
- var x2:int = SelManager.textFlow.flowComposer.findLineAtPosition(1843).x;
- var y2:int = SelManager.textFlow.flowComposer.findLineAtPosition(1843).y;
+ // Get the posititioning of the first and second columns
+ var x1:int = SelManager.textFlow.flowComposer.findLineAtPosition(0).x;
+ var y1:int = SelManager.textFlow.flowComposer.findLineAtPosition(0).y;
+ var x2:int = SelManager.textFlow.flowComposer.findLineAtPosition(1843).x;
+ var y2:int = SelManager.textFlow.flowComposer.findLineAtPosition(1843).y;
- assertTrue(
- "BlockProgression: BP: R to L, Direction: R to L placed text in an incorrect direction.",
- x1 == x2
- );
- assertTrue(
- "BlockProgression: BP: R to L, Direction: R to L placed text in an incorrect direction.",
- y1 < y2
- );
- }
+ assertTrue(
+ "BlockProgression: BP: R to L, Direction: R to L placed text in an incorrect direction.",
+ x1 == x2
+ );
+ assertTrue(
+ "BlockProgression: BP: R to L, Direction: R to L placed text in an incorrect direction.",
+ y1 < y2
+ );
+ }
- // Test BlockProgression.TB + Direction.RTL
- public function arabicPositioning():void
- {
- // Force the intended text positioning
- SelManager.textFlow.blockProgression = BlockProgression.TB;
- SelManager.textFlow.direction = Direction.RTL;
- SelManager.textFlow.paddingBottom = 0;
- SelManager.textFlow.paddingLeft = 0;
- SelManager.textFlow.paddingRight = 0;
- SelManager.textFlow.paddingTop = 0;
- SelManager.textFlow.columnCount = 2;
- SelManager.textFlow.columnGap = 0;
+ [Test]
+ /**
+ *
+ */
+ public function arabicPositioning():void
+ {
+ // Force the intended text positioning
+ SelManager.textFlow.blockProgression = BlockProgression.TB;
+ SelManager.textFlow.direction = Direction.RTL;
+ SelManager.textFlow.paddingBottom = 0;
+ SelManager.textFlow.paddingLeft = 0;
+ SelManager.textFlow.paddingRight = 0;
+ SelManager.textFlow.paddingTop = 0;
+ SelManager.textFlow.columnCount = 2;
+ SelManager.textFlow.columnGap = 0;
- // Create a new paragraph in the second column
- SelManager.selectRange(1862,1862);
- SelManager.splitParagraph();
+ // Create a new paragraph in the second column
+ SelManager.selectRange(1862, 1862);
+ SelManager.splitParagraph();
- SelManager.flushPendingOperations();
+ SelManager.flushPendingOperations();
- // Get the posititioning of the first and second columns
- var x1:int = SelManager.textFlow.flowComposer.findLineAtPosition(0).x;
- var y1:int = SelManager.textFlow.flowComposer.findLineAtPosition(0).y;
- var x2:int = SelManager.textFlow.flowComposer.findLineAtPosition(1873).x;
- var y2:int = SelManager.textFlow.flowComposer.findLineAtPosition(1873).y;
+ // Get the posititioning of the first and second columns
+ var x1:int = SelManager.textFlow.flowComposer.findLineAtPosition(0).x;
+ var y1:int = SelManager.textFlow.flowComposer.findLineAtPosition(0).y;
+ var x2:int = SelManager.textFlow.flowComposer.findLineAtPosition(1873).x;
+ var y2:int = SelManager.textFlow.flowComposer.findLineAtPosition(1873).y;
- assertTrue(
- "BlockProgression: BlockProgression: T to B, Direction: R to L placed text in an incorrect direction.",
- x1 > x2
- );
- assertTrue(
- "BlockProgression: BlockProgression: T to B, Direction: R to L placed text in an incorrect direction.",
- y1 == y2
- );
- }
+ assertTrue(
+ "BlockProgression: BlockProgression: T to B, Direction: R to L placed text in an incorrect direction.",
+ x1 > x2
+ );
+ assertTrue(
+ "BlockProgression: BlockProgression: T to B, Direction: R to L placed text in an incorrect direction.",
+ y1 == y2
+ );
+ }
- // Test BlockProgression.RL + Direction.LTR
- public function japaneseJustification():void
- {
- // Force the intended text positioning
- SelManager.textFlow.blockProgression = BlockProgression.RL;
- SelManager.textFlow.direction = Direction.LTR;
+ [Test]
+ /**
+ * Test BlockProgression.RL + Direction.LTR
+ */
+ public function japaneseJustification():void
+ {
+ // Force the intended text positioning
+ SelManager.textFlow.blockProgression = BlockProgression.RL;
+ SelManager.textFlow.direction = Direction.LTR;
- // Create new paragraphs to with severe justification differences
- SelManager.insertText("M");
- SelManager.insertText("MMMMMM");
- SelManager.insertText("MMMMMMMMMMMM");
- SelManager.selectRange(1,1);
- SelManager.splitParagraph();
- SelManager.selectRange(8,8);
- SelManager.splitParagraph();
+ // Create new paragraphs to with severe justification differences
+ SelManager.insertText("M");
+ SelManager.insertText("MMMMMM");
+ SelManager.insertText("MMMMMMMMMMMM");
+ SelManager.selectRange(1, 1);
+ SelManager.splitParagraph();
+ SelManager.selectRange(8, 8);
+ SelManager.splitParagraph();
- var xPos:Array = new Array();
- var yPos:Array = new Array();
+ var xPos:Array = new Array();
+ var yPos:Array = new Array();
- for ( var l:int = 0; l < TestFrame.textFlow.flowComposer.numLines; l++ )
- {
- var testLine:TextLine = SelManager.textFlow.flowComposer.getLineAt(l).getTextLine();
+ for (var l:int = 0; l < TestFrame.textFlow.flowComposer.numLines; l++)
+ {
+ var testLine:TextLine = SelManager.textFlow.flowComposer.getLineAt(l).getTextLine();
- xPos.push(testLine.getBounds( TestFrame.container as DisplayObject ).x);
- yPos.push(testLine.getBounds( TestFrame.container as DisplayObject ).y);
- }
+ xPos.push(testLine.getBounds(TestFrame.container as DisplayObject).x);
+ yPos.push(testLine.getBounds(TestFrame.container as DisplayObject).y);
+ }
- // Check that we're on different lines
- assertTrue( "Justification incorrect with BlockProgression: R to L, Direction: L to R",
- xPos[0] > xPos[1] && xPos[1] > xPos[2] );
- // Justification is correct
- assertTrue( "Justification incorrect with BlockProgression: R to L, Direction: L to R",
- yPos[0] == yPos[1] && yPos[1] == yPos[2] );
- }
+ // Check that we're on different lines
+ assertTrue("Justification incorrect with BlockProgression: R to L, Direction: L to R",
+ xPos[0] > xPos[1] && xPos[1] > xPos[2]);
+ // Justification is correct
+ assertTrue("Justification incorrect with BlockProgression: R to L, Direction: L to R",
+ yPos[0] == yPos[1] && yPos[1] == yPos[2]);
+ }
- // Test BlockProgression.TB + Direction.LTR
- public function romanJustification():void
- {
- // Force the intended text positioning
- SelManager.textFlow.blockProgression = BlockProgression.TB;
- SelManager.textFlow.direction = Direction.LTR;
+ [Test]
+ /**
+ * Test BlockProgression.TB + Direction.LTR
+ */
+ public function romanJustification():void
+ {
+ // Force the intended text positioning
+ SelManager.textFlow.blockProgression = BlockProgression.TB;
+ SelManager.textFlow.direction = Direction.LTR;
- // Create new paragraphs to with severe justification differences
- SelManager.insertText("M");
- SelManager.insertText("MMMMMM");
- SelManager.insertText("MMMMMMMMMMMM");
- SelManager.selectRange(1,1);
- SelManager.splitParagraph();
- SelManager.selectRange(8,8);
- SelManager.splitParagraph();
+ // Create new paragraphs to with severe justification differences
+ SelManager.insertText("M");
+ SelManager.insertText("MMMMMM");
+ SelManager.insertText("MMMMMMMMMMMM");
+ SelManager.selectRange(1, 1);
+ SelManager.splitParagraph();
+ SelManager.selectRange(8, 8);
+ SelManager.splitParagraph();
- var xPos:Array = new Array();
- var yPos:Array = new Array();
+ var xPos:Array = new Array();
+ var yPos:Array = new Array();
- for ( var l:int = 0; l < TestFrame.textFlow.flowComposer.numLines; l++ )
- {
- var testLine:TextLine = SelManager.textFlow.flowComposer.getLineAt(l).getTextLine();
+ for (var l:int = 0; l < TestFrame.textFlow.flowComposer.numLines; l++)
+ {
+ var testLine:TextLine = SelManager.textFlow.flowComposer.getLineAt(l).getTextLine();
- xPos.push(testLine.getBounds( TestFrame.container as DisplayObject ).x);
- yPos.push(testLine.getBounds( TestFrame.container as DisplayObject ).y);
- }
+ xPos.push(testLine.getBounds(TestFrame.container as DisplayObject).x);
+ yPos.push(testLine.getBounds(TestFrame.container as DisplayObject).y);
+ }
- // Check that we're on different lines
- assertTrue( "Justification incorrect with BlockProgression: T to B, Direction: L to R",
- yPos[0] != yPos[1] && yPos[1] != yPos[2] );
- // Justification is correct
- assertTrue( "Justification incorrect with BlockProgression: T to B, Direction: L to R",
- xPos[0] == xPos[1] && xPos[1] == xPos[2] );
- }
+ // Check that we're on different lines
+ assertTrue("Justification incorrect with BlockProgression: T to B, Direction: L to R",
+ yPos[0] != yPos[1] && yPos[1] != yPos[2]);
+ // Justification is correct
+ assertTrue("Justification incorrect with BlockProgression: T to B, Direction: L to R",
+ xPos[0] == xPos[1] && xPos[1] == xPos[2]);
+ }
- // Test BlockProgression.RL + Direction.RTL
- public function rtlJustification():void
- {
- // Force the intended text positioning
- SelManager.textFlow.blockProgression = BlockProgression.RL;
- SelManager.textFlow.direction = Direction.RTL;
+ [Test]
+ /**
+ * Test BlockProgression.RL + Direction.RTL
+ */
+ public function rtlJustification():void
+ {
+ // Force the intended text positioning
+ SelManager.textFlow.blockProgression = BlockProgression.RL;
+ SelManager.textFlow.direction = Direction.RTL;
- // Create new paragraphs to with severe justification differences
- SelManager.insertText("M");
- SelManager.insertText("MMMMMM");
- SelManager.insertText("MMMMMMMMMMMM");
- SelManager.selectRange(1,1);
- SelManager.splitParagraph();
- SelManager.selectRange(8,8);
- SelManager.splitParagraph();
+ // Create new paragraphs to with severe justification differences
+ SelManager.insertText("M");
+ SelManager.insertText("MMMMMM");
+ SelManager.insertText("MMMMMMMMMMMM");
+ SelManager.selectRange(1, 1);
+ SelManager.splitParagraph();
+ SelManager.selectRange(8, 8);
+ SelManager.splitParagraph();
- var xPos:Array = new Array();
- var yPos:Array = new Array();
+ var xPos:Array = new Array();
+ var yPos:Array = new Array();
- for ( var l:int = 0; l < TestFrame.textFlow.flowComposer.numLines; l++ )
- {
- var testLine:TextLine = SelManager.textFlow.flowComposer.getLineAt(l).getTextLine();
+ for (var l:int = 0; l < TestFrame.textFlow.flowComposer.numLines; l++)
+ {
+ var testLine:TextLine = SelManager.textFlow.flowComposer.getLineAt(l).getTextLine();
- xPos.push(testLine.getBounds( TestFrame.container as DisplayObject ).x);
- yPos.push(testLine.getBounds( TestFrame.container as DisplayObject ).y);
- }
+ xPos.push(testLine.getBounds(TestFrame.container as DisplayObject).x);
+ yPos.push(testLine.getBounds(TestFrame.container as DisplayObject).y);
+ }
- // Check that we're on different lines
- assertTrue( "Justification incorrect with BlockProgression: R to L, Direction: R to L",
- xPos[0] != xPos[1] && xPos[1] != xPos[2] );
- // Justification is correct
- assertTrue( "Justification incorrect with BlockProgression: R to L, Direction: R to L",
- yPos[0] > yPos[1] && yPos[1] > yPos[2] );
- }
+ // Check that we're on different lines
+ assertTrue("Justification incorrect with BlockProgression: R to L, Direction: R to L",
+ xPos[0] != xPos[1] && xPos[1] != xPos[2]);
+ // Justification is correct
+ assertTrue("Justification incorrect with BlockProgression: R to L, Direction: R to L",
+ yPos[0] > yPos[1] && yPos[1] > yPos[2]);
+ }
- // Test BlockProgression.TB + Direction.RTL
- public function arabicJustification():void
- {
- // Force the intended text positioning
- SelManager.textFlow.blockProgression = BlockProgression.TB;
- SelManager.textFlow.direction = Direction.RTL;
+ [Test]
+ /**
+ * Test BlockProgression.TB + Direction.RTL
+ */
+ public function arabicJustification():void
+ {
+ // Force the intended text positioning
+ SelManager.textFlow.blockProgression = BlockProgression.TB;
+ SelManager.textFlow.direction = Direction.RTL;
- // Create new paragraphs to with severe justification differences
- SelManager.insertText("M");
- SelManager.insertText("MMMMMM");
- SelManager.insertText("MMMMMMMMMMMM");
- SelManager.selectRange(1,1);
- SelManager.splitParagraph();
- SelManager.selectRange(8,8);
- SelManager.splitParagraph();
+ // Create new paragraphs to with severe justification differences
+ SelManager.insertText("M");
+ SelManager.insertText("MMMMMM");
+ SelManager.insertText("MMMMMMMMMMMM");
+ SelManager.selectRange(1, 1);
+ SelManager.splitParagraph();
+ SelManager.selectRange(8, 8);
+ SelManager.splitParagraph();
- var xPos:Array = new Array();
- var yPos:Array = new Array();
+ var xPos:Array = new Array();
+ var yPos:Array = new Array();
- for ( var l:int = 0; l < TestFrame.textFlow.flowComposer.numLines; l++ )
- {
- var testLine:TextLine = SelManager.textFlow.flowComposer.getLineAt(l).getTextLine();
+ for (var l:int = 0; l < TestFrame.textFlow.flowComposer.numLines; l++)
+ {
+ var testLine:TextLine = SelManager.textFlow.flowComposer.getLineAt(l).getTextLine();
- xPos.push(testLine.getBounds( TestFrame.container as DisplayObject ).x);
- yPos.push(testLine.getBounds( TestFrame.container as DisplayObject ).y);
- }
+ xPos.push(testLine.getBounds(TestFrame.container as DisplayObject).x);
+ yPos.push(testLine.getBounds(TestFrame.container as DisplayObject).y);
+ }
- // Check that we're on different lines
- assertTrue( "Justification incorrect with BlockProgression: T to B & Direction: R to L",
- yPos[0] != yPos[1] && yPos[1] != yPos[2] );
- // Justification is correct
- assertTrue( "Justification incorrect with BlockProgression: T to B & Direction: R to L",
- xPos[0] > xPos[1] && xPos[1] > xPos[2] );
- }
+ // Check that we're on different lines
+ assertTrue("Justification incorrect with BlockProgression: T to B & Direction: R to L",
+ yPos[0] != yPos[1] && yPos[1] != yPos[2]);
+ // Justification is correct
+ assertTrue("Justification incorrect with BlockProgression: T to B & Direction: R to L",
+ xPos[0] > xPos[1] && xPos[1] > xPos[2]);
+ }
- // Make sure the right to left fonts are displayed right to left
- public function arabicDirection():void
- {
- for ( var l:int = 0; l < TestFrame.textFlow.flowComposer.numLines; l++ )
- {
- var testLine:TextLine = SelManager.textFlow.flowComposer.getLineAt(l).getTextLine();
+ [Test]
+ /**
+ * Make sure the right to left fonts are displayed right to left
+ */
+ public function arabicDirection():void
+ {
+ for (var l:int = 0; l < TestFrame.textFlow.flowComposer.numLines; l++)
+ {
+ var testLine:TextLine = SelManager.textFlow.flowComposer.getLineAt(l).getTextLine();
- for ( var i:int = 1; i < testLine.atomCount; i++)
- {
- assertTrue( "Display direction incorrect on right to left fonts",
- testLine.getAtomBounds(i).x > testLine.getAtomBounds(i-1).x );
+ for (var i:int = 1; i < testLine.atomCount; i++)
+ {
+ assertTrue("Display direction incorrect on right to left fonts",
+ testLine.getAtomBounds(i).x > testLine.getAtomBounds(i - 1).x);
- assertTrue( "Display direction incorrect on right to left fonts",
- testLine.getAtomBounds(i).y == testLine.getAtomBounds(i-1).y );
- }
- }
- }
- }
+ assertTrue("Display direction incorrect on right to left fonts",
+ testLine.getAtomBounds(i).y == testLine.getAtomBounds(i - 1).y);
+ }
+ }
+ }
+ }
}